/* ============================================================
   base.css — токены проекта, сброс, общие компоненты
   МФОК (Форум объединённых культур). Значения — из Figma get_design_context.
   Брейкпоинты (desktop-first): base=1920 → max-width:1919=1440 → :1023=768 → :767=360.
   ============================================================ */

:root {
  /* Палитра */
  --c-dark:        #091e25; /* тёмные секции/кнопки */
  --c-dark-soft:   #2a3b45; /* шапка, карточки мини-новостей */
  --c-text:        #011f27; /* основной текст/заголовки на бежевом */
  --c-bg:          #f0dcc5; /* фон страницы (из Figma: rgb 240,220,197) */
  --c-line:        #bfb099; /* разделители на бежевом */
  --c-accent:      #c43a1e; /* CTA, цифры, активные элементы */
  --c-secondary:   #1c3d52; /* вторичный текст, лейблы */
  --c-btn-gray:    #415358; /* серые кнопки шапки */
  --c-photo-stub:  #d9d9d9; /* подложка фото */
  --c-white:       #ffffff;

  /* Шрифты */
  --font-display: 'Cochin LT', 'Cormorant Garamond', serif;
  --font-text:    'Inter Tight', Arial, sans-serif;

  /* Радиусы */
  --r4: 4px;  --r8: 8px;  --r12: 12px;  --r24: 24px;

  /* Сетка: гаттер контейнера (40 десктоп/планшет → 16 мобайл), кап контента 1920 */
  --gutter: 40px;
  --container-max: 1920px;

  /* Смещение шапки (под админ-панель Битрикса при будущей фиксации) */
  --header-offset: 0px;
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

/* Заголовочный стиль по умолчанию: Cochin, uppercase, weight 400 */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
}

/* ---------- Контейнер ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Иконки ---------- */
.icon { display: block; flex: none; }
/* стрелки/штрихи рисуются stroke=currentColor через спрайт */
.icon--stroke { fill: none; stroke: currentColor; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 56px;
  padding: 8px 24px;
  border-radius: var(--r8);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--c-white);
  white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease, opacity .2s ease, transform .15s ease;
}
.btn .icon { width: 20px; height: 20px; transition: transform .15s ease; }
.btn:not(.btn--icon):hover .icon { transform: translateX(4px); }

.btn--primary { background: var(--c-accent); }
.btn--dark    { background: var(--c-dark); }
.btn--light {
  background: rgba(255,255,255,.4);
  border: 1px solid var(--c-white);
  color: var(--c-text);
  opacity: .8;
}
.btn--light:hover { opacity: 1; background-color: rgba(255,255,255,.62); }
.btn--ghost { background: rgba(255,255,255,.2); color: var(--c-white); }

/* Ховеры кнопок — заметная реакция */
.btn--primary:hover { background-color: #a8301a; }
.btn--dark:hover    { background-color: #12333d; }
.btn--gray:hover    { background-color: #4c6168; }
.btn--ghost:hover   { background-color: rgba(255,255,255,.34); }

/* Малые кнопки шапки (h40) */
.btn--sm {
  height: 40px;
  padding: 8px 16px;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  border-radius: var(--r8);
}
.btn--sm .icon { width: 20px; height: 20px; }
.btn--gray { background: var(--c-btn-gray); color: var(--c-white); }
/* Квадратная иконочная кнопка (40×40) */
.btn--icon { width: 40px; height: 40px; padding: 10px; gap: 0; }
.btn--icon .icon { width: 20px; height: 20px; }

/* ---------- Лейбл секции «— Текст» ---------- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--c-accent);
}
.section-label__dash { width: 68px; height: 12px; color: inherit; }
.section-label__text {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  color: var(--c-text);
}
.section-label--light .section-label__text { color: var(--c-white); }

/* ---------- Стрелки слайдеров ---------- */
.slider-nav { display: inline-flex; gap: 4px; align-items: center; }
.slider-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(9,30,37,.3);
  border-radius: var(--r4);
  color: var(--c-text);
  background: transparent;
  transition: opacity .2s ease, background-color .2s ease;
}
.slider-nav__btn .icon { width: 20px; height: 20px; }
.slider-nav__btn[disabled] { opacity: .4; cursor: default; }
.slider-nav__btn:not([disabled]):hover { background-color: rgba(9,30,37,.08); }
.slider-nav--light .slider-nav__btn:not([disabled]):hover { background-color: rgba(255,255,255,.6); }
.slider-nav__btn--prev .icon { transform: scaleX(-1); }
.slider-nav--sm .slider-nav__btn { width: 24px; height: 24px; }
.slider-nav--sm .slider-nav__btn .icon { width: 12px; height: 12px; }
.slider-nav--light .slider-nav__btn {
  border-color: var(--c-white);
  color: var(--c-text);
  background: rgba(255,255,255,.4);
}

/* ---------- Утилиты ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Гаттер на мобайле ---------- */
@media (max-width: 767px) {
  :root { --gutter: 16px; }
}

/* ---------- Cookie-плашка (вешается main.js → initCookie) ---------- */
.s-cookie {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 24px;
  width: calc(100% - 2 * var(--gutter));
  max-width: 1200px;
  padding: 18px 28px;
  border-radius: var(--r12);
  background: var(--c-dark);
  color: rgba(255, 255, 255, .85);
  box-shadow: 0 12px 40px rgba(9, 30, 37, .35);
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  transition: opacity .3s ease, transform .3s ease;
}
.s-cookie.is-shown  { opacity: 1; transform: translateX(-50%) translateY(0); }
.s-cookie.is-hidden { opacity: 0; transform: translateX(-50%) translateY(20px); pointer-events: none; }
.s-cookie__text { margin: 0; font-family: var(--font-text); font-size: 14px; line-height: 20px; }
.s-cookie__link { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.s-cookie__link:hover { text-decoration: none; }
.s-cookie__btn { flex: none; }

@media (max-width: 767px) {
  .s-cookie {
    bottom: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
  }
  .s-cookie__btn { width: 100%; }
}

/* ---------- Обрезка длинных заголовков карточек многоточием «…» ----------
   В разметке всегда ПОЛНЫЙ заголовок статьи; визуально клампим до 3 строк.
   Featured (.s-feature__title) не клампим — он показывается целиком. */
.s-hero__card-title,
.s-news__name,
.s-ncard__title,
.s-rcard__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
