/* ============================================================
   Каркас страницы — шапка, навигация, подвал
   ============================================================ */

@layer layout {

  /* ---------- Шапка ---------- */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    padding: 16px 0;
    background: color-mix(in srgb, var(--bg-4) 92%, transparent);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    border-bottom: 1px solid var(--line-gold);
  }

  .site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: -.015em;
    color: var(--ink);
  }
  .brand__mark {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    color: var(--gold);
    display: inline-flex;
  }
  .brand__mark svg { width: 100%; height: 100%; color: var(--gold); }

  /* ---------- Навигация ---------- */
  .site-nav { display: flex; }

  .nav-list {
    display: flex;
    gap: 4px;
    align-items: center;
  }
  .nav-list a {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    font-size: 13.5px;
    letter-spacing: .005em;
    color: var(--ink-2);
    border-radius: var(--r-pill);
    white-space: nowrap;
    transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  }
  .nav-list a:hover,
  .nav-list a.is-current { color: var(--ink); background: var(--bg-2); }
  .nav-list .is-current { color: var(--gold-lo); font-weight: 500; }

  .nav-cta {
    margin-left: 10px;
    padding: 11px 20px;
    background: var(--ink);
    border-radius: var(--r-pill);
    font-weight: 600;
    white-space: nowrap;
  }
  /* Специфичность 0,2,0 — бьёт .nav-list a (0,1,1) */
  .nav-list .nav-cta { color: var(--bg); }
  .nav-list .nav-cta:hover { color: var(--bg); background: var(--ink-2); }

  /* ---------- Переключатель темы ---------- */
  .theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    margin-right: 8px;
  }
  .theme-switch button {
    width: 28px;
    height: 28px;
    border-radius: var(--r-pill);
    display: grid;
    place-items: center;
    color: var(--ink-3);
    transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  }
  .theme-switch button.is-active { background: var(--ink); color: var(--bg); }
  .theme-switch button svg { width: 14px; height: 14px; }

  /* ---------- Бургер ---------- */
  .nav-burger {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--ink);
  }
  .nav-burger:hover { background: var(--bg-2); }

  @media (max-width: 920px) {
    .nav-list { display: none; }
    .nav-burger { display: flex; }
  }

  /* ---------- Подвал ---------- */
  .site-footer {
    background: #1E1912;
    color: var(--ink-on-dark);
    padding: clamp(56px, 7vw, 72px) 0 40px;
    position: relative;
    z-index: 1;
    border-top: 2px solid rgba(210, 166, 90, .4);
  }
  /* Тонкое золотое свечение сверху футера */
  .site-footer::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 120px;
    background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(185, 138, 62, .10), transparent 70%);
    pointer-events: none;
  }

  .site-footer__grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: clamp(32px, 4vw, 56px);
    margin-bottom: clamp(48px, 6vw, 72px);
    position: relative;
  }

  .site-footer .brand { color: var(--ink-on-dark); margin-bottom: 18px; }
  .site-footer .brand__mark { color: var(--gold-hi); }

  .site-footer__lead {
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-on-dark-2);
    max-width: 38ch;
  }

  .site-footer h3 {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold-hi);
    margin-bottom: 18px;
  }

  .site-footer__col,
  .site-footer__grid ul {
    display: flex;
    flex-direction: column;
    gap: 11px;
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .site-footer__col a,
  .site-footer__grid ul a {
    font-size: 14px;
    color: rgba(242, 238, 223, .55);
    transition: color var(--t-fast) var(--ease);
  }
  .site-footer__col a:hover,
  .site-footer__grid ul a:hover { color: var(--gold-hi); }

  .site-footer__bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(242, 238, 223, .10);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(242, 238, 223, .28);
    position: relative;
  }
  .site-footer__bottom a { color: rgba(242, 238, 223, .42); }
  .site-footer__bottom a:hover { color: var(--gold-hi); }

  @media (max-width: 900px) {
    .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 36px 32px; }
  }
  @media (max-width: 560px) {
    .site-footer__grid { grid-template-columns: 1fr; }
  }

}

/* WordPress brand media fallback */
.brand__mark img {
  display: block;
  width: 100%;
  height: 100%;
}
