/* ============================================================
   Fakeradar — Shared chrome (layout, sidebar, brand, footer, bottom-nav)
   Mobile-first. One structural breakpoint at --bp (768px).
   Depends on tokens.css.
   ============================================================ */

/* ---------- App shell ---------- */
.app {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  min-height: 100vh;
}
.main-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ---------- Content area ---------- */
.content {
  width: 100%;
  flex: 1;
  padding: var(--s6) var(--s5) var(--s8);   /* 20 16 32 — footer follows; its own clearance handles the nav */
}

/* ---------- Content card (decorative frame for text pages: faq/about/contacts/agreement)
   Mobile: edge-to-edge, no frame. Desktop: rounded-top frame image + inset padding. ---------- */
.content-card { width: 100%; }

/* ============================================================
   NAV ICONS (shared mask mechanism: stroke = inactive, fill = active)
   Recolored via background + CSS mask, so rest/hover/active = color only.
   ============================================================ */
.ico {
  display: block;
  background: var(--muted);
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
  transition: background 0.15s;
}
.ico--home     { -webkit-mask-image: url('../images/nav/home-stroke.svg');     mask-image: url('../images/nav/home-stroke.svg'); }
.ico--faq      { -webkit-mask-image: url('../images/nav/faq-stroke.svg');      mask-image: url('../images/nav/faq-stroke.svg'); }
.ico--corp     { -webkit-mask-image: url('../images/nav/about-stroke.svg');    mask-image: url('../images/nav/about-stroke.svg'); }
.ico--reach    { -webkit-mask-image: url('../images/nav/contacts-stroke.svg'); mask-image: url('../images/nav/contacts-stroke.svg'); }
.is-active .ico--home  { -webkit-mask-image: url('../images/nav/home-fill.svg');     mask-image: url('../images/nav/home-fill.svg'); }
.is-active .ico--faq   { -webkit-mask-image: url('../images/nav/faq-fill.svg');      mask-image: url('../images/nav/faq-fill.svg'); }
.is-active .ico--corp  { -webkit-mask-image: url('../images/nav/about-fill.svg');    mask-image: url('../images/nav/about-fill.svg'); }
.is-active .ico--reach { -webkit-mask-image: url('../images/nav/contacts-fill.svg'); mask-image: url('../images/nav/contacts-fill.svg'); }

/* ============================================================
   SIDEBAR (desktop only)
   ============================================================ */
.sidebar { display: none; }

/* ============================================================
   BRAND PILL (mobile only) — centered top
   ============================================================ */
.brandbar {
  display: flex;
  justify-content: center;
  padding: var(--s4) var(--s5) var(--s2);
}
/* wordmark SVG already carries its own #F1F4F9 pill background */
.brandbar svg { height: 34px; width: auto; }

/* ============================================================
   FOOTER — mobile: stacked
   Last element on the page; reserve space so the © line clears the fixed bottom-nav (80px).
   ============================================================ */
.site-footer {
  padding: var(--s7) var(--s5);
  padding-bottom: calc(80px + env(safe-area-inset-bottom) + var(--s6));
}

.footer__social {
  display: flex;
  align-items: center;
  gap: var(--s7);
  padding-bottom: var(--s7);
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}
.social-link:hover { color: var(--primary-50); }   /* только текст — иконки с фиксированными заливками */
.social-link__icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  padding: var(--s7) 0;
  border-top: 1px solid var(--border);
}
.footer__links a {
  font-size: 1.25rem;          /* 20px — large tap targets on mobile */
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s;
}
.footer__links a:hover { color: var(--primary-50); }

.footer__copy {
  text-align: center;
  font-size: 0.75rem;
  color: var(--n-60);
  padding-top: var(--s7);
  border-top: 1px solid var(--border);
}

/* ============================================================
   BOTTOM NAV (mobile only) — fixed overlay
   ============================================================ */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 80px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  color: var(--muted);
  font-size: 0.6875rem;        /* 11px */
  font-weight: 500;
  text-decoration: none;
  padding: var(--s3) var(--s4);
}
.bnav-item .ico { width: 26px; height: 26px; }
.bnav-item:hover { color: var(--text); }
.bnav-item:hover .ico { background: var(--text); }
.bnav-item.is-active { color: var(--text); font-weight: 600; }
.bnav-item.is-active .ico { background: var(--text); }

/* ============================================================
   DESKTOP  (≥ 768px)
   layout: sidebar 106 + content 1228 + right gutter 106 = 1440
   ============================================================ */
@media (min-width: 768px) {

  .app { display: flex; }

  /* --- sidebar: fixed (stays put while the page scrolls).
     left aligns to the .app column on viewports wider than --page-max;
     main-wrapper reserves the column via padding-left. --- */
  .sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    top: 0;
    /* 100%, не 100vw: % у fixed-элемента считается без классического скроллбара —
       ровно как центрируется .app (margin-inline:auto); 100vw давал сдвиг на полскроллбара */
    left: max(0px, calc((100% - var(--page-max)) / 2));
    height: 100vh;
    overflow-y: auto;                 /* низкие окна: нижние пункты меню доскролливаются */
    width: var(--sidebar-w);          /* 106 */
    padding-top: var(--s10);          /* 48 */
    gap: var(--s8);
  }
  .sidebar__logo { width: 52px; height: 52px; flex-shrink: 0; }
  .sidebar__logo svg { width: 52px; height: 52px; }
  .sidebar__nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s7);                   /* 24 */
    width: 100%;
  }
  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s1);
    width: 100%;
    padding: var(--s3) 0;
    color: var(--muted);
    font-size: 0.6875rem;             /* 11 */
    font-weight: 500;
    text-decoration: none;
    position: relative;
    transition: color 0.15s;
  }
  .nav-item .ico { width: 30px; height: 30px; }
  .nav-item:hover { color: var(--text); }
  .nav-item:hover .ico { background: var(--text); }
  .nav-item.is-active { color: var(--text); font-weight: 600; }
  .nav-item.is-active .ico { background: var(--text); }

  /* --- main / content ---
     main-wrapper reserves a right gutter equal to the sidebar → symmetric layout
     (sidebar 106 | content | gutter 106). The content fills what's left, so it
     SHRINKS IMMEDIATELY as the window narrows below 1440 instead of the right
     gutter collapsing first. content-box ≤ 1228 at all times. --- */
  .main-wrapper { flex: 1; padding-left: var(--sidebar-w); padding-right: var(--sidebar-w); }
  .content {
    max-width: var(--content-max);    /* cap 1228; below 1440 it scales with the viewport */
    padding: var(--s10) 0 var(--s10); /* 48 0 48 */
  }

  /* --- content card: page-level decorative frame (desktop only).
     The "complex border" wraps the WHOLE page content with double inset padding;
     inner content (e.g. FAQ accordion) sits at its own width inside. --- */
  .content-card {
    background: var(--bg) url('../images/background.png') no-repeat top center;
    background-size: contain;
    padding: 3.25rem clamp(2rem, 8vw, 6.5rem) 0;   /* 52 top, 32→104 sides (double inset) */
  }

  /* --- brand pill hidden on desktop (lives in sidebar) --- */
  .brandbar { display: none; }

  /* --- bottom nav hidden on desktop --- */
  .bottom-nav { display: none; }

  /* --- footer: single row --- */
  .site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    padding: 4.5rem 0 1rem;     /* 72 top · 0 sides · 16 bottom (per design) */
    max-width: var(--content-max);
  }
  .footer__social { padding-bottom: 0; }
  .footer__links {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    padding: 0;
    border-top: 0;
  }
  .footer__links a {
    font-size: 0.875rem;              /* 14 */
    font-weight: 400;
    padding: var(--s1) var(--s4);
    border-right: 1px solid var(--border);
  }
  .footer__links a:last-child { border-right: 0; padding-right: 0; }
  .footer__copy {
    width: 100%;
    text-align: center;
    padding-top: var(--s4);
    margin-top: var(--s1);
  }
}
