/* =============================================================================
   npf-layout.css - one page column + a readable header, identical in every theme
   -----------------------------------------------------------------------------
   Load order: AFTER /npf-theme.css (it must be the last stylesheet on the page).
   Owns GEOMETRY only (width, margin, radius, padding) plus the header pill surface.
   Colours, fonts and shadows stay in the theme files.

   Why it exists (diagnosed live on /ar/about, 2026-11-09)
   1. --nile-page-max was 1328px in mist but 2400px in light/dark (08e3fda993fac005.css, :root),
      so header, footer and cards changed width and margins every time the theme changed.
   2. Header + footer used min(100% - 28px, max) while every section used
      min(100% - 2 * --ca-gutter, max): two different columns on the same page.
   3. .ca-editorial-banner / .ca-presence / .ca-company-statements had no max width:
      full width on big screens while the cards stayed at 1328px.
   4. Block radius was 0 / 26 / 28 / 30 / 32 / 34px and vertical gaps 0 / 18 / 28 / 38 / 40px.
   5. Header: 08e3fda993fac005.css forces the NAVY pill variables on every page that is not
      .dark (html:not(.dark) .ca-site .ca-header) while npf-theme.css forces dark ink text on
      mist/light -> the brand name was dark text on a navy pill.
   ============================================================================= */

/* 1. Tokens - the same value in every theme ---------------------------------- */
:root,
:root[data-theme] {
  --nile-page-max: 1328px;
  --nile-section-gap: clamp(22px, 3vw, 40px);
  --npf-radius: 26px;
  --npf-radius-inner: 18px;
  --npf-pad: 32px;
}
@media (max-width: 760px) {
  :root,
  :root[data-theme] {
    --npf-radius: 22px;
    --npf-radius-inner: 16px;
    --npf-pad: 20px;
  }
}

/* 2. One column: header, footer, cards and bands share the same edges ---------- */
html:root .ca-site :is(.ca-header, .ca-footer, .ca-company-origin, .ca-principles, .ca-contact, .hb-guide, .hb-glossary, .hb-visit, .hb-emergency, .hb-closing) {
  width: min(calc(100% - (var(--ca-gutter) * 2)), var(--nile-page-max)) !important;
  margin-inline: auto !important;
}
html:root .ca-site :is(.ca-editorial-banner, .ca-presence, .ca-company-statements) {
  width: min(100%, calc(var(--nile-page-max) + (var(--ca-gutter) * 2))) !important;
  margin-inline: auto !important;
}

/* 3. Cards: one radius, one text inset ---------------------------------------- */
html:root .ca-site :is(.ca-page-intro, .ca-company-origin, .ca-principles, .ca-contact, .ca-reading, .ca-source-route, .hb-guide, .hb-glossary, .hb-visit, .hb-emergency, .hb-closing, .ca-footer) {
  border-radius: var(--npf-radius) !important;
}
html:root .ca-site .ca-contact::before {
  border-radius: inherit !important;
}
html:root .ca-site .ca-company-origin {
  padding-inline: var(--npf-pad) !important;
}
/* mist/light give this card a hairline border, dark gives it none -> 1px taller box in the light themes */
html:root[data-theme="dark"] .ca-site .ca-company-origin {
  border: 1px solid transparent !important;
}
html:root .ca-site .ca-principles > ol > li {
  border-radius: var(--npf-radius-inner);
}

/* 4. Vertical rhythm: the same gap in front of every top-level card ------------- */
html:root .ca-site :is(.ca-company-origin, .ca-principles, .ca-contact) {
  margin-top: var(--nile-section-gap) !important;
}
html:root .ca-site .ca-editorial-banner {
  margin-top: var(--nile-section-gap) !important;
  padding-block: 0 !important;
}

/* 5. Header ------------------------------------------------------------------- */
html:root .ca-site .ca-header {
  border-radius: 999px !important;
}
@media (max-width: 760px) {
  html:root .ca-site .ca-header {
    border-radius: var(--npf-radius) !important;
  }
}
/* mist/light have a hairline header border, dark has none -> the header was 1px taller on phones */
html:root[data-theme="dark"] .ca-site .ca-header {
  border: 1px solid transparent !important;
}
/* the brand pill: one fixed height (the logo box differs per theme), so it is the same size everywhere */
html:root .ca-site .ca-header .ca-brand {
  min-width: 0 !important;
  height: 48px !important;
  min-height: 48px !important;
  padding-block: 0 !important;
}

/* 5a. Light themes: the pills use the theme's light surface instead of the navy one */
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-site :is(.ca-header, .ca-header-home, .ca-header-inner) {
  --nile-header-bg: var(--theme-header-control);
  --nile-header-border: var(--theme-outline);
  --nile-header-shadow: 0 6px 16px rgba(22, 55, 57, 0.08);
}
/* 5b. Logo: the same box in every theme (40px, 34px on phones) so the brand pill has the same width everywhere.
   Needs !important on every property: 6eb87bde69845270.css resets padding / radius / background of
   ".ca-site .ca-header .ca-brand img" with !important. */
html:root .ca-site .ca-header .ca-brand > img {
  box-sizing: border-box !important;
  width: 40px !important;
  height: 40px !important;
  padding: 2px !important;
  object-fit: contain !important;
}
@media (max-width: 760px) {
  html:root .ca-site .ca-header .ca-brand > img {
    width: 34px !important;
    height: 34px !important;
    padding: 1px !important;
  }
}
/* 5c. Light themes: the logo is a WHITE svg - give it a brand-colour badge so it is visible.
   (Must stay after 5b: same specificity, the later rule wins.) */
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-site .ca-header .ca-brand > img {
  padding: 7px !important;
  border-radius: 12px !important;
  background: var(--primary) !important;
  filter: none !important;
}
@media (max-width: 760px) {
  :is(html[data-theme="mist"], html[data-theme="light"]) .ca-site .ca-header .ca-brand > img {
    padding: 6px !important;
    border-radius: 10px !important;
  }
}
