/* Urgent Care Directory styles.
   Design tokens first, then layout, shared components, and page-specific pieces. */

:root {
    --navy: #14324f;
    --navy-light: #1f4a70;
    --teal: #0e7c86;
    --teal-dark: #0a626a;
    --teal-tint: #e7f4f5;
    --bg: #f4f6f9;
    --card: #ffffff;
    --border: #e1e6ec;
    --text: #1b2733;
    --muted: #5a6b7c;
    --link: #0b6571;
    --green: #177a3a;
    --green-tint: #e6f4ea;
    --red: #b42318;
    --red-tint: #fdecea;
    --gold: #b7791f;
    --radius: 12px;
    --radius-small: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.07);
    --shadow-hover: 0 4px 12px rgba(16, 24, 40, 0.10);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    color: var(--navy);
    line-height: 1.25;
}

h1 {
    font-size: 2.1rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.05rem;
}

img {
    max-width: 100%;
}

ul {
    list-style: none;
}

/* Elements hidden by script stay hidden even when a class sets display */
[hidden] {
    display: none !important;
}

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

.muted {
    color: var(--muted);
}

.note {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 10px;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--navy);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--navy);
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.brand-logo {
    display: block;
    height: 72px;
    width: auto;
}

.site-nav {
    display: flex;
    gap: 4px;
}

.site-nav a {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: var(--radius-small);
}

.site-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    text-decoration: none;
}

/* ---------- Page layout ---------- */
.page {
    max-width: 1160px;
    margin: 0 auto;
    padding: 20px 20px 50px;
}

.page-header {
    margin: 8px 0 22px;
}

.page-header .lead,
.lead {
    font-size: 1.08rem;
    color: #34485c;
    margin-top: 10px;
    max-width: 860px;
}

.page-header .search-box {
    margin-top: 16px;
}

.breadcrumbs {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.breadcrumbs span[aria-hidden] {
    color: #a0adb9;
}

.section {
    margin-top: 28px;
}

.section-title {
    font-size: 1.35rem;
    margin-bottom: 14px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.section.card,
.prose.card {
    padding: 24px;
}

.section-links,
.back-link {
    margin-top: 16px;
    font-weight: 600;
}

/* ---------- Buttons and search ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: inherit;
    font-weight: 600;
    font-size: 0.98rem;
    padding: 10px 18px;
    border-radius: var(--radius-small);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--teal);
    color: #fff;
}

.btn-primary:hover {
    background: var(--teal-dark);
}

.btn-outline {
    background: #fff;
    color: var(--navy);
    border-color: #c9d3dd;
}

.btn-outline:hover {
    border-color: var(--navy);
}

.btn-small {
    font-size: 0.88rem;
    padding: 7px 13px;
}

.search-box {
    display: flex;
    gap: 8px;
    max-width: 620px;
}

.search-box input {
    flex: 1;
    min-width: 0;
    font: inherit;
    padding: 11px 14px;
    border: 1px solid #c9d3dd;
    border-radius: var(--radius-small);
    background: #fff;
}

.search-box input:focus {
    outline: 3px solid rgba(14, 124, 134, 0.25);
    border-color: var(--teal);
}

.search-box-large input {
    font-size: 1.1rem;
    padding: 15px 18px;
}

.search-box-large .btn {
    font-size: 1.05rem;
    padding: 0 26px;
}

.link-button {
    background: none;
    border: none;
    color: var(--link);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* ---------- Homepage ---------- */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, var(--teal) 130%);
    color: #fff;
}

.hero-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 56px 20px 60px;
}

.hero h1 {
    color: #fff;
    font-size: 2.6rem;
}

.hero-sub {
    font-size: 1.15rem;
    color: #d6e3ee;
    margin: 12px 0 24px;
    max-width: 640px;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 26px;
    margin-top: 22px;
    font-size: 0.95rem;
    color: #d6e3ee;
}

.hero-points li::before {
    content: "✓";
    color: #7fd6dc;
    font-weight: 700;
    margin-right: 8px;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.info-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.info-card h2 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.info-card p {
    font-size: 0.95rem;
    color: #34485c;
}

.info-card-alert {
    border-top: 4px solid var(--red);
}

/* ---------- Link grids (states, cities) ---------- */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.link-grid li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    padding: 9px 12px;
}

.card .link-grid li {
    background: var(--bg);
    border-color: transparent;
}

.link-grid li:hover {
    border-color: var(--teal);
}

.link-grid a {
    font-weight: 600;
}

.link-grid .count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--teal-dark);
    background: var(--teal-tint);
    border-radius: 999px;
    padding: 1px 9px;
    flex-shrink: 0;
}

.letter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.letter-nav a {
    min-width: 32px;
    text-align: center;
    padding: 4px 6px;
    border-radius: 6px;
    background: var(--bg);
    font-weight: 700;
}

.letter-heading {
    margin: 20px 0 10px;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
    scroll-margin-top: 80px;
}

/* ---------- City page: filters and clinic cards ---------- */
.city-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-button {
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #c9d3dd;
    background: #fff;
    color: var(--navy);
    cursor: pointer;
}

.filter-button:hover {
    border-color: var(--navy);
}

.filter-button.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.sort-control {
    font-size: 0.9rem;
    color: var(--muted);
}

.sort-control select {
    font: inherit;
    font-size: 0.9rem;
    padding: 6px 8px;
    border: 1px solid #c9d3dd;
    border-radius: var(--radius-small);
    background: #fff;
    color: var(--text);
}

.clinic-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 18px;
}

.clinic-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}

.clinic-card:hover {
    box-shadow: var(--shadow-hover);
}

.clinic-photo img,
.photo-placeholder {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: linear-gradient(135deg, #dfe7ee, #eef2f6);
}

.clinic-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 16px;
    flex: 1;
}

.clinic-name {
    font-size: 1.12rem;
}

.clinic-name a {
    color: var(--navy);
}

.clinic-address,
.clinic-hours,
.nearby-meta {
    font-size: 0.9rem;
    color: var(--muted);
}

.clinic-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    font-size: 0.92rem;
}

.rating {
    font-weight: 700;
}

.rating .muted {
    font-weight: 400;
}

.star {
    color: var(--gold);
}

.clinic-status,
.open-status {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--green);
    background: var(--green-tint);
    border-radius: 999px;
    padding: 2px 10px;
}

.clinic-status.closed,
.open-status.closed {
    color: var(--red);
    background: var(--red-tint);
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.badges li {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--navy-light);
    background: #eef2f7;
    border-radius: 6px;
    padding: 2px 8px;
}

.badges-large li {
    font-size: 0.9rem;
    padding: 5px 12px;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
}

.no-matches {
    margin: 20px 0;
}

.nearby-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.nearby-list li:last-child {
    border-bottom: none;
}

.nearby-list a {
    font-weight: 600;
}

.nearby-list .nearby-meta {
    display: block;
}

.faq h3 {
    margin-top: 18px;
    margin-bottom: 4px;
}

.faq p {
    color: #34485c;
}

/* ---------- Clinic page ---------- */
.clinic-hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    padding: 24px;
    margin-top: 6px;
}

.clinic-hero-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.clinic-hero .clinic-address {
    font-size: 1rem;
}

.clinic-hero .clinic-meta {
    font-size: 1rem;
}

.clinic-phone {
    font-size: 1rem;
}

.clinic-hero .card-actions {
    margin-top: 6px;
}

.clinic-phone a {
    font-weight: 700;
}

.clinic-hero-photo img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--radius-small);
    background: #e9eef3;
}

.clinic-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.clinic-main p {
    color: #34485c;
}

.hours-table {
    width: 100%;
    border-collapse: collapse;
}

.hours-table th,
.hours-table td {
    text-align: left;
    font-weight: 400;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
}

.hours-table td {
    text-align: right;
}

.hours-table tr:last-child th,
.hours-table tr:last-child td {
    border-bottom: none;
}

.hours-table tr.today {
    background: var(--teal-tint);
}

.hours-table tr.today th,
.hours-table tr.today td {
    font-weight: 700;
}

.map-card {
    padding: 0 !important;
    overflow: hidden;
}

.map-card iframe {
    display: block;
    width: 100%;
    height: 300px;
    border: 0;
}

.notice-emergency,
.emergency-note {
    background: var(--red-tint);
    color: #7a1a12;
    border-left: 4px solid var(--red);
    border-radius: var(--radius-small);
    padding: 10px 14px;
    margin: 18px 0;
    font-size: 0.95rem;
}

.listing-footer {
    margin-top: 28px;
    font-size: 0.9rem;
    color: var(--muted);
}

/* ---------- Text pages (about, privacy, contact, for clinics) ---------- */
.prose {
    max-width: 820px;
}

.prose h1 {
    margin-bottom: 12px;
}

.prose h2 {
    font-size: 1.25rem;
    margin: 24px 0 8px;
}

.prose p {
    margin-bottom: 12px;
    color: #34485c;
}

.prose .search-box {
    margin: 12px 0 16px;
}

.code-box {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    padding: 10px;
    border: 1px solid #c9d3dd;
    border-radius: var(--radius-small);
    background: var(--bg);
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--navy);
    color: #c8d6e3;
    margin-top: 40px;
}

.footer-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 36px 20px 20px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 24px;
}

.footer-logo {
    display: block;
    height: 56px;
    width: auto;
}

.footer-brand p {
    font-size: 0.92rem;
    margin-top: 8px;
    max-width: 380px;
}

.footer-emergency {
    font-weight: 700;
    color: #fff;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    color: #e3ecf4;
    font-size: 0.95rem;
}

.footer-copy {
    max-width: 1160px;
    margin: 0 auto;
    padding: 16px 20px 24px;
    font-size: 0.85rem;
    color: #97abbf;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- Tablets ---------- */
@media (max-width: 900px) {
    .clinic-hero,
    .clinic-layout {
        grid-template-columns: 1fr;
    }
    .clinic-hero-photo {
        order: -1;
    }
    /* On narrow screens show hours and the map before the long description */
    .clinic-side {
        order: -1;
    }
    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
    body {
        font-size: 16px;
    }
    h1 {
        font-size: 1.65rem;
    }
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 16px 6px;
    }
    .site-header {
        position: static;
    }
    .brand-logo {
        height: 48px;
    }
    .site-nav {
        width: 100%;
        overflow-x: auto;
        margin-left: -12px;
    }
    .site-nav a {
        font-size: 0.9rem;
        padding: 6px 12px;
        white-space: nowrap;
    }
    .page {
        padding: 14px 16px 40px;
    }
    .hero-inner {
        padding: 32px 16px 36px;
    }
    .hero h1 {
        font-size: 1.9rem;
    }
    .hero-sub {
        font-size: 1rem;
    }
    .search-box-large input {
        font-size: 1rem;
        padding: 13px 14px;
    }
    .search-box-large .btn {
        padding: 0 16px;
    }
    .section.card,
    .prose.card,
    .clinic-hero {
        padding: 18px;
    }
    .clinic-list {
        grid-template-columns: 1fr;
    }
    .link-grid {
        grid-template-columns: 1fr 1fr;
    }
    .link-grid li {
        padding: 8px 10px;
    }
    .link-grid a {
        font-size: 0.92rem;
    }
    .clinic-hero .card-actions .btn {
        flex: 1;
    }
    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 380px) {
    .link-grid {
        grid-template-columns: 1fr;
    }
}
