/* =========================================================
   How Deaf-Friendly Is This Country? — concept prototype
   Minimal, high-contrast, low-motion styling.
   Colors: white background, black text, yellow highlights.
   ========================================================= */

:root {
  --color-bg: #ffffff;
  --color-text: #111111;
  --color-yellow: #ffd100;
  --color-yellow-dark: #e0b400;
  --color-gray-light: #e7e7e7;
  --color-gray-mid: #bdbdbd;
  --border-width: 2px;
  --radius: 4px;
  --max-width: 900px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

h1, h2, h3 {
  line-height: 1.3;
  margin: 0 0 0.5em 0;
}

p {
  margin: 0 0 1em 0;
}

ul {
  margin: 0 0 1em 0;
  padding-left: 1.3em;
}

button {
  font: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  border: var(--border-width) solid var(--color-text);
  border-radius: var(--radius);
  padding: 0.5em 0.9em;
  cursor: pointer;
}

button:hover {
  background: var(--color-yellow);
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-text);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */

.site-header,
.site-footer,
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.25rem;
}

.site-header {
  text-align: center;
  padding-bottom: 0.5rem;
}

.site-header h1 {
  font-size: 1.75rem;
}

.lede {
  font-size: 1.1rem;
  font-weight: bold;
}

.disclaimer {
  font-size: 0.9rem;
  color: #444;
}

.site-footer {
  text-align: center;
  font-size: 0.85rem;
  color: #444;
  border-top: var(--border-width) solid var(--color-gray-light);
  margin-top: 2rem;
}

/* ---------- Map toolbar ---------- */

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.zoom-controls {
  display: flex;
  gap: 0.4rem;
}

.zoom-controls button {
  min-width: 2.75rem;
  font-weight: bold;
}

/* ---------- Map ---------- */

#map-wrap {
  border: var(--border-width) solid var(--color-text);
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f5f7fa;
  touch-action: none;
}

#map {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#map.dragging {
  cursor: grabbing;
}

.country {
  fill: var(--color-gray-light);
  stroke: var(--color-text);
  stroke-width: 0.3;
  vector-effect: non-scaling-stroke;
}

.country.has-data {
  fill: var(--color-yellow);
}

.country:hover,
.country:focus-visible {
  fill: var(--color-yellow-dark);
  outline: none;
}

.country.has-data:hover,
.country.has-data:focus-visible {
  fill: #c99a00;
}

.country.selected {
  stroke-width: 1;
}

.map-hint {
  font-size: 0.9rem;
  color: #444;
  margin-top: 0.6rem;
}

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0;
  font-size: 0.9rem;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.swatch {
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--color-text);
  border-radius: 2px;
  display: inline-block;
}

.swatch-data {
  background: var(--color-yellow);
}

.swatch-nodata {
  background: var(--color-gray-light);
}

/* ---------- Overlay panel ---------- */

.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.overlay-backdrop[hidden] {
  display: none;
}

.overlay-panel {
  background: var(--color-bg);
  color: var(--color-text);
  border: 3px solid var(--color-text);
  border-radius: var(--radius);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
}

.overlay-close {
  position: sticky;
  top: 0;
  float: right;
  margin-left: 1rem;
  background: var(--color-bg);
}

#overlay-country-name,
#overlay-empty-name {
  font-size: 1.5rem;
  clear: both;
}

.overall-rating {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--color-yellow);
  border: var(--border-width) solid var(--color-text);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.rating-emoji {
  font-size: 2.25rem;
  line-height: 1;
}

.rating-caption {
  margin: 0;
  font-size: 0.85rem;
}

.rating-label {
  margin: 0;
  font-size: 1.2rem;
  font-weight: bold;
}

.summary {
  font-size: 1.05rem;
}

.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pros h3,
.cons h3 {
  font-size: 1rem;
}

.pros ul,
.cons ul {
  padding-left: 1.1em;
}

.pros li::marker {
  content: "+ ";
}

.cons li::marker {
  content: "- ";
}

.category-ratings {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.category-ratings li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--color-gray-mid);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
}

.category-ratings .emoji {
  font-size: 1.3rem;
  margin-left: 0.5rem;
}

.examples li {
  margin-bottom: 0.6rem;
}

.examples .place-label {
  font-weight: bold;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
  html {
    font-size: 17px;
  }

  .pros-cons,
  .category-ratings {
    grid-template-columns: 1fr;
  }

  .overlay-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .overlay-panel {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
  }
}

/* ---------- Motion ---------- */

.overlay-backdrop {
  animation: none;
}

@media (prefers-reduced-motion: no-preference) {
  .overlay-panel {
    transition: opacity 120ms ease-out;
  }
}
