/**
 * WMC Hero - clean implementation that works WITH GeneratePress, not against it.
 *
 * Design principles:
 * - Stay within GP's content container (.entry-content) - no 100vw breakouts
 * - Use box-shadow: 0 0 0 100vw <colour> to give a full-bleed visual appearance
 *   without actually breaking out of the document flow
 * - Mobile-first padding that scales up for desktop
 * - Don't override GP's max-widths, paddings, or layout properties
 */

/* ===== Base hero - always within content flow ===== */
.wmc-hero {
    background: #1c2e1c;
    color: #e8e8ec;
    padding: 32px 24px;
    margin: 0;
    box-sizing: border-box;
    position: relative;
}

@media (min-width: 768px) {
    .wmc-hero {
        padding: 48px 32px;
    }
}

@media (min-width: 1024px) {
    .wmc-hero {
        padding: 56px 40px;
    }
}

.wmc-hero-inner {
    max-width: 100%;
    margin: 0 auto;
}

/* ===== Full-bleed visual effect (without breaking layout) =====
 * This makes the hero APPEAR to span full viewport via a giant box-shadow,
 * but the element itself stays within its parent's natural width.
 * Avoids overflow issues, cutting text, and conflicts with GP layout.
 */
body.wmc-hero-bleed .wmc-hero,
body.wmc-hero-bleed .wmc-breadcrumbs-bar,
body.wmc-hero-bleed .wmc-hero-disclosure,
body.wmc-hero-bleed .wmc-hero-jump {
    box-shadow: 0 0 0 100vw inherit;
    clip-path: inset(0 -100vw);
}

body.wmc-hero-bleed .wmc-hero {
    box-shadow: 0 0 0 100vw #1c2e1c;
}
body.wmc-hero-bleed .wmc-breadcrumbs-bar {
    box-shadow: 0 0 0 100vw #14241a;
}
body.wmc-hero-bleed .wmc-hero-disclosure {
    box-shadow: 0 0 0 100vw #f5f6f8;
}
body.wmc-hero-bleed .wmc-hero-jump {
    box-shadow: 0 0 0 100vw #fff;
}

/* ===== Hero typography ===== */
.wmc-hero h1 {
    color: #fff;
    font-size: clamp(1.75rem, 4vw, 2.6rem);
    margin: 0 0 16px;
    line-height: 1.15;
    font-weight: 800;
}

.wmc-hero p {
    color: #c8c8d0;
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.65;
    margin: 0 0 12px;
}

.wmc-hero p:last-child {
    margin-bottom: 0;
}

.wmc-hero p a {
    color: #8ecf6e;
}
.wmc-hero p a:hover {
    color: #a8e08a;
}

/* ===== Breadcrumbs bar - sits between menu and hero ===== */
.wmc-breadcrumbs-bar {
    background: #14241a;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 10px 24px;
    color: #8a9a8a;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .wmc-breadcrumbs-bar {
        padding: 10px 32px;
    }
}

@media (min-width: 1024px) {
    .wmc-breadcrumbs-bar {
        padding: 10px 40px;
    }
}

.wmc-breadcrumbs-bar-inner {
    max-width: 100%;
    margin: 0 auto;
}

.wmc-breadcrumbs-bar .wmc-hero-breadcrumbs {
    margin: 0;
    font-size: 13px;
    color: #8a9a8a;
}
.wmc-breadcrumbs-bar a { color: #b0c8b0; }
.wmc-breadcrumbs-bar a:hover { color: #d0e0d0; }
.wmc-breadcrumbs-bar .breadcrumb_last { color: #c0d0c0; }

/* ===== Disclosure bar ===== */
.wmc-hero-disclosure {
    background: #f5f6f8;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 24px;
    margin: 0;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .wmc-hero-disclosure {
        padding: 10px 32px;
    }
}

@media (min-width: 1024px) {
    .wmc-hero-disclosure {
        padding: 10px 40px;
    }
}

.wmc-hero-disclosure p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}
.wmc-hero-disclosure a {
    color: #2d6a2e;
}

/* ===== Sticky jump-to-list link ===== */
.wmc-hero-jump {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 24px;
    margin: 0;
    text-align: center;
    box-sizing: border-box;
}
.wmc-hero-jump a {
    color: #2d6a2e;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}
.wmc-hero-jump a:hover {
    text-decoration: underline;
}

/* ===== TOC inside hero - drop the bar styling ===== */
.wmc-hero .wmc-toc-bar {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* ===== APB byline inside hero ===== */
.wmc-hero .apb-byline {
    border-top: 1px solid rgba(255,255,255,0.15);
    border-bottom: none;
    padding: 14px 0 0;
    margin: 16px 0 0;
}
.wmc-hero .apb-byline-author,
.wmc-hero .apb-byline-author a {
    color: #e0e0e8;
}
.wmc-hero .apb-byline-sep {
    color: rgba(255,255,255,0.25);
}
.wmc-hero .apb-byline-date {
    color: #9999aa;
}

/* ===== Hide GP elements when hero is active ===== */
body.wmc-has-hero #breadcrumbs:not(.wmc-hero-breadcrumbs) { display: none; }
body.wmc-has-hero .entry-header .entry-title { display: none; }
body.wmc-has-hero .entry-header { display: none; }
body.wmc-has-hero .disclaimer-top { display: none; }
body.wmc-has-hero .inside-article > .jump { display: none; }

/* ===== Make header/nav containers full-width so menu items don't wrap ===== */
body.wmc-has-hero .site-header .inside-header.grid-container,
body.wmc-has-hero .main-navigation .inside-navigation.grid-container {
    max-width: none !important;
    width: 100%;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}
@media (min-width: 768px) {
    body.wmc-has-hero .site-header .inside-header.grid-container,
    body.wmc-has-hero .main-navigation .inside-navigation.grid-container {
        padding-left: 32px;
        padding-right: 32px;
    }
}

/* ===== Remove GP padding inside .inside-article when hero is active
 *       so the hero touches the white background edges =====
 */
body.wmc-has-hero .inside-article {
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
}
body.wmc-has-hero .entry-content {
    margin-top: 0;
}

/* Restore padding for content AFTER the hero block */
body.wmc-has-hero .wmc-hero-jump ~ *,
body.wmc-has-hero .wmc-hero-disclosure ~ *:not(.wmc-hero-jump) {
    padding-left: 24px;
    padding-right: 24px;
}
@media (min-width: 768px) {
    body.wmc-has-hero .wmc-hero-jump ~ *,
    body.wmc-has-hero .wmc-hero-disclosure ~ *:not(.wmc-hero-jump) {
        padding-left: 32px;
        padding-right: 32px;
    }
}
@media (min-width: 1024px) {
    body.wmc-has-hero .wmc-hero-jump ~ *,
    body.wmc-has-hero .wmc-hero-disclosure ~ *:not(.wmc-hero-jump) {
        padding-left: 40px;
        padding-right: 40px;
    }
}

/* Add top spacing on the first sibling after the jump bar so content doesn't sit flush */
body.wmc-has-hero .wmc-hero-jump + * {
    padding-top: 24px;
}
@media (min-width: 768px) {
    body.wmc-has-hero .wmc-hero-jump + * {
        padding-top: 32px;
    }
}

/* ===== Featured sites collapsible toggle ===== */
body.wmc-has-hero .featured-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease;
    margin: 0;
    padding: 0 20px;
    border: none;
    border-radius: 0;
    background: #3a8a3c;
    box-sizing: border-box;
}
body.wmc-hero-bleed .featured-container {
    box-shadow: 0 0 0 100vw #3a8a3c;
    clip-path: inset(0 -100vw);
}
body.wmc-has-hero .featured-container.featured-open {
    max-height: 300px;
    padding: 14px 20px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    text-align: center;
}
body.wmc-has-hero .featured-container .featured-carousel {
    display: flex; gap: 4px; flex-wrap: nowrap; justify-content: center; margin: 0 !important;
}
body.wmc-has-hero .featured-container .featured-site {
    margin: 0; padding: 0 4px 10px 0; flex-shrink: 0; position: relative; overflow: visible;
}
body.wmc-has-hero .featured-container .featured-offer { margin: 0; padding: 0; }
body.wmc-has-hero .featured-container .carousel-title { display: none; }

.wmc-featured-tab {
    display: block;
    width: 100%;
    background: #3a8a3c;
    color: #fff;
    border: none;
    padding: 12px 20px;
    font-size: 15px; font-weight: 700;
    cursor: pointer; text-align: center;
    position: relative; overflow: hidden;
    box-sizing: border-box;
}

/* Featured tab full-bleed appearance via box-shadow trick */
body.wmc-hero-bleed .wmc-featured-tab {
    box-shadow: 0 0 0 100vw #3a8a3c;
    clip-path: inset(0 -100vw);
}
.wmc-featured-tab:hover { background: #2d6a2e; }
body.wmc-hero-bleed .wmc-featured-tab:hover { box-shadow: 0 0 0 100vw #2d6a2e; }
.wmc-featured-tab::after { content: " \25BC"; font-size: 12px; transition: transform 0.3s; }
.wmc-featured-tab.featured-tab-open::after { transform: rotate(180deg); }
.wmc-featured-tab::before {
    content: "";
    position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: wmc-glow 3s ease-in-out infinite;
    pointer-events: none;
}
@keyframes wmc-glow {
    0%, 100% { opacity: 0; transform: translateX(-30%); }
    50% { opacity: 1; transform: translateX(30%); }
}
@media (prefers-reduced-motion: reduce) {
    .wmc-featured-tab::before { animation: none; display: none; }
}
