/* ============================================
   Category Loop Block — v1.2
   ============================================ */

/* Default CSS variable fallbacks */
.clb-wrapper {
    font-family: inherit;
    --clb-title-desktop:   26px;
    --clb-title-mobile:    20px;
    --clb-seeall-desktop:  14px;
    --clb-seeall-mobile:   13px;
    --clb-seeall-color:    #c0392b;
    --clb-card-radius:     16px;
    --clb-card-border:     #E5E7EB;
    --clb-card-bg:         #FFFFFF;
    --clb-tag-gap:         8px;
    --clb-tag-radius:      40px;
    --clb-tag-border:      #D1D5DB;
    --clb-tag-bg:          #F9FAFB;
}

/* Header */
.clb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.clb-title {
    font-size: var(--clb-title-desktop);
    font-weight: 700;
    margin: 0;
    color: inherit;
    line-height: 1.2;
}

.clb-see-all {
    font-size: var(--clb-seeall-desktop);
    font-weight: 600;
    color: var(--clb-seeall-color);
    text-decoration: none;
    transition: opacity 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.clb-see-all:hover {
    opacity: 0.75;
    text-decoration: none;
    color: var(--clb-seeall-color);
}

/* Responsive title sizes */
@media (max-width: 767px) {
    .clb-title {
        font-size: var(--clb-title-mobile);
    }
    .clb-see-all {
        font-size: var(--clb-seeall-mobile);
    }
}

/* Grid */
.clb-grid {
    display: grid;
    gap: 1.25rem;
}
.clb-cols-1 { grid-template-columns: 1fr; }
.clb-cols-2 { grid-template-columns: repeat(2, 1fr); }
.clb-cols-3 { grid-template-columns: repeat(3, 1fr); }
.clb-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 767px) {
    .clb-cols-2,
    .clb-cols-3,
    .clb-cols-4 { grid-template-columns: 1fr; }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .clb-cols-3,
    .clb-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Card — uses CSS vars set by block attributes */
.clb-card {
    background: var(--clb-card-bg);
    border-radius: var(--clb-card-radius);
    border: 1px solid var(--clb-card-border);
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem 1rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.clb-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
    border-color: #9ca3af;
}

/* Card header */
.clb-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1rem;
    text-decoration: none;
    color: inherit;
}
.clb-card-header:hover { color: inherit; text-decoration: none; }

/* Icon */
.clb-icon-wrap {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #1a3a6b;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.clb-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}
.clb-icon-placeholder { background: #1a3a6b; }
.clb-icon-initial {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

/* Card text */
.clb-card-info { flex: 1; min-width: 0; }
.clb-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: #111827;
    line-height: 1.3;
}
.clb-card-desc {
    font-size: 0.825rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

/* Tags — uses CSS vars */
.clb-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--clb-tag-gap);
    border-top: 1px solid #f3f4f6;
    padding-top: 0.85rem;
}

.clb-tag {
    display: inline-block;
    font-size: 0.8rem;
    color: #374151;
    background: var(--clb-tag-bg);
    border: 1px solid var(--clb-tag-border);
    border-radius: var(--clb-tag-radius);
    padding: 0.3rem 0.85rem;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.clb-tag:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
    text-decoration: none;
}

/* Misc */
.clb-no-selection {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}
.block-editor .clb-card-header { pointer-events: none; }

/* ============================================
   SCF Repeater Table Block
   ============================================ */
.clb-repeater-table { width: 100%; box-sizing: border-box; }
.clb-rt-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.clb-rt-label { width: 50%; vertical-align: middle; line-height: 1.5; word-break: break-word; }
.clb-rt-value { width: 50%; vertical-align: middle; font-weight: 500; line-height: 1.5; word-break: break-word; }

/* ── Inline list mode ── */
.clb-inline-list { margin: 0; }
.clb-inline-row  { margin: 0; padding: 0; }
.clb-inline-row:last-child { margin-bottom: 0 !important; }
