/* The stylesheet of the settlements page (/settlements and its identical copy /settlements21). It is the only
   settlements stylesheet the page loads (after style.css and products.css) and replaces the settlements.css +
   settlements3..16 + settlements18 chain of the comparison pages, which keep their own files. Markup comes from
   settlements/render21.mjs; the search and the details card are built by settlements/client20.mjs. */

/* ---- Tuning variables: change a value here (no rebuild of the HTML needed); every comment says what it does ---- */
.settlements-page {
  --map-color: #F3EBDD; /* map edge band + light colour (the only place the colour is set) */
  --map-fill: rgba(0, 0, 0, 0.6); /* map interior darkness: last number 0 = transparent, 1 = solid black */
  --map-edge-width-desktop: 1.5px; /* inner edge band of the map on desktop, in px of rendered size (drawn inside the border only) */
  --map-edge-width-mobile: 1px; /* inner edge band of the map on phones and tablets (900px and narrower) */
  --map-shadow-blur: 14px; /* how far the black shadow behind the map spreads */
  --map-shadow-opacity: 0.55; /* shadow strength, 0 = none, 1 = solid black */
  --map-beam-duration: 48s; /* time for the light to travel once around the border (beam13.mjs reads it; fallback dur in render13.mjs) */
  --map-width: 78%; /* map width as a share of the hero content on desktop (75-80%); phones use 100% */
  --star-core-radius: 1.4; /* bright core radius in map units: about 3px on screen on desktop */
  --star-glow-radius: 14; /* soft glow radius in map units */
  --photo-scale: 1.12; /* zoom of the hero photo on desktop and tablet */
  --photo-origin: 85% 0%; /* the point the zoom grows from: top anchor pushes the dish down, away from the search field */
  --photo-position: 50% 20%; /* extra downward shift on very wide heroes, where the photo has spare height */
  --suggest-max-height: min(68vh, 30rem); /* search results and details card scroll inside this height */
  --status-ok: #99c5ae; /* the one "covered" colour: row status, row panel value, details card */
  --status-none: #7e8794; /* no status (occupied territories) */
  --overlay-radius: 10px; /* corner radius of the search results and the details card */

  /* layout (no need to change) */
  --directory-line: rgba(255, 255, 255, 0.1);
  --directory-muted: #a8b0bc;
  --directory-surface: #121820;
  --directory-surface-light: #171d25;
  --directory-inline: 8px; /* horizontal padding shared by the column bar and the rows */
  --directory-column-width: 6rem;
  --status-column-width: var(--directory-column-width);
  --postcode-column-width: var(--directory-column-width);
  --more-column-width: var(--directory-column-width);
  --directory-columns: minmax(0, 1fr) var(--status-column-width) var(--postcode-column-width) var(--more-column-width);
  --directory-columns-height: 48px;
  /* the same formula as `.catalog-header::before` in products.css, so the bar's top is the header's bottom edge */
  --directory-sticky-top: calc(var(--site-header-top-padding) + max(var(--site-header-control-size), var(--site-header-logo-width) * 0.237333) + 0.5rem);
  --map-edge-width: var(--map-edge-width-desktop);
}
@media (max-width: 47.99rem) {
  .settlements-page {
    --directory-sticky-top: calc(var(--site-header-top-padding) + max(var(--site-header-control-size), var(--site-header-logo-width) * 0.237333));
  }
}
@media (max-width: 900px) {
  .settlements-page { --map-width: 100%; --map-edge-width: var(--map-edge-width-mobile); --star-core-radius: 3.1; --star-glow-radius: 26; }
}
@media (max-width: 767px) {
  .settlements-page { --photo-scale: 1.4; --photo-origin: 100% 0%; --photo-position: 50% 50%; }
}
@media (max-width: 700px) {
  .settlements-page { --status-column-width: 54px; --postcode-column-width: 60px; --more-column-width: 44px; }
}

/* ---- Page frame and hero ---- */
.settlements-main { width: 100%; min-height: 70svh; padding: 0; }
.directory-wrap { width: min(1100px, calc(100% - 40px)); margin: 0 auto; padding: 0 0 88px; }

/* The hero is full width. Its z-index keeps the search results above the sticky column bar (850) and below the site header (900). */
.coverage-hero {
  position: relative;
  z-index: 860;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(380px, 54svh, 520px);
  padding: calc(var(--site-header-control-size) + var(--site-header-top-padding) * 2 + 36px) 0 20px;
  background: #04070d;
  /* a keystroke only changes the suggestion list inside the hero; containing it keeps the browser from re-checking the 4,000+ rows */
  contain: layout style;
}
.coverage-hero::after {
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: 100%;
  content: "";
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(4, 7, 13, 0.55) 0%, rgba(4, 7, 13, 0.25) 40%, var(--catalog-bg) 100%);
}
.coverage-hero picture { position: absolute; z-index: -1; inset: 0; display: block; overflow: hidden; pointer-events: none; }
.coverage-photo {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--photo-position);
  transform: scale(var(--photo-scale));
  transform-origin: var(--photo-origin);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; width: min(1100px, calc(100% - 40px)); margin: 0 auto; }
/* No width cap on the intro: the Georgian title is wider than the old "Starlink-ის" one and would wrap at 820px (the text keeps its own caps). */
.directory-intro { max-width: none; }
.directory-intro h1 {
  margin: 0;
  font-family: "AkolkhetiH", sans-serif;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}
.directory-intro p {
  max-width: 640px;
  margin: 14px 0 28px;
  color: #e8edf4;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.7;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
}

/* ---- Search field ---- */
.directory-search { position: relative; z-index: 5; display: block; }
.search-field {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid #424b57;
  border-radius: 8px;
  background: rgba(18, 22, 28, 0.94);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
}
.search-field:focus-within { border-color: #fff; outline: none; box-shadow: none; }
.search-field svg { flex: 0 0 auto; color: var(--directory-muted); }
.search-field input {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 10px 0;
  border: 0;
  outline: none;
  color: #fff;
  background: transparent;
  font: inherit;
  font-size: 1rem;
}
.search-field input::placeholder { color: #a8b0bc; opacity: 1; }
.search-field input::-webkit-search-cancel-button { display: none; }
#clear-search {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  color: #d6dbe2;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

/* ---- Search results and details card: one overlay in the language of the row panels ---- */
.search-dropdown,
.settlement-card {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  box-sizing: border-box;
  max-height: var(--suggest-max-height);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--directory-line);
  border-radius: var(--overlay-radius);
  background: var(--directory-surface-light);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.35);
  scrollbar-width: thin;
  scrollbar-color: #3a4552 transparent;
}
.search-dropdown ul { margin: 0; padding: 0; list-style: none; }
.search-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--directory-line);
  cursor: pointer;
  transition: background-color 120ms ease;
}
.search-option:last-child { border-bottom: 0; }
.search-option.is-active { background: rgba(37, 44, 53, 0.45); box-shadow: inset 2px 0 #809db2; }
.option-text { display: grid; min-width: 0; gap: 1px; }
.option-name { color: #f3f4f6; font-size: 0.98rem; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.option-municipality { color: var(--directory-muted); font-size: 0.78rem; line-height: 1.5; overflow-wrap: anywhere; }
.option-postcode { color: #c2c8d0; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.search-empty { margin: 0; padding: 14px 20px; color: var(--directory-muted); font-size: 0.93rem; }

/* Details card: title, then the row's own panel (same <dl>), then the link. */
.settlement-card { color: #f3f4f6; }
.card-title {
  margin: 0;
  padding: 14px 56px 12px 20px;
  border-bottom: 1px solid var(--directory-line);
  color: #f3f4f6;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.card-title [lang="en"] { color: var(--directory-muted); }
.card-title:focus { outline: 0; } /* a heading focused by the script for screen readers, not a control */
.settlement-card .settlement-panel { border: 0; border-radius: 0; }
.card-link {
  display: block;
  padding: 11px 20px;
  border-top: 1px solid var(--directory-line);
  color: #99b9d3;
  font-size: 0.85rem;
  text-decoration: none;
}
.card-link:hover { background: rgba(37, 44, 53, 0.45); color: #c8d5e2; }
.settlements-page .card-link:focus-visible,
.settlements-page .card-close:focus-visible { outline: 2px solid #99b9d3; outline-offset: -2px; }
.card-close {
  position: absolute;
  top: 3px;
  right: 8px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--directory-muted);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.card-close:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

/* While the results are open the page does not scroll (client20.mjs keeps the field where it was). The gutter is kept
   (style.css already does so from 48rem) so a classic scrollbar vanishing does not shift the layout. */
html.search-locked { overflow: hidden; scrollbar-gutter: stable; }

/* ---- Georgia map ---- */
.georgia-map {
  position: relative;
  z-index: 0;
  width: var(--map-width);
  margin: 26px auto;
  aspect-ratio: 792.50702 / 401.40411;
  pointer-events: none;
}
.georgia-map svg { display: block; width: 100%; height: 100%; overflow: visible; }
.georgia-map-shadow { position: absolute; inset: 0; z-index: -1; opacity: var(--map-shadow-opacity); filter: blur(var(--map-shadow-blur)); transform: translateY(4px); }
.georgia-map-shadow use { fill: #000; stroke: none; }
/* The outline keeps its exact coordinates. The fill covers the silhouette; the edge band is the outline stroked at twice
   its width and clipped to the silhouette (georgia-clip), so only the inner half shows and nothing spills outside.
   non-scaling-stroke makes the width px of rendered size, whatever the size of the map. */
#georgia-outline { vector-effect: non-scaling-stroke; }
.georgia-map-fill { fill: var(--map-fill); stroke: none; }
.georgia-map-edge { fill: none; stroke: var(--map-color); stroke-width: calc(var(--map-edge-width) * 2); stroke-linejoin: round; }
/* The light: a bright core in the map colour inside a soft radial glow (map colour to transparent), moved along the outer
   border by SMIL <animateMotion> (beam13.mjs falls back to requestAnimationFrame). It keeps moving under
   prefers-reduced-motion (owner decision: it must show on phones); it is small, slow and does not flash. */
.beam-stop { stop-color: var(--map-color); }
.beam-glow { r: var(--star-glow-radius); fill: url(#beam-glow-gradient); fill-opacity: 1; stroke: none; }
.beam-dot { r: var(--star-core-radius); fill: var(--map-color); stroke: none; }

/* ---- Column bar and rows: one grid, so each label sits exactly over its values ---- */
.directory-columns {
  position: sticky;
  top: var(--directory-sticky-top);
  z-index: 850;
  display: grid;
  grid-template-columns: var(--directory-columns);
  align-items: center;
  box-sizing: border-box;
  height: var(--directory-columns-height);
  padding: 7px var(--directory-inline);
  border-block: 1px solid var(--directory-line);
  border-radius: 6px 6px 0 0;
  background: var(--directory-surface);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  color: #bac3cf;
  font-size: 0.75rem;
  line-height: 1.35;
}
.directory-columns > *,
.s10-row > * { min-width: 0; }
/* Every column but the first is centred, label and value alike; the settlement name keeps the shared left edge. */
.directory-columns > :not(:first-child),
.s10-status,
.postcode { text-align: center; justify-self: stretch; }
.column-postcode { font-size: 0.68rem; }
.column-postcode,
.column-postcode abbr { white-space: nowrap; }
.column-postcode abbr { text-decoration: none; cursor: help; }

.directory { margin-top: 28px; }
.region-plain { margin-top: 44px; }
.region-plain:first-child { margin-top: 0; }
.region-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0 0 8px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  background: var(--directory-surface);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.region-bar h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  font-family: "AkolkhetiH", sans-serif;
  font-size: clamp(1.02rem, 1.8vw, 1.22rem);
  line-height: 1.55;
  overflow-wrap: break-word;
}
.group-count { flex: 0 0 auto; color: #929ca9; font-size: 0.76rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Lists of up to 100 rows (render15.mjs) that are far from the viewport are skipped by the browser. A closed row is
   about 69px high on desktop and 65px on a phone; `auto` remembers the real height once a list has been shown. */
.s10-list {
  margin: 0 var(--directory-inline);
  padding: 0;
  list-style: none;
  content-visibility: auto;
  contain-intrinsic-size: auto calc(var(--rows) * 69px);
}
.s10-list:last-child { margin-bottom: 10px; }
.s10-item { border-bottom: 1px solid var(--directory-line); }
.s10-row {
  display: grid;
  grid-template-columns: var(--directory-columns);
  align-items: center;
  min-height: 68px;
  cursor: pointer;
  list-style: none;
}
.s10-row::-webkit-details-marker { display: none; }
.s10-row:hover { background: rgba(37, 44, 53, 0.45); }
.settlements-page .s10-row:focus-visible { outline-offset: -2px; }
.s10-name { padding: 12px 12px 12px 0; font-size: 0.98rem; font-weight: 500; line-height: 1.65; overflow-wrap: anywhere; }
.postcode { color: #c2c8d0; font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.settlement-status { display: inline-block; font-size: 0.8rem; line-height: 1.55; text-align: center; white-space: nowrap; }
.settlement-status.is-available,
.settlement-panel dd.is-available { color: var(--status-ok); }
.settlement-status.is-unknown,
.settlement-panel dd.is-unknown { color: var(--status-none); }
/* The row chevron is drawn here instead of by an inline <svg> in every row (smaller HTML). */
.s10-more { display: grid; place-items: center; min-height: 44px; color: #c8d5e2; }
.s10-row:hover .s10-more { color: #fff; }
.s10-more::before {
  content: "";
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 5 7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 5 7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 150ms ease;
}
.s10-details[open] .s10-more::before { transform: rotate(90deg); }
.s10-item.is-selected > .s10-details > .s10-row { background: rgba(111, 151, 181, 0.09); box-shadow: inset 2px 0 #809db2; }
/* Brief highlight of the row a suggestion opened (a colour fade, no movement). */
.s10-item.is-flash > .s10-details > .s10-row { animation: settlement-flash 2.4s ease-out; }
@keyframes settlement-flash { from { background: rgba(243, 235, 221, 0.28); } to { background: rgba(111, 151, 181, 0.09); } }

/* Row panel (also the body of the details card) */
.settlement-panel { padding: 18px 20px; border-bottom: 1px solid var(--directory-line); background: var(--directory-surface-light); }
.settlement-panel dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; margin: 0; }
.settlement-panel dt { margin-bottom: 4px; color: var(--directory-muted); font-size: 0.78rem; line-height: 1.6; }
.settlement-panel dd { margin: 0; font-size: 0.93rem; line-height: 1.65; overflow-wrap: break-word; }
.settlement-panel dd [lang="en"] { overflow-wrap: anywhere; }

.noscript-notice,
.link-status { margin-top: 22px; color: var(--directory-muted); font-size: 0.8rem; line-height: 1.8; overflow-wrap: break-word; }
.settlements-page [hidden] { display: none; }
.settlements-page :is(button, a, summary, input):focus-visible { outline: 2px solid #a8d8f3; outline-offset: 3px; }
.search-field input:focus-visible { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1100; top: -100px; left: 16px; padding: 14px; color: #090b0f; background: #fff; }
.skip-link:focus { top: 12px; }

/* ---- Phones and small tablets ---- */
@media (max-width: 900px) {
  .georgia-map { margin: 22px auto; }
}
@media (max-width: 700px) {
  .directory-wrap { width: calc(100% - 24px); padding-bottom: 56px; }
  .hero-content { width: calc(100% - 24px); }
  .coverage-hero { min-height: 0; padding: calc(var(--site-header-control-size) + var(--site-header-top-padding) * 2 + 40px) 0 12px; }
  .directory-intro h1 { font-size: clamp(2rem, 9.5vw, 2.5rem); line-height: 1.2; }
  .directory-intro p { margin: 10px 0 20px; font-size: 1rem; line-height: 1.65; }
  .search-field { min-height: 54px; gap: 10px; padding-inline: 12px; }
  .search-field input { min-height: 52px; }
  #clear-search { padding-inline: 2px; }
  .search-option { padding: 10px 12px; }
  .option-postcode { font-size: 0.78rem; letter-spacing: 0.04em; }
  .search-empty { padding: 14px 12px; }
  .card-title { padding: 12px 52px 10px 12px; }
  .card-link { padding: 11px 12px; }
  .card-close { right: 4px; }
  .directory-columns { font-size: 0.68rem; }
  .column-postcode { font-size: 0.625rem; }
  .directory { margin-top: 0; }
  .region-plain { margin-top: 36px; }
  .region-plain:first-child { margin-top: 12px; }
  .region-bar { padding: 9px 12px; }
  .region-bar h2 { font-size: clamp(1.05rem, 4.4vw, 1.25rem); line-height: 1.4; overflow-wrap: anywhere; }
  .s10-list { margin-inline: 0; contain-intrinsic-size: auto calc(var(--rows) * 65px); }
  .s10-row { min-height: 0; padding: 10px var(--directory-inline); }
  .s10-name { padding: 0 10px 0 0; color: #f2f4f7; font-size: 0.95rem; line-height: 1.5; }
  .postcode { font-size: 0.78rem; letter-spacing: 0.04em; line-height: 1.5; }
  .settlement-panel { padding: 14px 12px 16px; border-top: 1px solid var(--directory-line); border-bottom: 0; }
  .settlement-panel dl { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 350px) {
  .search-field { gap: 8px; padding-inline: 10px; }
  #clear-search { font-size: 0.76rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .settlements-page *,
  .settlements-page *::before,
  .settlements-page *::after { animation: none !important; transition: none !important; }
}
