:root {
  --green: #17382d;
  --green-2: #25523f;
  --cream: #f7f3e9;
  --paper: #fffdf8;
  --gold: #b28a4e;
  --ink: #1e2722;
  --muted: #68736c;
  --line: #ded8c9;
  --shadow: 0 12px 34px rgba(23, 56, 45, .10);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.65 Georgia, 'Times New Roman', serif;
}
body.admin { background: #eef1ec; }
a { color: var(--green-2); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 8px; top: 8px; z-index: 99; background: #fff; padding: 8px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(23, 56, 45, .97);
  color: #fff;
  border-bottom: 2px solid var(--gold);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 72px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  font: 700 12px/1 Arial, sans-serif;
  letter-spacing: .08em;
  color: #f2dfb9;
}
.brand-text strong { display: block; font-size: 19px; letter-spacing: .01em; }
.brand-text small { display: block; font: 11px/1.4 Arial, sans-serif; color: #c8d5cd; letter-spacing: .04em; }
.site-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.site-nav a {
  color: #eef4ee;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font: 14px/1.2 Arial, sans-serif;
}
.site-nav a:hover, .site-nav a.active { background: rgba(255,255,255,.13); }
.site-nav .nav-admin { border: 1px solid rgba(255,255,255,.35); }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 8px; padding: 7px 12px; font: 13px Arial, sans-serif; }

/* Layout */
main { min-height: 65vh; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 22px; }
.section { padding: 54px 0; }
.section-tight { padding: 30px 0 54px; }
.stack > * + * { margin-top: 18px; }
.center { text-align: center; }

/* Typography */
h1, h2, h3 { font-weight: 500; color: var(--green); line-height: 1.15; margin: 0 0 14px; }
h1 { font-size: clamp(34px, 5vw, 58px); letter-spacing: -.02em; }
h2 { font-size: clamp(26px, 3vw, 36px); }
h3 { font-size: 21px; }
p { margin: 0 0 16px; }
.eyebrow { font: 12px/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .18em; color: var(--gold); margin: 0 0 12px; }
.lead { font-size: 19px; color: #405048; max-width: 760px; }
.muted { color: var(--muted); }
.prose p { max-width: 74ch; }
.prose p:last-child { margin-bottom: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  text-decoration: none;
  font: 14px/1 Arial, sans-serif;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: var(--green-2); transform: translateY(-1px); }
.btn.secondary { background: transparent; color: var(--green); }
.btn.secondary:hover { background: rgba(23,56,45,.08); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--green);
  color: #fff;
  padding: 82px 0 76px;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(23,56,45,.97) 0%, rgba(23,56,45,.86) 48%, rgba(23,56,45,.30) 100%),
    url('/photos/kinross/0.jpg') center/cover no-repeat;
  z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 760px; }
.hero .lead { color: #e8efe8; }
.hero .eyebrow { color: #e3c88f; }
.hero .btn.secondary { color: #fff; border-color: rgba(255,255,255,.7); }
.hero .btn.secondary:hover { background: rgba(255,255,255,.14); }

/* Cards and grids */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card-body { padding: 22px; flex: 1; }
.card-body > :last-child { margin-bottom: 0; }
.card h3 { margin-bottom: 8px; }
.card-thumb { height: 200px; background: #d9d3c4 center/cover no-repeat; }
.card-meta { font: 12px/1.5 Arial, sans-serif; text-transform: uppercase; letter-spacing: .09em; color: var(--gold); }
.card-footer { padding: 12px 22px 18px; }
.card a.card-link { text-decoration: none; color: inherit; }
.card a.card-link:hover h3 { color: var(--green-2); }

.stop-number {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font: 600 14px Arial, sans-serif;
  margin-bottom: 12px;
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(23,56,45,.08);
  color: var(--green);
  font: 12px/1.3 Arial, sans-serif;
  text-transform: capitalize;
}
.badge.gold { background: rgba(178,138,78,.2); color: #7d5d28; }

/* Detail */
.detail-hero { padding: 46px 0 26px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 38px; align-items: start; }
.fact-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.fact-list li { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.fact-list li:last-child { border-bottom: 0; }
.fact-list b { display: block; font: 11px/1.5 Arial, sans-serif; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.fact-list span { font-size: 15px; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 26px 0; }
.gallery button { padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #ddd; aspect-ratio: 4 / 3; cursor: zoom-in; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.gallery button:hover img { transform: scale(1.04); }
.gallery-large { grid-column: span 3; aspect-ratio: 16 / 7; }

/* Map */
.map-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.map-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-list { max-height: 620px; overflow: auto; padding: 8px; }
.map-list button {
  display: block; width: 100%; text-align: left; padding: 10px 12px;
  background: transparent; border: 0; border-radius: 8px; cursor: pointer;
  font: 14px/1.35 Arial, sans-serif; color: var(--ink);
}
.map-list button:hover { background: #edf2ec; }
.map-list small { display: block; color: var(--muted); }
#map, .mini-map { height: 620px; width: 100%; background: #e9e6db; z-index: 1; border-radius: var(--radius); }
.mini-map { height: 340px; margin: 26px 0; }
.leaflet-container { font: 13px/1.4 Arial, sans-serif; }
.map-popup a { font-weight: bold; }

/* Search / filters */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 26px; }
.toolbar input[type=search], .toolbar select {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  min-width: 240px;
  font: 14px Arial, sans-serif;
}
.list-row {
  display: flex; gap: 16px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-row .thumb { width: 76px; height: 64px; border-radius: 8px; background: #ddd center/cover; flex: none; }
.list-row .row-main { flex: 1; }
.list-row h3 { margin: 0 0 3px; font-size: 18px; }
.list-row p { margin: 0; color: var(--muted); font-size: 14px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,16,13,.94); display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 88vw; max-height: 82vh; object-fit: contain; }
.lightbox button {
  position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff;
  width: 48px; height: 48px; border-radius: 50%; font-size: 30px; cursor: pointer;
}
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-caption { position: absolute; bottom: 18px; color: #ddd; font: 13px Arial, sans-serif; }

/* Footer */
.site-footer { background: var(--green); color: #d5e0d7; padding: 30px 22px; text-align: center; font: 13px/1.7 Arial, sans-serif; }
.site-footer p { margin: 0; }

/* Admin */
.admin-header { background: var(--green); color: #fff; padding: 18px 22px; }
.admin-header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.admin-header h1 { color: #fff; font-size: 26px; margin: 0; }
.admin-header a { color: #d9e6dd; }
.admin-main { max-width: 1160px; margin: 0 auto; padding: 26px 22px 60px; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-tabs button { padding: 9px 16px; border: 1px solid var(--line); background: #fff; border-radius: 999px; cursor: pointer; font: 14px Arial, sans-serif; }
.admin-tabs button.active { background: var(--green); color: #fff; border-color: var(--green); }
.admin-columns { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.admin-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.admin-list { max-height: 70vh; overflow: auto; }
.admin-list button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; cursor: pointer; font: 14px Arial, sans-serif; }
.admin-list button:hover, .admin-list button.active { background: #e9f0e8; }
.admin-list small { display: block; color: var(--muted); }
.field { margin-bottom: 14px; }
.field label { display: block; font: 12px Arial, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font: 14px/1.5 Arial, sans-serif;
}
.field textarea { min-height: 130px; resize: vertical; }
.field textarea.json { min-height: 320px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.admin-note { background: #fff8e8; border: 1px solid #eadbb3; padding: 12px 15px; border-radius: 10px; font: 13px/1.5 Arial, sans-serif; }
.status { font: 13px Arial, sans-serif; color: var(--green-2); margin-left: 10px; }
.empty { padding: 26px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.row-editor {
  display: grid;
  grid-template-columns: 1.2fr 1fr .8fr .8fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafaf6;
}
.row-editor input, .row-editor select, .row-editor textarea {
  width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 6px;
  font: 13px/1.4 Arial, sans-serif;
}
.row-editor textarea { min-height: 60px; resize: vertical; }
.row-remove { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #ecdfdf; color: #8a3a3a; cursor: pointer; font-size: 20px; }
.stop-editor { grid-template-columns: 1fr 1fr 1fr 1fr auto; }
.stop-editor textarea { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .row-editor, .stop-editor { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: flex; }
  .header-inner { flex-wrap: wrap; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid, .map-layout, .admin-columns { grid-template-columns: 1fr; }
  #map, .map-list { height: 420px; max-height: 420px; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-large { grid-column: span 2; }
  .section { padding: 36px 0; }
}
