/* ==========================================================================
   brand v1 — ONE site grid (layout.css). Single source of truth for page width,
   page gutters, the reading measure and section rhythm. Loaded LAST (after hover.css)
   so it wins over GeneratePress (main.min.css + inline), critical.css, ui.min.css,
   nsp-custom.min.css and the component files. 23.11.2026.

   Rules
   1. One outer edge for header, top bar, navigation, content and footer:
      content box = --container (1120px), centred, with --gutter-page on both sides.
      At 1440px every block starts at 160px and ends at 1280px — the header's lines.
   2. GeneratePress inner wrappers (#page > .site-content > .content-area > main >
      article > .inside-article) never add width or side padding of their own.
   3. Card grids, catalogue, kits, tools, FAQ lists: full container width.
   4. Long running text (articles, policies, descriptions, video transcript):
      --measure (720px), aligned to the LEFT edge of the grid (one rule site-wide).
      Centred section headings / one-line subtitles may stay centred inside the container.
   5. Full-bleed bands (hero, coloured sections, footer rows): background to the
      screen edges, content inside the container lines (--bleed-pad).
   6. Gutters: 20px (<768) · 24px (768–1023) · 32px (>=1024). Section rhythm tokens.
   Content, texts, prices and functions.php are not touched by this file.
   ========================================================================== */

:root {
  --container: 1120px;                 /* the one content width (= header width) */
  --gutter-page: 20px;                 /* mobile */
  --page-max: calc(var(--container) + 2 * var(--gutter-page));
  --measure: 720px;                    /* long text column */
  --bleed-pad: max(var(--gutter-page), calc(50% - var(--container) / 2)); /* inside 100%-wide bands */
  --section-y: 40px;                   /* between sections (mobile) */
  --section-y-lg: 56px;                /* before/after big bands (mobile) */
  --container-max: var(--container);   /* legacy alias used by critical.css / ui.min.css */
}
@media (min-width: 768px)  { :root { --gutter-page: 24px; } }
@media (min-width: 1024px) { :root { --gutter-page: 32px; --section-y: 64px; --section-y-lg: 96px; } }

/* ---- 1. The outer edge: header bars, page, footer ---------------------- */
body .nsp-topbar__inner,
body .site-header .inside-header,
body .main-navigation .inside-navigation,
body #page.grid-container,
body .site-footer .inside-site-info {
  max-width: var(--page-max) !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--gutter-page) !important;
  padding-right: var(--gutter-page) !important;
  box-sizing: border-box !important;
}

/* ---- 2. GeneratePress inner wrappers: no own width / side padding ------- */
body #page .site-content,
body #page .content-area,
body #page .site-main,
body #page .inside-article,
body #page .inside-page-header {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
/* right-sidebar layouts (blog posts, hub pages): the sidebar is hidden site-wide,
   so the content column takes the whole container instead of 75% of it */
body #page .content-area { width: 100% !important; float: none !important; }
body #page #right-sidebar, body #page #left-sidebar { display: none !important; }

/* ---- 3. Component wrappers that set their own outer width → the container -- */
body .hw,                                   /* 6 tools + kits (wheel-v2.css: 820px) */
body .kt.hw,                                /* kits.css: 1120px */
body :is(.nsp-pp, .nsp-tu),                 /* legal-v2.css */
body .nsp-about,                            /* about-v2.css */
body .am-video,                             /* video-page.css: 960px */
body .nsp-quality-wrap,                     /* nsp-custom: 1200px + 40px padding */
body .nsp-delivery-wrap,                    /* nsp-custom: 1140px + 24px padding */
body .woocommerce-account .woocommerce,     /* nsp-custom: 1100px */
body .nsp-pp-section--calc,                 /* nsp-custom: 960px */
body .nsp-quality-video__wrap,              /* nsp-custom: 800px centred video on «Якість» */
body :is(.nsp-pp-faq, .nsp-faq, .nsp-inline-cta, .nsp-wheel-cta-wrap) { /* nsp-custom: 760px, centred */
  max-width: var(--container) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body :is(.nsp-quality-wrap, .nsp-delivery-wrap, .nsp-rp) { padding-left: 0 !important; padding-right: 0 !important; }

/* ---- 4. Long text: --measure, left-aligned ----------------------------- */
body :is(.nsp-pp__section, .nsp-tu__section),                 /* legal: 72ch */
body .nsp-rp,                                                 /* return policy: 960px centred → measure, left */
body :is(.nsp-about__mission-text, .nsp-about__global-text),  /* about: 68ch */
body .am-video__tr,                                           /* video transcript: 72ch */
body.single-post #page .entry-header,
body.single-post #page .entry-content,                        /* blog article */
body.right-sidebar:not(.single-post) #page .entry-content > :is(p, ul, ol, h2, h3, h4, blockquote, table, .nsp-pp-intro-text),
body .woocommerce-Tabs-panel--description > :is(p, ul, ol, h2, h3, h4, blockquote),
body .term-description > :is(p, ul, ol),
body .nsp-faq :is(.nsp-faq-answer, details > div, details > p),
body .hw-faq-item p,                                          /* tools FAQ answers */
body .nsp-faq__a > p,                                         /* hub FAQ answers (теми / системи) */
body .entry-summary > p,                                      /* blog list excerpts */
body .consultant-page > :is(p, ul, ol),                       /* «Про консультанта» */
body .am-trust__src {                                         /* sources line under the numbers */
  max-width: var(--measure) !important;
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* ---- 5. Full-bleed bands: background to the edges, content on the lines -- */
/* 100vw bands inside the content: children are centred at the container width —
   the same axis as the header, so no 100vw/scrollbar arithmetic (classic Windows scrollbars stay aligned) */
body .nsp-pp-section--alt {                 /* desktop used the mobile 20px padding */
  padding-left: var(--gutter-page) !important;
  padding-right: var(--gutter-page) !important;
}
body .nsp-pp-section--alt > * { max-width: var(--container); margin-left: auto !important; margin-right: auto !important; }
/* hero bands whose text block is offset with 50vw maths (Academy) or a fixed inner width (Partner) */
body :is(.acad-2750-hero__inner, .acad-2750-cta-photo__inner, .acad-2751-hero__inner, .acad-2751-cta-photo__inner, .pa11-pa-hero__inner, .pa744-pa-hero__inner, .nsp-partner-page-hero .nsp-partner-page-hero__inner) {
  max-width: var(--page-max) !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--gutter-page) !important;
  padding-right: var(--gutter-page) !important;
  box-sizing: border-box !important;
}
body :is(.acad-2750-hero__inner, .acad-2750-cta-photo__inner, .acad-2751-hero__inner, .acad-2751-cta-photo__inner) > * { max-width: 620px; }
body :is(.pa11-pa-hero__inner, .pa744-pa-hero__inner) > * { max-width: 520px; }
body .nsp-partner-page-hero .nsp-partner-page-hero__inner > * { max-width: 680px; }
body :is(.acad-2750-container, .acad-2751-container) { max-width: var(--container) !important; padding-left: 0 !important; padding-right: 0 !important; }
body :is(.acad-2750-section, .acad-2751-section) { padding-left: var(--gutter-page); padding-right: var(--gutter-page); }
body .site-footer :is(.nsp-ft-main, .nsp-ft-certs, .nsp-ft-ymyl, .nsp-ft-bottom) {
  padding-left: var(--bleed-pad) !important;
  padding-right: var(--bleed-pad) !important;
}

/* ---- 6. Section rhythm (tokens) ---------------------------------------- */
body .nsp-pp-section { margin-bottom: var(--section-y) !important; }
body .nsp-pp-section--alt { padding-top: var(--section-y) !important; padding-bottom: var(--section-y) !important; }
body :is(.nsp-quality-wrap, .nsp-delivery-wrap) { padding-top: var(--section-y) !important; padding-bottom: var(--section-y-lg) !important; }

/* ---- 7. Navigation fits the 1120px line ---------------------------------
   ru menu = 1104px of items + 7×4px gaps = 1132px > 1120px → wrapped to 2 rows once the header
   moved onto the grid. 18px instead of 20px link padding gives both languages one row (≥1025px). */
@media (min-width: 1025px) {
  body .main-navigation .main-nav > ul > li > a { padding-left: 18px !important; padding-right: 18px !important; }
}

/* ---- 8. Visuals that should not stretch to 1120 (owner 23.11: limit the element, not the page) ----
   Health test «Карта 11 систем»: bars + status were ~740px inside the old 820px card → keep that reading width. */
body .ht-rows { max-width: var(--measure); }
