/* SavvyGreat Broadcast hierarchy and hero extensions — Material 3 */
.sgbh-taxonomy,
.sgbh-category-filter {
    margin-top: clamp(26px, 3.5vw, 52px);
    padding: clamp(20px, 3vw, 34px);
    border: 1px solid var(--sgbv-outline-variant);
    border-radius: 30px;
    background: var(--sgbv-surface-low);
}

.sgbh-category-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.sgbh-category-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--sgbv-outline-variant);
    border-radius: 23px;
    background: var(--sgbv-surface);
}

.sgbh-category-heading {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 17px;
    background: var(--sgbv-secondary-container);
    color: var(--sgbv-on-secondary-container) !important;
    font-family: var(--m3-font-brand, "Google Sans", "Segoe UI", sans-serif);
    font-size: 18px;
    font-weight: 720;
}

.sgbh-category-heading:hover {
    box-shadow: inset 0 0 0 2px var(--sgbv-primary);
}

.sgbh-category-heading strong {
    display: grid;
    min-width: 32px;
    height: 32px;
    place-items: center;
    padding-inline: 8px;
    border-radius: 999px;
    background: var(--sgbv-surface);
    color: var(--sgbv-primary);
    font-size: 13px;
}

.sgbh-subcategory-links,
.sgbh-inline-subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sgbh-subcategory-links {
    padding: 14px;
}

.sgbh-subcategory-chip,
.sgbh-inline-subcategories a,
.sgbh-inline-subcategories > span {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid var(--sgbv-outline-variant);
    border-radius: 999px;
    background: var(--sgbv-surface-low);
    color: var(--sgbv-on-surface-variant) !important;
    font-size: 12px;
    font-weight: 700;
}

.sgbh-subcategory-chip:hover,
.sgbh-inline-subcategories a:hover {
    border-color: var(--sgbv-primary);
    background: var(--sgbv-primary-container);
    color: var(--sgbv-on-primary-container) !important;
}

.sgbh-subcategory-chip small,
.sgbh-inline-subcategories span span,
.sgbh-inline-subcategories > span small {
    display: grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    padding-inline: 5px;
    border-radius: 999px;
    background: var(--sgbv-surface);
    color: var(--sgbv-on-surface);
    font-size: 10px;
}

.sgbh-no-subcategories {
    color: var(--sgbv-on-surface-variant);
    font-size: 12px;
    font-style: italic;
}

.sgbh-video-section {
    scroll-margin-top: calc(var(--sgcv-context-offset, 108px) + 18px);
    padding-top: 4px;
}

.sgbh-inline-subcategories {
    margin: -4px 0 18px;
}

.sgbv-card-taxonomy {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 10px;
}

.sgbv-category-name,
.sgbv-subcategory-name {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 760;
    line-height: 18px;
}

.sgbv-category-name {
    background: var(--sgbv-primary-container);
    color: var(--sgbv-on-primary-container);
}

.sgbv-subcategory-name {
    background: #c8f7d2;
    color: #0b4d1b;
}

.sgbh-category-hero strong {
    color: var(--sgbv-on-surface);
}

.sgbh-category-hero code,
.sgbc-chips small {
    font-family: Consolas, "Courier New", monospace;
}

.sgbc-chips a {
    gap: 7px;
}

.sgbc-chips small {
    color: inherit;
    font-size: 9px;
    opacity: .68;
}

.sgbh-filter-summary {
    margin-top: 14px;
    padding: 12px 15px;
    border-radius: 14px;
    background: var(--sgbv-surface-low);
}

.sgbh-filter-summary strong {
    color: var(--sgbv-primary);
}

/* Keep every Broadcast subcategory inside the restored SavvyGreat M3 hero. */
.sgbv-hero-with-subcategories {
    align-items: stretch;
    min-height: clamp(420px, 35vw, 570px);
}

.sgbv-hero-with-subcategories .sgbv-hero-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.sgbv-hero-with-subcategories .sgbv-hero-copy > p {
    max-width: 68ch;
}

.sgbv-hero-subcategories {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 24px;
}

.sgbv-hero-subcategories a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid color-mix(in srgb, var(--sgbv-outline) 42%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--sgbv-surface) 79%, transparent);
    color: var(--sgbv-on-surface) !important;
    font-size: 13px;
    font-weight: 710;
    line-height: 20px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
    backdrop-filter: blur(10px);
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.sgbv-hero-subcategories a .material-symbols-rounded {
    color: var(--sgbv-primary);
    font-size: 19px;
    font-variation-settings: "FILL" 0, "wght" 560, "GRAD" 0, "opsz" 20;
}

.sgbv-hero-subcategories a:hover {
    border-color: color-mix(in srgb, var(--sgbv-primary) 65%, transparent);
    background: var(--sgbv-primary-container);
    color: var(--sgbv-on-primary-container) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.13);
    transform: translateY(-1px);
}

.sgbv-hero-subcategories a:hover .material-symbols-rounded {
    color: var(--sgbv-on-primary-container);
}

.sgbv-hero-subcategories a.is-active,
.sgbv-hero-subcategories a[aria-current="page"] {
    border-color: transparent;
    background: var(--sgbv-primary);
    color: var(--sgbv-on-primary) !important;
    box-shadow: 0 4px 13px color-mix(in srgb, var(--sgbv-primary) 28%, transparent);
}

.sgbv-hero-subcategories a.is-active .material-symbols-rounded,
.sgbv-hero-subcategories a[aria-current="page"] .material-symbols-rounded {
    color: var(--sgbv-on-primary);
    font-variation-settings: "FILL" 1, "wght" 620, "GRAD" 0, "opsz" 20;
}

.sgbv-hero-with-subcategories .sgbv-hero-actions {
    margin-top: 20px;
}

.sgbv-hero-with-subcategories .sgbv-hero-stats {
    align-self: center;
}

/* M3 section heading below the hero. */
.sgbv-classic-title-card.sgbv-m3-section-card {
    display: flex;
    min-height: 112px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: clamp(24px, 3vw, 42px) 0 18px;
    padding: clamp(22px, 3vw, 36px);
    border: 1px solid var(--sgbv-outline-variant);
    border-radius: 28px;
    background: linear-gradient(
        135deg,
        var(--sgbv-surface-low),
        var(--sgbv-surface-container)
    );
    box-shadow: 0 2px 7px rgba(0,0,0,.08);
}

.sgbv-classic-title-card.sgbv-m3-section-card h2 {
    margin: 5px 0 0;
    color: var(--sgbv-on-surface);
    font-family: var(--m3-font-brand, "Google Sans", "Segoe UI", sans-serif);
    font-size: clamp(27px, 2.8vw, 40px);
    font-weight: 630;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.sgbv-classic-title-card.sgbv-m3-section-card > strong {
    flex: 0 0 auto;
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--sgbv-secondary-container);
    color: var(--sgbv-on-secondary-container);
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .sgbv-hero-with-subcategories {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .sgbv-hero-with-subcategories .sgbv-hero-stats {
        width: 100%;
        align-self: stretch;
    }
}

@media (max-width: 900px) {
    .sgbh-category-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .sgbv-hero-with-subcategories {
        padding: 25px 20px;
    }

    .sgbv-hero-subcategories {
        width: calc(100% + 4px);
        flex-wrap: nowrap;
        margin-inline: -2px;
        padding: 2px 2px 8px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: inline proximity;
        scrollbar-width: thin;
    }

    .sgbv-hero-subcategories a {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .sgbv-classic-title-card.sgbv-m3-section-card {
        align-items: flex-start;
        flex-direction: column;
        border-radius: 24px;
    }
}

@media (max-width: 560px) {
    .sgbh-taxonomy,
    .sgbh-category-filter {
        padding: 16px;
        border-radius: 23px;
    }

    .sgbh-category-heading {
        font-size: 16px;
    }

    .sgbv-hero-subcategories a {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .sgbv-classic-title-card.sgbv-m3-section-card {
        min-height: 90px;
        padding: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sgbv-hero-subcategories a {
        transition-duration: .001ms !important;
    }
}

@media (forced-colors: active) {
    .sgbh-category-card,
    .sgbh-taxonomy,
    .sgbh-category-filter,
    .sgbh-subcategory-chip,
    .sgbh-inline-subcategories a,
    .sgbh-inline-subcategories > span,
    .sgbv-hero-subcategories a,
    .sgbv-classic-title-card.sgbv-m3-section-card {
        border: 1px solid CanvasText;
    }
}
