/* ============================================================
   Shared design tokens & components — inlined from ../shared/base.css
   so the help folder is self-contained / standalone.
   Help-specific overrides follow further below.
   ============================================================ */

:root {
  /* Brand colours */
  --navy:        #141c66;
  --navy-dark:   #0c103b;
  --red:         #d10f1f;
  --red-dark:    #a50c18;
  --cream:       #f4ede2;
  --cream-light: #f9f5ee;
  --beige:       #ede2d0;
  --muted:       #585d89;
  --white:       #ffffff;
  --ok:          #1f7a4d;
  --warn:        #b06a00;

  /* Type */
  --font-display: "Prata", Georgia, "Times New Roman", serif;
  --font-body:    "Droid Serif", Georgia, serif;

  /* Spacing / shape */
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 2px 10px rgba(20, 28, 102, .08);
  --shadow-lg: 0 8px 28px rgba(20, 28, 102, .16);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--navy-dark);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; color: var(--navy); line-height: 1.2; }
a { color: var(--navy); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-body);
  font-size: 1rem; font-weight: 700;
  padding: .6em 1.1em;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  background: var(--navy); color: var(--white);
  text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, transform .05s;
}
.btn:hover { background: var(--navy-dark); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--navy); }
.btn--ghost:hover { background: var(--navy); color: var(--white); }
.btn--red { background: var(--red); border-color: var(--red); }
.btn--red:hover { background: var(--red-dark); border-color: var(--red-dark); }

/* ---- Emergency bar (shared safety component) ---- */
.emergency {
  background: var(--red);
  color: var(--white);
  position: sticky; top: 0; z-index: 1000;
}
.emergency__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem;
  padding: .55rem 1rem;
}
.emergency__label { font-weight: 700; letter-spacing: .02em; text-transform: uppercase; font-size: .82rem; opacity: .95; }
.emergency__lines { display: flex; flex-wrap: wrap; gap: .4rem .9rem; flex: 1; }
.emergency a.tel {
  color: var(--white); text-decoration: none; font-weight: 700;
  display: inline-flex; align-items: baseline; gap: .35em;
  border-bottom: 1px dotted rgba(255,255,255,.6);
}
.emergency a.tel small { font-weight: 400; opacity: .85; font-size: .78em; }
.emergency a.tel:hover { border-bottom-style: solid; }

/* ---- Quick exit ---- */
.quick-exit {
  margin-left: auto;
  background: var(--white); color: var(--red);
  border: 2px solid var(--white);
  font-weight: 700; border-radius: var(--radius);
  padding: .35em .8em; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .4em;
}
.quick-exit:hover { background: var(--cream); }
.quick-exit small { font-weight: 400; opacity: .7; }

/* ---- Language toggle ---- */
.lang-toggle { display: inline-flex; border: 1.5px solid var(--navy); border-radius: 999px; overflow: hidden; }
.lang-toggle button {
  font-family: var(--font-body); font-size: .85rem; font-weight: 700;
  border: 0; background: transparent; color: var(--navy);
  padding: .25em .7em; cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] { background: var(--navy); color: var(--white); }

/* ---- Verification badge ---- */
.badge { display: inline-flex; align-items: center; gap: .35em; font-size: .78rem; font-weight: 700; padding: .15em .5em; border-radius: 999px; }
.badge--ok   { background: rgba(31,122,77,.12);  color: var(--ok); }
.badge--warn { background: rgba(176,106,0,.12);  color: var(--warn); }

/* ---- Utility ---- */
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }

/* ============================================================
   Help app --- layout (overrides the shared base above)
   ============================================================ */

:root {
  --red: #e44b4b;
  --red-dark: #c83d3d;
  --rule-beige: #d8c8ad;
  --radius: 3px;
  --radius-lg: 3px;
  --font-display: var(--font-body);
}

.page-head {
  position: relative;
  z-index: 2;
  width: 50vw;
  background: var(--cream-light);
  border-bottom: 0;
}
.page-head__inner {
  width: 100%;
  margin: 0;
  padding: 1.4rem clamp(1.25rem, 3vw, 2.5rem);
}
.page-head h1 { margin: 0 0 .25rem; font-size: clamp(1.7rem, 4vw, 2.6rem); }
.page-head__sub { margin: 0; color: var(--muted); max-width: 46ch; }
.emergency__inner {
  max-width: none;
  padding-inline: clamp(1.25rem, 3vw, 2.5rem);
}
.emergency a.tel {
  border-bottom: 0;
}
.emergency a.tel:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.emergency-menu {
  position: relative;
}
.emergency-menu summary {
  list-style: none;
  cursor: pointer;
  font-weight: 400;
  font-size: 14px;
  border: 2px solid rgba(255, 255, 255, .65);
  border-radius: 3px;
  padding: .2rem .55rem;
}
.emergency-menu summary::-webkit-details-marker { display: none; }
.emergency-menu summary::after {
  content: "\f054"; /* fa-chevron-right */
  font-family: "Font Awesome 6 Free"; font-weight: 900;
  margin-left: .45rem;
  font-size: .7em;
}
.emergency-menu[open] summary::after { content: "\f078"; } /* fa-chevron-down */
.emergency-menu__panel {
  position: absolute;
  top: calc(100% + .3rem);
  left: 0;
  z-index: 1001;
  min-width: min(82vw, 420px);
  padding: 1.35rem 1.6rem;
  background: var(--red);
  border: 0;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.emergency-menu__panel a.tel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .15rem;
}
.emergency-menu__panel a.tel small {
  font-size: .78rem;
  line-height: 1.3;
  opacity: .85;
}
.lang-toggle {
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  margin-left: auto;
  border: 0;
  border-radius: 3px;
  overflow: visible;
  color: var(--navy);
  font-size: .8rem;
}
.emergency .lang-toggle {
  flex: none;
  color: var(--white);
}
.lang-toggle a {
  color: var(--navy);
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  letter-spacing: .04em;
}
.emergency .lang-toggle a { color: var(--white); }
.lang-toggle a:hover,
.lang-toggle a[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 3px; }
.lang-toggle span { color: var(--muted); }
.emergency .lang-toggle span { color: rgba(255, 255, 255, .65); }

.wrap {
  width: 50vw;
  margin: 0;
  padding: 1.5rem clamp(1.25rem, 3vw, 2.5rem) 2.5rem;
}

/* Controls — sticky single-line bar parked under the emergency bar */
.controls {
  position: sticky;
  top: var(--emergency-h, 0px);
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .5rem;
  margin: 0 0 1.5rem;
  padding: .7rem 0;
  background: var(--cream);
}
.control {
  font-family: var(--font-body); font-size: 0.8rem;
  padding: .6em .8em; border: 1.5px solid var(--beige); border-radius: var(--radius);
  background: var(--white); color: var(--navy-dark);
  min-width: 0;
	height: 2.3rem;
}
.control:focus { outline: none; border-color: var(--red); }

.search-box { display: flex; align-items: center; flex: 1 1 220px; min-width: 0; }
.search-box #search { flex: 1 1 auto; width: 100%; }
.search-btn {
  display: none; flex: none;
  align-items: center; justify-content: center;
  width: 2.3rem; height: 2.3rem;
  border: 1.5px solid var(--beige); border-radius: var(--radius);
  background: var(--white); color: var(--navy); cursor: pointer; font-size: 0.8rem;
}
.search-btn:hover { border-color: var(--rule-beige); }

#region, #category { flex: 0 1 auto; cursor: pointer; }

/* Segmented list/map switch — borderless pill on a beige track */
.view-toggle {
  display: none;
  flex: none;
  gap: .25rem;
  padding: .25rem;
  border: 0;
  background: var(--beige);
  border-radius: var(--radius);
}
.view-toggle button {
  display: inline-flex; align-items: center; gap: .45em;
  font-family: var(--font-body); font-weight: 700; font-size: .9rem;
  border: 0; background: transparent; color: var(--navy);
  padding: .5em 1.1em; border-radius: var(--radius); cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.view-toggle button::before {
  font-family: "Font Awesome 6 Free"; font-weight: 900;
  font-size: .95em; line-height: 1;
}
.view-toggle button[data-view="list"]::before { content: "\f03a"; } /* fa-list */
.view-toggle button[data-view="map"]::before  { content: "\f3c5"; } /* fa-location-dot */
.view-toggle button[aria-pressed="true"] { background: var(--red); color: var(--white); }

.result-count { display: none; }

/* National resources */
.national-list { margin: 0 0 1.5rem; }
.national-list h2 {
  margin: 1.5rem 0;
  border-top: 2px solid #e5dfd6;
  padding-top: 1.5rem;
  font-size: clamp(1.25rem, 2.5vw, 1.7rem);
  color: var(--navy);
}
.national-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.resource-group {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.resource-group > h3 {
  margin-bottom: 0;
  font-weight: 600;
}
.resource-group__cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Two-column layout */
.layout { display: block; }
.list { display: flex; flex-direction: column; gap: 1rem; }
.map-wrap {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50vw;
  z-index: 1;
}
#map {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--cream);
  border-radius: 3px;
  box-shadow: none;
}
#map .leaflet-tile {
  filter: grayscale(1) sepia(.22) saturate(.72) contrast(.92) brightness(1.08);
}
#map .leaflet-control-zoom a,
#map .leaflet-control-attribution {
  background: var(--cream-light);
  border-color: rgba(228, 75, 75, .35);
  color: var(--red);
}
#map .leaflet-control-zoom a:hover { background: var(--red); color: #fff; }
#map .leaflet-control-attribution a { color: var(--red); }

.map-pin {
  background: transparent;
  border: 0;
}
.map-pin__dot {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 auto;
  background: var(--red);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(228, 75, 75, .22);
}

/* Centre card */
.card {
  background: var(--white); border: 1px solid transparent;
  border-radius: 3px; padding: clamp(1.35rem, 3.5vw, 3rem); box-shadow: none;
  scroll-margin-top: 70px; transition: border-color .15s;
}
.card.is-active { border: 2px solid var(--rule-beige); box-shadow: none; }
.card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.card__name { font-family: var(--font-body); font-weight: 400; color: var(--navy); font-size: clamp(1.28rem, 2.4vw, 1.55rem); margin: 0 0 .15rem; }
.card__city { color: var(--red); font-weight: 700; font-size: .9rem; }
.card__services { margin: .6rem 0 .8rem; color: var(--navy-dark); }
.card__phones { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .6rem; }
.card__meta { font-size: .9rem; color: var(--muted); display: flex; flex-direction: column; gap: .2rem; }
.card__meta a { color: var(--navy); }
.badge {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--cream);
  color: var(--red);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.badge--ok,
.badge--confirm {
  background: var(--cream);
  color: var(--red);
}
.badge i { font-size: 1.05rem; line-height: 1; }
.badge:hover,
.badge.is-open { background: #e5dfd6; }
.badge__tip {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  z-index: 10;
  display: none;
  width: max-content;
  max-width: min(72vw, 260px);
  padding: .55rem .7rem;
  background: var(--cream-light);
  color: var(--navy-dark);
  border: 0;
  border-radius: 3px;
  font-size: .82rem;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
}
.badge.is-open .badge__tip { display: block; }

.tel-btn {
  display: inline-flex; align-items: center; gap: .5em; align-self: flex-start;
  text-decoration: none; font-weight: 700; color: var(--navy);
  background: var(--cream); border: 1.5px solid transparent; border-radius: 3px;
  padding: .4em .8em;
}
.tel-btn:hover { border-color: var(--rule-beige); }
.tel-btn .num { font-variant-numeric: tabular-nums; }
.tel-btn .lbl { font-weight: 400; color: var(--muted); font-size: .82em; }

.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* Footer */
.page-foot {
  width: 50vw;
  margin: 0;
  padding: 1.5rem clamp(1.25rem, 3vw, 2.5rem) 3rem;
  border-top: 1px solid var(--beige);
}
.page-foot__safety { display: flex; gap: 0.5rem; background: rgba(209,15,31,.06); border-left: 0; padding: 1rem 1.1rem; border-radius: 3px; color: var(--navy-dark); }
.warn-icon {
  color: var(--red);
  margin-right: .25rem;
	margin-top: 0.3rem;
}
.page-foot__src { color: var(--muted); font-size: .82rem; }
.page-foot .btn--red {
  position: relative;
  display: inline-block;
  padding: .7rem 1.2rem;
  border-radius: 3px;
  background-clip: padding-box;
  border: 2px solid transparent;
  font-family: "Droid Serif Bold", "Droid Serif", Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 2px;
  text-align: center;
}

/* Leaflet popup */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--white);
  color: var(--navy-dark);
  border-radius: 3px;
  box-shadow: none;
}
.leaflet-popup-content {
  font-family: var(--font-body);
  padding: 1rem;
  font-size: 18px;
}
.leaflet-popup-content b { font-family: var(--font-body); font-weight: 400; color: var(--red); }
.leaflet-popup-content a {
  color: var(--red);
  text-decoration: none;
  margin-top: 1rem;
  display: block;
  font-weight: bold;
}
.leaflet-popup-content a.popup-maps {
  margin-top: .85rem;
  padding: .5rem .75rem;
  border: 2px solid var(--navy);
  border-radius: 3px;
  color: var(--navy);
  text-align: center;
  font-size: 16px;
  transition: background .15s, color .15s;
}
.leaflet-popup-content a.popup-maps:hover {
  background: var(--navy);
  color: var(--white);
}

/* Mobile: single column with view toggle */
@media (max-width: 820px) {
  .page-head { width: auto; }
  .page-head__inner, .wrap, .page-foot { width: auto; margin: 0 auto; padding-inline: 1rem; }
  .view-toggle { display: inline-flex; }
  .layout { grid-template-columns: 1fr; }
  .map-wrap { position: static; width: auto; margin-inline: -1rem; }
  #map { height: 70vh; min-height: 420px; border-radius: 0; }
  .wrap[data-view="list"] .map-wrap { display: none; }
  .wrap[data-view="map"] .list,
  .wrap[data-view="map"] .national-list { display: none; }

  /* Collapsible search keeps the sticky bar on one line: the input hides
     behind a magnifier and expands across the bar when opened. */
  .search-box { flex: 0 0 auto; }
  .search-btn { display: inline-flex; }
  .search-box #search { display: none; }
  .controls.search-open .search-box { flex: 1 1 auto; }
  .controls.search-open .search-box #search { display: block; }
  .controls.search-open #region,
  .controls.search-open #category,
  .controls.search-open .view-toggle { display: none; }
}

/* Small phones: relieve the crowded emergency bar + stack phone buttons */
@media (max-width: 666px) {
  /* Emergency bar: phones (with BG|EN) on row 1, quick-exit gets its own
     full-width row so it stays an easy, prominent safety tap target. */
  .emergency__inner { gap: .4rem .7rem; padding: .5rem .9rem; }
  .emergency__lines { flex: 1 1 auto; }
  .quick-exit {
    order: 5;
    flex-basis: 100%;
    margin-left: 0;
    justify-content: center;
  }

  /* Phone buttons: number + label stack, each taking the full width */
  .tel-btn {
    align-self: stretch;
    flex-direction: column;
    align-items: stretch;
    gap: .1rem;
  }
  .tel-btn .num, .tel-btn .lbl { width: 100%; }
}

/* Very narrow: drop the toggle labels to icons so the bar stays one line */
@media (max-width: 520px) {
  .view-toggle button span { display: none; }
  .view-toggle button { padding: .5em .7em; }
}
