@charset "utf-8";

:root {
  --forest: #1f3d2e;
  --forest-dark: #142a20;
  --terracotta: #c9662f;
  --terracotta-dark: #a8501f;
  --cream: #f7f3ea;
  --paper: #ffffff;
  --ink: #232323;
  --ink-soft: #5a5a52;
  --border: #e5e0d3;
  --shadow: 0 10px 30px rgba(20, 30, 20, 0.10);
  --radius: 14px;
  --max-width: 1120px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

a { color: var(--terracotta-dark); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--forest-dark);
}

/* ---------- Header / nav ---------- */

.nav-toggle { display: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 243, 234, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header__bar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--forest-dark);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.site-nav > ul > li > a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0;
}

.site-nav > ul > li > a:hover { color: var(--terracotta-dark); }

.site-nav .nav-cta {
  background: var(--terracotta);
  color: #fff !important;
  padding: 0.5rem 1rem !important;
  border-radius: 999px;
}

.site-nav .nav-cta:hover { background: var(--terracotta-dark); }

.has-sub { position: relative; }

.has-sub > ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.has-sub:hover > ul,
.has-sub:focus-within > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.has-sub > ul li a {
  display: block;
  padding: 0.45rem 1rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
  white-space: nowrap;
}

.has-sub > ul li a:hover { background: var(--cream); color: var(--terracotta-dark); }

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.nav-burger span {
  display: block;
  height: 2px;
  background: var(--forest-dark);
  border-radius: 2px;
}

/* ---------- Hero ---------- */

.hero {
  background-size: cover;
  background-position: center;
  min-height: 62vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 3rem 1.5rem;
}

.hero__inner { max-width: 720px; }

.hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 0.4em;
}

.hero__tagline {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin: 0 0 1.75rem;
  color: rgba(255,255,255,0.92);
}

.hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn--primary { background: var(--terracotta); color: #fff; }
.btn--primary:hover { background: var(--terracotta-dark); }

.btn--ghost { border-color: rgba(255,255,255,0.8); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,0.15); }

/* ---------- Sections ---------- */

.section { padding: 4.5rem 1.25rem; }
.section--tint { background: var(--paper); }

.section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section__inner--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.section__title { font-size: clamp(1.6rem, 3vw, 2.1rem); }

.section__lede {
  color: var(--ink-soft);
  margin: -0.25rem 0 2.25rem;
  max-width: 55ch;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.75rem;
}

.card-grid--narrow { grid-template-columns: repeat(auto-fit, minmax(220px, 320px)); }

.card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(20, 30, 20, 0.16);
}

.card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--forest); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }

.card__media--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--forest), var(--forest-dark));
}

.card__media--contain {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  padding: 0.75rem;
}

.card__media--contain img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card__body { padding: 1.1rem 1.25rem 1.4rem; }
.card__body h3 { margin-bottom: 0.3em; font-size: 1.15rem; }
.card__body p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--forest-dark);
  color: rgba(255,255,255,0.75);
  padding: 2.5rem 1.25rem;
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

.site-footer__inner p { margin: 0; }

.footer-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  margin-left: 1.25rem;
}

.footer-nav a:first-child { margin-left: 0; }
.footer-nav a:hover { color: #fff; text-decoration: underline; }

/* ---------- Simple content pages (about / contact) ---------- */

.page-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 5rem;
}

.page-content h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.page-content p { color: var(--ink-soft); }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.form-field { display: flex; flex-direction: column; gap: 0.4rem; }

.form-field label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--forest-dark);
}

.form-field input,
.form-field textarea {
  font: inherit;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--terracotta);
  outline-offset: 1px;
}

.form-field--hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form .btn { align-self: flex-start; border: none; cursor: pointer; }

.form-errors {
  color: #a3311a;
  background: #fbe9e4;
  border: 1px solid #f0c6ba;
  border-radius: 8px;
  padding: 0.9rem 1.25rem;
  margin: 0 0 1.5rem;
}

/* ---------- Page hero variant (sub-pages) ---------- */

.hero--page { min-height: 38vh; }
.hero--page h1 { margin-bottom: 0.25em; }

.page-content--wide { max-width: 980px; }

.lang-switch { text-align: right; font-size: 0.9rem; margin: 0 0 2rem; }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
  margin: 3rem 0;
}

.feature--reverse .feature__media { order: 2; }
.feature--reverse .feature__text { order: 1; }

.feature__media img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature__text h2 { font-size: 1.5rem; }

.feature-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0 3rem;
}

.feature-gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feature-gallery--contain img {
  height: auto;
  max-height: 480px;
  object-fit: contain;
  background: var(--paper);
}

@media (max-width: 720px) {
  .feature { grid-template-columns: 1fr; }
  .feature--reverse .feature__media,
  .feature--reverse .feature__text { order: initial; }
}

/* ---------- Trek map ---------- */

.trek-map {
  width: 100%;
  height: 70vh;
  min-height: 420px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin: 1.5rem 0 2.5rem;
}

.trek-map__popup { text-align: center; max-width: 200px; }
.trek-map__popup img { width: 100%; border-radius: 6px; margin-top: 0.35rem; }

/* ---------- Ride stats / itinerary cards ---------- */

.ride-stats {
  display: inline-block;
  font-weight: 600;
  color: var(--terracotta-dark);
  background: rgba(201, 102, 47, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.feature__media.card__media--icon {
  min-height: 220px;
  border-radius: var(--radius);
}

.callout {
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 4px solid var(--terracotta);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: var(--ink-soft);
  margin: 0 0 2rem;
}

/* ---------- Photo grid (dated galleries) ---------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.photo-grid a {
  display: block;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 0.4rem;
}

.photo-grid--contain img {
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: var(--paper);
}

.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.gallery-nav a { text-decoration: none; }
.gallery-nav a:hover { text-decoration: underline; }
.gallery-nav__up { font-weight: 600; color: var(--forest-dark); }
.gallery-nav__prev { text-align: left; }
.gallery-nav__next { text-align: right; }

@media (max-width: 600px) {
  .gallery-nav { justify-content: center; text-align: center; }
  .gallery-nav__prev, .gallery-nav__next { flex: 1 1 100%; text-align: center; }
}

/* ---------- Lightbox ---------- */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 15, 12, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.lightbox-overlay[hidden] { display: none; }

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 78vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  color: #fff;
  margin: 1rem 0 0.25rem;
  font-size: 1rem;
  text-align: center;
}

.lightbox-count {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin: 0;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.lightbox-play {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lightbox-play:hover { background: rgba(255, 255, 255, 0.25); }

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-close {
  top: 1.25rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.75rem;
  line-height: 1;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.25rem;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

@media (max-width: 600px) {
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 1rem; }
  .lightbox-close { top: 0.75rem; right: 0.75rem; }
}

/* ---------- Interactive hotspot photo (annotated route diagrams) ---------- */

.hotspot-photo {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 1.5rem auto;
  line-height: 0;
}

.hotspot-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.hotspot-photo--large { max-width: 1100px; }
.hotspot-photo--large a.hotspot {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
}

.hotspot-photo a.hotspot {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: var(--terracotta);
  border: 2px solid #fff;
  box-shadow: 0 0 0 rgba(201, 102, 47, 0.6);
  animation: hotspot-pulse 2.2s infinite;
  cursor: pointer;
  display: block;
}

.hotspot-photo a.hotspot:hover,
.hotspot-photo a.hotspot:focus-visible {
  background: var(--terracotta-dark);
  animation: none;
}

@keyframes hotspot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(201, 102, 47, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(201, 102, 47, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 102, 47, 0); }
}

.hotspot-preview {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 62%;
  max-width: 460px;
  background: rgba(20, 30, 24, 0.92);
  border: 2px solid #fff;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
  z-index: 5;
}

.hotspot-preview.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hotspot-preview img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.hotspot-preview__caption {
  display: block;
  color: #fff;
  font-size: 0.8rem;
  text-align: center;
  margin-top: 0.4rem;
}

@media (max-width: 600px) {
  .hotspot-preview { display: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .section__inner--split { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-burger { display: flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
  }

  .site-nav > ul > li { border-top: 1px solid var(--border); }
  .site-nav > ul > li:first-child { border-top: none; }
  .site-nav > ul > li > a { padding: 0.85rem 0; }

  .has-sub > ul {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0.5rem 1rem;
    display: none;
  }

  .has-sub:focus-within > ul,
  .has-sub:hover > ul { display: block; }

  .nav-cta { display: inline-block; margin: 0.75rem 0; }

  .nav-toggle:checked ~ .site-header .site-nav { max-height: 480px; }

  .hero { min-height: 52vh; }
}

/* ---------- Navigation tools (converter / bearing / resection) ---------- */

.converter {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2rem;
  align-items: start;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin: 2rem 0;
}

.converter__inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.converter__inputs .form-field select,
.converter__inputs .form-field input {
  width: 100%;
}

.converter__results {
  grid-column: 1 / 2;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.converter__result {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.converter__result-label {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.converter__result-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--forest-dark);
}

.converter__rose {
  grid-row: 1 / 3;
  grid-column: 2 / 3;
  width: 100%;
  max-width: 220px;
  justify-self: center;
}

@media (max-width: 720px) {
  .converter { grid-template-columns: 1fr; }
  .converter__inputs { grid-template-columns: 1fr 1fr; }
  .converter__results { grid-column: 1; }
  .converter__rose { grid-row: auto; grid-column: 1; max-width: 200px; }
}

.diagram-tool {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
  margin: 2rem 0;
}

.diagram-tool__canvas {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.diagram-tool__canvas svg { width: 100%; height: auto; display: block; touch-action: none; }

.diagram-tool__panel {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.diagram-tool__panel h3 { font-size: 1.05rem; margin-top: 0; }

.diagram-tool__panel ol {
  padding-left: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.diagram-tool__panel ol li { margin-bottom: 0.5rem; }

.diagram-tool__readout {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.diagram-tool__readout .converter__result-value { font-size: 1.9rem; }

@media (max-width: 860px) {
  .diagram-tool { grid-template-columns: 1fr; }
}

/* ---------- Embedded iframe tools ---------- */

.embed-frame {
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.embed-frame iframe {
  display: block;
  width: 100%;
  height: 640px;
  border: 0;
}

@media (max-width: 720px) {
  .embed-frame iframe { height: 460px; }
}
