/* altitude-maps.com - the one stylesheet. Mobile first; the layout is a single
   column that gains a margin on wide screens. Replaces the five Joomla theme
   files (950px fixed, tables) that rendered shrunken on phones. */
:root {
  --ink: #1d2733;
  --muted: #5b6673;
  --line: #d9dee4;
  --accent: #1f5f8b;
  --accent-soft: #e8f1f8;
  --bg: #fff;
  --panel: #f5f7f9;
  --max: 56rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }
a { color: var(--accent); }
a:hover { text-decoration: none; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0.6rem 0 0.4rem; }
h2 { font-size: 1.2rem; margin: 1.6rem 0 0.5rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 0.4rem; }
p { margin: 0.5rem 0; }
@media (min-width: 40rem) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.35rem; }
}

/* header / footer */
.site-header { background: var(--accent); color: #fff; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.2rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.site-header .brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.site-header nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-header nav a { color: #e9f1f8; text-decoration: none; font-size: 0.95rem; }
.site-header nav a:hover { text-decoration: underline; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin: 0.8rem 0 0; overflow-wrap: anywhere; }
.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 0.85rem; padding: 1rem 0 2rem; }

/* the answer */
.answer { background: var(--accent-soft); border-radius: 0.5rem; padding: 0.9rem 1rem; margin: 0.8rem 0 1rem; }
.answer .elevation-plain { font-size: 1.25rem; margin: 0; }
.answer .elevation-plain strong { font-size: 1.6rem; white-space: nowrap; }
.answer .also { color: var(--muted); font-size: 0.95rem; margin-top: 0.3rem; }
.caveat { border-left: 4px solid #d9a441; background: #fff8e8; padding: 0.6rem 0.9rem; margin: 0.8rem 0; }

/* fact cards */
.facts { display: grid; gap: 0.8rem; margin: 1rem 0; }
@media (min-width: 40rem) { .facts { grid-template-columns: repeat(3, 1fr); } }
.fact { background: var(--panel); border-radius: 0.5rem; padding: 0.8rem 0.9rem; }
.fact h3 { margin: 0 0 0.3rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.fact .big { font-size: 1.35rem; font-weight: 700; }
.fact p { margin: 0.25rem 0 0; font-size: 0.95rem; }

/* tables */
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; margin: 0.5rem 0 1rem; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 0.85rem; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }

/* terrain figures */
.terrain { display: grid; gap: 1rem; margin: 1rem 0; align-items: start; }
@media (min-width: 40rem) { .terrain { grid-template-columns: 1fr 1fr; } }
.terrain figure { margin: 0; }
.terrain figcaption, .relief figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }
.profile { width: 100%; height: auto; display: block; background: #fff; border: 1px solid var(--line); border-radius: 0.3rem; }
.relief { margin: 1rem 0; display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.relief img { width: 195px; height: 195px; border-radius: 0.3rem; border: 1px solid var(--line); image-rendering: auto; }
.relief .legend { font-size: 0.85rem; color: var(--muted); max-width: 28rem; }
.swatch { display: inline-block; width: 0.9rem; height: 0.9rem; vertical-align: -0.15rem; border-radius: 2px; margin-right: 0.2rem; }

/* lists */
.towns { columns: 2; column-gap: 1.5rem; padding: 0; list-style: none; font-size: 0.95rem; }
@media (min-width: 40rem) { .towns { columns: 3; } }
@media (min-width: 56rem) { .towns { columns: 4; } }
.towns li { break-inside: avoid; padding: 0.1rem 0; }
.links { padding-left: 1.2rem; }

/* home */
.finder { display: grid; gap: 0.8rem; margin: 1rem 0; }
.finder form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.finder input[type=text] { flex: 1 1 14rem; padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 0.3rem; font-size: 1rem; }
.btn { padding: 0.6rem 1rem; border: 0; border-radius: 0.3rem; background: var(--accent); color: #fff; font-size: 1rem; cursor: pointer; }
.btn.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
#map_canvas { width: 100%; height: 60vh; min-height: 20rem; border-radius: 0.4rem; border: 1px solid var(--line); overflow: hidden; }
#reading { font-size: 1.2rem; }
#reading strong { font-size: 1.6rem; }
.hint { color: var(--muted); font-size: 0.9rem; }

/* embed */
.embed textarea { width: 100%; font: 0.8rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 4.5rem; border: 1px solid var(--line); border-radius: 0.3rem; padding: 0.5rem; }
.badge-preview { margin: 0.5rem 0; }

/* ads: reserve room so the page does not jump when a unit fills */
.ad { margin: 1rem 0; min-height: 100px; }
.ad ins { min-height: 100px; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
