:root {
    /* Lockerbie palette: sandstone (primary), slate (header, footer, dark text), Annandale green.
       --blue keeps its old name so older rules still work; it now holds sandstone. */
    --sandstone: #9C3D2E;
    --sandstone-dark: #7A2E22;
    --sandstone-light: #F3E6DF;
    --slate: #2B2F33;
    --logo-blue: #348BC3;
    --pin-red: #CB2128;
    --blue: #9C3D2E;
    --green: #5E7A5A;
    --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body { font-family: var(--font-sans); }
h1, h2, h3, .font-serif { font-family: var(--font-serif); letter-spacing: -0.01em; }

/* Slate site header: the logo is white text, so the bar must stay dark. */
.site-nav { background: var(--slate); color: #fff; }
.site-nav a.nav-link, .site-nav button.nav-link { color: #fff; }
.site-nav a.nav-link:hover, .site-nav button.nav-link:hover { color: #F0C9BC; }
.site-nav .dropdown-menu a { color: #1f2937; }

.dropdown {
    position: relative;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 200px;
    z-index: 50;
    margin-top: 8px;
}
.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 20px;
    display: none;
}
.dropdown:hover > .dropdown-menu,
.dropdown:focus-within > .dropdown-menu,
.dropdown:hover::after,
.dropdown:focus-within::after {
    display: block;
}

/* Third level, opened to the left so it stays on screen beside Local Directory. */
.dropdown-sub {
    position: relative;
}
.dropdown-menu-sub {
    top: -8px;
    left: auto;
    right: 100%;
    margin-top: 0;
    z-index: 60;
}
.dropdown-sub::after {
    content: '';
    position: absolute;
    top: 0;
    right: 100%;
    width: 16px;
    height: 100%;
    display: none;
}
.dropdown-sub:hover > .dropdown-menu-sub,
.dropdown-sub:focus-within > .dropdown-menu-sub,
.dropdown-sub:hover::after,
.dropdown-sub:focus-within::after {
    display: block;
}

/* ============================================= */
/* Rollover enlarged photo for councillor tables */
/* Re-usable on any page that needs it          */
/* ============================================= */
.photo-cell {
    position: relative;
    z-index: 20;
}

.dg-rollover {
    position: absolute;
    bottom: 100%;              /* Positions directly above the small thumbnail */
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 14px;       /* Small, clean gap – exactly what you asked for */
    width: 220px;
    height: 330px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 35px 60px -15px rgb(0 0 0 / 0.3);
    overflow: hidden;
    border: 6px solid #fff;
    z-index: 999999 !important;
    display: none;
    pointer-events: none;
}
.dg-rollover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-cell:hover .dg-rollover {
    display: block;
}

.rollover-wrapper {
    position: relative;
    z-index: 10;
    overflow: visible !important;
}

/* Public directory index: area pills + typeahead */
.directory-area-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #2B2F33;
    text-decoration: none;
}
.directory-area-pill:hover {
    border-color: #9C3D2E;
    color: #9C3D2E;
}
.directory-area-pill.is-active,
.directory-area-pill[aria-current="true"] {
    background: #9C3D2E;
    border-color: #9C3D2E;
    color: #fff;
}
.directory-area-pill.is-active:hover,
.directory-area-pill[aria-current="true"]:hover {
    background: #7A2E22;
    border-color: #7A2E22;
    color: #fff;
}
.directory-area-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

/* Tailwind utilities such as .flex beat the HTML hidden attribute.
   Keep filtered listings, empty groups and the empty state actually gone. */
.js-directory-listing[hidden],
.js-directory-group[hidden],
.js-directory-no-matches[hidden],
.js-directory-search-clear[hidden] {
    display: none !important;
}

/* Homepage hero: native video stacks above the still so playing frames are visible. */
.hero-media {
    pointer-events: none;
    overflow: hidden;
    isolation: isolate;
}
.hero-media picture {
    z-index: 0;
}
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
    .hero-video {
        display: none !important;
    }
}

/* Mobile coverage checker: one network, then its 4G / 2G cells. */
.mobile-coverage-table thead th {
    position: static;
}
@media (max-width: 639px) {
    .mobile-coverage-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .mobile-coverage-table,
    .mobile-coverage-table tbody,
    .mobile-coverage-table tr,
    .mobile-coverage-table th,
    .mobile-coverage-table td {
        display: block;
        width: 100%;
    }
    .mobile-coverage-table tr {
        padding: 0.75rem 1.25rem;
        border-bottom: 1px solid #e5e7eb;
    }
    .mobile-coverage-table tr:last-child {
        border-bottom: 0;
    }
    .mobile-coverage-table th,
    .mobile-coverage-table td {
        padding: 0.35rem 0;
    }
    .mobile-coverage-table th[scope="row"] {
        font-size: 1.05rem;
        margin-bottom: 0.25rem;
    }
    .mobile-coverage-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        color: #2B2F33;
        margin-bottom: 0.15rem;
    }
}

/*
 * Wide tables (village postcode status, score guides) must scroll inside
 * their card. overflow-x: auto alone is not enough on phones: a min-width
 * table still expands the layout viewport, so the whole page pans sideways.
 * paint containment plus a containing transform keep the table off the ICB.
 */
.table-scroll-contain {
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
    contain: paint;
    transform: translateZ(0);
}
