/* ---------- БАЗА ---------- */
:root{
  --paper: #fff8ee;
  --ink:   #1a1a1a;

  /* Акценты */
  --olive:       #2f6d4f;
  --olive-dark:  #24533d;
  --gold:        #c89a5b;
  --gold-dark:   #a97f49;

  /* Шапка/футер */
  --header-bg:   #234e52;
  --footer-bg:   #234e52;
  --header-text: #ffffff;

  --container-w: 1080px;
  --radius: 14px;
  --shadow: 0 6px 18px rgba(0,0,0,.08);
  --soft-shadow: 0 2px 10px rgba(0,0,0,.06);

  /* Габариты */
  --header-h: 64px;
  --footer-h: 60px; /* базовая высота футера */
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  text-rendering: optimizeLegibility;

  /* резерв под фикс-футер + iOS safe-area */
  padding-bottom: calc(var(--footer-h) + env(safe-area-inset-bottom, 0px));
}

h1,h2,h3{
  font-family: Merriweather, Georgia, "Times New Roman", serif;
  margin: .2rem 0 .6rem;
  color: #234736;
}

/* ссылки в контенте */
a{ color: var(--olive); text-decoration: none; }
/* раньше здесь был белый цвет и на светлом фоне ссылки «исчезали» */
a:hover{ color: var(--olive-dark); text-decoration: none; }

.container{
  width: min(100% - 2rem, var(--container-w));
  margin-inline: auto;
}

/* ---------- ШАПКА ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  color: var(--header-text);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  backdrop-filter: saturate(110%);
  min-height: var(--header-h);
}
.site-header__inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}
.brand{ display:flex; align-items:center; gap:.6rem; }
.brand__name{
  font-family: Merriweather, Georgia, serif;
  font-weight: 700;
  letter-spacing: .2px;
  font-size: 1.1rem;
  color: var(--header-text);
}

/* справа: «Войти» / аккаунт + гамбургер */
.header-actions{ display:flex; align-items:center; gap:.6rem; }
/* мобильная кнопка — скрыта на десктопе */
.mobile-login{ display:none !important; }

/* ---------- НАВИГАЦИЯ ---------- */
.nav{ display:flex; align-items:center; gap:1.25rem; flex:1; justify-content:center; }
.nav__list{
  display:flex; align-items:center; gap:1rem;
  padding:0; margin:0; list-style:none;
}
.nav__item--mobile-cta{ display:none; }
.nav__actions{ display:flex; align-items:center; }

.nav__link{
  position:relative; display:inline-block;
  padding:.5rem .9rem; border-radius:999px;
  color:var(--header-text); font-weight:600; letter-spacing:.2px;
  transition: background-color .2s ease, color .2s ease;
}
.nav__link:hover{ background:rgba(255,255,255,.08); }
.nav__link::after{
  content:""; position:absolute; left:12px; right:12px; bottom:6px;
  height:2px; border-radius:2px;
  background:linear-gradient(90deg, var(--gold), var(--gold-dark));
  transform:scaleX(0); transform-origin:center;
  opacity:.95; transition:transform .22s ease;
}
.nav__link:hover::after, .nav__link:focus-visible::after{ transform:scaleX(1); }
.nav__link.is-active{ background:rgba(255,255,255,.12); color:#fff; }
.nav__link.is-active::after{ transform:scaleX(1); }

/* ---------- КНОПКИ ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:.5rem; padding:.55rem 1rem; border-radius:999px;
  border:1px solid transparent; font-weight:700; cursor:pointer;
  transition: transform .06s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:active{ transform: translateY(1px); }
.btn:focus-visible{ outline:3px solid var(--gold); outline-offset:2px; }
.btn--primary{ background:#2a7a5a; color:#fff; box-shadow:0 4px 12px rgba(0,0,0,.18); }
.btn--primary:hover{ background:#216249; }
.btn--block{ display:block; width:100%; text-align:center; }

/* ---------- ГАМБУРГЕР ---------- */
.nav-toggle{
  display:none; width:40px; height:40px;
  align-items:center; justify-content:center;
  border:1px solid rgba(255,255,255,.25);
  border-radius:10px; background:transparent; color:var(--header-text);
  transition:border-color .2s ease, background-color .2s ease;
}
.nav-toggle .bar{
  display:block; width:20px; height:2px; background:var(--header-text);
  margin:3px 0; transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1){ transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3){ transform: translateY(-5px) rotate(-45deg); }

/* ---------- КОНТЕНТ ---------- */
.hero{ padding: clamp(2rem, 4vw, 3rem) 0 1rem; }
.hero__title{ font-size: clamp(1.6rem, 3vw, 2rem); }
.hero__subtitle{ color:#5b544a; }

/* ---------- ПОДВАЛ (переразмещение) ---------- */
.site-footer{
  position: fixed;
  left:0; right:0; bottom:0;
  min-height: var(--footer-h);
  background: var(--footer-bg);
  color: var(--header-text);
  box-shadow: 0 -2px 8px rgba(0,0,0,.15);
  z-index: 40;
  display:flex; align-items:center;
  padding: 0;
}
.site-footer__inner{
  width: min(100% - 2rem, var(--container-w));
  margin-inline:auto;

  /* сетка из трёх равных колонок */
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items:center;
  gap: .5rem 1rem;

  padding: .75rem 0 calc(.6rem + env(safe-area-inset-bottom, 0px));
  font-size:.92rem;
}

/* левая колонка: ссылки с точками-разделителями */
.footer-nav{
  display:flex; flex-wrap:wrap; align-items:center;
  gap:.5rem 0;
  justify-self:start;
}
.footer-nav a{
  color:#e6f1ef; padding:.25rem .5rem; border-radius:8px;
}
.footer-nav a:hover{ color:#fff; background:rgba(255,255,255,.08); }
.footer-nav a + a::before{
  content:"•";
  margin: 0 .25rem 0 .15rem;
  opacity:.55;
}

/* центр: контакты */
.footer-contacts{
  justify-self:center; text-align:center; opacity:.95;
}
.footer-contacts a{ color:#e6f1ef; }
.footer-contacts a:hover{ color:#fff; }

/* правая колонка: копирайт */
.footer-copy{
  justify-self:end; text-align:right; opacity:.9;
}

/* общие ссылки в футере */
.site-footer a{ text-decoration:none; }
.site-footer a:hover{ text-decoration:none; }

/* ---------- ДОСТУПНОСТЬ ---------- */
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

.brand__logo{
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff8;
  padding: 2px;
}

/* ---------- АНИМАЦИИ МЕНЮ ---------- */
@keyframes menuPop{ from{ transform: translateY(-8px) scale(.98); opacity:0; } to{ transform:translateY(0) scale(1); opacity:1; } }
@keyframes itemIn{  from{ transform: translateY(-6px); opacity:0; } to{ transform:translateY(0); opacity:1; } }

/* ---------- АДАПТИВ ---------- */
@media (max-width: 900px){
  /* показываем мобильную кнопку Войти в шапке */
  .mobile-login{
    display:inline-flex !important;
    height:36px; padding:.45rem .9rem; border-radius:999px;
  }
  .nav__actions{ display:none; }
  .nav-toggle{ display:inline-flex; }

  /* выпадающее меню */
  .nav{
    z-index: 100;
    position:absolute; right:1rem; left:1rem; top:var(--header-h);
    display:block; background:#fff;
    border:1px solid rgba(0,0,0,.12);
    border-radius: var(--radius);
    padding:.75rem; box-shadow: var(--shadow);
    transform-origin: top right; transform: scale(.98);
    opacity:0; visibility:hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s step-end;
    margin-bottom: calc(var(--footer-h) + 8px);
  }
  .nav.open{
    transform: scale(1); opacity:1; visibility:visible;
    transition: opacity .2s ease, transform .2s ease, visibility .2s step-start;
    animation: menuPop .22s ease-out;
  }
  .nav__list{ display:flex; flex-direction:column; align-items:stretch; gap:.25rem; }
  .nav.open .nav__list > li{ animation: itemIn .2s ease-out both; }
  .nav.open .nav__list > li:nth-child(1){ animation-delay:.02s; }
  .nav.open .nav__list > li:nth-child(2){ animation-delay:.05s; }
  .nav.open .nav__list > li:nth-child(3){ animation-delay:.08s; }
  .nav.open .nav__list > li:nth-child(4){ animation-delay:.11s; }

  .site-header .nav .nav__link{ color:var(--ink); background:transparent; border-radius:10px; padding:.6rem .8rem; }
  .site-header .nav .nav__link:hover{ background: rgba(0,0,0,.05); }
  .site-header .nav .nav__link::after{ left:10px; right:10px; bottom:8px; background: linear-gradient(90deg, var(--olive), var(--olive-dark)); }
  .site-header .nav .nav__link.is-active{ background: rgba(47,109,79,.10); color: var(--olive-dark); }

  /* футер — в столбик */
  :root{ --footer-h: 96px; }
  .site-footer__inner{
    grid-template-columns: 1fr;
    text-align:center;
    gap:.35rem;
    padding:.6rem 0 calc(.6rem + env(safe-area-inset-bottom, 0px));
  }
  .footer-nav{ justify-content:center; justify-self:center; }
  .footer-nav a + a::before{ margin: 0 .35rem; }
  .footer-contacts{ justify-self:center; }
  .footer-copy{ justify-self:center; text-align:center; }
}

/* если пользователь отключил анимации */
@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; animation:none !important; }
}

/* ===== Аккаунт в шапке ===== */
.account{ position: relative; }
.account-btn{
  display:inline-flex; align-items:center; gap:.5rem;
  padding:.4rem .6rem; border-radius:999px;
  background: rgba(255,255,255,.08);
  color:#fff; border:1px solid rgba(255,255,255,.18);
  cursor:pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .03s;
}
.account-btn:hover{ background: rgba(255,255,255,.14); }
.account-btn:active{ transform: translateY(1px); }
.account-btn:focus-visible{ outline:0; box-shadow:0 0 0 3px rgba(200,154,91,.5); }

.account-name{ font-weight:700; letter-spacing:.2px; }
.account .chev{ opacity:.9; }

/* аватар (инициалы) */
.avatar{
  display:inline-grid; place-items:center;
  width:28px; height:28px; border-radius:50%;
  font-size:.8rem; font-weight:800;
  background: linear-gradient(135deg, #2a7a5a, #24533d);
  color:#fff;
}
.avatar.big{ width:44px; height:44px; font-size:1rem; }

/* дропдаун */
.account-menu{
  position:absolute; right:0; top:calc(100% + 8px);
  width: 280px;
  background:#fff; color:#1a1a1a;
  border:1px solid rgba(0,0,0,.08);
  border-radius:12px; box-shadow: 0 16px 40px rgba(0,0,0,.18);
  padding:.6rem; z-index: 120;
}
.account-card{
  display:flex; align-items:center; gap:.6rem;
  padding:.5rem; border-radius:10px;
  background:#f9f6f0; border:1px solid #efe6d6;
  margin-bottom:.4rem;
}
.account-card .info .name{ font-weight:800; }
.account-card .info .email{ color:#6d6256; font-size:.92rem; }

.account-link{
  display:block; padding:.6rem .6rem; border-radius:10px;
  color:#234736; font-weight:700; text-decoration:none;
}
.account-link:hover{ background:#f5efe4; }

.logout-form{ margin-top:.2rem; }
.account-logout{
  width:100%; padding:.65rem .8rem; border-radius:10px;
  background:#ffeceb; color:#7a2b33; border:1px solid #f3c0c4;
  font-weight:800; cursor:pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.account-logout:hover{ background:#ffdede; }

/* УБРАЛИ правило, прятавшее аккаунт на десктопе */
/* @media (min-width: 901px){ .header-actions .account{ display:none; } } */

/* На случай, если раньше был дубликат аккаунта внутри .nav__actions — скрываем его на мобилке */
@media (max-width: 900px){
  .nav__actions .account { display: none; }
}
