/* SpeleoMap site — shared styles (2026-10-08 overhaul).
   Every page links this first; a page's own <style> only holds what is
   unique to that page. */

:root {
  --bg: #111112; --surface: #1c1c1e; --border: #2c2c2e;
  --text: #f2f2f7; --dim: #8e8e93; --faint: #6e6e73;
  --red: #c0392b; --red-bg: #1a0f0e; --red-bdr: #3d1a18; --amber: #d48c2a;
  --mono: "SF Mono", Menlo, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* Footer sits at the bottom of the screen on short pages. */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }

/* Nav */
nav { position: fixed; top: 0; left: 0; right: 0; height: 52px; background: var(--bg); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 6px; z-index: 100; padding: 0 16px; }
.nav-brand { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; margin-right: 20px; text-decoration: none; flex-shrink: 0; }
.nav-brand sup { font-size: 9px; font-weight: 600; vertical-align: super; }
.nav-link { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); padding: 5px 10px; border-radius: 6px; border: 1px solid transparent; text-decoration: none; white-space: nowrap; }
.nav-link:hover { color: var(--text); border-color: var(--border); }
.nav-link.active { color: var(--red); border-color: var(--red-bdr); background: var(--red-bg); }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; margin-left: auto; padding: 6px; border: none; background: none; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--dim); border-radius: 2px; transition: all 0.25s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu { display: none; position: fixed; top: 52px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; padding: 12px 16px; gap: 4px; z-index: 99; }
.mobile-menu.open { display: flex; }
.mobile-menu a { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); padding: 10px 12px; border-radius: 8px; text-decoration: none; }
.mobile-menu a:hover { color: var(--text); background: var(--border); }
.mobile-menu a.active { color: var(--red); background: var(--red-bg); }
@media (max-width: 500px) {
  .nav-link { display: none; }
  .nav-brand { margin-right: 0; }
  .hamburger { display: flex; }
  nav { justify-content: space-between; }
}

/* Footer — one version everywhere; never squeezes into a column. */
footer { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--dim); text-align: center; padding: 20px 16px; border-top: 1px solid var(--border); margin-top: 24px; line-height: 1.8; width: 100%; align-self: stretch; }
footer p { margin: 6px 0; }
footer a { color: var(--dim); text-decoration: none; }
footer a:hover { color: var(--text); }
footer .social a { display: inline-flex; align-items: center; }
footer .social a + a { margin-left: 16px; }

/* Collapsible sections (guide pages, FAQ) */
details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; margin-bottom: 8px; transition: border-color 0.15s; }
details:hover, details[open] { border-color: var(--red-bdr); }
summary { color: var(--text); font-size: 14px; font-weight: 600; list-style: none; cursor: pointer; outline: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--red); font-weight: 700; font-family: var(--mono); }
details[open] > summary::after { content: '\2212'; }
details p { color: var(--dim); line-height: 1.75; margin: 12px 0 4px 0; font-size: 14px; }
details ul { color: var(--dim); line-height: 1.75; font-size: 14px; padding-left: 20px; margin: 10px 0; }
details ul li { margin-bottom: 6px; }
details a { color: var(--red); text-decoration: underline; }
details a:hover { color: var(--text); }
details strong { color: var(--text); font-weight: 500; }

/* Page building blocks for new pages (pages with their own <style> keep it). */
.page { max-width: 760px; margin: 0 auto; padding: 76px 20px 8px; }
.page.wide { max-width: 1040px; }
.page-label { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 2.5px; color: var(--red); text-transform: uppercase; margin-bottom: 10px; text-align: center; }
.page h1 { font-size: clamp(26px, 5vw, 38px); font-weight: 700; letter-spacing: -0.5px; line-height: 1.15; margin-bottom: 10px; text-align: center; }
.lead { font-size: 15px; color: var(--dim); line-height: 1.65; margin: 0 auto 18px; text-align: center; max-width: 620px; }
.back { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); text-decoration: none; margin-bottom: 18px; }
.back:hover { color: var(--text); }
.section-label { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 2px; color: var(--red); text-transform: uppercase; margin: 22px 0 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--text); transition: border-color 0.15s; }
.tile:hover { border-color: var(--red-bdr); }
.tile h3 { font-size: 15px; font-weight: 650; margin-bottom: 4px; }
.tile p { font-size: 13px; color: var(--dim); line-height: 1.5; }
.tile .tag { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--red); margin-bottom: 6px; display: block; }
.btn { display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; text-decoration: none; padding: 12px 20px; border-radius: 10px; border: 1px solid var(--red-bdr); background: var(--red); color: #fff; }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--red-bdr); }
.cta-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0 6px; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0 4px; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.pager a { color: var(--dim); text-decoration: none; }
.pager a:hover { color: var(--text); }
.related { font-size: 13px; color: var(--dim); margin: 14px 0 0; line-height: 1.7; }
.related a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.notify-line { text-align: center; font-size: 13px; color: var(--dim); margin: 16px 0 0; }
.notify-line a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 500px) {
  .page { padding: 66px 16px 8px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { padding: 12px; }
  .tile p { font-size: 12px; }
}

/* Guide topic pages: sections in two columns on wide screens. */
.page.topic { max-width: 1000px; }
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; align-items: start; }
.dgrid details { margin-bottom: 8px; }
.page.topic .section-label { margin: 16px 0 8px; }
.page.topic details { padding: 11px 16px; }
@media (max-width: 800px) { .dgrid { grid-template-columns: 1fr; } }

/* Build 37 (2026-10-22): the mission line opens /mission.html everywhere. */
.mission a { color: inherit; text-decoration: none; }
.mission a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 2026-10-29 - App Store coming-soon button (our own style, not Apple's badge artwork) */
.btn.store { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; background: #000; color: #fff; border: 1px solid #6e6e73; border-radius: 10px; padding: 8px 18px 9px; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; text-transform: none; letter-spacing: 0; line-height: 1.15; }
.btn.store small { font-size: 10px; font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase; color: #c7c7cc; }
.btn.store b { font-size: 19px; font-weight: 600; }
.btn.store:hover { border-color: #f2f2f7; filter: none; }
