/* Karrowmoor Maps -- same gothic wine-and-parchment system as the
   Chronicles site, so the two feel like one property. */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=IM+Fell+English:ital@0;1&family=IM+Fell+English+SC&display=swap');

:root {
  --bg: #0a080b;
  --bg-alt: #130f14;
  --panel: #1a1420;
  --panel-line: rgba(198, 161, 91, 0.16);
  --ink: #e9e1cc;
  --ink-dim: #a89a80;
  --ink-faint: #6f6455;
  --wine: #7d1a2e;
  --wine-bright: #a52840;
  --gold: #c6a15b;
  --gold-soft: #8f7640;
  --line: rgba(198, 161, 91, 0.28);
  --shadow: rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--wine-bright); }
h1, h2, h3, .display {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin: 0;
}

/* ---------- top nav (shared by index and viewer) ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4em 1.2em;
  padding: 0.85em 5vw;
  background: rgba(10, 8, 11, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--panel-line);
}
.site-nav .brand {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.95em;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
}
.site-nav .links {
  display: flex;
  gap: 1.4em;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.72em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-nav .links a { color: var(--ink-dim); }
.site-nav .links a:hover { color: var(--gold); }
.site-nav .links a.current { color: var(--gold); }

/* ---------- hero (index page) ---------- */

.hero {
  position: relative;
  min-height: 40vh;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,8,11,0.25) 0%, rgba(10,8,11,0.6) 55%, rgba(10,8,11,0.97) 100%);
}
.hero-content { position: relative; z-index: 2; width: 100%; padding: 0 5vw 2.6em; text-align: center; }
.hero-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 0.78em;
  letter-spacing: 0.3em;
  color: var(--gold-soft);
  text-transform: uppercase;
  margin-bottom: 0.8em;
  text-shadow: 0 2px 14px rgba(0,0,0,0.85);
}
.hero-title { font-size: clamp(1.9em, 5.5vw, 3.2em); text-transform: uppercase; text-shadow: 0 2px 30px rgba(0,0,0,0.7); }
.hero-subtitle { margin-top: 0.6em; font-style: italic; color: var(--ink-dim); font-size: 1.1em; }
.divider { width: 130px; height: 16px; margin: 1em auto 0; opacity: 0.75; }
.divider svg { width: 100%; height: 100%; }
.divider line, .divider circle { stroke: var(--gold); fill: none; stroke-width: 1; }
.divider circle { fill: var(--gold); }

/* ---------- map card grid (index page) ---------- */

main { position: relative; z-index: 1; }
.column { max-width: 62em; margin: 0 auto; padding: 3em 6vw 2em; }
.intro { text-align: center; max-width: 38em; margin: 0 auto 2.4em; color: var(--ink-dim); font-style: italic; }

.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.8em;
  margin: 1em 0 3em;
}
.map-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.map-card:hover { transform: translateY(-4px); border-color: var(--gold-soft); box-shadow: 0 20px 50px var(--shadow); }
.map-card .thumb { aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-alt); }
.map-card .thumb img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.9) brightness(0.9);
  transition: filter 0.3s ease, transform 0.6s ease;
}
.map-card:hover .thumb img { filter: saturate(1) brightness(1); transform: scale(1.04); }
.map-card .card-body { padding: 1em 1.2em 1.3em; }
.map-card .eyebrow { font-family: 'Cinzel', serif; font-size: 0.66em; letter-spacing: 0.16em; color: var(--gold-soft); text-transform: uppercase; }
.map-card h2 { font-size: 1.15em; margin: 0.35em 0 0; color: var(--ink); }

footer.site-foot { text-align: center; padding: 2.6em 5vw; color: var(--ink-faint); font-size: 0.82em; border-top: 1px solid var(--panel-line); }

/* ---------- map viewer ---------- */

.map-viewport {
  position: relative;
  height: calc(100vh - 58px);
  overflow: hidden;
  background: var(--bg-alt);
  touch-action: none;
  cursor: grab;
}
.map-viewport:active { cursor: grabbing; }
.map-viewport canvas {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  box-shadow: 0 30px 80px var(--shadow);
}

.zoom-controls {
  position: absolute;
  right: 1.2em;
  bottom: 1.2em;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
.zoom-controls button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  background: rgba(26, 20, 32, 0.88);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 1.2em;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.zoom-controls button:hover { border-color: var(--gold-soft); color: var(--ink); background: rgba(26,20,32,0.98); }
.zoom-controls button:active { transform: scale(0.94); }
.zoom-controls #zoom-reset { font-size: 0.95em; }

.map-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
  font-style: italic;
  z-index: 5;
}

@media (max-width: 640px) {
  .site-nav { padding: 0.7em 4vw; }
  .site-nav .links { gap: 0.9em; font-size: 0.66em; }
  .column { padding: 2.2em 5vw 1em; }
  .map-viewport { height: calc(100vh - 96px); }
  .zoom-controls button { width: 48px; height: 48px; }
}
