/* =============================================================
   Пасека «Гнездино» — стили сайта
   Тёмная сдержанная тема, один шрифт (Onest), никаких фреймворков.
   Все цвета и размеры собраны в переменных ниже — менять удобнее там.
   ============================================================= */

:root {
  --bg: #0f0e0c;          /* фон страницы */
  --bg-alt: #15130f;      /* фон «полос» через одну секцию */
  --panel: #1c1915;       /* карточки и панели */
  --line: rgba(240, 236, 228, 0.13);
  --line-soft: rgba(240, 236, 228, 0.07);

  --text: #f0ece4;        /* основной текст */
  --text-dim: rgba(240, 236, 228, 0.76);
  --muted: #9d968b;       /* подписи, вторичное */
  --accent: #c9a15c;      /* приглушённое золото с логотипа */
  --accent-soft: rgba(201, 161, 92, 0.12);

  --wrap: 1140px;
  --gutter: clamp(20px, 5vw, 48px);
  --radius: 8px;
  --radius-lg: 12px;

  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px; /* чтобы якорь не уезжал под шапку */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); max-width: 20ch; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

em { color: var(--muted); font-style: italic; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Текст только для скринридеров */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Ссылка «перейти к содержанию» — видна только при табуляции */
.skip-link {
  position: absolute;
  top: -100px; left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #171410;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.kicker {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

section { padding: clamp(72px, 11vh, 120px) 0; }

/* ---------- шапка ---------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  padding: 12px var(--gutter);
  transition: background-color .25s ease, border-color .25s ease;
  border-bottom: 1px solid transparent;
}

/* Класс вешает скрипт, когда страница прокручена ниже первого экрана */
.topbar.is-stuck {
  background: rgba(15, 14, 12, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line-soft);
}

.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.topbar.is-stuck .topbar-brand { opacity: 1; pointer-events: auto; }

.topbar-brand img { border-radius: 50%; }

.topbar-nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.topbar-nav a {
  padding: 8px 13px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.94rem;
  text-decoration: none;
  transition: color .2s ease, background-color .2s ease;
}

.topbar-nav a:hover { color: var(--text); background: rgba(240, 236, 228, 0.05); }

/* Текущий раздел подсвечивается при прокрутке (см. main.js) */
.topbar-nav a.is-current {
  color: var(--text);
  box-shadow: inset 0 -1px 0 var(--accent);
}

.burger {
  display: none;
  margin-left: auto;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 14, 12, 0.6);
  color: var(--text);
  cursor: pointer;
}

.burger-lines { display: grid; gap: 5px; }
.burger-lines i {
  display: block;
  width: 18px; height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s ease;
}
.burger[aria-expanded="true"] .burger-lines i:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] .burger-lines i:last-child { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 860px) {
  .burger { display: inline-flex; }
  .topbar-brand { opacity: 1; pointer-events: auto; }

  .topbar-nav {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: var(--gutter); right: var(--gutter);
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(15, 14, 12, 0.97);
    backdrop-filter: blur(12px);
  }

  .topbar-nav.is-open { display: flex; }
  .topbar-nav a { padding: 12px 14px; font-size: 1rem; }
}

/* ---------- первый экран ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 120px var(--gutter) 60px;
  text-align: center;
}

.hero-photo {
  position: absolute;
  inset: 0;
  background: url("https://commons.wikimedia.org/wiki/Special:FilePath/2016%20Pasieka%20w%20Trzebieszowicach%201.jpg?width=2000") center / cover;
  filter: saturate(0.85) brightness(0.8);
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 60% at 50% 45%, rgba(15,14,12,.6), rgba(15,14,12,.9) 70%),
    linear-gradient(180deg, rgba(15,14,12,.75), rgba(15,14,12,.85) 60%, var(--bg) 100%);
}

.hero-inner {
  position: relative;
  max-width: 720px;
}

.hero-logo {
  width: clamp(120px, 20vw, 168px);
  height: auto;
  margin: 0 auto 28px;
  border-radius: 50%;          /* логотип круглый, белый фон срезаем по кругу */
  border: 1px solid var(--line);
}

.hero h1 {
  font-size: clamp(2.2rem, 5.6vw, 3.6rem);
  letter-spacing: -0.03em;
}

.hero-lede {
  max-width: 52ch;
  margin: 20px auto 34px;
  color: var(--text-dim);
  font-weight: 300;
  font-size: clamp(1rem, 1.5vw, 1.1rem);
}

.hero-down {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.93rem;
  text-decoration: none;
  transition: border-color .2s ease, color .2s ease;
}

.hero-down:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- две колонки: «Место» и «Пасека» ---------- */

.place { background: var(--bg); }
.apiary { background: var(--bg-alt); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

/* Во втором блоке фотография слева — чтобы страница не выглядела одинаково */
.two-col--reverse .col-media { order: -1; }

.col-text p { color: var(--text-dim); font-weight: 300; max-width: 60ch; }
.col-text h2 { margin-bottom: 18px; }

.photo {
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background-size: cover;
  background-position: center;
}

.photo-place {
  background-image: url("https://commons.wikimedia.org/wiki/Special:FilePath/European%20honey%20bee%20extracts%20nectar.jpg?width=1200");
}

.photo-apiary {
  background-image: url("https://commons.wikimedia.org/wiki/Special:FilePath/Abeilles%20et%20ruches%2014.JPG?width=1200");
}

/* Три коротких факта под текстом про место */
.facts {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line-soft);
}

.facts li { color: var(--text-dim); font-weight: 300; font-size: 0.97rem; }
.facts span {
  display: block;
  color: var(--accent);
  font-weight: 500;
  font-size: 0.92rem;
}

/* Таймлайн истории пасеки */
.timeline {
  list-style: none;
  display: grid;
  gap: 18px;
  margin: 30px 0;
  padding: 0 0 0 22px;
  border-left: 1px solid var(--line);
}

.timeline li {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: baseline;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -26px; top: 11px;
  width: 7px; height: 7px;
  background: var(--accent);
}

.timeline-year { color: var(--accent); font-weight: 500; }
.timeline-text { flex: 1 1 260px; color: var(--text-dim); font-weight: 300; }

blockquote {
  margin: 0;
  padding-left: 20px;
  border-left: 2px solid var(--accent);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.5;
}

/* ---------- общая «шапка секции» ---------- */

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(18px, 4vw, 56px);
  align-items: end;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section-note {
  color: var(--muted);
  font-weight: 300;
  max-width: 46ch;
}

/* ---------- галерея ---------- */

.photos { background: var(--bg); }

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 200px;
  gap: 12px;
}

/* Снимок — это кнопка: по клику открывается крупный просмотр */
.shot {
  position: relative;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--panel);
  cursor: pointer;
}

.shot--tall { grid-row: span 2; }
.shot--wide { grid-column: span 2; }

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) brightness(0.88);
  transition: transform .4s ease, filter .3s ease;
}

.shot:hover img { transform: scale(1.03); filter: saturate(1) brightness(1); }

.shot-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 14px 12px;
  background: linear-gradient(transparent, rgba(15, 14, 12, 0.85));
  color: var(--text);
  font-size: 0.86rem;
  text-align: left;
}

@media (max-width: 860px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 160px; }
  .shot--wide { grid-column: span 2; }
  .shot--tall { grid-row: span 1; }
}

/* ---------- мёд ---------- */

.honey {
  background: var(--bg-alt);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.honey-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.honey-card {
  padding: 24px 22px;
  border: 1px solid var(--line-soft);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  background: rgba(28, 25, 21, 0.6);
}

.honey-card h3 { margin-bottom: 4px; }

.honey-when {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 0.86rem;
}

.honey-card p:last-child { color: var(--text-dim); font-weight: 300; font-size: 0.97rem; }

@media (max-width: 860px) {
  .honey-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- контакты ---------- */

.contacts {
  background:
    linear-gradient(rgba(15,14,12,.94), rgba(15,14,12,.97)),
    url("https://commons.wikimedia.org/wiki/Special:FilePath/Runny%20hunny.jpg?width=1600") center / cover;
}

.contacts-inner { max-width: 760px; }
.contacts-lede { margin-top: 18px; color: var(--text-dim); font-weight: 300; max-width: 56ch; }

.contact-list {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 34px 0 0;
  padding: 0;
}

.contact-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: rgba(28, 25, 21, 0.5);
  text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease;
}

.contact-list a:hover { border-color: var(--line); background: rgba(28, 25, 21, 0.8); }

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
}

.contact-body { display: grid; color: var(--muted); font-size: 0.87rem; font-weight: 300; }
.contact-body strong { color: var(--text); font-size: 0.98rem; font-weight: 500; }

/* ---------- подвал ---------- */

.site-footer {
  padding: clamp(48px, 7vh, 72px) 0 28px;
  background: var(--bg-alt);
  border-top: 1px solid var(--line-soft);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 32px;
}

.footer-brand { display: flex; align-items: center; gap: 16px; }
.footer-brand img { border-radius: 50%; border: 1px solid var(--line); }

.footer-name { margin: 0 0 4px; font-weight: 600; }
.footer-about { margin: 0; color: var(--muted); font-weight: 300; font-size: 0.92rem; max-width: 38ch; }

.footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }

.footer-nav a {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 300;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}

.footer-nav a:hover { color: var(--accent); border-color: var(--accent); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  color: rgba(157, 150, 139, 0.8);
  font-size: 0.78rem;
  font-weight: 300;
}

.footer-bottom p { margin: 0; }
.credits { max-width: 62ch; }

/* ---------- просмотр фотографии крупно ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(8, 7, 6, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lightbox[hidden] { display: none; }

.lightbox-figure {
  margin: 0;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lightbox-figure img {
  max-height: 78vh;
  width: auto;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  object-fit: contain;
}

.lightbox-figure figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 300;
  text-align: center;
}

.lightbox-nav, .lightbox-close {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(28, 25, 21, 0.7);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}

.lightbox-nav:hover, .lightbox-close:hover { border-color: var(--accent); color: var(--accent); }

.lightbox-close {
  position: absolute;
  top: clamp(12px, 3vw, 28px);
  right: clamp(12px, 3vw, 28px);
}

@media (max-width: 680px) {
  .lightbox-nav {
    position: absolute;
    bottom: 24px;
  }
  .lightbox-prev { left: 24px; }
  .lightbox-next { right: 24px; }
}

/* ---------- адаптив для крупных блоков ---------- */

@media (max-width: 980px) {
  .two-col { grid-template-columns: 1fr; }
  .two-col--reverse .col-media { order: 0; }
  .col-media { max-width: 460px; }
  .section-head { grid-template-columns: 1fr; align-items: start; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .honey-grid { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; }
}

/* Уважаем системную настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
