/* Therapy Index: Morning Lake palette, Fraunces + Source Sans 3. Light only. */
:root {
  --lake: #1f4e79;
  --lake-mist: #d6e4f0;
  --sky: #eef4f9;
  --card: #f7fafc;
  --rule: #d3dee8;
  --ink: #1b2733;
  --ink-60: #4f5d6b;
  --sunrise: #f2a900;
  --sunrise-light: #fff3cc;
  --ochre: #6b4a00;
  --paper: #ffffff;
  --radius: 10px;
  --measure: 68ch;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 720px) { body { font-size: 18px; } }

h1, h2, h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; margin-top: 1.6em; }
h3 { font-size: 1.15rem; margin-top: 1.2em; }
@media (min-width: 720px) { h1 { font-size: 2.5rem; } }

p { margin: 0 0 1em; }
a { color: var(--lake); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.measure { max-width: var(--measure); }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.wordmark { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.35rem; color: var(--lake); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.wordmark .wm-i { position: relative; display: inline-block; }
.wordmark .wm-i .lamp-dot { position: absolute; left: 0.07em; top: 0.06em; width: 0.3em; height: 0.3em; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.95rem; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { text-decoration: underline; }

/* Crisis strip */
.crisis { background: var(--sky); color: var(--ink); font-size: 0.95rem; }
.crisis .wrap { padding: 8px 16px; }
.crisis strong { font-weight: 600; }

/* Hero band */
.hero { background: var(--lake); color: #fff; padding: 40px 0 44px; }
.hero h1 { color: #fff; margin-bottom: 0.3em; }
.hero p { color: var(--lake-mist); max-width: 60ch; font-size: 1.1rem; }
.hero a { color: #fff; }

/* Lamp */
.lamp-dot { display: inline-block; width: 0.75em; height: 0.75em; border-radius: 50%; background: var(--sunrise); box-shadow: inset 0 0 0 1px var(--ink); vertical-align: -0.05em; margin-right: 0.35em; }
.lamp { display: inline-flex; align-items: center; gap: 0.35em; background: var(--sunrise-light); color: var(--ochre); padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 0.92rem; font-weight: 600; }
.lamp .lamp-dot { margin-right: 0; }
.lamp-off { color: var(--ink-60); font-size: 0.92rem; }

/* Chips and labels */
.chip { display: inline-block; background: var(--sky); color: var(--ink); border-radius: 999px; padding: 2px 10px; font-size: 0.88rem; font-weight: 600; margin: 0 6px 6px 0; }
.chip-muted { background: var(--card); color: var(--ink-60); border: 1px solid var(--rule); }
.label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-60); }
.muted { color: var(--ink-60); }
.small { font-size: 0.92rem; }

/* Buttons */
.btn { display: inline-block; font: inherit; font-weight: 600; border-radius: var(--radius); padding: 10px 18px; border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn-primary { background: var(--lake); color: #fff; }
.btn-primary:hover { background: #173d5f; }
.btn-sunrise { background: var(--sunrise); color: var(--ink); border-color: var(--ink); }
.btn-sunrise:hover { background: #e09c00; }
.btn-quiet { background: var(--paper); color: var(--lake); border-color: var(--rule); }
.btn-quiet:hover { background: var(--sky); }
.btn-danger { background: var(--paper); color: #7a1e1e; border-color: #c9a0a0; }

/* Forms */
form .field { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
.hint { font-size: 0.9rem; color: var(--ink-60); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="search"], input[type="url"], input[type="tel"], select, textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 9px 12px; width: 100%; max-width: 520px;
}
textarea { min-height: 120px; }
input:focus, select:focus, textarea:focus { border-color: var(--lake); outline: 2px solid var(--ink); outline-offset: 1px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.check input { margin-top: 0.35em; }
.radio-list { display: grid; gap: 8px; }
.radio-list label { font-weight: 400; display: flex; gap: 10px; align-items: flex-start; }
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { background: var(--sky); border-left: 4px solid var(--lake); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 16px 0; }
.notice-warm { background: var(--sunrise-light); border-left-color: var(--sunrise); }
.notice-plain { background: var(--card); border-left-color: var(--rule); }

/* Search */
.search-form { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; margin: 20px 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .search-form { grid-template-columns: 2fr 1.3fr 1fr auto; align-items: end; } .search-form .field { margin: 0; } }
.search-form .field.wide { grid-column: 1 / -1; }
.search-form input, .search-form select { max-width: none; }

.results-meta { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

/* Cards */
.card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; }
.card h3 { margin: 0 0 4px; font-size: 1.2rem; }
.card h3 a { text-decoration: none; color: var(--lake); }
.card h3 a:hover { text-decoration: underline; }
.card .row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--ink-60); font-size: 0.95rem; }
.card .photo { width: 56px; height: 56px; border-radius: 50%; background: var(--sky); color: var(--lake); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-family: "Fraunces", serif; float: right; margin-left: 12px; }

/* Index card (profile) */
.index-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 22px; margin: 20px 0; }
.index-card dl { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 10px 18px; margin: 0; }
.index-card dt { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-60); padding-top: 3px; }
.index-card dd { margin: 0; }
@media (max-width: 560px) { .index-card dl { grid-template-columns: 1fr; gap: 2px 0; } .index-card dt { margin-top: 10px; } }
.profile-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-top: 28px; }
.profile-head .photo { width: 96px; height: 96px; border-radius: 50%; background: var(--sky); color: var(--lake); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-family: "Fraunces", serif; font-size: 1.6rem; flex: none; }
.profile-head h1 { margin-bottom: 0.2em; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }

/* Home */
.metro-grid { display: grid; gap: 14px; margin: 20px 0; }
@media (min-width: 720px) { .metro-grid { grid-template-columns: repeat(3, 1fr); } }
.metro-card { display: block; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); }
.metro-card:hover { border-color: var(--lake); }
.metro-card h3 { margin: 0 0 4px; color: var(--lake); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.steps li { padding-left: 40px; position: relative; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--lake); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.9rem; }

/* Pagination */
.pager { display: flex; gap: 12px; margin: 20px 0; align-items: center; }

/* Tables (admin) */
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-60); }
pre { background: var(--card); border: 1px solid var(--rule); padding: 10px 12px; border-radius: 8px; overflow: auto; font-size: 0.9rem; white-space: pre-wrap; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); margin-top: 48px; padding: 28px 0 40px; color: var(--ink-60); font-size: 0.95rem; }
.site-footer .wrap { display: grid; gap: 16px; }
@media (min-width: 720px) { .site-footer .wrap { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer a { color: var(--ink); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

main { padding-bottom: 20px; }
.section { margin: 28px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Metro selector and hero search */
.metro-select { display: inline-flex; gap: 6px; align-items: center; }
.metro-select select { width: auto; max-width: none; padding: 6px 30px 6px 10px; font-size: 0.95rem; font-weight: 600; color: var(--lake); border-color: var(--rule); background: var(--paper); }
.hero-search { display: grid; gap: 10px; margin-top: 18px; max-width: 720px; }
@media (min-width: 720px) { .hero-search { grid-template-columns: 2fr 120px auto; } }
.hero-search input { max-width: none; background: #fff; border-color: transparent; }

/* Map view */
.view-toggle { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; margin-right: 8px; vertical-align: middle; }
.view-toggle a { padding: 4px 14px; text-decoration: none; color: var(--lake); font-weight: 600; font-size: 0.92rem; }
.view-toggle a.is-active { background: var(--lake); color: #fff; }
.map { height: 70vh; min-height: 420px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sky); }
.ti-cluster { background: rgba(31, 78, 121, 0.9); color: #fff; border: 2px solid #fff; border-radius: 50%; box-sizing: border-box; display: flex !important; align-items: center; justify-content: center; text-align: center; line-height: 1; font-weight: 600; font-family: "Source Sans 3", sans-serif; box-shadow: 0 1px 4px rgba(27, 39, 51, 0.3); }
.ti-cluster span { display: block; width: 100%; text-align: center; }
.gm-style .ti-popup { font-family: "Source Sans 3", sans-serif; font-size: 15px; line-height: 1.4; }
.ti-cluster-s { font-size: 0.9rem; }
.ti-cluster-m { font-size: 1rem; background: rgba(31, 78, 121, 0.95); }
.ti-cluster-l { font-size: 1.05rem; background: #1b2733; }
.leaflet-popup-content { font-family: "Source Sans 3", sans-serif; font-size: 15px; line-height: 1.4; margin: 12px 14px; }
.ti-popup a { color: var(--lake); }
.ti-popup-lamp { color: var(--ochre); font-weight: 600; margin-top: 4px; }
.ti-popup-note { color: var(--ink-60); font-size: 0.9em; }
