/* Alamedin Hikes — палитра ущелья: береста, арча, ледник, рябина */
:root {
  --birch: #f4f6f5;      /* фон: береста */
  --paper: #ffffff;
  --juniper: #1d3a31;    /* основной текст и тёмные плоскости: арча */
  --juniper-2: #2f5a4c;
  --glacier: #a9c3cc;    /* ледник */
  --glacier-soft: #e3edf0;
  --rowan: #b4382c;      /* акцент: рябина */
  --stone: #5f6b66;      /* второстепенный текст */
  --line: #d5dedb;
  --easy: #3f7d4f;
  --medium: #b47a12;
  --hard: #9e2b22;

  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Onest", -apple-system, "Segoe UI", system-ui, sans-serif;
  --measure: 68ch;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--birch);
  color: var(--juniper);
  font: 400 1.0625rem/1.65 var(--body);
}
img { max-width: 100%; display: block; }
a { color: var(--juniper-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--rowan); }
:focus-visible { outline: 3px solid var(--rowan); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(29, 58, 49, 0.96);
  color: var(--birch);
}
.bar {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; min-height: 60px;
}
.logo {
  font: 700 1.05rem/1 var(--display);
  color: inherit; text-decoration: none; letter-spacing: -0.01em;
}
.logo span { font-weight: 500; color: var(--glacier); margin-left: 0.35em; }
.site-header .logo:hover { color: var(--birch); }

nav ul { list-style: none; margin: 0; padding: 0; }
nav > ul { display: flex; gap: 4px; }
nav a {
  display: block; padding: 10px 12px; border-radius: 6px;
  color: var(--birch); text-decoration: none; font-size: 0.95rem;
}
nav a:hover, nav a[aria-current="page"] { background: rgba(255,255,255,0.1); color: #fff; }
.has-sub { position: relative; }
.sub {
  position: absolute; left: 0; top: 100%; min-width: 230px;
  background: var(--juniper); padding: 6px; border-radius: 0 0 8px 8px;
  display: none;
}
.has-sub:hover .sub, .has-sub:focus-within .sub { display: block; }
.menu-toggle {
  display: none; font: 600 0.95rem var(--body); color: var(--birch);
  background: transparent; border: 1px solid rgba(255,255,255,0.35); border-radius: 6px; padding: 7px 14px;
}

/* ---------- Первый экран ---------- */
.hero {
  position: relative;
  min-height: 46vh;
  display: flex; align-items: flex-end;
  background-color: var(--juniper-2);
  background-size: cover; background-position: center;
  color: #fff;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,40,34,0.05) 0%, rgba(20,40,34,0.35) 45%, rgba(16,32,27,0.85) 100%);
}
.hero-home { min-height: 82vh; }
.hero-inner {
  position: relative; width: 100%; max-width: 1180px; margin: 0 auto;
  padding: 48px 20px 44px;
}
.hero h1 {
  font: 700 clamp(2rem, 5.2vw, 4.2rem)/1.04 var(--display);
  letter-spacing: -0.02em;
  margin: 10px 0 14px; max-width: 24ch;
  text-wrap: balance;
}
.hero-home h1 { font-size: clamp(2.4rem, 7vw, 5.6rem); max-width: 14ch; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); max-width: 52ch; margin: 0; color: #eef3f1; }
.crumb { color: var(--glacier); font-size: 0.95rem; text-decoration: none; margin-right: 14px; }
.crumb:hover { color: #fff; }
.photo-credit {
  position: absolute; right: 14px; bottom: 10px; z-index: 1;
  font-size: 0.75rem; color: rgba(255,255,255,0.7);
}

/* Плашка сложности — как метка на тропе */
.level {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 0.85rem/1 var(--body);
  padding: 6px 10px 6px 8px; border-radius: 4px;
  background: #fff; color: var(--juniper);
}
.level::before { content: ""; width: 12px; height: 12px; border-radius: 2px; background: currentColor; }
.level-easy::before { background: var(--easy); }
.level-medium::before { background: var(--medium); }
.level-hard::before { background: var(--hard); transform: rotate(45deg) scale(0.85); }

/* ---------- Текст ---------- */
.content {
  max-width: 1180px; margin: 0 auto; padding: 48px 20px 72px;
}
.content > p, .content > ul, .content > h2, .content > dl { max-width: var(--measure); }
.content h2 {
  font: 600 clamp(1.3rem, 2.2vw, 1.7rem)/1.2 var(--display);
  letter-spacing: -0.01em;
  margin: 2.4em 0 0.7em;
}
.content h2:first-child { margin-top: 0; }
.content p { margin: 0 0 1em; }
.content ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.content li { margin: 0 0 0.55em; padding-left: 0.2em; }
.content li::marker { color: var(--rowan); }
.route-link { font-weight: 600; }

/* «Коротко о маршруте» — сводка как на табличке у начала тропы */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  margin: 0 0 1.4em;
}
.facts div { background: var(--paper); padding: 14px 16px; }
.facts dt { font-size: 0.85rem; color: var(--stone); margin-bottom: 2px; }
.facts dd { margin: 0; font-weight: 600; line-height: 1.35; }

/* Карточки маршрутов на главной */
.cards {
  display: grid; gap: 18px;
  grid-template-columns: repeat(5, 1fr);
  margin: 0 0 1.5em;
}
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper); border-radius: 10px; overflow: hidden;
  text-decoration: none; color: var(--juniper);
  border: 1px solid var(--line);
}
.card img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--glacier-soft); }
.card .level { position: absolute; top: 12px; left: 12px; }
.card-title { font: 600 1.15rem/1.25 var(--display); padding: 16px 18px 4px; }
.card-text { padding: 0 18px 18px; color: var(--stone); font-size: 0.97rem; }
.card:hover { border-color: var(--juniper-2); color: var(--juniper); }
.card:hover .card-title { color: var(--rowan); }

/* ---------- Подвал ---------- */
.site-footer { background: var(--juniper); color: #d9e4e0; margin-top: 40px; position: relative; }
.ridge { position: absolute; left: 0; right: 0; top: -79px; width: 100%; height: 80px; fill: var(--juniper); }
.footer-inner {
  max-width: 1180px; margin: 0 auto; padding: 36px 20px 48px;
  display: grid; gap: 32px; grid-template-columns: 1.6fr repeat(3, 1fr);
}
.site-footer h3 { font: 600 0.95rem var(--display); color: #fff; margin: 0 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: #d9e4e0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-about .logo { color: #fff; font-size: 1.2rem; }
.footer-about p { max-width: 38ch; }
.small { font-size: 0.85rem; color: #a9bdb6; }

/* ---------- 404 ---------- */
.notfound .content { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; }
.notfound .logo { color: var(--juniper); margin-bottom: 40px; }
.notfound h1 { font: 700 clamp(2rem, 5vw, 3.4rem)/1.1 var(--display); margin: 0 0 16px; }

/* ---------- Телефон ---------- */
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  nav {
    display: none; position: absolute; left: 0; right: 0; top: 60px;
    background: var(--juniper); padding: 8px 12px 16px;
    max-height: calc(100vh - 60px); overflow-y: auto;
  }
  nav.open { display: block; }
  nav > ul { flex-direction: column; }
  .sub { position: static; display: block; background: transparent; padding: 0 0 0 14px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
  .hero-home { min-height: 70vh; }
}
@media (max-width: 520px) {
  body { font-size: 1rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .photo-credit { right: 10px; bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
