/* ============================================================
   LawnBeast V2 — PUBLIC page shell (navbar / footer / FAB)
   Layered on top of css/v2/base.css (tokens, reset, toast).
   Used by base_public_v2.html for logged-out marketing/content
   pages (news, and future guides/changelog re-skins).
   MOBILE-FIRST: base styles = phone; desktop layered on.
   ============================================================ */

:root {
    /* public-shell tokens not present in base.css */
    --accent-border: #c8e6c9;   /* matches --positive-bg, green hairlines */
    --green-deepest: #2d5a2e;   /* matches --sidebar-active, footer/CTA depth */
    --radius: 8px;
    --radius-sm: 6px;
    --maxw: 1140px;                      /* Bootstrap .container xl tier; grows to 1320 (xxl) >=1400px — matches v1 base.html */
    --nav-h: 58px;                       /* navbar height — drives sticky offsets */
    --gutter: clamp(16px, 4vw, 28px);    /* page side padding scales w/ screen */
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;      /* stop iOS inflating text -> overflow */
}

body {
    overflow-x: clip;                    /* kill horizontal spill — sticky-safe (not 'hidden') */
    font-size: 16px;                     /* reading size, not the 13px app density */
    line-height: 1.65;
    min-height: 100vh;                   /* sticky footer: fill the viewport... */
    min-height: 100dvh;                  /* ...dvh where supported (mobile URL-bar safe) */
    display: flex;
    flex-direction: column;
}
.pub-main { flex: 1 0 auto; }            /* grow to push footer to the bottom on short pages */

img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* shared horizontal container: centered, gutter padding, never wider than screen */
.pub-container,
.footer-top,
.footer-bottom-inner {
    width: 100%;
    max-width: var(--maxw);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

/* ---------- Top brand bar ---------- */
.pub-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--accent);
    border-bottom: 1px solid var(--accent-dark);
}
.nav-inner {
    width: 100%;
    max-width: var(--maxw);
    margin-left: auto;
    margin-right: auto;
    min-height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 9px;
    padding-bottom: 9px;
    padding-left: var(--gutter);         /* mobile keeps breathing room; zeroed >=992px below */
    padding-right: var(--gutter);
}
.wordmark {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700;
    font-size: 19px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    letter-spacing: -.01em;
    flex: none;
    color: #fff;                          /* on green nav / green footer */
}
.wordmark .mark {                        /* badge dropped — just holds the logo */
    display: inline-flex;
    align-items: center;
    flex: none;
}
.wordmark .mark img {
    height: 34px;
    width: auto;
    display: block;
}
.nav-links {
    display: none;                       /* hidden on mobile, shown >=992px (hamburger below) */
    align-items: center;
    gap: 16px;                           /* ~v1 spacing (8px link padding each side) */
    margin-left: auto;                   /* push links flush right, next to nav-actions */
    font-size: 0.8rem;                   /* match v1 nav links (0.8rem / ~12.8px) */
    font-weight: 600;                    /* v1 semibold */
    letter-spacing: .4px;                /* v1 nav letter-spacing */
    white-space: nowrap;
    color: rgba(255,255,255,.82);
}
/* v1's "cl-effect-21" hover/active: a 2px white bar slides in from above AND
   below to frame the link, and the label brightens to white. Applies to the
   top-level nav links only (direct children) — the Resources toggle gets the
   same treatment below; dropdown menu items keep their own surface styling. */
.nav-links > a { position: relative; padding: 5px 0; transition: color var(--transition-fast); }
.nav-links > a::before,
.nav-links > a::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    opacity: 0;
    transition: opacity .24s ease, transform .24s ease;
}
.nav-links > a::before { top: 0; transform: translateY(-8px); }
.nav-links > a::after  { bottom: 0; transform: translateY(8px); }
.nav-links > a:hover,
.nav-links > a:focus,
.nav-links > a.is-active { color: #fff; }
.nav-links > a:hover::before,     .nav-links > a:hover::after,
.nav-links > a:focus::before,     .nav-links > a:focus::after,
.nav-links > a.is-active::before, .nav-links > a.is-active::after {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Resources dropdown (navbar variant only) ----------
   Mirrors v1's grouped "Resources" menu so the top-level row is short
   enough to expand at 992px. Only rendered inside .nav-links (>=992px);
   the mobile menu + footer render these links flat instead. */
.nav-dropdown { position: relative; display: flex; align-items: center; }
.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: relative;
    margin: 0;
    padding: 4px 0;
    background: none;
    border: 0;
    font: inherit;                       /* inherit .nav-links size/weight */
    line-height: inherit;
    color: rgba(255,255,255,.82);
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--transition-fast);
}
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle:focus,
.nav-dropdown-toggle.is-active { color: #fff; }
.nav-dropdown-toggle .bi-chevron-down {
    font-size: 11px;
    transition: transform var(--transition-fast);
}
.nav-dropdown.open .nav-dropdown-toggle .bi-chevron-down { transform: rotate(180deg); }
/* same top+bottom sliding bars as the plain nav links (v1 cl-effect-21) */
.nav-dropdown-toggle::before,
.nav-dropdown-toggle::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    opacity: 0;
    transition: opacity .24s ease, transform .24s ease;
}
.nav-dropdown-toggle::before { top: 0; transform: translateY(-8px); }
.nav-dropdown-toggle::after  { bottom: 0; transform: translateY(8px); }
.nav-dropdown-toggle:hover::before,     .nav-dropdown-toggle:hover::after,
.nav-dropdown-toggle:focus::before,     .nav-dropdown-toggle:focus::after,
.nav-dropdown-toggle.is-active::before, .nav-dropdown-toggle.is-active::after {
    opacity: 1;
    transform: translateY(0);
}
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 184px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
    z-index: 120;
}
.nav-dropdown-menu::before {            /* transparent bridge keeps hover alive across the gap */
    content: "";
    position: absolute;
    left: 0; right: 0; top: -8px;
    height: 8px;
}
.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-dropdown-menu a:hover { background: var(--surface-hover); color: var(--text); }
.nav-dropdown-menu a.is-active { background: var(--accent-bg); color: var(--accent-dark); font-weight: 600; }

/* right-side actions: Log in / Dashboard + primary CTA */
.nav-actions {
    display: none;                       /* shown as a flex row >=992px */
    align-items: center;
    gap: 16px;
    margin-left: 12px;                   /* extra breathing room between nav links and the login/CTA buttons */
}
/* Secondary pill — mirrors .nav-cta's shape/size but as a transparent,
   white-outlined "ghost" button so it reads as secondary to the CTA. */
.nav-login {
    background: transparent;
    color: #fff;
    padding: 8px 15px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.55);
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}
.nav-login:hover {
    background: rgba(255,255,255,.12);
    border-color: #fff;
    color: #fff;
    transform: translateY(-1px);
}

/* hamburger — shown on mobile, hidden >=1100px */
.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 42px;
    height: 42px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.nav-toggle:hover { background: rgba(255,255,255,.12); }

.nav-cta {
    background: #fff;
    color: var(--accent-dark);
    padding: 8px 15px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), background var(--transition-fast);
}
.nav-cta:hover { background: rgba(255,255,255,.88); transform: translateY(-1px); color: var(--accent-dark); }

/* ---------- Mobile slide-down menu (< 992px) ---------- */
/* Smooth height slide on open/close (mirrors v1's Bootstrap navbar-collapse).
   The grid 0fr->1fr trick animates to the content's natural height with no
   magic max-height value; .mobile-menu-inner clips the overflow mid-slide and
   keeps the collapsed links out of the tab order. Vertical padding + the top
   divider live on the inner children so they collapse with the slide (padding
   on the grid container itself would leave a sliver showing when closed). */
.mobile-menu {
    display: grid;                       /* .open toggled by js/v2/public-base.js */
    grid-template-rows: 0fr;
    background: var(--accent);
    padding: 0 var(--gutter);            /* horizontal only */
    transition: grid-template-rows .3s ease;
}
.mobile-menu.open { grid-template-rows: 1fr; }
.mobile-menu-inner {
    min-height: 0;
    overflow: hidden;
    visibility: hidden;                  /* not focusable while collapsed */
    transition: visibility .3s;
}
.mobile-menu.open .mobile-menu-inner { visibility: visible; }
.mobile-menu-links {
    display: flex;
    flex-direction: column;
    padding-top: 6px;
    border-top: 1px solid var(--accent-dark);
}
.mobile-menu-links a {
    padding: 12px 2px;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,.9);
    border-bottom: 1px solid rgba(255,255,255,.14);
}
.mobile-menu-links a:last-child { border-bottom: 0; }
.mobile-menu-links a.is-active { color: #fff; font-weight: 700; }

/* Collapsible "Resources" group inside the mobile menu — mirrors v1's collapsed
   navbar-collapse submenu (tap "Resources" to reveal Guides/Changelog/News).
   The footer keeps its flat list. */
.mobile-resources { display: flex; flex-direction: column; }
.mobile-resources-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 12px 2px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.14);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,.9);
    text-align: left;
    cursor: pointer;
}
.mobile-resources-toggle.is-active { color: #fff; font-weight: 700; }
.mobile-resources-toggle .bi-chevron-down {
    font-size: 13px;
    transition: transform var(--transition-fast);
}
.mobile-resources.open .mobile-resources-toggle .bi-chevron-down { transform: rotate(180deg); }
.mobile-resources-menu {
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height .28s ease;
}
.mobile-resources.open .mobile-resources-menu { max-height: 220px; }
.mobile-resources-menu a {
    padding: 11px 2px 11px 18px;         /* indented one step under "Resources" */
    font-size: 14.5px;
    font-weight: 500;
    color: rgba(255,255,255,.82);
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.mobile-resources-menu a:last-child { border-bottom: 1px solid rgba(255,255,255,.14); }
.mobile-resources-menu a.is-active { color: #fff; font-weight: 700; }

.mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    padding-bottom: 18px;                /* was on .mobile-menu; kept inside the clipped slide */
}
.mobile-menu-actions .mm-secondary {
    text-align: center;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    transition: background var(--transition-fast);
}
.mobile-menu-actions .mm-secondary:hover { background: rgba(255,255,255,.1); }
.mobile-menu-actions .nav-cta { display: flex; justify-content: center; }

/* ---------- Footer ---------- */
/* ---------- Footer — variant 1a: comprehensive site-map ----------
   Dark-green full-bleed band; inner grid + bottom legal bar constrained
   to --maxw. Lime column labels; muted-white links. Mobile-first: the
   grid is a single column and stacks; 2-up at 560px; the full 5-col
   site-map row lands at 992px (matches the desktop nav breakpoint). */
.pub-footer { margin-top: 56px; background: #26512a; color: rgba(255,255,255,0.66); }

.footer-top {
    padding-top: 44px; padding-bottom: 36px;
    display: grid;
    grid-template-columns: 1fr 1fr;      /* link columns 2x2 on mobile */
    gap: 36px 40px;
}
.footer-brand { grid-column: 1 / -1; }   /* brand spans the top on mobile */

/* brand column */
.footer-brand .wordmark { color: #fff; margin-bottom: 14px; }
.footer-blurb {
    margin: 0 0 20px;
    font-size: 14px; line-height: 1.7;
    color: rgba(255,255,255,0.6);
    max-width: 300px;
}
.footer-social { display: flex; gap: 10px; }
.footer-social-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.06);
    font-size: 15px;
    transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}
.footer-social-link:hover { color: #1f3f20; background: #a5d66a; transform: translateY(-2px); }

/* link columns */
.footer-col-title {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.09em; text-transform: uppercase;
    color: #a5d66a;
    margin-bottom: 16px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.footer-col a { font-size: 14px; color: rgba(255,255,255,0.66); transition: color var(--transition-fast); }
.footer-col a:hover { color: #fff; }

/* bottom legal bar */
.footer-bottom { background: rgba(0,0,0,0.16); border-top: 1px solid rgba(255,255,255,0.08); }
.footer-bottom-inner {
    padding-top: 18px; padding-bottom: 18px;
    display: flex; flex-direction: column;   /* stacked on mobile */
    align-items: flex-start; gap: 12px;
}
.footer-copy { font-size: 12px; color: rgba(255,255,255,0.5); }
.footer-year { font-family: 'IBM Plex Mono', monospace; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 22px; font-size: 12px; }
.footer-legal a { color: rgba(255,255,255,0.66); transition: color var(--transition-fast); }
.footer-legal a:hover { color: #fff; }

/* ---------- Back-to-top FAB ---------- */
.fab {
    position: fixed;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    width: 50px; height: 50px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    display: grid; place-items: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(78,150,79,.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s, background var(--transition-fast);
    z-index: 110;                         /* above navbar + sticky TOC */
}
.fab.show { opacity: .96; visibility: visible; transform: translateY(0); }
.fab:hover { opacity: 1; background: var(--accent-dark); }

/* ============================================================
   >= 700px : roomier — footer legal bar spreads to a single row
   ============================================================ */
@media (min-width: 700px) {
    .wordmark { font-size: 20px; }
    .footer-bottom-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* ============================================================
   >= 992px : full desktop nav — inline links + actions, hamburger
   and mobile menu retired. Matches v1's navbar-expand-lg (992px);
   the Resources dropdown folds Guides/Changelog/News into one item
   so the top-level row fits here.
   ============================================================ */
@media (min-width: 992px) {
    .nav-links { display: flex; }
    .nav-actions { display: flex; }
    .nav-toggle { display: none; }
    .mobile-menu { display: none !important; }

    /* desktop: nav content sits flush to the max-width edges */
    .nav-inner { padding-left: 0; padding-right: 0; }

    /* full 1a site-map row: brand + Product + Resources + Company */
    .footer-top {
        grid-template-columns: minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);
        gap: 40px;
    }
    .footer-brand { grid-column: auto; }
}

/* ============================================================
   >= 1400px : Bootstrap .container xxl tier. v1's marketing nav
   and footer use .container, which widens from 1140 (xl) to 1320
   here — so the public v2 shell (nav, news grid, footer, article
   header) tracks the same max-width v1 reaches on wide monitors.
   ============================================================ */
@media (min-width: 1400px) {
    :root { --maxw: 1320px; }
}
