/* ==========================================================================
   Huntingdonshire Business Directory - GLOBAL
   Tokens, reset, header (top bar + slim nav), mobile overlay, buttons, footer
   Palette: Civic Gold (navy + gold + green on cream)
   ========================================================================== */

:root {
    /* Brand colours - Community Green */
    --brand:        #1E2E48;   /* navy - structural primary */
    --brand-dark:   #16233A;   /* hover / active */
    --brand-deep:   #101B2E;   /* deepest, gradient base */
    --accent:       #2F7D55;   /* forest green - CTAs / accents */
    --accent-dark:  #256341;   /* green hover */
    --accent-2:     #C39A45;   /* gold - secondary highlight */

    /* Neutrals */
    --charcoal:     #16233A;   /* dark sections + headings */
    --ink:          #1C2534;   /* body text */
    --muted:        #5A6478;   /* secondary text */
    --grey:         #F2F6F3;   /* soft (green-tinted) section background */
    --grey-line:    #E3E8E5;   /* hairlines / borders */
    --cream:        #FAFBFB;   /* near-white top-bar surface, matched to the new logo background */
    --white:        #ffffff;

    /* Text on accent */
    --on-accent:    #ffffff;   /* white text on green */

    /* Rhythm & effects */
    --maxw:       1180px;
    --gutter:     clamp(1.25rem, 4vw, 3rem);
    --section-y:  clamp(3.5rem, 8vw, 6.5rem);
    --radius:     14px;
    --radius-lg:  22px;
    --radius-sm:  8px;
    --shadow-sm:  0 4px 18px rgba(16,27,46,0.06);
    --shadow-md:  0 14px 40px rgba(16,27,46,0.12);
    --ease:       cubic-bezier(0.22, 0.61, 0.36, 1);

    --font-head: 'Archivo', system-ui, -apple-system, sans-serif;
    --font-body: 'Archivo', system-ui, -apple-system, sans-serif;

    --top-h: 120px;   /* top bar height (desktop) */
    --nav-h: 68px;    /* slim nav height (desktop) */
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    color: var(--brand);
    line-height: 1.15;
    margin: 0 0 .5em;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: var(--section-y); }
.section--grey { background: var(--grey); }
.section--cream { background: var(--cream); }
.section--charcoal { background: var(--charcoal); color: #E7EAF1; }
.section--charcoal h1, .section--charcoal h2, .section--charcoal h3 { color: #fff; }

.eyebrow {
    font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--accent-dark); margin: 0 0 .6rem;
}
.section__head { max-width: 720px; margin: 0 auto clamp(2rem,4vw,3rem); text-align: center; }
.section__head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.section__head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* Gold rule motif (echoes the logo) */
.rule-gold { display:inline-flex; align-items:center; gap:.6rem; color:var(--accent-dark); }
.rule-gold::before, .rule-gold::after { content:""; width:34px; height:2px; background:var(--accent); }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: var(--font-head); font-weight: 700; font-size: .98rem;
    line-height: 1; padding: .85rem 1.4rem; border-radius: var(--radius-sm);
    border: 2px solid transparent; cursor: pointer; transition: all .18s var(--ease);
    white-space: nowrap; text-align: center;
}
.btn--primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; transform: translateY(-1px); }
.btn--outline { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn--outline:hover { background: var(--brand); color: #fff; }
.btn--light { background: #fff; color: var(--brand); border-color: #fff; }
.btn--light:hover { background: var(--cream); border-color: var(--cream); color: var(--brand); }
.btn--ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn--ghost-light:hover { background: rgba(255,255,255,.12); border-color:#fff; color:#fff; }
.btn--lg { padding: 1.05rem 1.8rem; font-size: 1.05rem; }
.btn--block { width: 100%; }

/* Email reveal (JS assembles the address to deter harvesting; wraps instead of overflowing) */
.email-reveal { white-space: normal; text-align: center; color: #fff; }
.email-reveal .email-reveal__label { text-align: center; }
.email-inline { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--accent-dark); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.email-inline:hover { color: var(--accent); }

/* Email copy link (non-button, used on the coming-soon cards) */
.email-copy { display: inline-flex; align-items: center; gap: .5rem; background: none; border: 0; padding: .3rem 0; cursor: pointer; font-family: var(--font-head); font-weight: 700; font-size: 1.08rem; color: var(--accent-dark); line-height: 1.25; }
.email-copy > i { flex: 0 0 auto; color: var(--accent); font-size: 1.05rem; line-height: 1; display: grid; place-items: center; }
.email-copy .email-reveal__label { line-height: 1.25; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; text-decoration-color: rgba(47,125,85,.45); }
.email-copy:hover, .email-copy.is-copied { color: var(--accent); }
.email-copy:hover .email-reveal__label { text-decoration-color: var(--accent); }
.email-copy.is-copied .email-reveal__label { text-decoration: none; }

/* ==========================================================================
   HEADER  (top bar + slim nav, both live in the header include)
   ========================================================================== */
.site-header { position: static; }
.topbar .topbar__inner { max-width: 1480px; }   /* only the white top bar spans wider (equal gutters); the navy nav keeps the standard 1180px content width */

/* --- Top bar (taller) --- */
.topbar { background: var(--cream); border-bottom: 1px solid var(--grey-line); }
.topbar__inner {
    display: flex; align-items: center; gap: 1rem;
    min-height: var(--top-h); padding-block: .5rem;
}
.brand { display: inline-flex; align-items: center; gap: .85rem; margin-right: auto; }
.brand__mark { color: var(--accent-2); font-size: 2.4rem; line-height: 1; transition: color .18s var(--ease); }
.brand__name { display: block; font-family: var(--font-head); font-weight: 800; color: var(--brand); font-size: 1.55rem; line-height: 1.02; letter-spacing: -.01em; }
.brand__sub { display: block; font-family: var(--font-head); font-weight: 700; color: var(--accent-dark); font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; margin-top: .3rem; }
.brand:hover .brand__mark { color: var(--accent-dark); }
.brand:hover .brand__name { color: var(--brand-dark); }

.topbar__actions { display: inline-flex; align-items: center; gap: 1.15rem; }

/* Hamburger */
.nav-toggle {
    display: none; align-items: center; justify-content: center;
    width: 46px; height: 46px; border: 1px solid var(--grey-line); background:#fff;
    border-radius: var(--radius-sm); color: var(--brand); font-size: 1.35rem; cursor: pointer;
}

/* --- Slim nav (below) --- */
.subnav { background: var(--brand); }
.subnav__inner { display: flex; align-items: center; gap: .9rem; min-height: var(--nav-h); }
.subnav a {
    position: relative;
    font-family: var(--font-head); font-weight: 600; font-size: 1rem;
    color: #D7DCE6; padding: .95rem 1.15rem; border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; gap: .45rem; letter-spacing: .01em;
}
.subnav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.subnav a.is-active { color: #fff; }
.subnav a.is-active::after {
    content: ""; position: absolute; left: 1.15rem; right: 1.15rem; bottom: .5rem;
    height: 3px; border-radius: 2px; background: var(--accent);
}
.subnav a.subnav__search { margin-left: auto; padding: .38rem .78rem; color: #fff; border: 1px solid rgba(255,255,255,.22); }
.subnav a.subnav__search::after { display: none; }
.subnav a.subnav__search:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ==========================================================================
   MOBILE OVERLAY MENU
   ========================================================================== */
.nav-overlay {
    position: fixed; inset: 0; z-index: 100; background: var(--brand);
    display: flex; flex-direction: column; padding: 1.4rem var(--gutter) 2rem;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
    overflow-y: auto;
}
.nav-overlay.is-open { opacity: 1; visibility: visible; transform: none; }
.nav-overlay__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.nav-overlay__brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.nav-overlay .brand__mark { color: var(--accent-2); font-size: 1.9rem; line-height: 1; }
.nav-overlay .brand__name { color: #fff; font-size: 1.25rem; line-height: 1.02; }
.nav-overlay .brand__sub { color: var(--accent-2); font-size: .58rem; }
.nav-close { flex: 0 0 auto; width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.06); color:#fff; border-radius: var(--radius-sm); font-size: 1.5rem; cursor: pointer; display: grid; place-items: center; }
.nav-close:hover { background: rgba(255,255,255,.14); border-color:#fff; }
.nav-overlay__links { list-style: none; margin: 0 0 1rem; padding: 0; }
.nav-overlay__links a {
    display: flex; align-items: center; gap: .7rem; color: #fff; font-family: var(--font-head);
    font-weight: 600; font-size: 1.1rem; padding: .7rem 0; border-bottom: 1px solid rgba(255,255,255,.1);
}
.nav-overlay__links a:hover { color: var(--accent); }
.nav-overlay__links i { color: var(--accent); width: 22px; text-align: center; }
.nav-overlay__cta { display: grid; gap: .7rem; margin-top: 1.3rem; }
.nav-overlay__contact { margin-top: 1.4rem; color: #C7CDD8; font-size: .95rem; }
.nav-overlay__contact a { color: #fff; }

body.menu-open { overflow: hidden; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { background: var(--brand-deep); color: #C4CBD8; padding-top: clamp(3.2rem,6vw,4.8rem); border-top: 3px solid var(--accent); }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1.2fr; column-gap: clamp(2.4rem, 5vw, 5rem); row-gap: 2.6rem; }
.site-footer h4 { color: #fff; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1.2rem; position: relative; padding-bottom: .7rem; }
.site-footer h4::after { content:""; position:absolute; left:0; bottom:0; width:32px; height:2px; background: var(--accent); }
.site-footer a { color: #C4CBD8; transition: color .15s var(--ease); }
.site-footer a:hover { color: var(--accent); }
.footer-brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; margin-bottom: 1.1rem; }
.site-footer .brand__mark { color: var(--accent-2); font-size: 1.9rem; line-height: 1; }
.site-footer .brand__name { color: #fff; font-size: 1.3rem; line-height: 1.02; font-weight: 800; }
.site-footer .brand__sub { color: var(--accent-2); font-size: .58rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; margin-top: .3rem; display: block; }
.footer-brand:hover .brand__mark { color: var(--accent); }
.site-footer .footer-brand:hover .brand__name { color: #fff; }
.site-footer .footer-brand:hover .brand__sub { color: var(--accent-2); }
.footer-about p { color: #9AA4B6; font-size: .95rem; line-height: 1.65; margin: 0; max-width: 34ch; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; font-size: .97rem; }
.footer-links a { display: inline-flex; align-items: center; gap: .5rem; }
.footer-links a::before { content:"\f105"; font-family:"Font Awesome 6 Free"; font-weight:900; color: var(--accent); font-size:.8rem; opacity:.7; transition: transform .15s var(--ease); }
.footer-links a:hover::before { transform: translateX(3px); }
.footer-cta p { color:#9AA4B6; font-size:.95rem; margin:0 0 1.1rem; }
.footer-bottom {
    margin-top: clamp(2.5rem,5vw,3.5rem); border-top: 1px solid rgba(255,255,255,.1);
    padding: 1.4rem 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    font-size: .88rem; color: #8892A6;
}
.footer-bottom .tagline { color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.footer-bottom a { color: #8892A6; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .subnav { display: none; }              /* slim nav folds into overlay */
    .topbar__actions .btn { display: none; }/* buttons move into overlay */
    .nav-toggle { display: inline-flex; }
    .brand__name { font-size: 1.25rem; }
    .brand__mark { font-size: 2rem; }
    .brand__sub { font-size: .58rem; letter-spacing: .18em; }
    .brand { margin-left: 0; }
    .topbar__actions { margin-right: 0; }
    :root { --top-h: 96px; }
    .site-header { position: sticky; top: 0; z-index: 60; }   /* mobile only: bar stays reachable */
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .brand__name { font-size: 1.05rem; }
    .brand__mark { font-size: 1.7rem; }
    .brand__sub { font-size: .52rem; letter-spacing: .14em; }
    :root { --top-h: 80px; }
    /* Centre every footer item on mobile */
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-about p { max-width: none; }
    .site-footer h4 { padding-bottom: .8rem; }
    .site-footer h4::after { left: 50%; transform: translateX(-50%); }
    .footer-links { justify-items: center; }
    .footer-cta .btn { max-width: 320px; margin-inline: auto; }
    .footer-bottom { flex-direction: column; align-items: center; text-align: center; }
}

/* ==========================================================================
   FORM HELPERS (honeypot + error banner) - shared by the contact + listing forms
   ========================================================================== */
/* Honeypot spam trap: visually hidden (not display:none, so bots still fill it) */
.hp-field { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
/* Error banner shown on ?error=1 (tuned for the navy form cards) */
.form-error { background: rgba(214,69,69,.14); border: 1px solid rgba(214,69,69,.55); color: #ffdada; border-radius: var(--radius-sm); padding: .85rem 1.1rem; margin: 0 0 1.4rem; font-size: .96rem; line-height: 1.5; }

/* ==========================================================================
   FORM LOADING OVERLAY (shown while contact / listing forms submit)
   ========================================================================== */
.form-overlay { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 1.5rem; background: rgba(16,27,46,.78); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.form-overlay.is-visible { display: flex; animation: hbd-fade .2s var(--ease); }
.form-overlay__box { display: flex; flex-direction: column; align-items: center; gap: 1.15rem; background: #fff; border-radius: var(--radius-lg); padding: 2.3rem 2.7rem; box-shadow: var(--shadow-md); text-align: center; }
.form-overlay__spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--grey-line); border-top-color: var(--accent); animation: hbd-spin .8s linear infinite; }
.form-overlay__text { margin: 0; font-family: var(--font-head); font-weight: 700; color: var(--brand); font-size: 1.05rem; }
body.form-sending { overflow: hidden; }
@keyframes hbd-spin { to { transform: rotate(360deg); } }
@keyframes hbd-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .form-overlay__spinner { animation-duration: 2s; } .form-overlay.is-visible { animation: none; } }
