/* =====================================================================
   SEO Link Hubs — Frontend Widget Styles
   Matches the Klook-style numbered pill / rounded-rectangle grid.
   ===================================================================== */

/* ── CSS custom properties (overridable per theme) ── */
:root {
    --slh-border:       #c9a84c;      /* gold/amber border            */
    --slh-num-bg:       #fdf6e3;      /* warm cream for the number box*/
    --slh-pill-bg:      #ffffff;      /* pill background              */
    --slh-num-color:    #c9a84c;      /* number text                  */
    --slh-text-color:   #3d2b00;      /* link label text              */
    --slh-hover-border: #a07830;      /* slightly deeper on hover     */
    --slh-hover-bg:     #fefaf0;      /* subtle warm tint on hover    */
    --slh-radius:       6px;
    --slh-num-width:    36px;
    --slh-font:         inherit;
}

/* ── Wrapper ── */
.slh-hub-wrap {
    font-family: var(--slh-font);
    box-sizing: border-box;
}

/* ── Heading ── */
.slh-hub-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 14px 0;
    padding: 0;
    line-height: 1.3;
}

/* ── Grid ── */
.slh-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ── Each pill item ── */
.slh-item {
    flex: 0 0 auto;
    border: 1px solid var(--slh-border);
    border-radius: var(--slh-radius);
    background: var(--slh-pill-bg);
    overflow: hidden;              /* clips the number box corners  */
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.slh-item:hover {
    border-color: var(--slh-hover-border);
    background: var(--slh-hover-bg);
    box-shadow: 0 2px 8px rgba(201, 168, 76, .20);
}

/* ── The anchor fills the entire pill ── */
.slh-link {
    display: flex;
    align-items: stretch;
    text-decoration: none;
    min-height: 36px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent; /* cleaner on mobile  */
}

/* ── Number box (left cell) ── */
.slh-num {
    flex: 0 0 var(--slh-num-width);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--slh-num-bg);
    border-right: 1px solid var(--slh-border);
    color: var(--slh-num-color);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    padding: 0 4px;
    transition: background .18s ease;
}

.slh-item:hover .slh-num {
    background: #fbefc7;
}

/* ── Label (right cell) ── */
.slh-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--slh-text-color);
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;        /* pills stay single-line by default */
}

/* ── Empty state ── */
.slh-empty {
    color: #999;
    font-style: italic;
    font-size: .9rem;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Tablet: allow labels to wrap inside each pill for long text */
@media (max-width: 768px) {
    .slh-hub-heading {
        font-size: 1.1rem;
    }

    .slh-label {
        white-space: normal;
        text-align: left;
    }

    .slh-link {
        min-height: 40px; /* larger touch target */
    }
}

/* Mobile: pills auto-size to content, wrap naturally — no forced columns */
@media (max-width: 480px) {
    .slh-grid {
        gap: 6px;
    }

    .slh-item {
        flex: 0 0 auto;   /* size to content, never forced wider */
        min-width: 0;
        max-width: 100%;  /* but never overflow the container    */
    }

    .slh-label {
        font-size: .8rem;
        padding: 6px 8px;
        white-space: nowrap; /* keep label on one line inside the pill */
    }

    .slh-num {
        --slh-num-width: 30px;
        font-size: .72rem;
    }
}
