/* ============================================================
   Assisted Senior Living — mobile-first design system
   Audience skews older (seniors + adult-child caregivers):
   large type, high contrast, generous tap targets (min 44px).
   ============================================================ */

:root {
    /* Palette — calm, trustworthy, healthcare-adjacent */
    --teal-700: #1f6f6b;
    --teal-600: #2a8580;
    --teal-500: #35a29b;
    --teal-50:  #e8f4f3;
    --gold-500: #e0a43b;
    --gold-600: #c68a24;
    --ink-900:  #16211f;
    --ink-700:  #33413e;
    --ink-500:  #5c6b68;
    --line:     #dfe6e4;
    --bg:       #ffffff;
    --bg-soft:  #f5f8f7;
    --danger:   #c0392b;
    --focus:    #1a73e8;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.06);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.08);

    --wrap: 1120px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --tap: 44px; /* minimum interactive target */
}

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 18px;          /* larger base for readability */
    line-height: 1.6;
    color: var(--ink-900);
    background: var(--bg);
}

h1, h2, h3 { line-height: 1.2; color: var(--ink-900); margin: 0 0 .5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

a { color: var(--teal-700); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--teal-600); }

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

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- Skip link (a11y) ---- */
.skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 100;
    background: var(--ink-900); color: #fff; padding: 12px 16px;
    border-radius: var(--radius-sm); text-decoration: none;
    transition: top .15s;
}
.skip-link:focus { top: 8px; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: #fff; border-bottom: 1px solid var(--line);
}
.site-header__bar {
    display: flex; align-items: center; gap: 12px;
    min-height: 64px;
}
.site-logo {
    font-weight: 800; font-size: 1.15rem; color: var(--teal-700);
    text-decoration: none; letter-spacing: -.01em; margin-right: auto;
    display: flex; align-items: center; gap: 8px;
}
.site-logo__mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--teal-600); color: #fff; display: grid; place-items: center;
    font-size: 1.1rem;
}

/* Phone CTA — prominent, tappable */
.header-cta {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: var(--tap); padding: 8px 16px;
    background: var(--gold-500); color: #1c1400; font-weight: 700;
    border-radius: 999px; text-decoration: none; white-space: nowrap;
}
.header-cta:hover { background: var(--gold-600); color: #1c1400; }

/* Nav toggle (mobile) */
.nav-toggle {
    appearance: none; border: 1px solid var(--line); background: #fff;
    width: var(--tap); height: var(--tap); border-radius: var(--radius-sm);
    display: grid; place-items: center; cursor: pointer; font-size: 1.4rem;
}
.main-nav { display: none; }
.main-nav[data-open="true"] { display: block; }
.main-nav ul {
    list-style: none; margin: 0; padding: 8px 0 16px;
    display: flex; flex-direction: column; gap: 2px;
    border-top: 1px solid var(--line);
}
.main-nav a {
    display: block; padding: 12px 8px; min-height: var(--tap);
    color: var(--ink-700); text-decoration: none; font-weight: 600;
    border-radius: var(--radius-sm);
}
.main-nav a:hover { background: var(--bg-soft); }

/* ============================================================
   Hero / search
   ============================================================ */
.hero {
    background: linear-gradient(160deg, var(--teal-700), var(--teal-500));
    color: #fff; padding: 40px 0 48px;
}
.hero h1 { color: #fff; font-size: clamp(1.7rem, 6vw, 2.6rem); }
.hero p { color: rgba(255,255,255,.92); font-size: 1.1rem; max-width: 40ch; }

.search-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 16px; margin-top: 20px; display: grid; gap: 12px;
}
.search-card label { font-weight: 700; color: var(--ink-900); font-size: .95rem; }
.field {
    width: 100%; min-height: var(--tap); padding: 12px 14px; font-size: 1rem;
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    background: #fff; color: var(--ink-900);
}
.field:focus { border-color: var(--teal-500); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--tap); padding: 12px 22px; font-size: 1rem; font-weight: 700;
    border-radius: 999px; border: 2px solid transparent; cursor: pointer;
    text-decoration: none; text-align: center;
}
.btn--primary { background: var(--teal-600); color: #fff; }
.btn--primary:hover { background: var(--teal-700); color: #fff; }
.btn--gold { background: var(--gold-500); color: #1c1400; }
.btn--gold:hover { background: var(--gold-600); }
.btn--ghost { background: #fff; color: var(--teal-700); border-color: var(--teal-500); }
.btn--block { width: 100%; }

/* ============================================================
   Content sections
   ============================================================ */
main { display: block; }
.section { padding: 36px 0; }
.section--soft { background: var(--bg-soft); }
.section__head { margin-bottom: 20px; }
.section__head p { color: var(--ink-500); }

.breadcrumbs {
    font-size: .9rem; color: var(--ink-500); padding: 12px 0;
}
.breadcrumbs a { color: var(--ink-500); }
.breadcrumbs span { color: var(--ink-900); }

/* Grid of cards */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }

/* Facility listing card */
.listing {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.listing__media { aspect-ratio: 4 / 3; background: var(--teal-50); overflow: hidden; }
.listing__media img { width: 100%; height: 100%; object-fit: cover; }
.listing__body { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.listing__title { font-size: 1.15rem; margin: 0; }
.listing__title a { text-decoration: none; }
.listing__addr { color: var(--ink-500); font-size: .95rem; }
.listing__desc { color: var(--ink-700); font-size: .95rem; }
.listing__actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
.listing__phone {
    display: inline-flex; align-items: center; gap: 6px; font-weight: 700;
    color: var(--teal-700); text-decoration: none; min-height: var(--tap);
}
.badge {
    display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em;
    text-transform: uppercase; padding: 3px 10px; border-radius: 999px;
    background: var(--gold-500); color: #1c1400;
}

/* State / city index chips */
.chip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip {
    display: block; padding: 14px 16px; min-height: var(--tap);
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
    text-decoration: none; color: var(--ink-900); font-weight: 600;
}
.chip:hover { border-color: var(--teal-500); background: var(--teal-50); }

/* Prose (content pages) */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }
.prose img { border-radius: var(--radius-sm); margin: 12px 0; }

/* Content tables */
.ctable { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: .95rem; }
.ctable th, .ctable td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.ctable thead th { background: var(--teal-50); color: var(--ink-900); }
.ctable tbody th[scope="row"] { background: var(--bg-soft); font-weight: 700; white-space: nowrap; }

/* Responsive video embed */
.embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius-sm); margin: 16px 0; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* In-content call-to-action band */
.cta-band {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between;
    background: var(--teal-50); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px 24px; margin: 28px 0;
}
.cta-band strong { display: block; font-size: 1.1rem; }
.cta-band span { color: var(--ink-700); }

/* Photo gallery (facility detail) */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.gallery__thumb { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }

/* Reviews */
.review { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; background: #fff; }
.review__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review__by { color: var(--ink-500); font-size: .9rem; margin: 4px 0 0; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: var(--ink-900); color: #cdd8d5; padding: 40px 0 24px; margin-top: 48px;
}
.site-footer a { color: #fff; }
.site-footer__cols { display: grid; gap: 28px; grid-template-columns: 1fr; }
.site-footer h4 { color: #fff; margin: 0 0 10px; font-size: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer__legal {
    border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 16px;
    font-size: .85rem; color: #9fb0ac;
}

/* ============================================================
   Responsive — tablet & up
   ============================================================ */
@media (min-width: 720px) {
    body { font-size: 19px; }
    .grid { grid-template-columns: 1fr 1fr; }
    .chip-grid { grid-template-columns: repeat(3, 1fr); }
    .search-card { grid-template-columns: 2fr 2fr auto; align-items: end; }
    .site-footer__cols { grid-template-columns: 2fr 1fr 1fr; }
}

@media (min-width: 1000px) {
    .nav-toggle { display: none; }
    .main-nav { display: block !important; }
    .main-nav ul {
        flex-direction: row; align-items: center; border-top: 0; padding: 0; gap: 4px;
    }
    .main-nav a { padding: 10px 14px; }
    .grid { grid-template-columns: repeat(3, 1fr); }
    .chip-grid { grid-template-columns: repeat(4, 1fr); }
    /* Two-column layout with sidebar on directory pages */
    .with-sidebar { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ============================================================
   Location map (keyless OpenStreetMap embed)
   ============================================================ */
.map-embed {
    position: relative;
    width: 100%;
    height: 320px;
    margin: 16px 0 8px;
    border-radius: var(--radius, 12px);
    overflow: hidden;
    background: #e9eeec;
}
.map-embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
.map-directions {
    margin: 0 0 8px;
    font-size: .95rem;
}


/* ---- City quick-facts + FAQ (SEO/AEO content) ---- */
.factbox { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 24px; }
.factbox h2 { font-size: 1.2rem; margin-bottom: 10px; }
.factbox .ctable th[scope="row"] { width: 55%; }

.faq__item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; background: #fff; }
.faq__item summary { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; position: relative; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; position: absolute; right: 16px; top: 12px; font-size: 1.3rem; color: var(--teal-600); }
.faq__item[open] summary::after { content: "\2212"; }
.faq__answer { padding: 0 16px 16px; color: var(--ink-700); }

/* City intro (admin-managed HTML from Notes) */
.city-intro { color: var(--ink-700); margin-bottom: 24px; }
.city-intro p:last-child { margin-bottom: 0; }
