/* ==========================================================
   1. FOUNDATION — vars, reset, базовая типографика
   ========================================================== */

:root {
  --bg: #f4f3ee;
  --navy: #191b2a;
  --grey-nav: #8a8d9e;
  --border: #d8d6cf;
  --green: #269e26;
  --card-w: 380px;
  --header-h: 64px;
  --tg: #229ed9;
  --wa: #17b169;
  --vk: #0077ff;
  --max-w: 1360px;
  --article-w: 720px;
  --star: #f5a623;
}

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

body {
  background: var(--bg);
  color: var(--navy);
  font-family: 'Manrope', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

body.no-scroll { overflow: hidden; }

/* ==========================================================
   2. SHARED — header / nav / footer / мобильное меню
   ========================================================== */

/* ── site-header (используется на всех страницах кроме single/single-home) ── */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #fff;
}
.site-header .header-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: var(--header-h, 64px);
  padding: 0 40px;
  border-bottom: 0.5px solid var(--border);
  gap: 24px;
}
.site-header .logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-header .once-logo-svg { width: 30px; height: 30px; flex-shrink: 0; }

.site-header .nav-links {
  margin-left: auto;
  display: flex;
  gap: 28px;
  align-items: center;
}
.site-header .nav-links > a,
.site-header .nav-more-btn {
  font-size: 15px;
  font-weight: 500;
  color: var(--grey-nav);
  text-decoration: none;
  transition: color 0.15s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.site-header .nav-links > a:hover,
.site-header .nav-more-btn:hover { color: var(--navy); }
.site-header .nav-links > a.active { color: var(--navy); font-weight: 700; }

/* Dropdown «Ещё» — раскрытие по hover */
.site-header .nav-more { position: relative; }
.site-header .nav-more-btn iconify-icon { font-size: 14px; transition: transform 0.2s; }
.site-header .nav-more:hover .nav-more-btn,
.site-header .nav-more:focus-within .nav-more-btn { color: var(--navy); }
.site-header .nav-more:hover .nav-more-btn iconify-icon,
.site-header .nav-more:focus-within .nav-more-btn iconify-icon { transform: rotate(180deg); }
.site-header .nav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  padding-top: 14px;
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  z-index: 210;
}
.site-header .nav-dropdown-inner {
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 0;
  box-shadow: 0 16px 44px rgba(25,27,42,0.10);
}
.site-header .nav-more:hover .nav-dropdown,
.site-header .nav-more:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.site-header .nav-dropdown a {
  display: block;
  padding: 10px 20px;
  font-size: 14.5px;
  color: var(--navy);
  text-decoration: none;
  opacity: 0.82;
  transition: opacity 0.15s, background 0.15s;
}
.site-header .nav-dropdown a:hover { background: var(--bg); opacity: 1; }

/* Burger */
.site-header .nav-burger {
  display: none;
  background: none;
  border: none;
  color: var(--navy);
  padding: 8px;
  cursor: pointer;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
}
.site-header .nav-burger:hover { background: var(--bg); }
.site-header .nav-burger svg { width: 22px; height: 22px; display: block; }

/* Бургер — переключение на X при открытом меню */
.site-header .nav-burger .burger-close { display: none; }
.site-header .nav-burger[aria-expanded="true"] .burger-open { display: none; }
.site-header .nav-burger[aria-expanded="true"] .burger-close { display: block; }

/* Мобильное меню — выезжает из-под хедера, сам хедер не трогаем */
.mobile-menu {
  position: fixed;
  top: var(--header-h, 64px);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 199;
  display: flex;
  flex-direction: column;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s, visibility 0.28s;
  pointer-events: none;
}
.mobile-menu[data-open="true"] {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.mobile-menu-links {
  display: flex;
  flex-direction: column;
  padding: 14px 20px 28px;
  overflow-y: auto;
  flex: 1;
}
.mobile-menu-links a {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--navy);
  text-decoration: none;
  padding: 16px 0;
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-menu-links a:last-child { border-bottom: none; }
.mobile-menu-links a svg { opacity: 0.35; }

@media (max-width: 840px) {
  .site-header .header-inner { padding: 0 16px; gap: 12px; }
  .site-header .nav-links { display: none; }
  .site-header .nav-burger { display: inline-flex; }
  .site-header .logo-link { font-size: 14px; }
}

/* ── Footer (single/single-home) ── */
.site-footer {
  border-top: 0.5px solid var(--border);
  padding: 40px 0 56px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--grey-nav);
}
.footer-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--grey-nav);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--navy); }
.footer-links .footer-sep {
  color: var(--border);
  user-select: none;
  font-weight: 400;
}

@media (max-width: 840px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 18px; padding: 0 16px; }
  .footer-links { gap: 14px 22px; }
  .footer-links .footer-sep { display: none; }
}

/* ── Общие msg-bubbles (36px вариант, используется во многих страницах) ── */
.msg-bubbles {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
  margin-left: 2px;
}

.msg-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.msg-bubble:hover { opacity: 0.7; }
.msg-bubble svg { display: block; overflow: visible; }


/* ── Generic container utility ── */
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 40px; }
@media (max-width: 760px) { .wrap { padding: 0 20px; } }

/* ── Search dropdown (shared across home/archive/category) ── */
.hero-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 52px rgba(25,27,42,0.22), 0 2px 6px rgba(25,27,42,0.10);
  max-height: 460px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  isolation: isolate;
}
.hero-search-results.is-visible { display: block; }
.hero-search-result {
  display: block;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--navy);
  background: #ffffff;
  transition: background 0.15s;
  cursor: pointer;
}
.hero-search-result:last-child { border-bottom: none; }
.hero-search-result:hover,
.hero-search-result:focus { background: var(--bg); }
.hero-search-result-title { font-size: 15.5px; font-weight: 600; color: var(--navy); line-height: 1.4; }
.hero-search-result-cat { font-size: 13px; color: var(--grey-nav); margin-top: 4px; }
.hero-search-noresult { padding: 16px 20px; font-size: 14px; color: var(--grey-nav); font-style: italic; background: #ffffff; }
