/* [locations_directory] */
.aldir {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #2a1b22;
                }

/* SSR fallback */
.aldir-noscript-service { margin-bottom: 32px; }
.aldir-noscript-h2 { font-size: 22px; font-weight: 800; color: #602276; margin: 24px 0 12px; }
.aldir-noscript-h3 { font-size: 16px; font-weight: 700; color: #2a1b22; margin: 16px 0 8px; }
.aldir-noscript-hub { font-size: 12px; color: #bf4a92; font-weight: 600; text-decoration: none; margin-left: 8px; }
.aldir-noscript-hub:hover { text-decoration: underline; }
.aldir-noscript-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 24px; }
.aldir-noscript-list a { color: #2a1b22; text-decoration: none; font-size: 14px; padding: 4px 0; display: block; }
.aldir-noscript-list a:hover { color: #bf4a92; text-decoration: underline; }

/* Sticky bar — honours --aldir-offset-desktop / mobile */
.aldir-sticky {
    position: sticky;
    top: var(--aldir-offset-desktop);
    z-index: 50;
    background: transparent;
    padding: 12px 0 14px;
    margin-bottom: 24px;
}

/* ── Boxed mode (max_height attribute set) ──
   The TOWN LIST scrolls inside a fixed-height area. Filters stay
   above the scroll area at full width, so the scrollbar starts
   below the filters. All visual styling preserved. */
.aldir--boxed .aldir-body {
    max-height: var(--aldir-max-height);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-color: #bf4a92 #F5EEF6;
    scrollbar-width: thin;
}
.aldir--boxed .aldir-body::-webkit-scrollbar { width: 10px; }
.aldir--boxed .aldir-body::-webkit-scrollbar-track { background: transparent; }
.aldir--boxed .aldir-body::-webkit-scrollbar-thumb {
    background: #bf4a92;
    border-radius: 999px;
    border: 2px solid #FDF6F9;
}
.aldir--boxed .aldir-body::-webkit-scrollbar-thumb:hover {
    background: #602276;
}
/* Sticky filter no longer needs to be sticky in boxed mode —
   it sits at the top of the interactive area, above the scroll. */
.aldir--boxed .aldir-sticky {
    position: static;
}
.aldir--boxed .aldir-county-section,
.aldir--boxed .aldir-az-section {
    scroll-margin-top: 16px;
}
/* In boxed mode the container is narrow — collapse multi-col grids to 1 col */
.aldir--boxed .aldir-az-sections-grid,
.aldir--boxed .aldir-county-sections-grid {
    grid-template-columns: 1fr;
}

/* ── Columns option (columns="N" attribute) ── */
.aldir--cols .aldir-towns-grid,
.aldir--cols .aldir-az-towns-list {
    grid-template-columns: repeat(var(--aldir-cols, 2), minmax(0, 1fr));
}
.aldir--cols .aldir-az-sections-grid,
.aldir--cols .aldir-county-sections-grid {
    grid-template-columns: 1fr;
}

/* Row 1 layout */
.aldir-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

/* Outer wrapper — non-scrolling, holds the chevrons fixed to its right/left edge */
.aldir-tabs-outer {
    position: relative;
    flex: 1; min-width: 0;
}

/* Inner wrap — this is the scrollable strip */
.aldir-tabs-wrap {
    scrollbar-width: none;
    -ms-overflow-style: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.aldir-tabs-wrap::-webkit-scrollbar { display: none; }

/* Mobile scroll fade — positioned on the outer wrapper so they don't scroll */
.aldir-tabs-outer.has-overflow-right::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 64px;
    pointer-events: none;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, #fff 80%);
    z-index: 1;
}
.aldir-tabs-outer.has-overflow-left::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 64px;
    pointer-events: none;
    background: linear-gradient(to left, rgba(255,255,255,0) 0%, #fff 80%);
    z-index: 1;
}

/* Chevrons — positioned on the outer wrapper so they're fixed relative to the strip's edges */
.aldir-scroll-hint-right,
.aldir-scroll-hint-left {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #602276;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(96, 34, 118, 0.35);
}
.aldir-scroll-hint-right {
    right: 8px;
    animation: aldir-nudge-right 1.6s ease-in-out infinite;
}
.aldir-scroll-hint-left {
    left: 8px;
    animation: aldir-nudge-left 1.6s ease-in-out infinite;
}
.aldir-tabs-outer.has-overflow-right .aldir-scroll-hint-right { display: flex; }
.aldir-tabs-outer.has-overflow-left .aldir-scroll-hint-left { display: flex; }
.aldir-scroll-hint-right svg,
.aldir-scroll-hint-left svg { width: 14px; height: 14px; }
@keyframes aldir-nudge-right {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-4px); }
}
@keyframes aldir-nudge-left {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(4px); }
}
.aldir-tabs {
    background: transparent;
    padding: 6px;
    display: inline-flex;
    gap: 4px;
}
.aldir-tab {
    padding: 10px 18px; border-radius: 22px; background: transparent;
    color: var(--aldir-inactive-color, #602276); font-size: 13px; border: none; cursor: pointer;
    font-family: inherit; font-weight: 700;
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    transition: background .15s, color .15s;
}
.aldir-tab:hover { background: #FBEAF0; }
.aldir-tab.active { background: #602276; color: #fff; }
.aldir-tab .ct {
    background: #F5EEF6;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    color: #602276;
}
.aldir-tab.active .ct { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* The "Jobs" button — amber #efbb6a brand colour, contrast-safe */
.aldir-tab-jobs {
    background: #FDF1DE;
    color: #7A3505;
}
.aldir-tab-jobs:hover { background: #F7DDB0; color: #5A2604; }
.aldir-tab-jobs.active { background: #efbb6a; color: #4A1F03; }
.aldir-tab-jobs .ct { background: #fff; color: #7A3505; }
.aldir-tab-jobs.active .ct { background: rgba(255, 255, 255, 0.4); color: #4A1F03; }

/* View toggle */
.aldir-view-toggle {
    background: transparent;
    padding: 4px;
    display: inline-flex;
    gap: 2px;
    flex-shrink: 0;
}
.aldir-view-btn {
    padding: 8px 14px; border-radius: 999px; background: transparent;
    color: var(--aldir-inactive-color, #602276); font-size: 12px; border: none; cursor: pointer;
    font-family: inherit; font-weight: 700;
    display: inline-flex; align-items: center; gap: 5px;
    text-decoration: none;
}
.aldir-view-btn:hover { background: #FBEAF0; color: #602276; }
.aldir-view-btn.active { background: #602276; color: #fff; }
.aldir-view-link svg { opacity: 0.6; }
.aldir-view-link:hover svg { opacity: 1; }

/* Jobs sub-tabs row */
.aldir-jobs-subtabs {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px;
    padding: 6px;
    background: transparent;
}
.aldir-jobs-subtabs[hidden] { display: none; }
.aldir-jobs-subtab {
    padding: 8px 14px; border-radius: 12px; background: transparent;
    color: #7A3505; font-size: 13px; border: none; cursor: pointer;
    font-family: inherit; font-weight: 700;
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    transition: background .15s, color .15s;
}
.aldir-jobs-subtab:hover { background: #FDF1DE; }
.aldir-jobs-subtab.active { background: #efbb6a; color: #4A1F03; }
.aldir-jobs-subtab .ct {
    background: #FDF1DE;
    color: #7A3505;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.aldir-jobs-subtab.active .ct { background: rgba(255, 255, 255, 0.4); color: #4A1F03; }

/* County row — wraps into multiple rows. Visually subordinate to service tabs. */
.aldir-county-row { width: 100%; }
.aldir-county-strip {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.aldir-county-pill {
    padding: 5px 11px; background: transparent; border-radius: 999px; font-size: 12px;
    border: none; cursor: pointer; color: #602276;
    font-family: inherit; font-weight: 600; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 5px;
    transition: color .15s, background .15s;
}
.aldir-county-pill:hover { background: #F5EEF6; color: #4A1A5E; }
.aldir-county-pill.active { background: #F5EEF6; color: #602276; font-weight: 700; }
.aldir-county-pill .ct {
    opacity: 0.55;
    font-weight: 600;
    font-size: 11px;
}
.aldir-county-pill.active .ct { opacity: 0.75; }

/* ── Collapsible county jump-nav (collapse_counties="yes") ── */
.aldir-county-row.aldir-county-row--collapsible {
    display: flex; flex-direction: column; gap: 8px;
}
.aldir-county-toggle {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px 6px 14px;
    background: #FFFFFF;
    border: 1px solid #E8D7E6;
    border-radius: 999px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #602276;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
    box-shadow: 0 1px 2px rgba(96, 34, 118, 0.04);
}
.aldir-county-toggle:hover {
    background: #F5EEF6;
    border-color: #D9BFD5;
}
.aldir-county-toggle:focus-visible {
    outline: 2px solid #602276;
    outline-offset: 2px;
}
.aldir-county-toggle-label { letter-spacing: -.005em; }
.aldir-county-toggle-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 18px; padding: 0 6px;
    background: #F5EEF6;
    color: #602276;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.aldir-county-toggle-chevron {
    color: #602276;
    transition: transform .2s ease;
    flex-shrink: 0;
    margin-left: 2px;
}
.aldir-county-toggle[aria-expanded="true"] .aldir-county-toggle-chevron {
    transform: rotate(180deg);
}
/* Collapse the strip itself with a smooth grid-row reveal —
   no JS height measuring, works with wrapping pill grids. */
.aldir-county-row--collapsible .aldir-county-strip-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .22s ease;
}
.aldir-county-row--collapsible.aldir-snap .aldir-county-strip-wrap { transition: none; }
.aldir-county-row--collapsible.aldir-open .aldir-county-strip-wrap {
    grid-template-rows: 1fr;
}
.aldir-county-row--collapsible .aldir-county-strip-wrap > .aldir-county-strip {
    overflow: hidden;
    min-height: 0;
}
.aldir-county-row--collapsible.aldir-open .aldir-county-strip-wrap > .aldir-county-strip {
    padding-top: 2px; /* breathing room once open */
}
/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .aldir-county-row--collapsible .aldir-county-strip-wrap,
    .aldir-county-toggle-chevron { transition: none; }
}

/* Body */
.aldir-body { background: #FDF6F9; border-radius: 24px; padding: 28px; }

/* County sections — laid out in a 2-column grid alphabetically */
.aldir-county-sections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px 28px;
    align-items: start;
}
.aldir-county-section {
    scroll-margin-top: calc(var(--aldir-offset-desktop) + 30px);
}
.aldir-county-section-h { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }

.aldir-county-section-icon { width: 44px; height: 44px; background: #602276; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.aldir-county-section-name { font-size: 22px; font-weight: 800; color: #2a1b22; letter-spacing: -.01em; line-height: 1; }
.aldir-county-section-sub { font-size: 12px; color: #8a6478; margin-top: 4px; font-weight: 500; }
.aldir-county-section-hub { font-size: 13px; color: #fff; text-decoration: none; font-weight: 700; padding: 8px 14px; border-radius: 999px; background: #602276; margin-left: auto; display: inline-flex; align-items: center; gap: 7px; transition: background .15s, transform .15s, box-shadow .15s; box-shadow: 0 2px 6px rgba(96, 34, 118, 0.18); }
.aldir-county-section-hub:hover { background: #4A1A5E; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(96, 34, 118, 0.32); }
.aldir-county-section-hub:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(96, 34, 118, 0.18); }

.aldir-towns-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
/* When county sections are in the 2-column grid, tighten the inner town grid
   to 3 columns since each section is half-width.
   Excludes boxed/cols modes where county grid is 1-col (sections are full-width). */
.aldir:not(.aldir--boxed):not(.aldir--cols) .aldir-county-sections-grid .aldir-towns-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.aldir-town-row {
    padding: 14px 18px; font-size: 14px; color: #2a1b22; text-decoration: none;
    background: #fff; border-radius: 14px; font-weight: 700;
    transition: background .2s, color .2s;
    border: 1.5px solid transparent; display: block;
}
.aldir-town-row:hover { background: #bf4a92; color: #fff; border-color: #bf4a92; }

/* Service prefix eyebrow shown above the town name when show_service_prefix="yes" */
.aldir-prefix {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #8a6478;
    line-height: 1.2;
    margin-bottom: 2px;
    letter-spacing: 0.01em;
}
.aldir-town-row:hover .aldir-prefix { color: rgba(255, 255, 255, 0.85); }
.aldir-az-towns-list a:hover .aldir-prefix { color: rgba(255, 255, 255, 0.85); }
/* In the SSR list (only seen briefly before JS hydration, but valid for crawlers) */
.aldir-noscript-list .aldir-prefix { display: inline; margin-right: 4px; color: #8a6478; }

/* A-Z view */
.aldir-az-letters-row { margin-bottom: 4px; }
.aldir-az-letters-row[hidden] { display: none; }
.aldir-az-letters {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 8px;
    background: #fff;
    border: 1.5px solid #E2C9D7;
    border-radius: 20px;
}
.aldir-letter { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #a13778; text-decoration: none; border-radius: 50%; transition: background .2s, color .2s; }
.aldir-letter.has { cursor: pointer; background: #FBEAF0; }
.aldir-letter.has:hover { background: #bf4a92; color: #fff; }
.aldir-letter.empty { color: #C2A6B5; opacity: 0.5; }

.aldir-az-section { margin-bottom: 32px; scroll-margin-top: calc(var(--aldir-offset-desktop) + 30px); }
.aldir-az-section:last-child { margin-bottom: 0; }
.aldir-az-sections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px 24px;
}
.aldir-az-section-h { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.aldir-az-letter-circle { width: 44px; height: 44px; border-radius: 50%; background: #bf4a92; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0; }
.aldir-az-letter-meta { font-size: 13px; color: #8a6478; font-weight: 500; }
.aldir-az-letter-meta strong { color: #2a1b22; font-weight: 700; }
.aldir-az-towns-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.aldir-az-towns-list a {
    padding: 10px 14px;
    color: #2a1b22;
    text-decoration: none;
    font-size: 14px;
    transition: background .2s, color .2s;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    border-radius: 12px;
    font-weight: 700;
    border: 1.5px solid transparent;
    line-height: 1.25;
}
.aldir-az-towns-list a:hover { background: #bf4a92; color: #fff; }
.aldir-az-towns-list .tag { font-size: 11px; color: #8a6478; font-weight: 500; margin-left: 0; }
.aldir-az-towns-list a:hover .tag { color: rgba(255,255,255,0.85); }

@media (max-width: 640px) {
    .aldir-sticky { top: var(--aldir-offset-mobile); }
    .aldir-body { padding: 20px; border-radius: 22px; }
    .aldir-towns-grid { grid-template-columns: 1fr 1fr; }
    /* Override the desktop 3-col towns rule on mobile */
    .aldir:not(.aldir--boxed):not(.aldir--cols) .aldir-county-sections-grid .aldir-towns-grid {
        grid-template-columns: 1fr 1fr;
    }
    .aldir-county-section-name { font-size: 18px; }
    .aldir-az-section, .aldir-county-section {
        /* Sticky bar is taller on mobile (view toggle wraps + maybe alphabet) */
        scroll-margin-top: calc(var(--aldir-offset-mobile) + 30px);
    }
    /* Stack the sticky row so the view toggle doesn't crowd services */
    .aldir-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .aldir-view-toggle {
        width: 100%;
        justify-content: stretch;
    }
    .aldir-view-toggle .aldir-view-btn { flex: 1; }
    /* A-Z: single column of sections on mobile */
    .aldir-az-sections-grid { grid-template-columns: 1fr; gap: 24px; }
    .aldir-az-towns-list { grid-template-columns: 1fr 1fr; }
    /* County: single column of sections on mobile */
    .aldir-county-sections-grid { grid-template-columns: 1fr; gap: 28px; }

    /* Cap explicit columns option to 2 on mobile regardless of attribute value */
    .aldir--cols .aldir-towns-grid,
    .aldir--cols .aldir-az-towns-list {
        grid-template-columns: 1fr 1fr;
    }
}

/* Phones: every text at least 12px, tap targets at least 44px apart (target plus spacing).
   Desktop is unchanged. Empty A to Z letters are hidden here (they cannot be tapped) so the
   bigger letters still fit in three rows. */
@media (max-width: 640px) {
    .aldir-tab,
    .aldir-view-btn,
    .aldir-jobs-subtab,
    .aldir-county-toggle,
    .aldir-county-pill,
    .aldir-county-section-hub { box-sizing: border-box; }
    .aldir-tab { font-size: 14px; min-height: 40px; padding: 10px 16px; }
    .aldir-tab .ct,
    .aldir-jobs-subtab .ct,
    .aldir-county-pill .ct,
    .aldir-county-toggle-count,
    .aldir-prefix,
    .aldir-az-towns-list .tag { font-size: 12px; }
    .aldir-county-pill .ct { opacity: 0.7; }
    .aldir-view-toggle { gap: 6px; }
    .aldir-view-btn { font-size: 14px; min-height: 38px; justify-content: center; }
    .aldir-jobs-subtab { font-size: 14px; min-height: 40px; }
    .aldir-county-toggle { font-size: 14px; min-height: 40px; padding: 8px 14px 8px 16px; }
    .aldir-county-strip { gap: 8px 4px; }
    .aldir-county-pill { font-size: 14px; min-height: 36px; padding: 8px 12px; }
    .aldir-county-section-hub { font-size: 14px; min-height: 40px; }
    .aldir-az-letters { display: grid; grid-template-columns: repeat(auto-fill, 40px); justify-content: space-between; gap: 4px; }
    .aldir-letter { width: 40px; height: 40px; font-size: 14px; }
    .aldir-letter.empty { display: none; }
}

@media print {
    .aldir-sticky, .aldir-view-toggle { display: none !important; }
    .aldir-noscript { display: block !important; }
    .aldir-interactive { display: none !important; }
}
