/* ============================================================
   Nordic Club UA — components.css
   Buttons, cards, chips, stats, accordion, tabs, filters,
   tables, forms, quotes, media, reveal. Load after layout.css.
   All colours come from the --c-* surface context (base.css /
   layout.css), so components flip automatically on dark.
   ============================================================ */

/* ---- Icon sizing ---- */

.icon {
  width: 24px;
  height: 24px;
  flex: none;
}

.icon--sm {
  width: 20px;
  height: 20px;
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--t-fast) var(--ease-ui),
    border-color var(--t-fast) var(--ease-ui),
    color var(--t-fast) var(--ease-ui),
    transform var(--t-fast) var(--ease-ui);
}

.btn:active {
  transform: translateY(0);
}

/* Primary — gold on navy text */
.btn--primary {
  background: var(--gold-500);
  color: var(--ink-900);
}

.btn--primary:hover {
  background: var(--gold-400);
  transform: translateY(-1px);
}

/* Ghost — hairline, fills on hover */
.btn--ghost {
  background: transparent;
  border-color: var(--c-line);
  color: var(--c-text);
}

.btn--ghost:hover {
  border-color: var(--c-text);
  background: var(--c-hover-fill);
}

/* Quiet — text + arrow */
.btn--quiet {
  min-height: 0;
  padding: 4px 0;
  border: 0;
  gap: 8px;
  color: var(--c-text);
  font-weight: 500;
}

.btn--quiet .icon,
.btn--quiet svg {
  width: 20px;
  height: 20px;
  color: var(--c-accent-text);
  transition: transform var(--t-fast) var(--ease-ui);
}

.btn--quiet:hover .icon,
.btn--quiet:hover svg {
  transform: translateX(4px);
}

.btn--sm {
  min-height: 40px;
  padding: 8px 18px;
  font-size: 0.875rem;
}

/* «Додати в календар». Живе ТУТ, а не в pages/events.css: events.js
   рендерить цю кнопку й на головній, де того файлу немає. */
.btn-ics svg {
  color: var(--c-accent-text);
}

.btn[disabled],
.btn[aria-disabled="true"],
.btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Row of CTAs (hero, section foot, final CTA). Use this instead of
   inline styles whenever two or more buttons sit side by side. */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.btn-row--tight {
  gap: 12px;
}

/* ---- Cards ---- */

a.card {
  text-decoration: none;
  color: inherit;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(24px, 3vw, 36px);
  background: var(--c-card-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--r);
  transition:
    border-color var(--t) var(--ease-ui),
    transform var(--t) var(--ease-ui),
    box-shadow var(--t) var(--ease-ui);
}

/* Tension-fan reveal on hover — currentColor through an SVG mask */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  -webkit-mask: url("../brand/tension-fan.svg") no-repeat right bottom / 72% auto;
  mask: url("../brand/tension-fan.svg") no-repeat right bottom / 72% auto;
  transition: opacity var(--t) var(--ease-ui);
}

.card:hover {
  border-color: var(--gold-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.card:hover::after,
.card:focus-within::after {
  opacity: 0.10;
}

.card--dark {
  background: var(--ink-700);
  border-color: var(--ink-600);
  color: var(--paper);
  --c-text: var(--paper);
  --c-muted: var(--ink-400);
  --c-line: var(--ink-500);
  --c-accent-text: var(--gold-500);
  --c-focus: var(--gold-500);
}

.card--dark:hover {
  border-color: var(--gold-500);
  box-shadow: none;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--c-muted);
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: 500;
  line-height: var(--lh-sub);
  letter-spacing: -0.01em;
  color: var(--c-text);
}

.card__title a {
  text-decoration: none;
}

/* Назва картки події — посилання на /events/<id> (events.js). */
.card__title-link:hover,
.card__title-link:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--c-accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.card__text {
  font-size: var(--fs-sm);
  color: var(--c-muted);
}

.card__icon {
  color: var(--c-accent-text);
}

.card__foot {
  margin-block-start: auto;
  padding-block-start: 8px;
}

/* ---- Локація події ----------------------------------------
   Назва місця веде на Google Maps (events.json → venueUrl).
   Підкреслення лишаємо: усередині картки посилання мусить
   читатися як посилання, а не як просто золотий текст. */

.event-venue-link {
  color: var(--c-accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.event-venue-link:hover {
  text-decoration-thickness: 2px;
}

/* Подія лише онлайн — «Онлайн» підкреслено золотою лінією (Василь
   29.10.2026: «щоб було зрозуміло»). */
.event-facts__online {
  font-weight: 500;
  color: var(--c-text);
  text-decoration: underline;
  text-decoration-color: var(--gold-500);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.card__meta-venue {
  font-weight: 500;
}

/* ---- Факти події: коли · де (спільне для events.html і
   компактних карток на index.html, щоб порядок і вигляд збігались) ---- */

.event-facts {
  display: grid;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--c-muted);
}

.event-facts li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.event-facts svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-block-start: 3px;
  color: var(--c-accent-text);
}

.event-facts__note {
  display: block;
  margin-block-start: 2px;
  font-size: var(--fs-xs);
}

.event-speakers {
  display: grid;
  gap: 10px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--c-line-soft);
  font-size: var(--fs-sm);
}

.event-speakers__name {
  font-weight: 500;
  color: var(--c-text);
}

.event-speakers__role {
  color: var(--c-muted);
}

.event-spots {
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-accent-text);
  font-variant-numeric: tabular-nums;
}

.event-pending {
  font-size: var(--fs-xs);
  color: var(--c-muted);
}

/* ---- Підказка після «Додати в календар» --------------------
   Зʼявляється тільки після натискання (events.js), бо сам по собі
   .ics завантажується мовчки — і кнопка виглядає зламаною. */

.event-cal-note {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-block-start: 10px;
  font-size: var(--fs-xs);
  color: var(--c-muted);
}

.event-cal-note__link {
  color: var(--c-accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Event card — date block */
.card--event .card__date {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card__date-day {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--c-accent-text);
}

.card__date-month {
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-accent-text);
}

/* Tier card — pricing */
.card--tier .card__price {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 200;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}

.card--tier .card__per {
  font-size: 0.875rem;
  color: var(--c-muted);
}

.card--tier .card__benefits {
  display: grid;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--c-muted);
}

/* Project card — status chip sits in .card__meta */
.card--project .card__status {
  align-self: flex-start;
}

/* ---- Chips ---- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
  white-space: nowrap;
}

.chip--gold {
  color: var(--c-accent-text);
  border-color: var(--c-accent-text);
  background: var(--gold-glow);
}

/* ---- Badge — small marker label with a rhombus tick ---- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-accent-text);
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  background: currentColor;
  transform: rotate(45deg);
}

/* ---- Stats & KPI band ---- */

.stat__num {
  font-family: var(--font-display);
  font-size: var(--fs-stat);
  font-weight: 200;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}

.stat__num sup {
  font-size: 0.45em;
  vertical-align: super;
  color: var(--c-accent-text);
}

.stat__label {
  margin-block-start: 10px;
  font-size: 0.875rem;
  color: var(--c-muted);
  max-width: 22ch;
}

/* 4-up desktop / 2-up tablet / 2-up mobile, hairline dividers */
.stat-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat-band .stat {
  padding: clamp(20px, 3vw, 36px) clamp(20px, 3vw, 40px);
  border-inline-start: 1px solid var(--c-line);
}

.stat-band .stat:first-child {
  border-inline-start: 0;
}

@media (max-width: 900px) {
  .stat-band {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 12px;
  }

  .stat-band .stat {
    border-inline-start: 0;
  }

  .stat-band .stat:nth-child(even) {
    border-inline-start: 1px solid var(--c-line);
  }
}

/* ---- Accordion ---- */

.accordion {
  border-top: 1px solid var(--c-line);
}

.accordion__item {
  border-bottom: 1px solid var(--c-line);
}

.accordion__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 22px 4px;
  text-align: left;
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: 700;
  color: var(--c-text);
  transition: color var(--t-fast) var(--ease-ui);
}

.accordion__btn:hover {
  color: var(--c-accent-text);
}

.accordion__btn .icon,
.accordion__btn svg {
  color: var(--c-muted);
  transition: transform var(--t) var(--ease-ui);
}

.accordion__btn[aria-expanded="true"] .icon,
.accordion__btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.accordion__panel {
  display: grid;
  grid-template-rows: minmax(0, 0fr);
  transition: grid-template-rows var(--t) var(--ease-ui);
}

.accordion__panel > * {
  overflow: hidden;
  min-height: 0;
}

.accordion__btn[aria-expanded="true"] + .accordion__panel,
.accordion__item.is-open .accordion__panel {
  grid-template-rows: 1fr;
}

.accordion__body {
  box-sizing: border-box;
  padding: 0 4px;
  color: var(--c-muted);
  max-width: var(--measure);
}

/* Відступ знизу — margin на останній дитині, а не padding на самому
   .accordion__body: цей елемент і є ціллю grid-колапсу (селектор
   .accordion__panel > *), а padding на ньому колапс до 0 ігнорує —
   рядок тексту лишався видимим під закритим питанням. */
.accordion__body > *:last-child {
  margin-bottom: 24px;
}

/* ---- Tabs ---- */

.tabs__list {
  display: flex;
  gap: clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--c-line);
  overflow-x: auto;
}

.tab {
  padding: 12px 6px 14px;
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  color: var(--c-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition:
    color var(--t-fast) var(--ease-ui),
    border-color var(--t-fast) var(--ease-ui);
}

.tab:hover {
  color: var(--c-text);
}

/* .tabs__list — scroll-контейнер, а overflow обрізає обидві осі,
   тому рамка малюється ВСЕРЕДИНІ бокса (offset -2px). */
.tab:focus-visible {
  outline-offset: -2px;
  border-radius: var(--r-sm);
}

/* Підкреслення активної вкладки — індикатор стану, тому колір із
   контексту поверхні, а не невидимий на білому gold-500. */
.tab[aria-selected="true"],
.tab.is-active {
  color: var(--c-text);
  border-bottom-color: var(--c-accent-text);
}

.tabs__panel[hidden] {
  display: none;
}

/* ---- Filter bar (events) — buttons with aria-pressed ---- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter {
  padding: 8px 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--c-muted);
  background: transparent;
  transition:
    color var(--t-fast) var(--ease-ui),
    background-color var(--t-fast) var(--ease-ui),
    border-color var(--t-fast) var(--ease-ui);
}

.filter:hover {
  color: var(--c-text);
  border-color: var(--c-muted);
}

.filter[aria-pressed="true"] {
  background: var(--c-solid);
  color: var(--c-solid-text);
  border-color: var(--c-solid);
}

/* ---- Comparison table ---- */

/* Усередині лише текст, тому в розмітці контейнер має tabindex="0"
   + role="region" + aria-labelledby (WCAG 2.1.1). Рамка — всередині,
   бо зовнішню обрізав би власний overflow. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--c-line);
  border-radius: var(--r);
}

.table-scroll:focus-visible {
  outline-offset: -2px;
}

.table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
}

.table th,
.table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--c-line);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--c-surface);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
}

.table tbody th {
  font-weight: 500;
  color: var(--c-text);
}

.table tbody tr:last-child th,
.table tbody tr:last-child td {
  border-bottom: 0;
}

.table .is-highlight {
  background: var(--gold-glow);
}

/* ---- Forms ---- */

/* align-content:start ОБОВʼЯЗКОВИЙ у двоколонковій .form-grid.
   Поле — це grid із рядків «підпис / контрол / підказка». Сусідня
   комірка з підказкою вища, тому сітка розтягує й це поле, а без
   align-content його внутрішні рядки розтягуються разом із ним:
   input стає вищим за сусідній, а відступ між підписом і полем
   росте. Візуально рядки форми йдуть косо. Пакуємо рядки вгору —
   поле займає стільки, скільки треба, а зайва висота лишається
   порожньою внизу комірки. */
.form-field {
  display: grid;
  gap: 8px;
  align-content: start;
}

.form-field + .form-field {
  margin-block-start: 18px;
}

.form-field > label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text);
}

/* font: inherit ОБОВʼЯЗКОВИЙ. Скидання шрифта для форм у проєкті
   немає, тому <select> і <textarea> беруть власний системний
   шрифт: у WebKit це ~13px замість успадкованих ~17px. Через це
   select виходив помітно нижчим за сусідній input у тому ж рядку
   сітки, а textarea малювалась моноширинною. */
.input,
.select,
.textarea {
  width: 100%;
  font: inherit;
  line-height: 1.4;
  padding: 13px 16px;
  background: var(--c-field-bg);
  color: var(--c-text);
  border: 1px solid var(--c-field-border);
  border-radius: 12px;
  transition: border-color var(--t-fast) var(--ease-ui), box-shadow var(--t-fast) var(--ease-ui);
}

/* box-shadow замість гострого outline: на заокругленому полі кутастий
   outline виглядав би дешевше. --gold-glow — той самий токен, що і
   для сяйва героя в tokens.css. */
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
  border-color: var(--c-accent-text);
  box-shadow: 0 0 0 4px var(--gold-glow);
}

/* Нативний <select> у WebKit ІГНОРУЄ padding, доки не скинуто
   системний вигляд, тому в сітці він виходив помітно нижчим за
   сусідній input. Скидаємо appearance і малюємо власну стрілку
   фоном. Колір стрілки — ink-400: він читається і на темному полі,
   і на світлому, тож одного правила вистачає на обидва контексти.
   Місце під стрілку звільняє padding-inline-end. */
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C93A4' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5 12 15.5 18 9.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--c-muted);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--c-muted);
  opacity: 0.7;
}

.textarea {
  min-height: 140px;
  resize: vertical;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--c-muted);
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-block-start: 3px;
  flex: none;
  /* Індикатор стану: --gold-600 давав 2.2:1 до білого поля. */
  accent-color: var(--c-accent-text);
}

.form-note {
  font-size: 0.875rem;
  color: var(--c-muted);
}

/* Палітра закрита (червоного токена немає): помилка = акцентна
   лінійка + насиченість + ЗАВЖДИ текст. Колір із контексту. */
.form-error {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text);
  padding-inline-start: 10px;
  border-inline-start: 2px solid var(--c-accent-text);
}

/* Два сигнали, а не лише колір: акцентна рамка ≥3:1 (WCAG 1.4.11)
   плюс подвоєна товщина через inset box-shadow (не зсуває
   розкладку). Третій — текст .form-error через aria-describedby. */
.input.is-invalid,
.select.is-invalid,
.textarea.is-invalid {
  border-color: var(--c-accent-text);
  box-shadow: inset 0 0 0 1px var(--c-accent-text);
}

.form-success {
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--c-accent-text);
  border-radius: var(--r);
  background: var(--gold-glow);
  color: var(--c-text);
}

/* ---- Logo strip (partners) ---- */

.logo-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vw, 64px);
}

.logo-strip img,
.logo-strip svg {
  height: 72px;
  width: auto;
  opacity: 0.55;
  filter: grayscale(1);
  transition: opacity var(--t-fast) var(--ease-ui), filter var(--t-fast) var(--ease-ui);
}

.logo-strip a:hover img,
.logo-strip a:hover svg {
  opacity: 0.9;
  filter: grayscale(0);
}

/* ---- Quote (testimonial) ---- */

.quote {
  position: relative;
  padding-inline-start: clamp(24px, 4vw, 40px);
  border-inline-start: 2px solid var(--gold-500);
}

.quote__text {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  font-weight: 300;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--c-text);
}

.quote__author {
  margin-block-start: 20px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text);
}

.quote__role {
  font-size: 0.875rem;
  color: var(--c-muted);
}

/* ---- Horizon divider — thin motif line in currentColor ---- */

.divider-horizon {
  height: clamp(40px, 6vw, 64px);
  background: currentColor;
  opacity: 0.55;
  -webkit-mask: url("../brand/horizon-simple.svg") no-repeat center / contain;
  mask: url("../brand/horizon-simple.svg") no-repeat center / contain;
}

/* Standalone divider inside a section (not the footer): needs its
   own breathing room above the following content. */
.divider-horizon--spaced {
  margin-block-start: clamp(48px, 7vw, 88px);
}

@supports not (mask: url("")) {
  .divider-horizon {
    height: 0;
    border-top: 1px solid var(--c-line);
    -webkit-mask: none;
    mask: none;
    background: none;
  }
}

/* ---- Media — image with navy scrim (AA text overlay) ---- */

.media {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--scrim-media);
}

/* --plain — послаблений скрим ЛИШЕ для фото БЕЗ тексту (.55 дає
   білому лише 3.9:1 на світлій ділянці кадру). Зʼявився .media__body
   — повертаємо повний скрим. Страховка: у розмітці такі фігури й так
   позначені класом .media, а не .media--plain. */
.media--plain::after {
  background: var(--scrim-media-soft);
}

.media--plain:has(.media__body)::after {
  background: var(--scrim-media);
}

/* Текст поверх фото — завжди світлий: скрим існує, щоб білий
   проходив AA, а не щоб сірий став читабельним. */
.media__body {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: clamp(20px, 3vw, 32px);
  color: var(--paper);
  --c-text: var(--paper);
  --c-muted: var(--paper-200);
  --c-accent-text: var(--gold-500);
  --c-focus: var(--gold-500);
}

/* ---- Breadcrumb ---- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--c-muted);
}

.breadcrumb li {
  display: flex;
  gap: 6px;
  align-items: center;
}

.breadcrumb li + li::before {
  content: "/";
  opacity: 0.5;
}

.breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--c-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb [aria-current="page"] {
  color: var(--c-text);
}

/* ---- Scroll reveal ----
   Scoped to html.js so content never hides without JavaScript.
   Stagger: set style="--i:0/1/2…" on siblings. reveal.js adds
   .is-in via IntersectionObserver (threshold .15, once). */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--t-slow) var(--ease-enter),
    transform var(--t-slow) var(--ease-enter);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---- Модалка «Дізнатись більше» (events.js → openEventModal) ---- */

/* На весь екран (рішення власника 03.10.2026): подія читається як
   окрема сторінка — повний опис буває довгим, і у вікні посеред
   екрана його доводилось гортати у вузькій смузі. Текст лишається
   колонкою --w-text по центру, хрестик закріплений у куті. */
.event-modal {
  /* Світла поверхня — власна, а не успадкована від <body>: у кабінеті
     body темний (.section--deep), а вікно події має виглядати так само,
     як на сайті (рішення власника 03.10.2026). Значення — з base.css. */
  --c-bg: var(--paper);
  --c-text: var(--ink-800);
  --c-muted: var(--slate-600);
  --c-line: var(--paper-200);
  --c-line-soft: var(--paper-100);
  --c-accent-text: var(--gold-800);
  --c-focus: var(--gold-800);
  --c-card-bg: var(--paper);
  --c-surface: var(--paper-50);
  --c-hover-fill: rgba(8, 29, 42, .05);
  --c-solid: var(--ink-800);
  --c-solid-text: var(--paper);
  margin: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: none;
  border-radius: 0;
  background: var(--c-card-bg);
  color: var(--c-text);
  overflow: hidden auto;
}

/* Відкрите вікно — колонкою: вміст розтягується, підвал унизу навіть
   тоді, коли опис короткий. Лише [open]: інакше display перебив би
   UA-правило, що ховає закритий <dialog>. */
.event-modal[open] {
  display: flex;
  flex-direction: column;
}

:is(.event-modal, .event-page) .event-modal__panel {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(880px + 32px);
  margin-inline: auto;
  padding: clamp(16px, 4vw, 48px) 16px;
}

:is(.event-modal, .event-page) .event-modal__image {
  border-radius: var(--r);
}

/* Дата, час і місце — одним рядком, а не стовпчиком. */
:is(.event-modal, .event-page) .event-modal__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}

:is(.event-modal, .event-page) .event-modal__facts li {
  margin: 0;
}

/* Короткий опис — вступом: крупніше, з тонкою лінією ліворуч. */
:is(.event-modal, .event-page) .event-modal__text {
  padding-inline-start: 16px;
  border-inline-start: 2px solid var(--gold-500);
  font-size: 1.125rem;
  line-height: 1.6;
}

/* Колір вікна й сторінки події (рішення власника 03.10.2026, варіант 3):
   мітки, іконки, підзаголовки й номери кроків — фʼордовим синім
   --ink-500; золото --gold-500 лише в лініях — рисці перед міткою й
   лінії біля вступу. Темне золото --gold-800 на білому давало
   оливкуватий відтінок. Картки подій у списках не зачіпає. */
:is(.event-modal, .event-page) {
  --event-ink: var(--ink-500);
}

:is(.event-modal, .event-page) .event-modal__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--event-ink);
}

:is(.event-modal, .event-page) .event-modal__eyebrow[hidden] {
  display: none;
}

:is(.event-modal, .event-page) .event-modal__eyebrow::before {
  content: "";
  flex: none;
  width: 18px;
  height: 2px;
  background: var(--gold-500);
}

/* Місце — одним рядком із містом і форматом: «Осло · Офлайн · Schjødt»
   (рішення власника 03.10.2026). Назва місця лишається посиланням на
   карту, кольором вікна. Картки в списках не зачіпає — там назва під
   рядком, як було. */
:is(.event-modal, .event-page) .event-modal__facts .event-facts__note {
  display: inline;
  margin: 0;
  font-size: inherit;
}

:is(.event-modal, .event-page) .event-modal__facts .event-facts__note::before {
  content: " · ";
  display: inline-block;
  white-space: pre;
  color: var(--c-muted);
  text-decoration: none;
}

:is(.event-modal, .event-page) .event-modal__facts .event-venue-link {
  color: var(--event-ink);
}

:is(.event-modal, .event-page) .event-modal__facts svg,
:is(.event-modal, .event-page) .rich__h,
:is(.event-modal, .event-page) .rich__steps li::before {
  color: var(--event-ink);
}

/* Підзаголовки розділів — золоте підкреслення на всю довжину слова
   (рішення власника 03.10.2026, варіант 6). text-decoration, а не
   рамка: дворядковий заголовок («Що ми хочемо зробити») підкреслений
   на кожному рядку, а не однією лінією під блоком. */
:is(.event-modal, .event-page) .rich__h {
  text-decoration: underline;
  text-decoration-color: var(--gold-500);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  text-decoration-skip-ink: none;
  line-height: 1.9;
  padding-block-start: 0;
}

:is(.event-modal, .event-page) .event-modal__desc {
  margin-block-start: 8px;
}

/* Підвал вікна — .site-footer дає синє тло й світлі кольори. */
.event-modal .event-modal__foot {
  flex: none;
  padding-block: clamp(40px, 6vw, 72px) clamp(32px, 5vw, 48px);
  text-align: start;
}

.event-modal__foot-inner {
  max-width: calc(880px + 32px);
  margin-inline: auto;
  padding-inline: 16px;
}

.event-modal__foot .site-footer__horizon {
  margin-block-end: clamp(32px, 5vw, 56px);
}

.event-modal__foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.event-modal__foot-brand img {
  display: block;
  width: 220px;
  height: auto;
  margin-block-end: 16px;
}

.event-modal__foot .site-footer__tagline {
  margin: 0;
}

.event-modal__foot .site-footer__heading {
  margin-block-end: 12px;
}

.event-modal__foot .site-footer__socials {
  margin-block-start: 16px;
}

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

.event-modal .event-modal__close {
  position: fixed;
  top: 16px;
  right: 16px;
}

.event-modal::backdrop {
  background: rgba(5, 15, 24, 0.72);
}

.event-modal__panel {
  position: relative;
}

.event-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(5, 15, 24, 0.55);
  color: var(--paper);
}

.event-modal__close svg {
  width: 18px;
  height: 18px;
}

.event-modal__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.event-modal__image[hidden] {
  display: none;
}

.event-modal__body {
  display: grid;
  gap: 14px;
  padding: clamp(20px, 3vw, 32px);
}

.event-modal__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 500;
  color: var(--c-text);
}

.event-modal__text[hidden],
.event-modal__desc[hidden],
.event-modal__speakers[hidden] {
  display: none;
}

/* ---- Повний опис події (rich-text.js, api/event-page.js → richHtml) ----
   Розділ — підзаголовок ліворуч, текст праворуч, між розділами тонка
   лінія; на вузькому екрані підзаголовок стає над текстом. Без
   декоративних знаків: лише мітки, лінії й рамки (рішення власника
   щодо стриманих блоків). */
.rich {
  display: grid;
  line-height: 1.7;
  color: var(--c-text);
}

.rich__sec {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 10px clamp(20px, 4vw, 40px);
  padding-block: clamp(20px, 3vw, 28px);
  border-block-start: 1px solid var(--c-line);
}

.rich__sec:first-child {
  border-block-start: 0;
  padding-block-start: 8px;
}

.rich__sec--plain .rich__body {
  grid-column: 1 / -1;
}

.rich__h {
  margin: 0;
  padding-block-start: 5px;
  font-family: var(--font-body, inherit);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-accent-text);
}

.rich__side {
  display: grid;
  align-content: start;
  gap: 16px;
}

/* Логотип клубу під «Організатор» (rich-text.js → ORG_RE). */
.rich__org {
  display: block;
  width: 160px;
  height: auto;
}

.rich__body {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.rich__p {
  margin: 0;
}

/* Кроки: номер ліворуч, між пунктами тонка лінія. */
.rich__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rich-step;
}

.rich__steps li {
  counter-increment: rich-step;
  position: relative;
  margin: 0;
  padding: 10px 0 10px 44px;
  border-block-start: 1px solid var(--c-line);
}

.rich__steps li:first-child {
  border-block-start: 0;
  padding-block-start: 0;
}

.rich__steps li::before {
  content: counter(rich-step, decimal-leading-zero);
  position: absolute;
  inset-inline-start: 0;
  top: 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.7rem;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
  color: var(--c-accent-text);
}

.rich__steps li:first-child::before {
  top: 0;
}

/* Короткі пункти — компактними заокругленими мітками за довжиною
   тексту (рішення власника 03.10.2026: лаконічніше, не великі
   квадрати). margin: 0 обовʼязковий: загальне li + li у base.css
   піднімало першу мітку над рештою. */
.rich__chips {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rich__chips li {
  margin: 0;
  padding: 4px 12px;
  border: 1px solid var(--c-line);
  border-radius: 14px;
  font-size: var(--fs-xs);
  line-height: 1.5;
}

/* Програма події (rich-text.js → programRows, 09.10.2026): розкривна
   таблиця «час — що відбувається». Закрита за замовчуванням. */
.rich__program {
  --prog-ink: var(--c-accent-text);
  border: 1px solid var(--c-line);
  border-radius: 14px;
  overflow: hidden;
}

.rich__program-toggle {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  transition: background-color .2s ease;
}

.rich__program-toggle:hover { background: color-mix(in srgb, var(--prog-ink) 4%, transparent); }
.rich__program-toggle::-webkit-details-marker { display: none; }

.rich__program-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rich__program-label { display: grid; gap: 2px; min-width: 0; }
.rich__program-title { font-weight: 500; color: var(--c-text); }
.rich__program-meta { font-size: var(--fs-sm); color: var(--c-muted); }

.rich__program-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 7px 14px 7px 16px;
  border: 1px solid var(--prog-ink);
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--prog-ink);
  transition: background-color .2s ease, color .2s ease;
}

.rich__program-btn::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s ease;
}

.rich__program-toggle:hover .rich__program-btn { background: var(--prog-ink); color: #fff; }
.rich__program[open] .rich__program-btn::after { transform: translateY(2px) rotate(-135deg); }

.rich__program-hide,
.rich__program[open] .rich__program-show { display: none; }
.rich__program[open] .rich__program-hide { display: inline; }

/* Смуга вечора: кожен пункт — відрізок завдовжки зі свій час. */
.rich__program-bar { display: flex; gap: 3px; height: 6px; }
.rich__seg { flex: 1 1 0; min-width: 4px; border-radius: 3px; background: color-mix(in srgb, var(--prog-ink) 18%, transparent); }
.rich__seg--talk { background: var(--prog-ink); }
.rich__seg--break { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--prog-ink) 30%, transparent) 0 3px, transparent 3px 6px); }

.rich__program .rich__timeline {
  margin: 0;
  padding: 6px 20px 14px;
  list-style: none;
  border-block-start: 1px solid var(--c-line);
}

.rich__row {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 14px;
  margin: 0;
}

.rich__time {
  padding-block: 12px;
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--prog-ink);
  white-space: nowrap;
}

/* Шкала: точка біля кожного пункту, лінія між ними. */
.rich__what {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 12px 0 12px 26px;
}

.rich__what::before {
  content: "";
  position: absolute;
  left: 0;
  top: 19px;
  width: 11px;
  height: 11px;
  box-sizing: border-box;
  border: 2px solid var(--prog-ink);
  border-radius: 50%;
  background: var(--c-bg);
  z-index: 1;
}

.rich__what::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: color-mix(in srgb, var(--prog-ink) 25%, transparent);
}

.rich__row:first-child .rich__what::after { top: 24px; }
.rich__row:last-child .rich__what::after { bottom: auto; height: 24px; }

.rich__row--talk .rich__what::before { background: var(--prog-ink); }
.rich__row--break .rich__what { color: var(--c-muted); font-style: italic; }
.rich__row--break .rich__what::before { border-style: dashed; }

.rich__who { font-weight: 500; color: var(--c-text); }
.rich__topic { color: var(--c-muted); }

.rich__row--talk {
  margin-inline: -20px;
  padding-inline: 20px;
  background: color-mix(in srgb, var(--prog-ink) 5%, transparent);
}

.rich__row--talk .rich__what::before { box-shadow: 0 0 0 4px color-mix(in srgb, var(--prog-ink) 12%, transparent); }

:is(.event-modal, .event-page) .rich__program { --prog-ink: var(--event-ink); }

@media (max-width: 480px) {
  .rich__program-toggle { padding: 16px; }
  /* Вузько: кнопка — лише кружок зі стрілкою, підпис на весь рядок. */
  .rich__program-btn { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .rich__program-btn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .rich__program .rich__timeline { padding-inline: 16px; }
  .rich__row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .rich__row--talk { margin-inline: -16px; padding-inline: 16px; }
  .rich__time { padding: 12px 0 0 26px; }
  .rich__what { padding-top: 2px; }
  .rich__what::before { top: -12px; }
  .rich__row:first-child .rich__what::after { top: -6px; }
}

/* ---- Перегляд фото на весь екран ----
   <dialog> на весь вʼюпорт: сам dialog — темне поле, фото по центру
   вписане цілком (contain, не обрізане). Клік по полю закриває. */
.has-photo-viewer {
  overflow: hidden;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(64px, 8vh, 88px) clamp(16px, 7vw, 104px);
  border: 0;
  /* Суцільне тло: над білим вікном події (кабінет, recapNode) напівпрозоре
     пропускало текст вікна крізь фото. */
  background: var(--ink-900);
  color: var(--paper);
}

.photo-viewer[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-viewer::backdrop {
  background: transparent;
}

.photo-viewer__img {
  max-width: min(100%, 1600px);
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .8);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
}

.photo-viewer__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(8, 29, 42, .7);
  color: var(--paper);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-ui), color var(--t-fast) var(--ease-ui);
}

.photo-viewer__btn[hidden] {
  display: none;
}

.photo-viewer__btn svg {
  width: 22px;
  height: 22px;
}

.photo-viewer__btn:hover,
.photo-viewer__btn:focus-visible {
  border-color: var(--gold-500);
  color: var(--gold-500);
}

.photo-viewer__close {
  top: 16px;
  right: 16px;
}

.photo-viewer__nav {
  top: 50%;
  transform: translateY(-50%);
}

.photo-viewer__nav--prev {
  left: clamp(12px, 2vw, 28px);
}

.photo-viewer__nav--next {
  right: clamp(12px, 2vw, 28px);
}

.photo-viewer__count {
  position: absolute;
  bottom: clamp(20px, 3vh, 32px);
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--fs-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-400);
}

/* На телефоні стрілки внизу, по боках від лічильника: посередині
   екрана вони закривали б саме фото. */
@media (max-width: 600px) {
  .photo-viewer {
    padding: 72px 12px 96px;
  }

  .photo-viewer__nav {
    top: auto;
    bottom: 20px;
    transform: none;
  }

  .photo-viewer__nav--prev {
    left: calc(50% - 104px);
  }

  .photo-viewer__nav--next {
    right: calc(50% - 104px);
  }

  .photo-viewer__count {
    bottom: 36px;
  }
}

/* Фото минулої події (events.js → recapNode): сітка мініатюр, клік —
   переглядач, як в архіві на сайті. */
.rich__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
}
.rich__photo {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--c-surface, #f6f7f8);
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
}
.rich__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.rich__photo:hover img { transform: scale(1.04); }
.rich__photo:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }

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

.event-modal__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-block-start: 8px;
}

/* Лічильник місць у вікні й на сторінці події (112): синій підпис,
   золото — лише в лінії заповнення (стандарт оформлення подій). */
.event-seats {
  display: grid;
  gap: 8px;
  margin-block-start: 8px;
  padding-block-start: 18px;
  border-block-start: 1px solid var(--c-line);
}
.event-seats[hidden] { display: none; }
.event-seats__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.event-seats__count { white-space: nowrap; }
.event-seats__bar {
  position: relative;
  block-size: 4px;
  border-radius: 2px;
  background: var(--c-line);
  overflow: hidden;
}
.event-seats__fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  background: var(--gold-500);
  border-radius: 2px;
  transition: width .4s ease;
}
.event-seats__note { margin: 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--c-muted); }

/* ============================================================
   Reduced motion — kill transforms and animations, keep short
   opacity fades only. Must stay LAST in this file.
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .btn--primary:hover,
  .btn--quiet:hover .icon,
  .btn--quiet:hover svg,
  .card,
  .card:hover,
  .card::after,
  .accordion__btn svg,
  .accordion__btn .icon,
  .accordion__panel,
  .nav-overlay,
  .nav-overlay__link,
  .nav-overlay.is-open .nav-overlay__link,
  .site-header,
  .site-header__link::after,
  .logo-strip img,
  .logo-strip svg {
    transition-duration: 0.01ms;
    transition-delay: 0ms;
  }

  .btn--primary:hover,
  .btn:active,
  .card:hover,
  .btn--quiet:hover .icon,
  .btn--quiet:hover svg {
    transform: none;
  }

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