/* Bug 1 fix (Phase 11.8.100, chat web-1b3f6ffe): reserve space for header
   placeholder before layout.js injects it. Prevents layout shift on page load.
   --header-h is defined in /api/theme/css; fallback 60px matches default. */
#site-header {
  min-height: var(--header-h, 60px);
}

/* B1 fix: hide hamburger on desktop (base rule, outside media queries) */
.l-nav-hamburger {
  display: none;
}

/* ============================================================
   Base nav styles for landing pages
   Extracted from landing-HTML inline <style> (CTX-FRONTEND-CSS-REFACTOR-v1)
   Previously duplicated in 9 HTML files (index, about, consent, consultants,
   contacts, how-it-works, offer, privacy, terms) causing cascade conflicts
   with the responsive rules below (FE-2-B6 root cause). Now centralized here.
   CSS variable fallbacks preserve page-specific theming (e.g. index.html uses
   --nav-link-color, --nav-cta-pad, --nav-cta-size, --btn-bg-h).
   ============================================================ */
.l-nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
  align-items: center;
}
.l-nav-link {
  padding: 7px 14px;
  border-radius: var(--r-btn);
  font-size: var(--small-size);
  font-weight: 500;
  color: var(--nav-link-color, var(--gray-500));
  transition:
    color var(--trans-fast),
    background var(--trans-fast);
  white-space: nowrap;
}
.l-nav-link:hover {
  color: var(--primary);
  background: var(--accent-ghost);
}
.l-nav-link.active {
  color: var(--primary);
  font-weight: 700;
  background: var(--accent-ghost);
}
.l-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  padding: var(--nav-cta-pad, 8px 18px);
  border-radius: var(--r-btn);
  font-size: var(--nav-cta-size, var(--small-size));
  font-weight: 600;
  margin-left: 8px;
  transition: background var(--trans-fast);
  white-space: nowrap;
}
.l-nav-btn:hover {
  background: var(--btn-bg-h, var(--primary-dark));
}

/* ============================================================
   Mobile-responsive layout for landing pages
   Breakpoints: 768px (tablet), 480px (phone)
   Desktop rendering: UNCHANGED
   ============================================================ */

/* ---- Tablet ≤768px ---- */
@media (max-width: 768px) {
  /* Header */
  .l-header-inner {
    padding: 0 16px;
    height: 56px;
  }
  .l-logo {
    font-size: 14px;
  }

  /* Show hamburger, hide nav links */
  .l-nav-hamburger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 24px;
    color: var(--text);
    border-radius: var(--r);
    transition: background 0.15s;
  }
  .l-nav-hamburger:hover {
    background: var(--accent-ghost);
  }
  .l-nav {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    flex-direction: column;
    padding: 20px;
    gap: 4px;
    z-index: 200;
    display: none !important;
    overflow-y: auto;
  }
  .l-nav.open {
    display: flex !important;
  }
  /* B2 fix: show nav links when mobile menu is open (overrides index.html inline `@media (max-width:600px){.l-nav-link{display:none}}`) */
  .l-nav.open .l-nav-link {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    width: 100%;
    text-align: left;
  }
  .l-nav-link {
    padding: 14px 16px;
    font-size: 16px;
    border-radius: var(--r);
  }
  .l-nav-btn {
    margin-left: 0;
    margin-top: 8px;
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 16px;
  }

  /* Hero */
  .l-hero {
    padding: 56px 16px 48px;
  }
  .l-hero h1 {
    font-size: 28px;
    line-height: 1.25;
  }
  .l-hero-sub {
    font-size: 15px;
  }
  .l-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .l-hero-actions .btn-pri,
  .l-hero-actions .btn-sec {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .l-trust-strip {
    gap: 16px;
  }
  .l-trust-item {
    flex: 1 1 40%;
    min-width: 120px;
  }

  /* Widgets */
  .l-widgets-grid {
    grid-template-columns: 1fr;
  }
  .l-widgets-section {
    padding: 48px 16px;
  }
  .l-widget {
    padding: 24px 20px;
  }

  /* Sections */
  .l-section {
    padding: 48px 16px;
  }
  .l-section-alt {
    padding: 48px 16px;
  }
  .l-inner {
    padding: 0;
  }

  /* FAQ */
  .l-faq-wrap {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* CTA */
  .l-cta {
    padding: 48px 16px;
  }
  .l-cta h2 {
    font-size: 24px;
  }
  .l-cta p {
    margin-bottom: 24px;
  }
  .l-cta-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .l-cta-actions .btn-pri,
  .l-cta-actions .btn-amber,
  .l-cta-actions .btn-sec {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Footer */
  .l-footer {
    padding: 40px 16px 24px;
  }
  .l-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  /* Section titles */
  .l-section-title {
    font-size: 24px;
  }
}

/* ---- Phone ≤480px ---- */
@media (max-width: 480px) {
  /* Hero */
  .l-hero {
    padding: 40px 12px 36px;
  }
  .l-hero h1 {
    font-size: 24px;
  }
  .l-hero-badge {
    font-size: 12px;
    padding: 4px 10px;
    margin-bottom: 20px;
  }
  .l-trust-strip {
    gap: 12px;
  }
  .l-trust-item {
    flex: 1 1 100%;
    min-width: 0;
  }
  .l-trust-num {
    font-size: 22px;
  }

  /* Nav mobile */
  .l-nav {
    padding: 12px;
  }
  .l-nav-link {
    padding: 12px 14px;
    font-size: 15px;
  }

  /* Buttons */
  .btn-pri,
  .btn-sec,
  .btn-amber {
    padding: 12px 20px;
    font-size: 15px;
  }

  /* Widgets */
  .l-widgets-section {
    padding: 36px 12px;
  }
  .l-widget {
    padding: 20px 16px;
  }

  /* Sections */
  .l-section,
  .l-section-alt {
    padding: 36px 12px;
  }

  /* FAQ */
  .l-faq-q {
    font-size: 14px;
    padding: 14px 0;
  }
  .l-faq-a {
    font-size: 14px;
  }

  /* CTA */
  .l-cta {
    padding: 36px 12px;
  }
  .l-cta h2 {
    font-size: 22px;
  }

  /* Footer — single column */
  .l-footer {
    padding: 32px 12px 20px;
  }
  .l-footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-bottom: 28px;
  }

  /* Section title */
  .l-section-title {
    font-size: 22px;
  }
}

/* ============================================================
   FE-6: Inline-style replacements — landing pages
   Task: p3-html-inline-styles-refactor-to-css-classes (chat web-573f13dc)
   Replaces inline style="..." attributes in landing HTML files
   (about.html, contacts.html, how-it-works.html, index.html).
   App pages (admin, consultant, lk, auth, book) use classes from app.css instead.
   ============================================================ */

/* l-inner with full width (no max-width constraint) — for section headers in
   about.html + how-it-works.html. Previously inline style="max-width: 100%". */
.l-inner--full {
  max-width: 100%;
  margin: 0 auto;
}

/* 1120px container — for grids in about.html (.principles-grid) +
   how-it-works.html (.formats-grid, .price-grid).
   Previously inline style="max-width: 1120px; margin: 0 auto". */
.container-1120 {
  max-width: 1120px;
  margin: 0 auto;
}

/* Large amber button variant — for about.html CTA "Записаться на совет".
   Previously inline style="font-size: 16px; padding: 14px 32px" on .btn-amber. */
.btn-amber--lg {
  font-size: 16px;
  padding: 14px 32px;
}

/* Muted price tag — for how-it-works.html "по договорённости" price-tag.
   Previously inline style="font-size: 24px; color: var(--gray-500)" on .price-tag. */
.price-tag--muted {
  font-size: 24px;
  color: var(--gray-500);
}

/* Primary-bg CTA section — for how-it-works.html bottom CTA section.
   Previously inline style="background: var(--primary); padding: 64px 24px; text-align: center" on <section>. */
.section-primary-bg {
  background: var(--primary);
  padding: 64px 24px;
  text-align: center;
}

/* CTA section title (white) — for how-it-works.html <h2> inside .section-primary-bg.
   Previously multiline inline style="font-size: clamp(22px, 3.5vw, 34px); font-weight: var(--h-weight); color: #fff; margin-bottom: 14px". */
.section-primary-bg__title {
  font-size: clamp(22px, 3.5vw, 34px);
  font-weight: var(--h-weight);
  color: #fff;
  margin-bottom: 14px;
}

/* CTA section subtitle (semi-transparent white) — for how-it-works.html <p> inside .section-primary-bg.
   Previously inline style="font-size: 16px; color: rgba(255, 255, 255, 0.7); margin-bottom: 32px". */
.section-primary-bg__subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 32px;
}

/* CTA primary button — for how-it-works.html "Записаться на совет →" link.
   Previously multiline inline style="display: inline-flex; align-items: center; gap: 8px;
   background: var(--cta-btn-bg); color: var(--cta-btn-color); padding: 14px 32px;
   border-radius: var(--r-btn); font-size: var(--cta-btn-size); font-weight: var(--cta-btn-weight)". */
.btn-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cta-btn-bg);
  color: var(--cta-btn-color);
  padding: 14px 32px;
  border-radius: var(--r-btn);
  font-size: var(--cta-btn-size);
  font-weight: var(--cta-btn-weight);
}

/* Small meta text (gray-400) — for contacts.html "Точный адрес будет указан позже" etc.
   Previously inline style="font-size: 13px; color: var(--gray-400)" on <span>. */
.text-meta-sm {
  font-size: 13px;
  color: var(--gray-400);
}

/* FAQ description text — for index.html FAQ section <p>.
   Previously multiline inline style="font-size: var(--body-size); color: var(--gray-500);
   line-height: var(--line-h); margin-bottom: 28px". */
.l-faq-desc {
  font-size: var(--body-size);
  color: var(--gray-500);
  line-height: var(--line-h);
  margin-bottom: 28px;
}
