/*
 * Directory listing components — shared by /directory (index list view,
 * server-rendered + JS-rebuilt) and the /directory/country|region
 * landing pages.
 *
 * Card markup lives in resources/views/directory/_card.blade.php and is
 * mirrored by buildMikvahCard() in directory/index.blade.php — keep all
 * three in sync.
 */

/* ── Hero additions (directory index) ──
 * The hero keeps the legacy .page_title section + bg-directory.jpg
 * image; these classes style the redesigned content inside it:
 * breadcrumb, left-aligned H1, lede, and the search/locate row. */
.redesign .dir-hero {
    text-align: left;
    padding-top: 56px;
    padding-bottom: 52px;
    /* Legacy style.css caps .page_title at max-height:268px on mobile,
     * which clipped the lede and swallowed the search/locate row. The
     * redesigned hero sizes itself from its content. */
    max-height: none;
    height: auto;
    overflow: visible;
}
.redesign .dir-hero h1 {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(32px, 5.5vw, 54px);
    line-height: 1.1;
    margin: 0;
}
.redesign .dir-hero h1 em {
    font-style: italic;
    font-weight: 300;
}
.redesign .dir-hero__crumbs {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-family: var(--font-body);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    margin: 0 0 18px;
}
.redesign .dir-hero__crumbs a {
    color: var(--neutral-white);
    font-weight: 600;
    text-decoration: none;
}
.redesign .dir-hero__crumbs a:hover { text-decoration: underline; text-underline-offset: 2px; }
.redesign .dir-hero__crumbs svg { width: 11px; height: 11px; opacity: 0.6; flex-shrink: 0; }
.redesign .dir-hero__crumbs .crumb-home { display: inline-flex; align-items: center; }
.redesign .dir-hero__crumbs .crumb-home svg { width: 15px; height: 15px; opacity: 1; }
.redesign .dir-hero__crumbs span { color: var(--neutral-white); }
.redesign .dir-hero__lede {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.85);
    max-width: 62ch;
    margin: 14px 0 0;
}

/* Search field + "Use my location" row inside the hero. */
.redesign .dir-searchrow {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
    margin-top: 28px;
}
.redesign .dir-searchrow__field {
    flex: 1;
    min-width: 260px;
    max-width: 520px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--neutral-white);
    border-radius: 999px;
    padding: 0 8px 0 22px;
    height: 54px;
    box-shadow: 0 6px 18px rgba(20, 30, 35, 0.18);
}
.redesign .dir-searchrow__field > svg {
    width: 18px;
    height: 18px;
    color: var(--brand-slate, #85a5b0);
    flex-shrink: 0;
}
.redesign .dir-searchrow__field input {
    border: 0;
    outline: 0;
    flex: 1;
    min-width: 0;
    height: 100%;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-heading);
    background: transparent;
}
.redesign .dir-searchrow__field input::placeholder { color: var(--text-paragraph); opacity: 0.75; }
.redesign .dir-searchrow__go {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--brand-sea-green);
    color: var(--neutral-white);
    cursor: pointer;
    transition: background 140ms ease, transform 140ms ease;
}
.redesign .dir-searchrow__go:hover { background: var(--brand-sea-green-darker); transform: scale(1.05); }
.redesign .dir-searchrow__go svg { width: 16px; height: 16px; }
.redesign .dir-searchrow__locate {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 24px;
    height: 54px;
    border: 0;
    border-radius: 999px;
    background: var(--brand-peach);
    color: var(--text-heading);
    font-family: var(--font-body);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(20, 30, 35, 0.18);
    transition: background 140ms ease, transform 140ms ease;
}
.redesign .dir-searchrow__locate:hover { background: var(--brand-peach-darker); transform: translateY(-1px); }
.redesign .dir-searchrow__locate svg { width: 17px; height: 17px; }
.redesign .dir-searchrow__locate[disabled] { opacity: 0.6; cursor: wait; transform: none; }

/* ── Results header: count on the left, List/Map toggle on the right ── */
.redesign .dir-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px 18px;
    flex-wrap: wrap;
    padding: 36px 0 22px;
}
.redesign .dir-results-head h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 28px;
    line-height: 1.2;
    color: var(--text-heading);
    margin: 0;
}
.redesign .dir-results-head h2 strong {
    font-weight: 500;
    color: var(--brand-sea-green);
}

/* List/Map pill toggle (easytabs nav — initialized manually with
 * tabs: 'ul.dir-toggle > li', so it can live inside the flex header).
 *
 * The bounce-in lives HERE rather than reusing theme-animate.css's
 * .appear-animation/.bounceInLeft — that stylesheet loads deferred, so
 * the pill would paint visible, get hidden when the CSS arrived, then
 * animate (a visible flash). This file ships in the render-blocking
 * redesign bundle and `animation-fill-mode: both` keeps the pill
 * hidden through the start delay, so it animates in exactly once. */
@keyframes dir-toggle-in {
    0%   { opacity: 0; transform: translateX(-280px); }
    60%  { opacity: 1; transform: translateX(18px); }
    80%  { transform: translateX(-6px); }
    100% { opacity: 1; transform: translateX(0); }
}
.redesign ul.dir-toggle {
    display: inline-flex;
    padding: 4px;
    margin: 0;
    background: var(--neutral-white);
    border: 1px solid var(--brand-border-peach);
    border-radius: 100px;
    box-shadow: 0 2px 6px rgba(85, 75, 75, 0.05);
    list-style: none;
    animation: dir-toggle-in 650ms cubic-bezier(0.215, 0.61, 0.355, 1) 120ms both;
}
/* Hidden until the list pane has content (bare /directory). CSS
 * animations don't run on display:none elements and start fresh when
 * shown — so removing this class plays the bounce-in at reveal time. */
.redesign ul.dir-toggle.dir-toggle--hidden { display: none; }
@media (prefers-reduced-motion: reduce) {
    .redesign ul.dir-toggle { animation: none; }
}
.redesign ul.dir-toggle li { margin: 0; padding: 0; border: none; background: none; }
.redesign ul.dir-toggle li a,
.redesign ul.dir-toggle li.active a,
.redesign ul.dir-toggle li.active a:hover {
    display: block;
    padding: 9px 26px;
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--text-paragraph) !important;
    background: transparent;
    border: none !important;
    border-radius: 100px;
    text-decoration: none;
    transition: background 140ms ease, color 140ms ease;
}
.redesign ul.dir-toggle li a:hover {
    color: var(--brand-sea-green) !important;
    background: var(--brand-offwhite-peach);
}
.redesign ul.dir-toggle li.active a,
.redesign ul.dir-toggle li.active a:hover,
.redesign ul.dir-toggle li.active a:focus {
    background: var(--brand-sea-green) !important;
    color: var(--neutral-white) !important;
    box-shadow: 0 1px 3px rgba(40, 65, 75, 0.18);
}

/* ── Card grid ──
 * Top padding reserves room for the floating badges on the first row;
 * the row gap keeps badges of a lower row clear of the card above. */
.redesign .dir-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 16px;
    padding-top: 9px;
    align-items: start;
}
@media (max-width: 760px) {
    .redesign .dir-cards { grid-template-columns: 1fr; }
}

/* ── Mikvah card ──
 * A real anchor to the detail page (followable, middle-clickable).
 * On /directory the page's delegated click handler intercepts plain
 * left-clicks to open the quick-view modal instead. */
.redesign .dir-card {
    position: relative;
    display: block;
    background: var(--neutral-white);
    border: 1px solid var(--brand-border-peach);
    border-radius: 16px;
    padding: 20px 22px;
    text-decoration: none;
    transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.redesign .dir-card:hover {
    border-color: var(--brand-sea-green);
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(40, 65, 75, 0.10);
    text-decoration: none;
}
.redesign .dir-card__badges {
    position: absolute;
    top: -8px;
    left: 18px;
    display: flex;
    gap: 6px;
}
/* Cards that carry badges get extra top padding so the floating pill
 * doesn't crowd the name. :has() is supported by every browser that
 * matters here; older ones just render the original (tighter) padding. */
.redesign .dir-card:has(.dir-card__badges) {
    padding-top: 26px;
}
.redesign .dir-badge {
    font-family: var(--font-body);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.redesign .dir-badge--built { background: var(--brand-sea-green); color: var(--neutral-white); }
.redesign .dir-badge--access { background: var(--brand-beige); color: var(--text-heading); }
.redesign .dir-card__top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.redesign .dir-card__name {
    flex: 1;
    min-width: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 22px;
    line-height: 1.2;
    color: var(--text-heading);
    transition: color 150ms ease;
}
.redesign .dir-card:hover .dir-card__name { color: var(--brand-sea-green); }
.redesign .dir-card__dist {
    flex-shrink: 0;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--brand-sea-green);
    background: var(--brand-offwhite-peach);
    padding: 5px 12px;
    border-radius: 999px;
    white-space: nowrap;
}
.redesign .dir-card__addr {
    display: block;
    margin-top: 7px;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-paragraph);
}
.redesign .dir-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 18px;
    margin-top: 13px;
    padding-top: 13px;
    border-top: 1px solid var(--brand-offwhite-peach);
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-paragraph);
}
.redesign .dir-card__meta-item { display: inline-flex; align-items: center; gap: 7px; }
.redesign .dir-card__meta-item svg { width: 14px; height: 14px; color: var(--brand-slate, #85a5b0); flex-shrink: 0; }

@media (max-width: 600px) {
    .redesign .dir-hero {
        padding-top: 32px;
        padding-bottom: 36px;
    }
    .redesign .dir-hero__crumbs { margin-bottom: 14px; }
    .redesign .dir-hero__lede { font-size: 15px; margin-top: 12px; }
    .redesign .dir-searchrow { margin-top: 22px; }
}

@media (max-width: 480px) {
    .redesign .dir-card { padding: 16px 18px; }
    .redesign .dir-card:has(.dir-card__badges) { padding-top: 24px; }
    .redesign .dir-card__name { font-size: 19px; }
    .redesign .dir-results-head h2 { font-size: 23px; }
    .redesign .dir-searchrow__locate { width: 100%; justify-content: center; }
}

/* ── "Know of a mikvah that's not listed?" prompt ──
 * Peach panel + pin icon on the left and a solid sea-green CTA on the
 * right. Kept narrow so it doesn't compete with the map/list above. */
.redesign .dir-add-prompt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px 18px;
    max-width: 720px;
    margin: 32px auto 40px;
    padding: 18px 24px;
    background: var(--brand-offwhite-peach);
    border: 1px solid var(--brand-border-peach);
    border-radius: 16px;
}
.redesign .dir-add-prompt__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--neutral-white);
    color: var(--brand-sea-green);
    border: 1px solid var(--brand-border-peach);
}
.redesign .dir-add-prompt__icon svg { width: 20px; height: 20px; }
.redesign .dir-add-prompt__text {
    flex: 1;
    min-width: 200px;
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.4;
    color: var(--text-heading);
}
.redesign .dir-add-prompt__cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--brand-sea-green);
    color: var(--neutral-white) !important;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(40, 65, 75, 0.16);
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.redesign .dir-add-prompt__cta svg {
    width: 14px;
    height: 14px;
    transition: transform 160ms ease;
}
.redesign .dir-add-prompt__cta:hover {
    background: var(--brand-sea-green-darker);
    color: var(--neutral-white) !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(40, 65, 75, 0.22);
    text-decoration: none;
}
.redesign .dir-add-prompt__cta:hover svg { transform: translateX(3px); }

@media (max-width: 520px) {
    .redesign .dir-add-prompt {
        text-align: center;
        margin: 28px 16px 32px;
        padding: 18px 20px;
    }
    .redesign .dir-add-prompt__text { text-align: center; }
    .redesign .dir-add-prompt__cta { width: 100%; justify-content: center; }
}
