/*
  borovets.eu design system: tokens and shared components used by every page
  (the homepage and the Rila Altitude Camp page). Page-specific layout lives in
  styles.css and in each page's own <style>. See DESIGN.md.

  Fonts are loaded by each page's <head>:
  Sofia Sans Extra Condensed 700-900, Sofia Sans 400-700, IBM Plex Mono 400-600.
*/

:root {
  /* Brand colour */
  --pine: #16281f;          /* primary dark: dark bands, footer, buttons on light */
  --pine-2: #1e362a;        /* raised dark surface */
  --pine-3: #2b4a3a;        /* highlight in dark-band gradients */
  --snow: #eef1ec;          /* page background */
  --snow-2: #e2e8e0;        /* alternate light band, tags */
  --white: #ffffff;         /* cards, inputs */
  --ink: #131a16;           /* body text (15.5:1 on snow) */
  --granite: #5a6660;       /* secondary text (5.3:1 on snow) */
  --line: rgba(19, 26, 22, 0.16);
  --glacial: #4fa3b8;       /* accent on dark (5.4:1 on pine); solid button fill */
  --glacial-deep: #2e7a8c;  /* accent fills, borders and hovers on light */
  --glacial-ink: #24697a;   /* accent text on light (5.5:1 on snow) */
  --waymark: #c8321e;       /* trail-waymark red: stripes, "hard" tags, errors */
  --flag-green: #00966e;
  --flag-red: #d62612;

  /* Map data colours (categorical). script.js sets marker fills to these values. */
  --map-food: #d18f31;
  --map-bar: #8d2f48;
  --map-stay: #164238;
  --map-ski: #2f80ed;
  --map-bike: #10a56f;

  /* Type */
  --font-display: "Sofia Sans Extra Condensed", "Arial Narrow", sans-serif;
  --font-body: "Sofia Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  /* Shape, depth and spacing */
  --radius: 0;
  --shadow: 0 12px 28px rgba(22, 40, 31, 0.14);
  --gutter: clamp(16px, 4vw, 40px);

  /* Bulgarian trail waymark: white/red stripe used as a band on cards */
  --waymark-stripe: repeating-linear-gradient(90deg, #fff 0 14px, var(--waymark) 14px 28px);
}

/* ============ Base ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--snow);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: var(--white);
  background: var(--glacial);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--glacial);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.skip-link {
  position: absolute;
  top: 0;
  left: -999px;
  z-index: 2000;
  padding: 0.6rem 1rem;
  color: var(--white);
  background: var(--pine);
}

.skip-link:focus {
  top: 1rem;
  left: 1rem;
}

/* ============ Site header ============ */
/* Sticky light bar on every page: brand left, section links, one CTA right.
   z-index sits above Leaflet's map controls (1000). */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 60px;
  padding: 0.75rem var(--gutter);
  border-bottom: 1px solid var(--line);
  background: rgba(238, 241, 236, 0.94);
  backdrop-filter: blur(8px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Bulgarian tricolour chip: the brand mark */
.flag {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 11px;
  outline: 1px solid rgba(0, 0, 0, 0.15);
  background: linear-gradient(to bottom, #fff 0 33%, var(--flag-green) 33% 66%, var(--flag-red) 66% 100%);
}

/* Sub-brand after the main brand, e.g. "borovets.eu / Rila Altitude Camp" */
.brand-crumb {
  margin-left: -0.75rem;
  color: var(--granite);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-crumb a {
  color: var(--ink);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-left: auto;
}

.site-nav a {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--glacial-ink);
}

.site-nav .nav-cta {
  padding: 0.5rem 1.1rem;
  color: var(--white);
  background: var(--pine);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav .nav-cta:hover {
  color: var(--white);
  background: var(--glacial-deep);
}

@media (max-width: 860px) {
  .site-header {
    gap: 0.8rem;
  }

  .site-nav a:not(.nav-cta) {
    display: none;
  }
}

@media (max-width: 520px) {
  .brand-crumb {
    display: none;
  }
}

/* ============ Type helpers ============ */
.eyebrow {
  margin: 0 0 1rem;
  color: var(--glacial-ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ============ Buttons ============ */
/* .solid: glacial fill, for dark backgrounds. .ghost: outline, for dark
   backgrounds. .dark: pine fill, for light backgrounds. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.75rem 1.7rem;
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.btn.solid {
  color: var(--pine);
  background: var(--glacial);
}

.btn.solid:hover {
  background: var(--white);
}

.btn.ghost {
  color: var(--snow);
  border: 1.5px solid rgba(238, 241, 236, 0.5);
  background: transparent;
}

.btn.ghost:hover {
  color: var(--glacial);
  border-color: var(--glacial);
}

.btn.dark {
  color: var(--white);
  background: var(--pine);
}

.btn.dark:hover {
  background: var(--glacial-deep);
}

.btn[disabled] {
  cursor: wait;
  opacity: 0.6;
}

/* ============ Elevation rail ============ */
/* Fixed ruler down the left edge from Musala to the resort, on every page.
   Add class="has-rail" to <body> and the rail markup as its first child. */
:root {
  --rail-w: 64px;
}

.has-rail {
  padding-left: var(--rail-w);
}

.has-rail .skip-link:focus {
  left: calc(var(--rail-w) + 1rem);
}

.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: var(--rail-w);
  padding: 14px 0;
  border-right: 1px solid rgba(19, 26, 22, 0.18);
  background: var(--snow);
}

.rail .tick {
  position: relative;
  margin: 0 auto;
  color: var(--granite);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.02em;
  transform: rotate(180deg);
  writing-mode: vertical-rl;
}

.rail .tick::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -15px;
  width: 10px;
  height: 1px;
  background: var(--granite);
}

.rail .tick.peak {
  color: var(--waymark);
  font-weight: 600;
}

/* Trail waymark: white over red */
.rail .marker {
  width: 22px;
  height: 14px;
  margin: 0 auto;
  outline: 1px solid rgba(19, 26, 22, 0.25);
  background: linear-gradient(to bottom, #fff 0 50%, var(--waymark) 50% 100%);
}

@media (max-width: 860px) {
  .has-rail {
    padding-left: 0;
  }

  .has-rail .skip-link:focus {
    left: 1rem;
  }

  .rail {
    display: none;
  }
}

/* ============ Datum row ============ */
/* Key figures (heights, distances) in mono under a hairline, on dark bands. */
.datum {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2.2rem;
  margin: 2.4rem 0 0;
  padding: 1.4rem 0 0;
  border-top: 1px solid rgba(238, 241, 236, 0.25);
  list-style: none;
}

.datum > * {
  min-width: 120px;
}

.datum .v {
  display: block;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
}

.datum .k {
  display: block;
  color: rgba(238, 241, 236, 0.65);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============ Waymark band ============ */
.band {
  height: 8px;
  background: var(--waymark-stripe);
}

/* ============ Site footer ============ */
.site-footer {
  padding: 3rem var(--gutter);
  color: rgba(238, 241, 236, 0.7);
  background: var(--ink);
  font-size: 0.88rem;
}

.site-footer p {
  margin: 0;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.site-footer .footer-brand {
  margin-bottom: 0.4rem;
  color: var(--white);
}

.site-footer .footer-title {
  margin-bottom: 0.3rem;
  color: var(--white);
  font-weight: 700;
}

.site-footer a {
  color: var(--glacial);
}

.site-footer .footer-note {
  max-width: 90ch;
  margin-top: 2rem;
  color: rgba(238, 241, 236, 0.45);
  font-size: 0.75rem;
}
