/* Historical Maps of Ethiopia — all styling. No external fonts or assets. */

:root {
  --ink: #2b2622;
  --muted: #6b6258;
  --bg: #f4efe7;
  --panel: #fffdf9;
  --line: #ddd3c4;
  --accent: #7a4b2b;
  --max: 1100px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

a { color: var(--accent); }

/* ---------- headers ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem;
}
.site-header.home {
  text-align: center;
  padding: 2.5rem 1.25rem 2rem;
}
.site-header.home h1 {
  margin: 0 0 .5rem;
  font-size: 2.1rem;
  letter-spacing: .01em;
}
.intro {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
}
.home-link {
  text-decoration: none;
  font-size: .95rem;
}
.home-link:hover { text-decoration: underline; }

/* ---------- front-page grid ---------- */
.grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}
.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  background: #e8e0d2;
  display: block;
  border-bottom: 1px solid var(--line);
}
.card-text {
  padding: .75rem .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.card-title { font-weight: bold; }
.card-caption { color: var(--muted); font-size: .9rem; }

/* ---------- map page ---------- */
.map-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
.map-page h1 {
  margin: .25rem 0 .35rem;
  font-size: 1.8rem;
}
.map-caption {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-style: italic;
  font-size: 1.02rem;
  max-width: 680px;
}

.viewer {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 360px;
  background: #20242a;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.viewer.grabbing { cursor: grabbing; }
.viewer-img {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}
.viewer-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.viewer-controls button {
  font: inherit;
  font-size: .95rem;
  line-height: 1;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  color: #fff;
  background: rgba(20, 22, 26, .72);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 4px;
  cursor: pointer;
}
.viewer-controls button:hover { background: rgba(20, 22, 26, .9); }
.viewer-hint {
  position: absolute;
  left: 10px;
  bottom: 8px;
  margin: 0;
  padding: 3px 8px;
  font-family: system-ui, sans-serif;
  font-size: .72rem;
  color: #f4efe7;
  background: rgba(20, 22, 26, .55);
  border-radius: 4px;
  z-index: 2;
  pointer-events: none;
}

/* ---------- info + download ---------- */
.map-info {
  margin: 1.5rem 0;
  max-width: 680px;
}
.description { margin: 0 0 1.25rem; }
.download {
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-size: .95rem;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  padding: .6rem 1.1rem;
  border-radius: 4px;
}
.download:hover { background: #5e3920; }

.map-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  font-size: .95rem;
}
.map-nav .next { margin-left: auto; text-align: right; }

/* ---------- footer rule ---------- */
.site-footer {
  max-width: var(--max);
  margin: 1.5rem auto 2.5rem;
  padding: 1.5rem 1.25rem 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 520px) {
  .viewer { height: 60vh; }
  .site-header.home h1 { font-size: 1.7rem; }
}
