/* ==========================================================================
   Service Overview — sklare/service-overview
   Premium SaaS Layout · Karo Background · Glassmorphism Cards
   ========================================================================== */

/* ── Section Container ── */
.blk-service-overview {
    max-width: var(--wp--custom--layout--wideSize, 1400px);
    margin: 0 auto;
    padding: var(--wp--preset--spacing--128) var(--wp--preset--spacing--32);
    box-sizing: border-box;
    position: relative;
    /* NO overflow — it breaks position: sticky on the sidebar */
}

/* Containment on direct children instead of overflow on parent */
.blk-service-overview > * {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Karo grid-line texture (matches pt-fundament pattern) */
.blk-service-overview::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-color: transparent;
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 100%);
}

/* Ensure content sits above the pattern */
.blk-service-overview__grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--wp--preset--spacing--64);
    align-items: start;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}


/* ══════════════════════════════════════════════════════
   DESKTOP (≥ 901px)
   2-column grid: 260px sidebar | 1fr card stack
   ══════════════════════════════════════════════════════ */

@media (min-width: 901px) {
    .blk-service-overview__grid {
        grid-template-columns: 260px 1fr;
    }
}


/* ── Sticky Sidebar (Desktop: vertical, left column) ── */
.blk-service-overview__sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.blk-service-overview__sidebar .section-label {
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--t1-heading-label, 11px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--wp--preset--color--text-muted);
    border-bottom: 1px solid rgba(18, 18, 18, 0.1);
    padding-bottom: var(--wp--preset--spacing--16);
    margin: 0;
}

.blk-service-overview__sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--16);
    margin: var(--wp--preset--spacing--24) 0 var(--wp--preset--spacing--32) 0;
}

/* Dropdown: hidden on desktop, shown on mobile via media query */
.blk-service-overview__dropdown {
    display: none;
}

.blk-service-overview__sidebar-link {
    display: block;
    font-size: var(--wp--preset--font-size--sm);
    color: var(--wp--preset--color--text-muted);
    text-decoration: none;
    padding: var(--wp--preset--spacing--8) 0;
    padding-left: var(--wp--preset--spacing--16);
    border-left: 2px solid transparent;
    transition:
        color 0.3s var(--wp--custom--spring),
        border-color 0.3s var(--wp--custom--spring);
}

.blk-service-overview__sidebar-link:hover {
    color: var(--wp--preset--color--text-main);
    border-left-color: var(--wp--preset--color--text-light);
}

.blk-service-overview__sidebar-link.is-active {
    color: var(--wp--preset--color--hero-blue);
    border-left-color: var(--wp--preset--color--hero-blue);
    font-weight: 500;
}

.blk-service-overview__sidebar-cta {
    border-top: 1px solid rgba(18, 18, 18, 0.1);
    padding-top: var(--wp--preset--spacing--24);
}


/* ── Service Cards — Glassmorphism ── */
.blk-service-overview__detail-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.blk-service-overview__service-card {
    padding: clamp(20px, 2.5vw, 28px);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--wp--preset--color--surface, #EAE9E4);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition:
        box-shadow 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
}

.blk-service-overview__service-card:hover {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: var(--wp--preset--color--text-light, #BDBDBA);
}

/* Force ALL children to stay inside the card boundary */
.blk-service-overview__service-card > * {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Card Header */
.blk-service-overview__card-header {
    display: flex;
    align-items: baseline;
    gap: var(--wp--preset--spacing--12);
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--wp--preset--color--surface, #EAE9E4);
}

.blk-service-overview__card-index {
    color: var(--wp--preset--color--text-muted, #3D3D3D);
    font-size: var(--t1-heading-label, 11px);
    font-weight: 600;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.blk-service-overview__card-title {
    font-size: var(--t1-heading-card);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin: 0;
}

/* Card Body: desc + features */
.blk-service-overview__card-body {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--16);
    margin-bottom: var(--wp--preset--spacing--12);
}

/* Card Description */
.blk-service-overview__card-desc {
    max-width: 100%;
    margin: 0;
    font-size: var(--wp--preset--font-size--base);
    line-height: 1.65;
    color: var(--wp--preset--color--text-muted);
}

/* Feature Pills */
.blk-service-overview__card-features {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.blk-service-overview__card-features li {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--wp--preset--color--text-muted, #3D3D3D);
    padding: 4px 12px;
    border: 1px solid var(--wp--preset--color--surface, #EAE9E4);
    border-radius: 40px;
    background-color: var(--wp--preset--color--blue-100);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.blk-service-overview__service-card:hover .blk-service-overview__card-features li {
    border-color: var(--wp--preset--color--text-light, #BDBDBA);
    color: var(--wp--preset--color--text-main, #121212);
}

/* Tag Pills */
.blk-service-overview__card-tag-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.blk-service-overview__tag {
    font-family: 'Inter', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 12px;
    border: 1px solid rgba(18, 18, 18, 0.08);
    border-radius: 40px;
    color: var(--wp--preset--color--text-muted);
    background: rgba(255, 255, 255, 0.4);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.blk-service-overview__service-card:hover .blk-service-overview__tag {
    border-color: var(--wp--preset--color--text-light, #BDBDBA);
    color: var(--wp--preset--color--text-main, #121212);
}


/* ── Dark Mode ── */
.has-background .blk-service-overview__sidebar-cta,
.has-background .blk-service-overview__sidebar .section-label {
    border-color: rgba(255, 255, 255, 0.1);
}

.has-background .blk-service-overview__service-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.has-background .blk-service-overview__service-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(252, 73, 11, 0.2);
}

.has-background .blk-service-overview__tag {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--wp--preset--color--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.has-background .blk-service-overview::before {
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}


/* ══════════════════════════════════════════════════════
   TABLET (≤ 900px)
   Single column. Sidebar → sticky horizontal pill strip
   directly under the site header.
   ══════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .blk-service-overview {
        padding: 56px 16px;
    }

    .blk-service-overview__grid {
        grid-template-columns: 1fr;
        gap: 20px;
        min-width: 0;
        max-width: 100%;
        /* NO overflow — breaks sticky sidebar strip */
    }

    /* Child containment: prevent blowout without overflow */
    .blk-service-overview__grid > * {
        min-width: 0;
        box-sizing: border-box;
    }

    /* ── Sidebar: sticky horizontal strip ── */
    .blk-service-overview__sidebar {
        position: sticky;
        top: calc(var(--wp--custom--headerHeight, 64px) - 1px);
        z-index: 10;
        background-color: rgba(245, 244, 240, 0.92);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        margin-inline: -16px;
        padding: 12px 16px;
        border-bottom: 1px solid rgba(18, 18, 18, 0.06);
    }

    .blk-service-overview__sidebar .section-label {
        display: none;
    }

    .blk-service-overview__sidebar-cta {
        display: none;
    }

    /* ── Hide pill nav on mobile, show dropdown ── */
    .blk-service-overview__sidebar-nav {
        display: none;
    }

    .blk-service-overview__dropdown {
        display: block;
        position: relative;
    }

    .blk-service-overview__dropdown-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 10px 16px;
        font-family: var(--wp--preset--font-family--body);
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.02em;
        color: var(--wp--preset--color--text-main, #121212);
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(18, 18, 18, 0.1);
        border-radius: 10px;
        cursor: pointer;
        transition: border-color 0.2s ease;
    }

    .blk-service-overview__dropdown-toggle:active {
        border-color: var(--wp--preset--color--hero-blue);
    }

    .blk-service-overview__dropdown-chevron {
        transition: transform 0.25s ease;
        flex-shrink: 0;
    }

    .blk-service-overview__dropdown.is-open .blk-service-overview__dropdown-chevron {
        transform: rotate(180deg);
    }

    .blk-service-overview__dropdown-list {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(18, 18, 18, 0.08);
        border-radius: 12px;
        padding: 6px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        z-index: 20;
        max-height: 60vh;
        overflow-y: auto;
    }

    .blk-service-overview__dropdown.is-open .blk-service-overview__dropdown-list {
        display: flex;
        flex-direction: column;
    }

    .blk-service-overview__dropdown-item {
        display: block;
        padding: 10px 14px;
        font-size: 13px;
        font-weight: 400;
        color: var(--wp--preset--color--text-muted, #3D3D3D);
        text-decoration: none;
        border-radius: 8px;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .blk-service-overview__dropdown-item:active {
        background: rgba(18, 18, 18, 0.04);
    }

    .blk-service-overview__dropdown-item.is-active {
        color: var(--wp--preset--color--hero-blue);
        font-weight: 600;
        background: rgba(18, 18, 18, 0.03);
    }

    /* ── Cards: full-width, reduced spacing ── */
    .blk-service-overview__service-card {
        padding: 20px;
    }

    .blk-service-overview__service-card:hover {
        transform: none; /* no lift on touch */
    }

    .blk-service-overview__card-header {
        gap: 10px;
    }

    .blk-service-overview__card-title {
        font-size: 17px;
        hyphens: auto;
    }

    .blk-service-overview__card-desc {
        max-width: 100%;
        font-size: var(--wp--preset--font-size--sm);
    }

    .blk-service-overview__card-features li {
        font-size: 9px;
        padding: 3px 10px;
    }

    .blk-service-overview__card-tag-row {
        gap: 4px;
    }

    .blk-service-overview__tag {
        font-size: 9px;
        padding: 3px 10px;
    }
}


/* ══════════════════════════════════════════════════════
   SMALL MOBILE (≤ 480px)
   Tighter spacing, stacked card header
   ══════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .blk-service-overview {
        padding: 40px 12px;
    }

    .blk-service-overview__sidebar {
        margin-inline: -12px;
        padding: 10px 12px;
    }

    .blk-service-overview__dropdown-toggle {
        padding: 8px 12px;
        font-size: 12px;
    }

    .blk-service-overview__dropdown-item {
        padding: 8px 12px;
        font-size: 12px;
    }

    .blk-service-overview__service-card {
        padding: 16px;
        border-radius: 10px;
    }

    .blk-service-overview__card-header {
        flex-direction: column;
        gap: 2px;
    }

    .blk-service-overview__card-title {
        font-size: var(--wp--preset--font-size--base);
    }

    .blk-service-overview__card-desc {
        font-size: 12px;
        line-height: 1.55;
    }

    .blk-service-overview__card-features li {
        font-size: 9px;
        padding: 3px 8px;
    }
}


/* ── Dark mode — responsive overrides ── */
@media (max-width: 900px) {
    .has-background .blk-service-overview__sidebar {
        background-color: rgba(18, 18, 18, 0.92);
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }

    .has-background .blk-service-overview__sidebar-link {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .has-background .blk-service-overview__dropdown-toggle {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--wp--preset--color--text-main);
    }

    .has-background .blk-service-overview__dropdown-list {
        background: rgba(30, 30, 30, 0.96);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .has-background .blk-service-overview__dropdown-item {
        color: rgba(255, 255, 255, 0.7);
    }

    .has-background .blk-service-overview__dropdown-item.is-active {
        color: var(--wp--preset--color--hero-blue);
        background: rgba(255, 255, 255, 0.05);
    }
}
