/* =========================================================
   Business Finder Directories - Global CSS (prefix: none for tokens/base)
   ========================================================= */


/* =========================================================
   SECTION 1 - Design tokens
   Option E palette: deep blue + sage green + near-navy + off-white
   Individual edition pages override --accent for their own colour
   ========================================================= */

:root {
    /* Palette */
    --primary:      #205890;
    --primary-dark: #163F66;
    --primary-tint: rgba(32, 88, 144, 0.06);
    --accent:       #4E8B5E;
    --accent-dark:  #3D6F4A;
    --accent-tint:  rgba(78, 139, 94, 0.08);
    --deep:         #1B2635;
    --white:        #ffffff;
    --neutral:      #F5F5F0;
    --neutral-line: #E5E5DE;
    --ink:          #1B2635;
    --muted:        #6B7280;
    --muted-light:  #9CA3AF;

    /* Edition brand colours - exact values supplied by Craig.
     * Each edition has a primary colour and gradates into the next edition's primary.
     * Chain: BFSt (gold) → THD (light green) → LV (teal) → BFW (cyan) → TRD (dark blue) → back to cyan
     */
    --edn-bfst:    #F9B503;   /* St Ives - gold */
    --edn-bfst-to: #55947F;   /* gradates to Light Green (THD's primary) */

    --edn-thd:     #55947F;   /* Hemingfords - light green */
    --edn-thd-to:  #036666;   /* gradates to Teal (LV's primary) */

    --edn-lv:      #036666;   /* Living Villages - teal */
    --edn-lv-to:   #00A0E3;   /* gradates to Cyan (BFW's primary) */

    --edn-bfw:     #00A0E3;   /* Woodston - cyan */
    --edn-bfw-to:  #332F60;   /* gradates to Dark Blue (TRD's primary) */

    --edn-trd:     #332F60;   /* Ramsey - dark blue */
    --edn-trd-to:  #00A0E3;   /* gradates back to Cyan */

    /* Layout */
    --maxw:      1240px;
    --gutter:    clamp(1.25rem, 4vw, 2.5rem);
    --section-y: clamp(3.5rem, 7vw, 5.5rem);
    --radius:    10px;
    --radius-lg: 18px;
    --radius-pill: 999px;

    /* Nav drawer */
    --drawer-w:  460px;
    --topbar-h:  84px;

    /* Elevation */
    --shadow-sm: 0 1px 3px rgba(27, 38, 53, 0.06), 0 1px 2px rgba(27, 38, 53, 0.04);
    --shadow-md: 0 4px 12px rgba(27, 38, 53, 0.08), 0 2px 4px rgba(27, 38, 53, 0.04);
    --shadow-lg: 0 12px 32px rgba(27, 38, 53, 0.12), 0 4px 8px rgba(27, 38, 53, 0.06);
    --shadow-drawer: 0 20px 60px rgba(27, 38, 53, 0.24);

    /* Motion */
    --ease:      cubic-bezier(0.22, 0.61, 0.36, 1);
    --dur-fast:  0.15s;
    --dur-base:  0.28s;
    --dur-slow:  0.4s;

    /* Type */
    --font-body: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-head: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}


/* =========================================================
   SECTION 2 - Reset + base
   ========================================================= */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease);
}
a:hover {
    color: var(--primary-dark);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    line-height: 1.15;
    color: var(--deep);
    font-weight: 600;
    letter-spacing: -0.015em;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: 0;
    background: none;
}


/* =========================================================
   SECTION 3 - Layout containers
   ========================================================= */

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

.section {
    padding-block: var(--section-y);
    background: var(--white);
}
.section--neutral {
    padding-block: var(--section-y);
    background: var(--neutral);
}
.section--deep {
    padding-block: var(--section-y);
    background: var(--deep);
    color: var(--white);
}
.section--primary {
    padding-block: var(--section-y);
    background: var(--primary);
    color: var(--white);
}


/* =========================================================
   SECTION 4 - Shared UI: eyebrow, buttons
   ========================================================= */

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease);
    border: 1.5px solid transparent;
    white-space: nowrap;
}
.btn--primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn--primary:hover,
.btn--primary:focus-visible {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
}
.btn--accent {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}
.btn--accent:hover,
.btn--accent:focus-visible {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: var(--white);
    transform: translateY(-1px);
}
.btn--outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn--outline:hover,
.btn--outline:focus-visible {
    background: var(--primary);
    color: var(--white);
}
.btn--outline-white {
    background: transparent;
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.4);
}
.btn--outline-white:hover,
.btn--outline-white:focus-visible {
    background: var(--white);
    color: var(--primary);
    border-color: var(--white);
}
.btn--lg {
    padding: 1.05rem 1.85rem;
    font-size: 1rem;
}
.btn--sm {
    padding: 0.6rem 1.1rem;
    font-size: 0.85rem;
}


/* =========================================================
   SECTION 5 - Skip link (a11y)
   ========================================================= */

.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(-100%);
    background: var(--deep);
    color: var(--white);
    padding: 0.55rem 1rem;
    z-index: 1000;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform var(--dur-fast) var(--ease);
}
.skip-link:focus {
    transform: translateY(0);
    color: var(--white);
}


/* =========================================================
   SECTION 6 - Top bar (slim, fixed)
   Contains: hamburger toggle (left), site wordmark, contact CTA (right)
   ========================================================= */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 0.5px solid var(--neutral-line);
    z-index: 90;
    display: flex;
    align-items: center;
    padding-inline: var(--gutter);
}
.topbar__inner {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
}
.topbar__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0 1.2rem;
    height: 48px;
    background: var(--primary);
    color: var(--white);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: background var(--dur-fast) var(--ease);
}
.topbar__toggle i {
    font-size: 1.1rem;
}
.topbar__toggle-label {
    font-size: 0.85rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
}
.topbar__toggle:hover,
.topbar__toggle:focus-visible {
    background: var(--primary-dark);
}
.topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--deep);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.015em;
    min-width: 0;
}
.topbar__brand-logo {
    width: 62px;
    height: 62px;
    display: block;
    flex-shrink: 0;
    border-radius: 50%;
}
.topbar__brand-name {
    font-size: 1.05rem;
    line-height: 1;
}
.topbar__brand-name .topbar__brand-sub {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
    margin-top: 0.15rem;
}
.topbar__cta {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}
.topbar__phone {
    display: none;
    align-items: center;
    gap: 0.5rem;
    color: var(--deep);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}
.topbar__phone i {
    color: var(--primary);
}
.topbar__phone:hover {
    color: var(--primary);
}
.topbar__contact {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 1.15rem;
    height: 44px;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.topbar__contact i {
    font-size: 0.9rem;
}
.topbar__contact:hover,
.topbar__contact:focus-visible {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
}


/* =========================================================
   SECTION 7 - Slide-out nav drawer
   Slides in from the left. Same behaviour on all devices.
   ========================================================= */

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(27, 38, 53, 0.45);
    z-index: 190;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-base) var(--ease), visibility var(--dur-base) var(--ease);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.drawer-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(var(--drawer-w), 92vw);
    background: var(--white);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform var(--dur-slow) var(--ease);
    box-shadow: var(--shadow-drawer);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.drawer.is-open {
    transform: translateX(0);
}

.drawer__head {
    padding: 1.5rem var(--gutter);
    border-bottom: 0.5px solid var(--neutral-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    background: var(--primary);
    color: var(--white);
}
.drawer__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--white);
    text-decoration: none;
}
.drawer__brand-logo {
    width: 78px;
    height: 78px;
    display: block;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--white);
    padding: 3px;
}
.drawer__brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.drawer__brand-name {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}
.drawer__brand-sub {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.85;
    font-weight: 500;
    margin-top: 0.2rem;
}
.drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border-radius: 10px;
    font-size: 1rem;
    transition: background var(--dur-fast) var(--ease);
}
.drawer__close:hover,
.drawer__close:focus-visible {
    background: rgba(255, 255, 255, 0.25);
}

.drawer__nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    -webkit-overflow-scrolling: touch;
}
.drawer__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.drawer__link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem var(--gutter);
    color: var(--deep);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
    position: relative;
}
.drawer__link:hover,
.drawer__link:focus-visible {
    background: color-mix(in srgb, var(--item-clr, var(--primary)) 8%, transparent);
    color: var(--item-clr, var(--primary));
}
.drawer__link[aria-current="page"] {
    background: color-mix(in srgb, var(--item-clr, var(--primary)) 10%, transparent);
    color: var(--item-clr, var(--primary));
    font-weight: 700;
}
.drawer__link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 26px;
    background: var(--item-clr, var(--primary));
    border-radius: 2px;
}

/* Coloured icon badge - filled square with white icon */
.drawer__link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--item-clr, var(--primary));
    color: var(--white);
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--item-clr, var(--primary)) 22%, transparent);
    transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.drawer__link:hover .drawer__link-icon,
.drawer__group-toggle:hover .drawer__link-icon {
    transform: scale(1.05);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--item-clr, var(--primary)) 32%, transparent);
}

/* Expandable "The editions" section */
.drawer__group {
    border-top: 0.5px solid var(--neutral-line);
    border-bottom: 0.5px solid var(--neutral-line);
    margin-block: 0.35rem;
}
.drawer__group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem var(--gutter);
    color: var(--deep);
    background: transparent;
    text-align: left;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.drawer__group-toggle:hover {
    background: color-mix(in srgb, var(--item-clr, var(--primary)) 8%, transparent);
    color: var(--item-clr, var(--primary));
}
.drawer__group-toggle-icon {
    margin-left: auto;
    color: var(--muted);
    transition: transform var(--dur-base) var(--ease), color var(--dur-fast) var(--ease);
}
.drawer__group-toggle:hover .drawer__group-toggle-icon {
    color: var(--item-clr, var(--primary));
}
.drawer__group[aria-expanded="true"] .drawer__group-toggle-icon {
    transform: rotate(180deg);
}
.drawer__editions {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--neutral);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--dur-slow) var(--ease), padding var(--dur-fast) var(--ease);
}
.drawer__group[aria-expanded="true"] .drawer__editions {
    max-height: 600px;
    padding: 0.5rem 0 0.85rem;
}
.drawer__edition {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem var(--gutter) 0.75rem calc(var(--gutter) + 1.25rem);
    color: var(--deep);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background var(--dur-fast) var(--ease);
    position: relative;
}
.drawer__edition::before {
    content: "";
    position: absolute;
    left: var(--gutter);
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--edn-dot, var(--primary));
    border-radius: 2px;
    transition: height var(--dur-fast) var(--ease);
}
.drawer__edition:hover {
    background: var(--white);
    color: var(--edn-dot, var(--primary));
}
.drawer__edition:hover::before {
    height: 28px;
}
.drawer__edition-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--white), 0 2px 6px rgba(27, 38, 53, 0.15);
}
.drawer__edition-name {
    font-weight: 600;
    line-height: 1.2;
    display: block;
}
.drawer__edition-area {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.35;
    margin-top: 0.15rem;
}

/* Drawer footer (contact info) */
.drawer__foot {
    padding: 1.25rem var(--gutter) 1.5rem;
    border-top: 0.5px solid var(--neutral-line);
    background: var(--neutral);
    flex-shrink: 0;
}
.drawer__foot-label {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 0.85rem;
}
.drawer__foot-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.drawer__foot-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--deep);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius);
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.drawer__foot-list a:hover {
    background: var(--white);
    color: var(--primary);
}
.drawer__foot-list a i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--primary);
    color: var(--white);
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(32, 88, 144, 0.22);
}
.drawer__foot-list li:nth-child(2) a i {
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(78, 139, 94, 0.22);
}

body.drawer-open {
    overflow: hidden;
}


/* =========================================================
   SECTION 8 - Site footer
   ========================================================= */

.site-footer {
    background: var(--deep);
    color: rgba(255, 255, 255, 0.85);
    padding: 4rem var(--gutter) 2rem;
    margin-top: 4rem;
}
.site-footer__inner {
    max-width: var(--maxw);
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.15);
}
.site-footer h4 {
    color: var(--white);
    font-size: 1.05rem;
    margin-bottom: 1rem;
    letter-spacing: -0.005em;
}
.site-footer p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.65;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}
.site-footer__brand-name {
    font-family: var(--font-head);
    font-size: 1.25rem;
    color: var(--white);
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 0.5rem;
}
.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.site-footer ul a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    transition: color var(--dur-fast) var(--ease);
}
.site-footer ul a:hover {
    color: var(--white);
}
.site-footer ul a i {
    color: var(--accent);
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
}
.site-footer__editions a {
    padding-left: 0;
}
.site-footer__edn-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}
.site-footer__bottom {
    max-width: var(--maxw);
    margin-inline: auto;
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    flex-wrap: wrap;
}
.site-footer__bottom a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.site-footer__bottom a:hover {
    color: var(--white);
}


/* =========================================================
   SECTION 9 - Utilities
   ========================================================= */

.body-top-offset {
    padding-top: var(--topbar-h);
}


/* =========================================================
   SECTION 10 - Responsive
   ========================================================= */

@media (max-width: 1024px) {
    .site-footer__inner {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 780px) {
    :root {
        --topbar-h: 70px;
    }
    .topbar__inner {
        grid-template-columns: auto 1fr auto;
        gap: 0.75rem;
    }
    .topbar__contact {
        display: none;
    }
    .topbar__phone {
        display: inline-flex;
        width: 40px;
        height: 40px;
        justify-content: center;
        background: var(--accent);
        color: var(--white);
        border-radius: 10px;
    }
    .topbar__phone span {
        display: none;
    }
    .topbar__phone i {
        color: var(--white);
    }
    .topbar__brand-name {
        font-size: 0.95rem;
    }
    .topbar__brand-sub {
        display: none;
    }
    .topbar__brand-logo {
        width: 54px;
        height: 54px;
    }
    .topbar__toggle {
        width: 44px;
        height: 44px;
        padding: 0;
        gap: 0;
    }
    .topbar__toggle-label {
        display: none;
    }
    .site-footer__inner {
        grid-template-columns: 1fr;
        gap: 2.25rem;
    }
    .site-footer__bottom {
        justify-content: center;
        text-align: center;
    }

    /* Full-screen drawer on mobile - contact foot flows at end of scroll, not pinned */
    .drawer {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        height: 100dvh;
        bottom: auto;
        box-shadow: none;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .drawer__nav {
        flex: 0 0 auto;
        overflow-y: visible;
    }
    .drawer__foot {
        margin-top: 2rem;
    }
}

@media (max-width: 480px) {
    .topbar__brand {
        gap: 0.5rem;
    }
    .topbar__brand-name {
        display: none;
    }
}


/* =========================================================
   SECTION 11 - Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}
