/* ==========================================================================
   Flask app supplements — additions on top of the theme's main.css.
   Kept separate so main.css stays a pristine copy of the child theme.
   ========================================================================== */

/* Mobile hamburger menu.
   The child theme relied on the Genesis parent for the responsive menu (it just
   hid .nav-primary at <=900px). We add a lightweight toggle here, driven by the
   existing main.js (.menu-toggle / .nav-primary .active classes). */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--white);
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Homepage header is white, so the toggle bars need to be dark there. */
body.home .menu-toggle { color: var(--gray-900); }

/* Author avatar fallback — WordPress used Gravatar images; we render initials in
   a brand-green circle instead (no avatar image source on the flat-file site). */
.avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--envera-green);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}
.article-author-avatar.avatar-initials { width: 44px; height: 44px; font-size: 15px; }
.author-bio-image.avatar-initials { width: 72px; height: 72px; font-size: 24px; }

/* About page leader card — monogram fallback inside the theme's gradient
   placeholder (no current headshot on the flat-file site yet). */
.leader-photo-placeholder .leader-monogram {
    font-family: var(--font-heading);
    font-size: 5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: rgba(255, 255, 255, 0.85);
}

/* About — single full-width leadership feature card (photo left, body right).
   The live site shows one leader, not the theme's two-card photo+join layout. */
/* Compound selector: about-page.css loads after app.css, so a single-class
   override would lose the cascade to its `.about-leadership-grid` rule. */
.about-leadership-grid.about-leadership-grid--solo { grid-template-columns: 1fr; }
.about-leader-card--feature {
    display: grid;
    grid-template-columns: 360px 1fr;
    align-items: stretch;
}
.about-leader-card--feature .leader-photo { height: 100%; min-height: 340px; }
.about-leader-card--feature .leader-body { align-self: center; padding: 44px 48px; }

/* Shared "Let's talk about your project" pre-footer CTA band (deep-green rounded
   card, centered, in a white section). Used on the About page and the homepage.
   On the homepage the preceding section is dark, so it needs top padding too; on
   About the white section above already supplies the top whitespace. */
.cta-band { background: var(--white); padding: 0 0 96px; }
body.home .cta-band { padding-top: 96px; }
.cta-band .cta-inner {
    background: #28351a; /* deep envera green */
    border-radius: 20px;
    padding: 80px 32px;
    text-align: center;
}
.cta-band h2 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}
.cta-band p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.7;
    max-width: 520px;
    margin: 0 auto 32px;
}

/* Generic interior pages (Privacy Policy, Terms of Service, …). Clears the fixed
   header and constrains the prose column for readability on the white background. */
.page-hero {
    padding: calc(var(--nav-height) + 56px) 0 40px;
    border-bottom: 1px solid var(--gray-100);
}
.page-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    font-weight: 600;
    color: var(--gray-900);
    letter-spacing: -0.03em;
    margin: 0;
}
.page-body { padding: 56px 0 96px; }
.page-body .entry-content {
    max-width: 760px;
    margin: 0 auto;
    color: var(--gray-800);
}

/* Footer CONTACT column — the address sits inline under the phone (plain text,
   so it needs an explicit color on the dark footer) with a little extra space. */
.footer-col li.footer-contact-address {
    margin-top: 24px;
    color: var(--gray-400);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Clear the fixed 88px header on single posts. The theme's offset relied on a
   .site-inner wrapper that this Flask app doesn't render, leaving only the hero's
   48px top padding — so the back-link/category badge tucked under the header.
   Mirror the archive hero's spacing; calc keeps it correct at the 72px mobile nav. */
.single-article .article-hero {
    padding-top: calc(var(--nav-height) + 52px);
}

/* Uniform article hero footprint. Every featured image fills the same full-width
   banner: wide images (ratio >= FULLBLEED_MIN_RATIO in app.py, or an explicit
   `hero_image`) go full-bleed; narrower/card-shaped graphics are centered on a
   full-width dark accent band (matching the footer/About hero) so there are no
   white side gaps. Treatment is chosen in app.py _hero_for(); the template emits
   .is-fullbleed / .is-banded. The band is edge-to-edge; only the image inside
   is constrained. */
.article-hero-media { width: 100%; margin-top: 32px; }
.article-hero-media.is-fullbleed img {
    width: 100%;
    height: clamp(280px, 38vw, 520px);
    object-fit: cover;
    display: block;
}
.article-hero-media.is-banded {
    background: #e9f1dd;             /* light envera-green tint (#76A642 @ ~18% over white) */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px var(--container-padding);
}
.article-hero-media.is-banded img {
    max-width: 640px;                /* keep card graphics at a sensible size */
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    box-shadow: 0 10px 30px rgba(20, 22, 18, 0.10);  /* lift the graphic off the light band */
}

/* Inline images in blog post bodies. The theme only constrained <figure> images,
   so plain markdown images (![](...)) rendered at intrinsic width and overflowed
   the content column (sliding under the sidebar). Constrain + center them. */
.single-article .article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 32px auto;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .about-leader-card--feature { grid-template-columns: 1fr; }
    .about-leader-card--feature .leader-photo { min-height: 280px; }
    .about-leader-card--feature .leader-body { padding: 32px; }
    .cta-band { padding-bottom: 64px; }
    body.home .cta-band { padding-top: 64px; }
    .cta-band .cta-inner { padding: 56px 24px; }

    /* Article hero: shorter banner + tighter band padding on mobile. */
    .article-hero-media.is-fullbleed img { height: clamp(220px, 50vw, 360px); }
    .article-hero-media.is-banded { padding: 28px 20px; }
    .article-hero-media.is-banded img { max-width: 100%; }
}

@media (max-width: 900px) {
    .menu-toggle { display: inline-flex; }

    /* Reveal the hidden nav as a dropdown panel when toggled open. */
    .site-header .nav-primary.active {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 16px 24px 24px;
        background: var(--white);
        border-top: 1px solid var(--gray-100);
        box-shadow: var(--shadow-lg);
    }

    .site-header .nav-primary.active .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        width: 100%;
    }

    .site-header .nav-primary.active .nav-menu > li > a {
        display: block;
        padding: 12px 4px;
        color: var(--gray-800);
    }

    /* Keep the "Get in Touch" button full-width in the mobile panel. */
    .site-header .nav-primary.active .nav-menu > li:last-child > a {
        margin-top: 8px;
        text-align: center;
    }

    /* Capabilities dropdown: hover can't fire on touch, so render the sub-menu
       inline (static, indented) inside the open mobile panel. */
    .site-header .nav-primary.active .nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0 0 4px;
        min-width: 0;
    }
    .site-header .nav-primary.active .nav-menu .sub-menu a {
        padding: 10px 4px 10px 20px;
        color: var(--gray-600);
    }
}

/* ==========================================================================
   CONTACT FORM + NEWSLETTER (Mailgun)
   ========================================================================== */

/* Honeypot — visually hidden but still in the DOM for bots to fill. Not
   display:none (some bots skip those) and not [hidden] for the same reason. */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Screen-reader-only label (newsletter email input). */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Inline status banner under the contact form. */
.form-status {
    margin-top: 14px;
    font-size: 0.9375rem;
    line-height: 1.5;
}
.form-status:empty { margin-top: 0; }
.form-status--error {
    color: #b3261e;
}

/* "Sending…" disabled submit state. */
.modal-form button[type="submit"]:disabled {
    opacity: 0.65;
    cursor: default;
}

/* Success panel that replaces the form after a successful send. */
.form-success {
    text-align: center;
    padding: 32px 8px;
}
.form-success svg { color: var(--envera-green); }
.form-success h3 {
    margin: 16px 0 8px;
    color: var(--gray-900);
}
.form-success p {
    color: var(--gray-600);
    max-width: 32ch;
    margin: 0 auto;
}

/* Footer newsletter signup (4th footer column). */
.footer-newsletter p {
    margin: 0 0 16px;
}
.newsletter-input-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.newsletter-input {
    flex: 1 1 140px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 0.9375rem;
}
.newsletter-input::placeholder { color: var(--gray-400); }
.newsletter-input:focus {
    outline: none;
    border-color: var(--envera-green);
    background: rgba(255, 255, 255, 0.1);
}
.newsletter-btn {
    flex: 0 0 auto;
    padding: 10px 18px;
}
.newsletter-btn:disabled { opacity: 0.65; cursor: default; }
.newsletter-status {
    margin-top: 10px;
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: 1px;
}
.newsletter-status--success { color: var(--envera-green-bright); }
.newsletter-status--error { color: #ff9b94; }

/* Server-rendered result page (no-JS contact/newsletter fallback). */
.form-result {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    padding: 24px 0 8px;
}
.form-result svg { color: var(--envera-green); margin-bottom: 8px; }
.form-result h1 { color: var(--gray-900); margin: 0 0 12px; }
.form-result p { color: var(--gray-600); margin: 0 0 12px; }
.form-result .btn { margin-top: 16px; }
.form-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Nav "Get in Touch" CTA — a green pill button at the end of the menu, on every
   header state (transparent practice header, white home/interior). */
.site-header .nav-menu .nav-cta {
    display: inline-block;
    padding: 9px 20px;
    background: var(--envera-green);
    color: #fff !important;
    border-radius: 999px;
    font-weight: 600;
    line-height: 1.2;
    transition: background 0.2s ease, transform 0.2s ease;
}
.site-header .nav-menu .nav-cta:hover {
    background: var(--envera-green-dark);
    color: #fff !important;
    transform: translateY(-1px);
}
/* In the mobile hamburger panel, let it sit inline like the other items but keep
   the button look. */
@media (max-width: 900px) {
    .site-header .nav-primary.active .nav-menu .nav-cta {
        display: inline-block;
        margin: 8px 4px;
    }
}

/* Uniform logo size — match the blog (light-header) 30px everywhere; the theme
   shrinks it to 26px on the home page. main.css is pristine, so override here. */
body.home .site-header .custom-logo,
body.home .site-header .custom-logo-link img {
    height: 30px;
}

/* Active-topic filter banner on /insights?tag=… */
.topic-filter-banner {
    padding: 16px 0;
    background: var(--off-white);
    border-bottom: 1px solid #e6e8e3;
}
.topic-filter-banner .container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.topic-filter-label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-600);
}
.topic-filter-value {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--envera-green);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
}
.topic-filter-clear {
    margin-left: auto;
    font-size: 0.9375rem;
    color: var(--gray-600);
    text-decoration: none;
}
.topic-filter-clear:hover { color: var(--envera-green-dark); }
