/* =====================================================
   MedClinic — Bright Theme (stable blog layout, clean)
   ===================================================== */

/* ========================
   0) CSS Variables
   ======================== */
   :root{
    /* Brand */
    --brand:#0a7cff; --brand-2:#2563eb; --brand-900:#1d4ed8;
    /* Support */
    --success:#16a34a; --warning:#f59e0b; --danger:#ef4444;
    /* Neutrals */
    --ink:#0f172a; --muted:#475569; --muted-2:#334155;
    /* Surfaces */
    --bg:#f6f9ff; --surface:#ffffff; --line:#e6efff;
    /* Layout */
    --container:1200px; --header-height:72px; --section-pad-y:clamp(40px,6vw,80px);
    /* Offsets */
    --header-gap-extra:48px;         /* отступ под фикс-хедер */
    --toc-gap-extra:96px;            /* доп. отступ для TOC */
    --anchor-offset: calc(var(--header-height) + 8px);
    /* Radius + Shadows */
    --r-sm:8px; --r-md:12px; --r-lg:16px; --r-xl:20px;
    --shadow-soft:0 6px 18px rgba(2,6,23,.08);
    --shadow-lift:0 12px 28px rgba(2,6,23,.14);
    /* Typography */
    --h1:clamp(28px,4.8vw,44px); --h2:clamp(22px,3.4vw,32px);
    --h3:clamp(18px,2.6vw,24px); --h4:clamp(16px,2.2vw,20px);
    --lead-size:clamp(17px,1.6vw,20px);
    /* Header palette */
    --header-top-bg-1:#f2f7ff; --header-top-bg-2:#ffffff;
    --header-border:#e8f0ff; --hover-fill:#eef5ff; --chip-bg:#f3f7ff;
  }

  /* ========================
     1) Base / Reset
     ======================== */
  *{box-sizing:border-box}
  html,body{height:100%}
  html{scroll-behavior:smooth}
  body{
    margin:0;
    padding-top: calc(var(--header-height) + var(--header-gap-extra));
    font:16px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,Inter,Arial,"Helvetica Neue",sans-serif;
    color:var(--ink); background:var(--bg);
  }
  img{max-width:100%;height:auto;display:block}
  a{color:var(--brand);text-decoration:none}
  a:hover{color:var(--brand-2);text-decoration:underline;text-underline-offset:3px}
  .container{width:min(92%,var(--container));margin:0 auto}
  ::selection{background:rgba(10,124,255,.28);color:#0b1529}

  /* ========================
     2) Buttons
     ======================== */
  .btn-primary{
    display:inline-flex;align-items:center;justify-content:center;
    height:48px;padding:0 20px;border-radius:12px;
    background:linear-gradient(90deg,var(--brand),var(--brand-2));
    color:#fff;font-weight:800; box-shadow:0 10px 24px rgba(37,99,235,.24);
    transition:transform .15s ease,box-shadow .15s ease
  }
  .btn-primary:hover{transform:translateY(-1px);box-shadow:0 14px 34px rgba(37,99,235,.3)}
  .btn-outline{
    display:inline-flex;align-items:center;justify-content:center;
    height:48px;padding:0 16px;border-radius:12px;border:1px solid var(--line);
    background:#fff;color:var(--ink);font-weight:700
  }

  /* ========================
     3) Header (fixed)
     ======================== */
  .site-header{
    position:fixed;top:0;left:0;right:0;z-index:2000;
    background:#fff;border-bottom:1px solid var(--header-border);
    box-shadow:0 10px 26px rgba(10,124,255,.07)
  }
  .header-top{border-bottom:1px solid var(--header-border);background:linear-gradient(180deg,var(--header-top-bg-1) 0%,var(--header-top-bg-2) 100%)}
  .header-top-inner{
    width:min(100%,var(--container));margin:0 auto;padding:6px 20px;
    display:flex;align-items:center;justify-content:space-between;gap:12px
  }
  .info-list{display:flex;flex-wrap:wrap;gap:14px 18px;align-items:center}
  .info-item,.info-link{display:inline-flex;align-items:center;gap:8px;font-size:13.5px;color:#334155}
  .site-header .icon{width:18px;height:18px;color:#7f8aa3}
  .info-link{color:#0f172a;font-weight:800}
  .info-link:hover{color:var(--brand-2);text-decoration:none}
  .header-top-right{display:flex;align-items:center;gap:14px}
  .quick-links{display:flex;align-items:center;gap:8px}
  .quick-links .ql-btn{
    display:grid;place-items:center;width:44px;height:44px;border-radius:12px;
    background:#fff;border:1px solid var(--header-border);
    box-shadow:0 8px 20px rgba(2,6,23,.08),0 1px 4px rgba(2,6,23,.04);color:var(--brand-2)
  }
  .quick-links .ql-btn svg,.quick-links .ql-btn img{width:22px;height:22px;display:block;object-fit:contain}
  .quick-links .ql-btn svg path,.quick-links .ql-btn svg circle{vector-effect:non-scaling-stroke;stroke-width:1.8}
  .header-inner{
    width:min(100%,var(--container));margin:0 auto;padding:10px 20px;
    display:flex;align-items:center;justify-content:space-between
  }
  .logo img{height:34px;width:auto;display:block}
  .header-bottom{width:100%;margin:8px 0 0}
  .main-nav{
    display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;row-gap:6px;
    width:min(100%,var(--container));margin:0 auto;padding:0 20px
  }
  .main-nav .nav-link{
    display:inline-flex;align-items:center;justify-content:center;height:38px;padding:0 14px;border-radius:10px;border:1px solid transparent;
    color:#0f172a;font-weight:700;line-height:1;transition:background .18s ease,color .18s ease,border-color .18s ease
  }
  .main-nav .nav-link:hover{background:var(--hover-fill);color:var(--brand-2);text-decoration:none}
  .main-nav .nav-link.active{color:var(--brand-2);background:rgba(37,99,235,.12);border-color:rgba(37,99,235,.18)}
  .main-nav .btn-cta{
    display:inline-flex;align-items:center;justify-content:center;height:38px;padding:0 16px;border-radius:999px;
    background:linear-gradient(90deg,#22C55E,#16A34A);color:#fff!important;font-weight:800;line-height:1;box-shadow:0 10px 24px rgba(22,163,74,.26);
    transition:transform .12s ease,box-shadow .18s ease
  }
  .main-nav .btn-cta:hover{transform:translateY(-1px);box-shadow:0 14px 34px rgba(22,163,74,.32)}
  /* Mobile header bits */
  .burger{display:none;width:40px;height:40px;border:1px solid var(--header-border);border-radius:10px;background:#fff;align-items:center;justify-content:center;gap:4px;flex-direction:column}
  .burger span{width:18px;height:2px;background:#0f172a;border-radius:2px}
  .mobile-menu[hidden]{display:none!important}
  .mobile-menu{position:fixed;inset:0;z-index:1999;background:rgba(2,6,23,.42);display:grid;place-items:start center}
  .mobile-nav{
    margin-top: calc(var(--header-height) + var(--header-gap-extra));
    background:#fff;width:min(560px,92vw);border-radius:22px;padding:14px;
    box-shadow:0 12px 40px rgba(2,6,23,.10),0 2px 8px rgba(2,6,23,.04);
    border:1px solid var(--header-border);display:grid;gap:8px
  }
  .mobile-nav .nav-link,.mobile-nav .btn-cta{height:52px;border-radius:14px;justify-content:start;padding-left:14px}
  @media (max-width:1024px){.info-list{display:none}.main-nav{display:none}.burger{display:flex}}

  /* ========================
     4) Hero
     ======================== */
  .hero{padding: calc(var(--section-pad-y) + 20px) 0 var(--section-pad-y)}
  .hero-flex{display:flex;align-items:center;justify-content:space-between;gap:32px}
  .hero-text{flex:1 1 640px;max-width:60ch;text-align:left}
  .hero-text h1{font-size:clamp(34px,5.6vw,54px);line-height:1.12;letter-spacing:-.012em;margin-bottom:14px}
  .hero-text p.lead{font-size:clamp(17px,1.4vw,19px);color:#475569;margin-bottom:18px}
  .hero-visual{flex:1 1 520px;display:flex;align-items:flex-end;justify-content:flex-end;min-width:320px}
  .hero-photo{width:min(560px,42vw);height:auto;object-fit:contain;filter:drop-shadow(0 12px 28px rgba(2,6,23,.10))}
  .hero h1,.hero .lead{text-align:center}
  @media (max-width:1024px){.hero-flex{flex-direction:column;align-items:flex-start;gap:20px}.hero-visual{width:100%;justify-content:center}.hero-photo{width:min(520px,78vw)}}

  /* Hero badges (generic) */
  .hero-badges{display:grid;grid-template-columns:repeat(2,1fr);gap:16px 24px;justify-items:center;margin:24px 0;padding:0;list-style:none}
  .hero-badges li{
    background:linear-gradient(135deg,#f8fafc,#eef4ff);padding:12px 40px;border-radius:30px;font-size:15px;font-weight:600;color:#0f172a;
    box-shadow:0 2px 8px rgba(0,0,0,.08);position:relative;min-width:220px;text-align:center;transition:all .25s ease-in-out
  }
  .hero-badges li::before{content:"";position:absolute;left:16px;top:50%;width:8px;height:8px;border-radius:50%;background:#2563eb;transform:translateY(-50%);box-shadow:0 0 0 3px rgba(37,99,235,.15)}
  .hero-badges li:hover{background:linear-gradient(135deg,#e0e7ff,#f0f7ff);transform:translateY(-2px);box-shadow:0 6px 16px rgba(37,99,235,.15)}

  /* Alt hero (#hero) */
  #hero{padding:60px 0}
  #hero .hero-flex{display:grid;grid-template-columns:1fr 1.4fr;align-items:stretch;gap:40px}
  #hero .hero-text{max-width:560px;display:flex;flex-direction:column;justify-content:center}
  #hero .hero-text h1{font-size:clamp(28px,3vw,44px);line-height:1.2;margin-bottom:20px}
  #hero .hero-badges{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:28px}
  #hero .hero-badges li{background:#fff;padding:8px 14px;border-radius:20px;font-size:14px;font-weight:500;color:#0a284e;box-shadow:0 2px 6px rgba(0,0,0,.08)}
  #hero .hero-photo{width:100%;height:100%;object-fit:cover;border-radius:20px;box-shadow:0 18px 48px rgba(2,6,23,.18)}
  @media (max-width:1024px){#hero .hero-flex{grid-template-columns:1fr;gap:28px}#hero .hero-text{text-align:center;max-width:100%}#hero .hero-badges{justify-content:center}#hero .hero-photo{height:auto}}

  /* ========================
     5) Sections
     ======================== */
  section+section{border-top:1px solid rgba(2,6,23,.06)}
  main>section{padding-block:var(--section-pad-y)}
  .section-title{margin:0 0 8px;font-size:var(--h2);text-align:center}
  .section-subtitle{margin:0 0 18px;color:var(--muted);max-width:80ch;text-align:center}

  /* ========================
     6) Cards
     ======================== */
  .about-cards,.advantages-cards{display:grid;grid-template-columns:repeat(3,minmax(260px,1fr));gap:26px;align-items:stretch;margin-top:28px}
  @media (max-width:1024px){.about-cards,.advantages-cards{grid-template-columns:repeat(2,minmax(240px,1fr))}}
  @media (max-width:640px){.about-cards,.advantages-cards{grid-template-columns:1fr}}
  .about-card,.advantages-card{
    display:grid;grid-template-columns:72px 1fr;grid-auto-rows:min-content;column-gap:16px;align-items:start;text-align:left;
    padding:22px;min-height:200px;background:radial-gradient(120% 120% at -10% -10%,rgba(10,124,255,.08),transparent 55%),var(--surface);
    border:1px solid var(--line);border-radius:var(--r-xl);box-shadow:var(--shadow-soft);
    transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease
  }
  .about-card:hover,.advantages-card:hover{transform:translateY(-6px);box-shadow:var(--shadow-lift);border-color:rgba(10,124,255,.28)}
  .about-card img,.advantages-card img{
    grid-row:span 2;width:52px;height:52px;object-fit:contain;background:radial-gradient(closest-side,rgba(10,124,255,.16),rgba(10,124,255,.08),transparent 75%);
    border-radius:50%;padding:10px;filter:drop-shadow(0 2px 6px rgba(0,0,0,.06))
  }
  .about-card h3,.advantages-card h3{margin:2px 0 6px;font-size:1.08rem;color:var(--ink)}
  .about-card p,.advantages-card p{margin:0;font-size:.98rem;line-height:1.6;color:var(--muted)}

  /* ========================
     7) Form (incl. errors)
     ======================== */
  .form-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow-soft);padding:22px}
  .form{display:grid;gap:16px}
  .form-row{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
  @media (max-width:900px){.form-row{grid-template-columns:1fr}}
  .form label{display:grid;gap:6px;font-weight:700;color:#0b1529}
  .form input,.form select,.form textarea{
    width:100%;padding:12px 12px;border-radius:10px;border:1px solid rgba(2,6,23,.12);
    background:#fff;color:var(--ink);font:inherit;transition:border-color .15s ease,box-shadow .15s ease
  }
  .form input:focus,.form select:focus,.form textarea:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(10,124,255,.18)}
  .form-note{margin:8px 0 0;color:var(--muted);font-size:.95rem}

  /* Inline ошибки (JS) */
  .form .field-error{margin-top:6px;font-size:.92rem;color:var(--danger)}
  .form :is(input,select,textarea).is-invalid{border-color:var(--danger);box-shadow:0 0 0 3px rgba(239,68,68,.18)}
  .form label:has(:is(input,select,textarea).is-invalid){color:var(--danger)}
  .form.was-validated :is(input,select,textarea):invalid{border-color:var(--danger);box-shadow:0 0 0 3px rgba(239,68,68,.18)}
  .form.was-validated label:has(:invalid){color:var(--danger)}

  /* ========================
     8) Contacts + Map
     ======================== */
  .contacts-container{display:grid;grid-template-columns:1fr;gap:18px}
  .map{padding:10px;background:#ffffff;border:2px solid #e3edff;border-radius:16px;box-shadow:0 8px 24px rgba(37,99,235,.08)}
  .map iframe{border:0;border-radius:12px;width:100%;height:300px}
  #contacts .contact-info{text-align:center;margin:0 auto 18px;font-size:1rem;line-height:1.6}
  #contacts .contact-info a{color:var(--brand);font-weight:700;text-decoration:none}
  #contacts .contact-info a:hover{text-decoration:underline}

  /* ========================
     9) Footer
     ======================== */
  .site-footer{background:#fff;border-top:1px solid rgba(2,6,23,.08);padding:28px 20px;font-size:.95rem}
  .footer-wrap{width:min(92%,var(--container));margin:0 auto}
  .footer-top{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:20px;margin-bottom:20px}
  .footer-brand{display:inline-flex;align-items:center;gap:8px;font-weight:900;color:#0f172a}
  .footer-brand:hover{color:var(--brand)}
  .footer-brand img{height:28px;width:auto}
  .footer-nav{display:flex;flex-direction:column;gap:6px}
  .footer-nav a{color:#0f172a;text-decoration:none}
  .footer-nav a:hover{color:var(--brand)}
  .footer-contacts-mini{display:flex;flex-direction:column;gap:6px}
  .footer-hours{margin:4px 0 0;font-size:.9rem;color:var(--muted)}
  .footer-social{display:flex;gap:12px;margin-top:8px;align-items:center}
  .footer-social a{display:inline-flex;width:36px;height:36px;align-items:center;justify-content:center;border-radius:50%;background:#eef4ff;transition:background .2s ease}
  .footer-social a:hover{background:var(--brand)}
  .footer-social img{width:20px;height:20px}
  .footer-bottom{border-top:1px solid rgba(2,6,23,.06);padding-top:12px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;color:var(--muted);font-size:.85rem}
  .footer-legal a{color:inherit;margin-left:14px;text-decoration:none}
  .footer-legal a:hover{color:var(--brand);text-decoration:underline;text-underline-offset:3px}

  /* ========================
     10) Blog Page & Article
     ======================== */

  /* Blog hero */
  .blog-page .hero{padding:24px 0 10px!important;text-align:center}
  .blog-page .hero .lead{max-width:800px;margin:0 auto}
  .blog-page .hero h1,.blog-page .hero .lead{margin-inline:auto;max-width:900px}

  /* Base article-wrap (одна колонка по умолчанию) */
  .article-wrap{
    display:grid; gap:22px;
    width:min(96vw,var(--container));
    margin:24px auto 48px;
    grid-template-columns:1fr;
    align-items:start;
    overflow:visible;
  }

  .blog-page .article-wrap{
    grid-template-columns:240px minmax(0,760px);
    width:min(95vw,1100px);
  }
  .blog-page .article{
    max-width:760px;width:100%;
    background:var(--surface);border:1px solid var(--line);
    border-radius:16px;box-shadow:var(--shadow-soft);padding:24px 22px
  }

  /* TOC (sticky на десктопах) */
  .blog-page .toc{
    position:sticky;
    top:calc(var(--header-height) + var(--header-gap-extra) + var(--toc-gap-extra))!important;
    align-self:start;
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:12px;
    box-shadow:var(--shadow-soft);
    padding:12px!important;
    max-height:calc(100vh - (var(--header-height) + var(--header-gap-extra) + 24px));
    overflow:auto; scrollbar-width:thin;
  }
  .blog-page .toc .toc-title{
    margin:0 0 8px!important;
    font-size:13.5px;font-weight:800;letter-spacing:.02em;color:var(--muted-2);
  }
  .blog-page .toc nav{display:flex;flex-direction:column;gap:6px!important}
  .blog-page .toc nav a{
    display:grid; grid-template-columns:18px 1fr; align-items:center; gap:10px;
    min-height:32px; padding:6px 10px!important;
    border-radius:10px; border:1px solid transparent;
    font-size:14px; line-height:1.28; color:var(--ink);
    white-space:normal; overflow:visible; text-overflow:clip;
    transition:background .18s ease,color .18s ease,border-color .18s ease;
    text-decoration:none!important;
  }
  .blog-page .toc nav a::before{
    content:""; justify-self:center; width:8px; height:8px; border-radius:50%;
    background:#94a3b8; box-shadow:0 0 0 3px rgba(148,163,184,.18);
  }
  .blog-page .toc nav a:hover{
    background:rgba(2,6,23,.045)!important; border-color:rgba(2,6,23,.06); color:var(--brand);
  }
  .blog-page .toc nav a:hover::before{background:#7c8aa6}
  .blog-page .toc nav a.is-active{
    background:rgba(37,99,235,.10); border-color:rgba(37,99,235,.18);
    color:var(--brand-2); font-weight:800;
  }
  .blog-page .toc nav a.is-active::before{
    background:var(--brand-2); box-shadow:0 0 0 3px rgba(37,99,235,.16);
  }
  /* webkit scrollbar */
  .blog-page .toc::-webkit-scrollbar{width:8px}
  .blog-page .toc::-webkit-scrollbar-thumb{background:rgba(2,6,23,.15);border-radius:8px}
  .blog-page .toc::-webkit-scrollbar-track{background:transparent}

  /* Article content */
  .a-section + .a-section{margin-top:24px}
  .article h2{
    display:flex;align-items:center;gap:12px;margin:0 0 10px;
    font-size:clamp(22px,3.2vw,30px)
  }
  .article h2::before{content:"";width:8px;height:26px;border-radius:6px;background:var(--brand);flex:0 0 auto}
  .article h3{margin:12px 0 8px;font-size:1.06rem;color:#0b1529}
  .article p{margin:0 0 12px;line-height:1.7}

  /* ========================
     11) Utilities & Cookies
     ======================== */
  h1,h2,h3,h4,h5,h6{margin:0 0 10px;color:var(--ink);line-height:1.25;letter-spacing:-.01em;text-wrap:balance;text-align:center}
  h1{font-size:var(--h1);font-weight:900;line-height:1.15}
  h2{font-size:var(--h2);font-weight:800}
  h3{font-size:var(--h3);font-weight:700}
  h4{font-size:var(--h4);font-weight:700}
  .prose{max-width:68ch}
  .prose.center{margin-inline:auto}
  .prose .lead{font-size:var(--lead-size);color:var(--muted)}

  .cookie-banner{
    position:fixed;left:50%;bottom:16px;transform:translateX(-50%);
    width:min(980px,96vw);background:#fff;border:1px solid var(--line);
    border-radius:14px;box-shadow:var(--shadow-soft);padding:12px 14px;z-index:1000;
    display:flex;align-items:center;gap:12px
  }
  .cookie-banner.is-hidden{display:none}
  .cookie-banner__text{margin:0}
  .cookie-banner__actions{display:flex;gap:10px;margin-left:auto}

  /* Anchor offsets */
  #about,#advantages,#professor-block,#contacts,#form{scroll-margin-top:var(--anchor-offset)}
  .article .a-section{scroll-margin-top:calc(var(--header-height) + var(--header-gap-extra) + var(--toc-gap-extra) - 8px)!important}
  @media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

  /* ========================
     12) Professor Block
     ======================== */
  #professor-block{--grid-gap:36px;--block-gap:22px;--panel-pad:22px;--sticky-top:140px;padding:56px 0}
  #professor-block .container{width:min(92%,1160px);margin:0 auto}
  #professor-block .section-title{font-size:clamp(24px,3.2vw,34px);line-height:1.2;margin:0 0 28px;text-align:left}
  #professor-block .row{display:grid;grid-template-columns:clamp(300px,34vw,460px) minmax(0,1fr);gap:var(--grid-gap);align-items:start}
  #professor-block .card-frame{position:sticky;top:var(--sticky-top);padding:12px;background:#fff;border:1.5px solid #e6eefc;border-radius:18px;box-shadow:0 10px 28px rgba(37,99,235,.08)}
  #professor-block .photo img{display:block;width:100%;height:auto;border-radius:14px}
  #professor-block .text{text-align:left;max-width:780px}
  #professor-block .text .lead{margin:2px 0 var(--block-gap);color:#475569;font-size:clamp(15px,1.1vw,17px);line-height:1.65}
  #professor-block .panel{background:#fff;border:1.5px solid #e6eefc;border-radius:18px;padding:var(--panel-pad) clamp(18px,2.2vw,28px);box-shadow:0 10px 28px rgba(2,6,23,.06);margin:0 0 var(--block-gap)}
  #professor-block .panel:last-child{margin-bottom:0}
  #professor-block .panel h3{margin:0 0 10px;font-size:clamp(18px,1.6vw,22px);font-weight:700}
  #professor-block .panel ul{margin:0;padding:0;list-style:none}
  #professor-block .panel li{position:relative;padding-left:22px;margin:8px 0;line-height:1.55;color:#0f172a}
  #professor-block .panel li::before{content:"";position:absolute;left:0;top:.65em;width:8px;height:8px;border-radius:50%;background:#1d4ed8;box-shadow:0 0 0 3px rgba(29,78,216,.14);transform:translateY(-50%)}
  #professor-block .panel ul ul{margin-top:6px;margin-left:10px}
  #professor-block .panel ul ul li::before{background:#059669;box-shadow:0 0 0 3px rgba(5,150,105,.14)}
  #professor-block .full-row{grid-column:1/-1;display:grid;grid-template-columns:clamp(300px,34vw,460px) minmax(0,1fr);gap:var(--grid-gap);margin-top:var(--block-gap)}
  #professor-block .full-row .panel{grid-column:2}
  @media (max-width:980px){
    #professor-block .row{grid-template-columns:1fr;gap:22px}
    #professor-block .card-frame{position:static}
    #professor-block .full-row{grid-template-columns:1fr}
    #professor-block .full-row .panel{grid-column:1}
    #professor-block .section-title{text-align:center}
  }

  /* ========================
     13) Responsive tweaks
     ======================== */
  /* Desktop compact: 1280–1025 (ТОЛЬКО для блога) */
  @media (max-width:1280px) and (min-width:1025px){
    .blog-page .article-wrap{grid-template-columns:220px minmax(0,760px);gap:18px}
    .blog-page .toc nav a{font-size:13px;padding:5px 8px!important}
  }

  /* Планшеты/мобилки — сетка одна колонка, TOC статичен */
  @media (max-width:1024px){
    .blog-page .article-wrap{
      grid-template-columns:1fr; gap:16px;
      width:min(96vw,var(--container)); margin:16px auto 32px;
    }
    .blog-page .toc{
      position:static!important; top:auto!important; max-height:none!important;
      margin-bottom:6px; padding:10px 12px;
    }
    .blog-page .article .a-section{scroll-margin-top:calc(var(--header-height) + 12px)!important}
    :root{--toc-gap-extra:72px}
  }

  /* Mobile-first misc */
  .cta-stack{display:flex;flex-direction:column;gap:12px;align-items:stretch;max-width:520px}
  @media (max-width:680px){
    .cta-stack .btn-primary,.cta-stack .btn-outline,.cta-stack .btn-lg{width:100%;height:52px;font-weight:800}
    .form input,.form select,.form textarea{padding:14px 12px}
    .form .btn-primary,#submit-btn{width:100%;height:52px}
    .map iframe{height:280px}
    #contacts .contact-info{font-size:.98rem}
  }
  @media (max-width:800px){
    .footer-top{flex-direction:column;align-items:stretch}
    .footer-bottom{flex-direction:column;align-items:flex-start;gap:8px}
  }

  /* Mobile header cleanup */
  @media (max-width:768px){
    .header-top{display:none!important}
    :root{--header-height:60px;--header-gap-extra:16px}
    .site-header{box-shadow:0 6px 16px rgba(2,6,23,.08)}
    .header-inner{
      padding:8px 12px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px
    }
    .logo img{height:28px}
    .main-nav{display:none!important}
    .burger{display:flex}
  }
  @media (max-width:380px){:root{--header-gap-extra:10px}}
  .site-header .m-actions{display:none}
  @media (max-width:1024px){
    .site-header .m-actions{display:flex;gap:8px;align-items:center}
    .site-header .m-actions .m-btn{
      display:grid;place-items:center;width:44px;height:44px;border-radius:12px;
      background:#fff;border:1px solid var(--header-border);
      box-shadow:0 8px 20px rgba(2,6,23,.08),0 1px 4px rgba(2,6,23,.04)
    }
    .site-header .m-actions img{width:18px;height:18px;display:block}
  }

  /* =========================================================
     14) BLOG LAYOUT SAFETY NET — держать в самом конце файла
     Перебивает внешние файлы и неожиданные :not(.blog-page)
     ========================================================= */
  .blog-page .article-wrap{
    display:grid !important;
    align-items:start;
    gap:22px;
    width:min(95vw,1100px) !important;
    margin:24px auto 48px !important;
  }
  @media (min-width:1025px){
    .blog-page .article-wrap{
      grid-template-columns: 240px minmax(0,760px) !important;
    }
    .blog-page .article{
      max-width:760px !important;
      width:100% !important;
      justify-self:stretch;
    }
    .blog-page .article-wrap > .toc{
      display:block !important;
      visibility:visible !important;
      position:sticky !important;
      top:calc(var(--header-height) + var(--header-gap-extra) + var(--toc-gap-extra)) !important;
      align-self:start !important;
      background:var(--surface);
      border:1px solid var(--line);
      border-radius:12px;
      box-shadow:var(--shadow-soft);
      padding:12px !important;
      max-height:calc(100vh - (var(--header-height) + var(--header-gap-extra) + 24px));
      overflow:auto;
    }
  }
  @media (max-width:1024px){
    .blog-page .article-wrap{
      grid-template-columns: 1fr !important;
      gap:16px !important;
      width:min(96vw, var(--container)) !important;
      margin:16px auto 32px !important;
    }
    .blog-page .toc{
      display:block !important;
      position:static !important;
      top:auto !important;
      max-height:none !important;
      margin-bottom:6px !important;
      padding:10px 12px !important;
    }
    .blog-page .article .a-section{
      scroll-margin-top: calc(var(--header-height) + 12px) !important;
    }
  }
  .blog-page .toc{ display:block !important; }

  #hero .hero-badges{ list-style:none; margin:20px 0; padding:0; }
  #hero .hero-badges li{
    position: relative;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    padding: 10px 38px !important;
    min-height: 40px;
  }
  #hero .hero-badges li::before{
    content: ""; position: absolute !important;
    left: 14px; top: 50%; transform: translateY(-50%);
    width: 8px; height: 8px; border-radius: 50%;
    background: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,.15);
  }
  @media (max-width: 420px){
    #hero .hero-badges li{ padding-inline: 32px !important; }
  }
