/* ============================================================
   Nordic Club UA — layout.css
   Containers, sections (surface rhythm), grid, header, footer,
   split layouts. Load after base.css.
   ============================================================ */

/* ---- Containers ---- */

.container {
  width: 100%;
  max-width: calc(var(--w-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-width: calc(var(--w-wide) + 2 * var(--gutter));
}

.container--text {
  max-width: calc(var(--w-text) + 2 * var(--gutter));
}

/* ---- Sections & surface rhythm ----
   Dark sections override the --c-* context set on <body>,
   so every component flips its colours automatically. */

.section {
  position: relative;
  padding-block: var(--sect-pad);
}

.section--tight {
  padding-block: var(--sect-pad-tight);
}

.section--light {
  background: var(--paper-50);
  --c-bg: var(--paper-50);
  --c-surface: var(--paper);
  --c-card-bg: var(--paper);
}

.section--dark,
.section--deep,
.site-footer {
  color: var(--paper);
  --c-text: var(--paper);
  --c-muted: var(--ink-400);
  --c-line: var(--ink-500);
  --c-line-soft: var(--ink-600);
  --c-accent-text: var(--gold-500);
  --c-focus: var(--gold-500);
  --c-hover-fill: rgba(255, 255, 255, .07);
  --c-solid: var(--paper);
  --c-solid-text: var(--ink-900);
  --c-field-bg: var(--ink-700);
  --c-field-border: var(--ink-500);
}

.section--dark {
  background: var(--ink-800);
  --c-bg: var(--ink-800);
  --c-surface: var(--ink-700);
  --c-card-bg: var(--ink-700);
}

.section--deep {
  background: var(--ink-900);
  --c-bg: var(--ink-900);
  --c-surface: var(--ink-800);
  --c-card-bg: var(--ink-800);
}

/* Хедер і оверлей — теж темні поверхні, хоч і не .section: без
   цього фокус-рамка взяла б світлий --c-focus (3.25:1 на navy). */
.site-header,
.nav-overlay {
  --c-accent-text: var(--gold-500);
  --c-focus: var(--gold-500);
}

/* Текст лежить БЕЗПОСЕРЕДНЬО НА ФОТО, тому приглушений не може бути
   --ink-400 (3.2:1 на світлій ділянці кадру). --paper-200 дає 7.8:1
   і читається як «тихіший білий», а не як сірий. */
.hero,
.page-header {
  --c-muted: var(--paper-200);
}

/* Section header block: eyebrow + title + lead */
.section__head {
  margin-block-end: clamp(40px, 6vw, 72px);
}

.section__head .eyebrow {
  margin-block-end: 20px;
}

.section__head .lead {
  margin-block-start: 20px;
}

/* ---- 12-column grid ---- */

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}

.col-1 { grid-column: span 1; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .col-1,
  .col-2,
  .col-3,
  .col-4 {
    grid-column: span 3;
  }

  .col-5,
  .col-6,
  .col-7,
  .col-8,
  .col-9,
  .col-10,
  .col-11,
  .col-12 {
    grid-column: span 6;
  }
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }

  [class*="col-"] {
    grid-column: 1 / -1;
  }
}

/* ---- Split (two-column feature layout) ---- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

.split--top {
  align-items: start;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }
}

/* ---- Site header ----
   Transparent over the dark hero; nav.js adds .is-scrolled
   past 80px → ink-900 background + hairline + compact height. */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: var(--z-header);
  color: var(--paper);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background-color var(--t) var(--ease-ui),
    border-color var(--t) var(--ease-ui);
}

.site-header.is-scrolled {
  background: var(--ink-900);
  border-bottom-color: var(--ink-600);
}

/* Only pages whose first block is a dark hero keep .site-header--overlay.
   Pages without one drop that modifier: the header is solid navy from the
   start and the page's FIRST <section> (usually .page-header) carries
   .u-header-offset — not <main>. */
.site-header:not(.site-header--overlay) {
  background: var(--ink-900);
  border-bottom-color: var(--ink-600);
}

/* min-height СВІДОМО без transition: анімація висоти перекладала все
   піддерево хедера кожен кадр саме під час скролу. Плавно міняються
   лише фон і гейрлайн; компактна висота стає одразу. */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

.site-header.is-scrolled .site-header__inner {
  min-height: var(--header-h-compact);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.site-header__brand svg {
  height: 38px;
  width: auto;
}

.site-header__nav ul {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.5vw, 36px);
  /* Цей <ul> без класу, тому інакше він підхопив би базовий стиль
     прозових списків з base.css (list-style: square + золотий ::marker)
     і кожен пункт меню отримав би золотий квадратик. */
  list-style: none;
  padding-inline-start: 0;
}

.site-header__link {
  position: relative;
  display: inline-block;
  padding: 8px 2px;
  color: var(--paper);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  opacity: 0.82;
  transition: opacity var(--t-fast) var(--ease-ui);
}

.site-header__link:hover {
  opacity: 1;
}

.site-header__link::after {
  content: "";
  position: absolute;
  inset-inline: 2px;
  bottom: 0;
  height: 2px;
  background: var(--gold-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-fast) var(--ease-ui);
}

.site-header__link[aria-current="page"],
.site-header__link.is-active {
  opacity: 1;
}

.site-header__link[aria-current="page"]::after,
.site-header__link.is-active::after {
  transform: scaleX(1);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Language switcher — UK active; NO / EN disabled (title «Скоро») */
.lang-switch {
  display: flex;
  gap: 2px;
}

.lang-switch__item {
  padding: 6px 8px;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 0.55;
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: opacity var(--t-fast) var(--ease-ui);
}

.lang-switch__item:hover {
  opacity: 0.85;
}

.lang-switch__item.is-active {
  opacity: 1;
  color: var(--gold-500);
}

.lang-switch__item[disabled],
.lang-switch__item[aria-disabled="true"] {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--paper);
  border-radius: var(--r-sm);
}

/* ---- Mobile full-screen overlay nav ---- */

/* Оверлей мусить скролитися сам: body під ним заблокований
   (.has-nav-open), тому переповнення = недосяжні посилання. На
   альбомному телефоні (667×375) пʼять посилань і підвал не влазять.
   Рядок логотип+хрестик тепер у потоці й sticky, а не absolute. */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  padding: 0 var(--gutter) var(--gutter);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ink-900);
  color: var(--paper);
  visibility: hidden;
  opacity: 0;
  transition:
    opacity var(--t) var(--ease-ui),
    visibility 0s linear var(--t);
}

/* Центрування залишком місця, а не justify-content: center — інакше
   верх контенту недосяжний прокруткою. */
.nav-overlay > nav {
  margin-block: auto;
  padding-block: 24px;
}

.nav-overlay.is-open {
  visibility: visible;
  opacity: 1;
  transition:
    opacity var(--t) var(--ease-ui),
    visibility 0s;
}

/* Overlay top row — brand + close button, aligned with the header height */
.nav-overlay__head {
  position: sticky;
  top: 0;
  z-index: 1;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
  background: var(--ink-900);
}

.nav-overlay__head svg {
  height: 38px;
  width: auto;
}

.nav-overlay__list {
  display: grid;
  gap: 8px;
}

/* line-height обовʼязково: без нього 40px кегль успадковував
   --lh-body 1.65 і посилання займало 86px замість 64px. */
.nav-overlay__link {
  display: inline-block;
  padding: 10px 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--paper);
  text-decoration: none;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--t) var(--ease-enter),
    transform var(--t) var(--ease-enter);
  transition-delay: calc(var(--i, 0) * 60ms);
}

/* Стагер розкриття. Бриф §9 дозволяє інлайн-стилі лише для
   SVG-анімації, тому індекси --i живуть тут, а не в розмітці. */
.nav-overlay__list li:nth-child(1) .nav-overlay__link { --i: 0; }
.nav-overlay__list li:nth-child(2) .nav-overlay__link { --i: 1; }
.nav-overlay__list li:nth-child(3) .nav-overlay__link { --i: 2; }
.nav-overlay__list li:nth-child(4) .nav-overlay__link { --i: 3; }
.nav-overlay__list li:nth-child(5) .nav-overlay__link { --i: 4; }
.nav-overlay__list li:nth-child(n + 6) .nav-overlay__link { --i: 5; }

.nav-overlay.is-open .nav-overlay__link {
  opacity: 1;
  transform: none;
}

.nav-overlay__link[aria-current="page"],
.nav-overlay__link.is-active {
  color: var(--gold-500);
}

.nav-overlay__foot {
  margin-top: clamp(32px, 6vh, 56px);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

/* Body scroll lock while overlay is open (nav.js toggles) */
.has-nav-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .site-header__nav,
  .site-header__actions .lang-switch {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }
}

/* Компенсація фіксованої висоти хедера. Ставиться на ПЕРШУ <section>
   сторінки без темного hero (як правило .page-header), а не на <main>. */
.u-header-offset {
  padding-block-start: calc(var(--header-h) + 24px);
}

/* ---- Site footer ---- */

.site-footer {
  background: var(--ink-900);
  --c-bg: var(--ink-900);
  --c-surface: var(--ink-800);
  --c-card-bg: var(--ink-800);
  padding-block: clamp(64px, 8vw, 112px) 40px;
}

.site-footer__horizon {
  color: var(--ink-500);
  margin-block-end: clamp(48px, 7vw, 80px);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: clamp(32px, 4vw, 56px);
}

@media (max-width: 900px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}

.site-footer__brand svg {
  height: 44px;
  width: auto;
}

.site-footer__tagline {
  margin-block-start: 20px;
  max-width: 34ch;
  font-size: var(--fs-sm);
  color: var(--ink-400);
}

.site-footer__heading {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--ink-400);
  margin-block-end: 18px;
}

.site-footer__links {
  display: grid;
  gap: 10px;
}

.site-footer__link {
  color: var(--ink-400);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-ui);
}

.site-footer__link:hover {
  color: var(--paper);
}

/* Соцмережі. РАМКИ У ЧІПА НЕМА свідомо: кожен бренд-гліф несе
   власний контур (LinkedIn і Instagram — заокруглений квадрат,
   Facebook — коло, YouTube — «екран»), і рамка чіпа давала
   рамку в рамці. Чіп лишається 40 × 40 як зона натискання;
   від'ємний margin вирівнює перший гліф із текстом колонки. */
.site-footer__socials {
  display: flex;
  gap: 6px;
  margin-block-start: 20px;
  margin-inline-start: -8px;
}

.site-footer__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--ink-400);
  border-radius: var(--r-sm);
  transition: color var(--t-fast) var(--ease-ui);
}

.site-footer__social:hover {
  color: var(--gold-500);
}

.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-block-start: clamp(48px, 6vw, 72px);
  padding-block-start: 28px;
  border-top: 1px solid var(--ink-600);
  color: var(--ink-400);
  font-size: var(--fs-xs);
}
