/*
  ДН 35 — style.css
  =================
  Дизайн ще в процесі — секції додаються по мірі того, як приходять екрани.
  Готово: Hero.
  Заглушка (з попереднього каркасу, чекає дизайну): вступне слово, рубрики,
  сторінки рубрик, картки, нижня/верхня навігація в рубриці.
*/

/* ===================== ШРИФТИ ===================== */
@font-face {
  font-family: "KyivTypeTitling";
  src: url("KyivTypeTitling-Medium.eot");
  src: url("KyivTypeTitling-Medium.eot?#iefix") format("embedded-opentype"),
       url("KyivTypeTitling-Medium.woff2") format("woff2"),
       url("KyivTypeTitling-Medium.woff") format("woff"),
       url("KyivTypeTitling-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ===================== ТОКЕНИ ===================== */
:root {
  /* брендові кольори (Figma) */
  --color-pink: #D50762;    /* акцент — з triangle-color-top.svg */
  --color-purple: #849ECE;  /* другорядний — картки рубрик */
  --color-light-gray: #E9E9EA;
  --color-dark: #051107;
  --color-white: #ffffff;

  --color-bg: var(--color-white);
  --color-surface: var(--color-light-gray);
  --color-text: var(--color-dark);
  --color-muted: #6b6b6b;
  --color-accent: var(--color-pink);
  --color-secondary: var(--color-purple);
  --color-border: #e0e0e0;

  --font-body: "Montserrat", system-ui, -apple-system, sans-serif;
  --font-title: "KyivTypeTitling", "Montserrat", system-ui, -apple-system, sans-serif;

  /* товщина стрічок трикутників — легко підкрутити тут */
  --ribbon-top-h: 40px;
  --ribbon-bottom-h: 40px;
  --triangle-ratio: 0.861; /* однакове співвідношення сторін в обох svg */
}
.z-4 {
  z-index: 4;
}
.z-5 {
  z-index: 5;
}
.z-6 {
  z-index: 6;
}
.z-7 {
  z-index: 7;
}
.z-8 {
  z-index: 8;
}
.z-10 {
  z-index: 10;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.5;
}
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; }
p { margin: 0 0 1em; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.position-relative {
  position: relative;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.lead {
    font-size: 1.3em;
}
.video-link, .item-link {
    margin-bottom: 2em;
    display: block;
    position: relative;
}
.video-cover, .item-cover {
    border-radius: 1rem;
}
h4 {
  margin-top: 0;
}
.title {
    font-family: var(--font-title);
    font-weight: 500;
    text-transform: uppercase;
    font-size: clamp(20px, 2.3vw, 26px);
    letter-spacing: .01em;
    margin-bottom: 1em;
}
/* ===================== CONTAINER (Bootstrap 5.3 breakpoints) ===================== */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}
@media (min-width: 576px)  { .container { max-width: 540px; } }
@media (min-width: 768px)  { .container { max-width: 720px; } }
@media (min-width: 992px)  { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

/* ===================== PAGES (роутинг) ===================== */
.page { display: none; }
.page.is-active { display: block; }

/* =========================================================
   HERO
========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(340px, 52vw, 820px);
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

/* стрічки трикутників — повторювані по горизонталі svg-плитки */
.hero__ribbon {
  position: absolute;
  left: 0;
  width: 100%;
  z-index: 3;
  background-repeat: repeat-x;
  background-position: left top;
  pointer-events: none;
}
.hero__ribbon--top {
  top: 0;
  height: var(--ribbon-top-h);
  background-image: url("../img/triangle-color-top.svg");
  background-size: calc(var(--ribbon-top-h) * var(--triangle-ratio)) var(--ribbon-top-h);
}
.hero__ribbon--bottom {
  bottom: 0;
  height: var(--ribbon-bottom-h);
  background-image: url("../img/triangle-gray-bottom.svg");
  background-size: calc(var(--ribbon-bottom-h) * var(--triangle-ratio)) var(--ribbon-bottom-h);
}
.hero__ribbon--blue {
    background-image: url(../img/triangle-blue-bottom.svg);
}
.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding-top: clamp(40px, 8vw, 90px);
  padding-bottom: clamp(40px, 8vw, 90px);
}
.hero__emblem {
  width: 100%;
  max-width: 520px;
  height: auto;
}

@media (max-width: 575.98px) {
  :root {
    --ribbon-top-h: 30px;
    --ribbon-bottom-h: 30px;
  }
  .hero__emblem { max-width: 320px; }
}

/* =========================================================
   INTRO BLOCK (Екран 2 — вступне слово)
========================================================= */
.intro-block {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  padding: 64px 0 0;
}

/* фоновий патерн el1.png — до правого краю ЕКРАНУ (не контейнера),
   висота блока = 4 висоти однієї плитки */
.intro-block__pattern {
    position: absolute;
    top: 40px;
    right: 0;
    width: min(48vw, 640px);
    height: calc(var(--el1-tile-h) * 4);
    background-image: url(../img/el1.png);
    background-repeat: repeat;
    background-size: auto calc(100% / 4);
    z-index: 1;
    height: calc(100% - 40px);
    left: 0;
}
:root {
  --el1-tile-h: 92px;
  --el1-tile-w: calc(var(--el1-tile-h) * 180 / 162); /* натуральні пропорції el1.png */
}

.intro-block__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
}


.intro-block__text { max-width: 560px; }
.intro-block__quote { width: 90px; height: auto; margin-bottom: 16px; }
.intro-block__text p { font-size: 17px; font-weight: 600; /*color: var(--color-text);*/ }

.intro-block__signature { margin-top: 24px; }
.intro-block__signature strong { display: block; font-size: 16px; font-weight: 700; }
.intro-block__signature span { display: block; font-size: .8em; /*color: var(--color-muted);*/ font-weight: 400; }


.intro-block__full,
.intro-block__toggle-wrap {
  grid-column: 1 / -1;
}

.intro-block__toggle-wrap {
  display: flex;
  justify-content: start;
}

.intro-block__full {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .4s ease, opacity .3s ease, margin-top .4s ease;
}
.intro-block__full[hidden] { display: block; } /* керуємо через max-height, не через hidden-атрибут */
.intro-block__full.is-open {
  max-height: 4000px; /* з запасом — реального тексту менше */
  opacity: 1;
  margin-top: 20px;
}
.intro-block__full p { font-weight: 400; font-size: 15px; color: var(--color-text); }

.intro-block__toggle {

  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: transparent;
  border: 2px solid var(--color-accent);
  border-radius: 4px;
  color: var(--color-accent);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  text-transform: lowercase;
  cursor: pointer;
}
.intro-block__arrow {
  display: inline-block;
  width: 10px;
  height: 12px;
  background-image: url("../img/triangle-color-top.svg");
  background-size: contain;
  background-repeat: no-repeat;
}
.intro-block__arrow--left  { transform: rotate(-90deg); }
.intro-block__arrow--right { transform: rotate(90deg); }

.intro-block__avatar-wrap { position: relative; z-index: 2; }
.intro-block__avatar {
    width: 320px;
    height: auto;
    margin-top: 0;
    margin-left: 50px;
    margin-bottom: 30px;
}
@media (max-width:991px) {
  .intro-block__avatar {
    margin-left: 0;
  }
  .intro-block {
    padding: 24px 0 0;
  }
}
/* стрічка el2.png під кнопкою — фоном, повтор по X, ширина контейнера */
.intro-block__ribbon {
  grid-column: 1 / -1;
  position: relative;
  z-index: 2;
  margin-top: 48px;
  width: 100%;
  height: var(--el2-tile-h);
  background-image: url("../img/el2.png");
  background-repeat: repeat-x;
  background-position: left top;
  background-size: var(--el2-tile-w) var(--el2-tile-h);
}
:root {
  --el2-tile-h: 40px;
  --el2-tile-w: calc(var(--el2-tile-h) * 94 / 112); /* натуральні пропорції el2.png */
}

@media (max-width: 991.98px) {
  .intro-block__inner { grid-template-columns: 1fr; }
  .intro-block__avatar-wrap { justify-self: center; }
  .intro-block__pattern {width: 100%;
        /* opacity: .6; */
        background-position: center top;}
}
@media (max-width: 575.98px) {
  :root { --el1-tile-h: 64px; --el2-tile-h: 26px; }
}

/* =========================================================
   RUBRIC TEASER (Екран 3+ — прев'ю рубрики на головній,
   з переходом в саму рубрику по кнопці)
========================================================= */
:root {
  --rt-ribbon-h: 40px;         /* висота верхньої/нижньої стрічки трикутників */
  --rt-flat-h: 90px;           /* висота чистого блоку var(--color-surface) під стрічкою, куди заходить голова з фото */
  --rt-photo-w: clamp(280px, 72vw, 70vw); /* img3.png майже квадратний (1001×1000) */
  --rt-photo-shift: 200px;     /* наскільки фото зсунуте вліво від центру (заходить на картку) */
}

.rubric-teaser {
  position: relative;
  overflow: hidden; /* ріже фото справа/знизу, як і задумано */
  padding: 230px 0px 240px;
}

.rubric-teaser__bg {
  position: absolute;
  inset: 0;
  background-image: url("../img/bg2.jpg");
  background-size: cover;
  background-position: center;
  z-index: 1;
}

/* чистий колір під верхньою стрічкою — та сама заливка, що й у самій svg-стрічці (var(--color-surface)),
   щоб голова на фото "стояла" на рівному тлі, а не на текстурі бетону */
.rubric-teaser__flat {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--rt-flat-h);
  background: var(--color-surface);
  z-index: 2;
}

.rubric-teaser__ribbon {
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--rt-ribbon-h);
  background-repeat: repeat-x;
  background-size: calc(var(--rt-ribbon-h) * var(--triangle-ratio)) var(--rt-ribbon-h);
  pointer-events: none;
  z-index: 5;
}
.rubric-teaser__ribbon--top {
    top: var(--rt-flat-h);
    background-image: url(../img/triangle-gray-top.svg);
}
.rubric-teaser__ribbon--bottom {
  bottom: 0;
  background-image: url("../img/triangle-gray-bottom.svg");
}
.rubric-teaser__ribbon--purple--bottom {
  bottom: 0;
  background-image: url("../img/triangle-color-bottom.svg");
}
.rubric-teaser__ribbon.rubric-teaser__ribbon--purple--bottom {
    z-index: 13;
}
.rubric-teaser__card {
  position: relative;
  max-width: 480px;
  background: var(--color-secondary);
  border-radius: 4px;
  padding: 40px;
  /* право­руч запас під нахлест фото — підбирається разом з --rt-photo-shift */
  padding-right: calc(40px + var(--rt-photo-shift) * 0.35);
  color: var(--color-white);
}
.rubric-teaser__title { width: 100%; max-width: 300px; height: auto; margin-bottom: 16px; }
.rubric-teaser__text { font-size: 15px; margin-bottom: 20px; }

.rubric-teaser__button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border: 2px solid var(--color-accent);
  border-radius: 4px;
  color: var(--color-white);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.rubric-teaser__photo {
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: calc(var(--rt-photo-shift) * -1);
    width: auto;
    height: 100%;
}

@media (max-width: 991.98px) {
  .rubric-teaser {
    padding: 180px 0px 0px;
  }
    .rubric-teaser__photo {
        position: relative;
        margin-top: -40px;
        height: calc(100% + 40px);
        margin-left: -40%;
    }
  .rubric-teaser__card { max-width: 100%; padding-right: 40px; }
}
@media (max-width: 575.98px) {
  :root { --rt-ribbon-h: 24px; --rt-flat-h: 60px; }
}

/* =========================================================
   RUBRIC DUO (Екран 4 — "Артефакти" + "Україна, як вибір"
   в одній секції, з переходом кожна у свою рубрику)
========================================================= */
.rubric-duo {
  position: relative;
  background: var(--color-surface);
  padding: 40px 0 0px;
  z-index: auto; /* лежить поверх хвоста попередньої секції за замовчуванням (пізніший елемент), але явний z-index — на випадок майбутніх stacking-контекстів */
  
}

.rubric-duo__cards {
  display: flex;
  flex-direction: column;
}

.title-stroked {
    font-family: var(--font-title);
    font-size: 40px;
    font-weight: normal;
    color: #fff;
    -webkit-text-fill-color: #fff;
    -webkit-text-stroke: 15px var(--color-pink);
    paint-order: stroke fill;
}
@media (max-width:576px) {
  .title-stroked {
    font-size: 30px;
  }
}
.hero-title {
  font-family: var(--font-title);
  font-size: 60px;
  font-weight: normal;
  color: #fff;
  -webkit-text-fill-color: #fff;
  -webkit-text-stroke: 22px var(--color-pink);
  paint-order: stroke fill;
  text-align: center;
}
.rubric-duo__card {
  position: relative;
  z-index: 1;
  max-width: 460px;
  padding: 32px 36px;
  border-radius: 4px;
  color: var(--color-white);
  margin-top: -110px;
  z-index: 8;
}
.rubric-teaser__card_purple {
  background: var(--color-accent);
}
.rubric-teaser__card_purple .title-stroked {
  -webkit-text-stroke: 15px var(--color-purple);
}
.rubric-duo__card--artefakty {
  align-self: flex-start;
  background: var(--color-secondary);
}
.rubric-duo__card--vybir {
  align-self: flex-end;
  margin-top: -40px; /* невеликий нахлест на перший блок, шаховий порядок */
  z-index: 9; /* пізніша картка лягає поверх кута першої */
  
}

.rubric-duo__title { width: 100%; height: auto; margin-bottom: 16px; }
.rubric-duo__card--artefakty .rubric-duo__title { max-width: 280px; }
.rubric-duo__card--vybir .rubric-duo__title { max-width: 320px; }

.rubric-duo__text { font-size: 15px; margin-bottom: 20px; }

.rubric-duo__button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border: 2px solid var(--color-white);
  border-radius: 4px;
  color: var(--color-white);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.rubric-duo__button .intro-block__arrow { filter: brightness(0) invert(1); } /* трикутники в колір рамки кнопки (білий) */

/* велосипед — виступ за ліву межу контейнера, той самий трюк, що .offset-left-lg */
.rubric-duo__bike-wrap {
    position: relative;
    /* width: 100%; */
    /* left: 50%; */
    /* margin-left: -50%; */
    /* margin-top: 40px; */
    overflow: hidden;
    margin-left: -300px;
    text-align: right;
}
.rubric-duo__bike {
  margin-top: -30px; 
}

@media (max-width: 991.98px) {
  .rubric-duo__card--vybir {
    margin-left: auto;
  }
  .rubric-duo__bike {
      margin-top: -30px;
      z-index: 2;
        position: relative;
  }
  .rubric-duo__bike-wrap {
    position: relative;
    width: 100%;
    left: auto;
    margin-left: 0;
    overflow: visible;
    margin-left: auto;
    text-align: right;
}
}
@media (max-width: 767.98px) {
  .rubric-duo__card { max-width: 100%; }
  .rubric-duo__card--vybir { margin-top: 24px; } /* на вузькому екрані шаховий нахлест ламається — просто йдуть одна під одною */
}

/* =========================================================
   HOME TIMELINE — хвиляста лінія, що проходить крізь тизери рубрик
   на головній (від #start-timeline до #end-timeline). top/height
   рахуються в JS (positionHomeTimeline), бо висота між точками
   "плаває" разом з реflow-ом контенту при зміні ширини екрана.
========================================================= */
#page-home { position: relative; }

.home-timeline {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6; /* нижче .rubric-teaser__card(4)/__photo(5), вище __bg(1)/__flat(2) */
  background-image: url("../img/timeline.svg");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}

/* крапки на лінії — окремі кола (не всередині svg), щоб не спотворювались
   через preserveAspectRatio:none у самій лінії; left/top у % — ті самі
   координати cx/cy, що були в оригінальному timeline.svg */
.home-timeline__dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid;
  transform: translate(-50%, -50%);
}
.home-timeline__dot--pink {
  background: var(--color-accent);
  border-color: var(--color-white);
}
.home-timeline__dot--purple {
  background: var(--color-secondary);
  border-color: #949494;
}

/* =========================================================
   РУБРИКА - УКРАЇНА ЯК ЛЮДИНА
========================================================= */
.rubric-color-bg {
  background-color: var(--color-accent);
}
.rubric-teaser--lyudyna {
    padding: 100px 0;
}
.rubric-teaser--lyudyna .rubric-teaser__card {
    margin: auto;
    background: var(--color-light-gray);
    color: var(--color-dark);
    padding-right: 40px;
}
.rubric-teaser--lyudyna .rubric-teaser__card .rubric-teaser__button {
    color: var(--color-dark);
}
@media (max-width:991px) {
  .rubric-teaser--lyudyna {
    padding: 60px 0;
  }
}
/* =========================================================
   SHARE BLOCK (Екран 7 — "Поділитися", закриває стрічку
   рубрик-тізерів на головній)
========================================================= */
:root {
  --share-ribbon-h: 40px;
}

.share-block {
  position: relative;
  background: var(--color-surface);
  padding: var(--share-ribbon-h) 0;
  overflow: hidden;
}

/* ті самі стрічки трикутників, що й у hero/rubric-teaser — верх як hero__ribbon--top,
   низ як rubric-teaser__ribbon--purple--bottom */
.share-block__ribbon {
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--share-ribbon-h);
  background-repeat: repeat-x;
  background-position: left top;
  background-size: calc(var(--share-ribbon-h) * var(--triangle-ratio)) var(--share-ribbon-h);
  pointer-events: none;
}
.share-block__ribbon--top {
  top: 0;
  background-image: url("../img/triangle-color-top.svg");
}
.share-block__ribbon--bottom {
  bottom: 0;
  background-image: url("../img/triangle-color-bottom.svg");
}

.share-block__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 60px 0;
}
.share-block__photo {
  width: 100%;
  max-width: 460px;
  height: auto;
  flex: 1 1 0;
}
.share-block__share {
  flex: 0 0 auto;
  text-align: center;
}
.share-block__label {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text);
}

.c-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.c-socials__link {
  display: inline-block;
  width: 32px;
  height: 32px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.i-facebook  { background-image: url("../img/facebook.svg"); }
.i-instagram { background-image: url("../img/instagram.svg"); }
.i-twitter   { background-image: url("../img/twitter.svg"); }

@media (max-width: 767.98px) {
  .share-block__inner { flex-wrap: wrap; }
  .share-block__photo { max-width: 45%; }
  .share-block__share { flex: 1 0 100%; order: 3; margin-top: 24px; }
}
@media (max-width: 575.98px) {
  :root { --share-ribbon-h: 24px; }
  .share-block__photo { max-width: 100%; flex: 1 0 100%; }
  .share-block__photo:last-of-type { order: 2; }
  .share-block__share { order: 1; margin-top: 0; margin-bottom: 24px; }
}

/* =========================================================
   RUBRIC CONTENT — блочна система статті всередині рубрики
   (перша реалізація: "Голоси Незалежності")
========================================================= */

/* 1. Hero рубрики — той самий .hero/.hero__ribbon/.hero__bg, що й на
   головній, тільки без фіксованого min-height: висоту задає padding
   навколо titul-svg (.rubric-hero__content) */
.hero--rubric { min-height: 0; }
.rubric-hero__content {
  padding: clamp(48px, 15vw, 240px) 0;
}
.rubric-hero__emblem { max-width: 460px; }

/* 2/3/4/5/6. Контентні блоки статті — чергування світло-сірого і
   голубого фону */
.rubric-content { position: relative; padding: 56px 0; font-size: 18px;}
.rubric-content--gray { background: var(--color-surface); }
.rubric-content--blue {
  overflow: hidden;
  background: var(--color-secondary);
  padding: calc(var(--rt-ribbon-h) + 40px) 0 calc(var(--rt-ribbon-h) + 40px);
  color: #fff;
}
/* ribbon--top в rubric-teaser спирається на rubric-teaser__flat (тут
   такого спейсера нема) — притискаємо стрічку впритул до верху блоку */
.rubric-content--blue .rubric-teaser__ribbon--top { top: 0; }

.rubric-content__title {
  font-family: var(--font-title);
  font-weight: 500;
  text-transform: uppercase;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: .01em;
  margin-bottom: 28px;
  color: var(--color-text);
}
.rubric-content__title--on-color { color: var(--color-white); }

/* дивайдер-стрічка на всю ширину контейнера (el2.png) — перевикористання
   .intro-block__ribbon, тут без grid-контексту, тож своя верхня відбивка */
.rubric-content__divider {
  margin: 0 0 32px;
}

.rubric-content__banner-wrap { position: relative; margin-bottom: 32px; }
.rubric-content__banner { width: 100%; height: auto; border-radius: 4px; }

/* el3/el4/el5 — декоративний елемент, підвішений на лівий нижній край банера */
.rubric-content__deco {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  width: clamp(110px, 16vw, 200px);
  height: auto;
}
.rubric-content__deco--left {
  left: 0;
  bottom: 0;
  transform: translate(-35%, 20%);
}

.rubric-content__cols {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 32px;
}
@media (min-width: 992px) {
  .rubric-content__cols { grid-template-columns: 1fr 1fr; gap: 40px; }
}

.rubric-content__text p { font-size: 15px; margin-bottom: 20px; color: var(--color-text); }
.rubric-content__text--on-color p { color: var(--color-white); }
.rubric-content__text--full { max-width: 720px; }

/* кнопка з зовнішнім посиланням — стрілки вказують ВСЕРЕДИНУ, до тексту
   (на відміну від .rubric-teaser__button, де вони "розходяться" назовні) */
.content-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border: 2px solid var(--color-accent);
  border-radius: 4px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  text-transform: lowercase;
  transition: background-color .4s ease;
  margin-bottom: 1rem;
}
.content-btn::before,
.content-btn::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 12px;
  background-image: url("../img/triangle-color-top.svg");
  background-size: contain;
  background-repeat: no-repeat;
}
.content-btn::before { transform: rotate(90deg); }  /* вістря вправо, до тексту */
.content-btn::after  { transform: rotate(-90deg); } /* вістря вліво, до тексту */
.content-btn:hover {
    /*background-color: var(--color-secondary);
    color: #fff;*/
    background: #fff;
  }
.rubric-content--blue .content-btn:hover {
    background-color: var(--color-light-gray);
    color: var(--color-accent);
}
@media (max-width: 575.98px) {
  .rubric-content { padding: 36px 0; }
}

/* 7. Footer рубрики — .share-block без верхньої стрічки трикутників */
.share-block--no-top { padding-top: 0; }

/* =========================================================
   ДАЛІ — ЗАГЛУШКА З КАРКАСУ (чекає дизайну наступних екранів)
========================================================= */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 40px 0;
  color: var(--color-muted);
  font-size: 14px;
}

.rubric-topnav {
  position: sticky;
  top: 60px;
  z-index: 40;
  background: var(--color-accent);
}
/* до 991px список їде на всю ширину екрана (без .container) — так більше
   пунктів влазить у видиму область; від 992px обмежуємо так само, як .container */
.rubric-topnav__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 10px 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;

  /* тонкий кастомний скролбар — сигналізує, що список можна прогорнути */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .5) transparent;
}
.rubric-topnav__inner::-webkit-scrollbar { height: 4px; }
.rubric-topnav__inner::-webkit-scrollbar-track { background: transparent; }
.rubric-topnav__inner::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .5);
  border-radius: 999px;
}
/* скролбари на тач-пристроях браузер часто ховає повністю — тому дублюємо
   підказку легким градієнтом з правого краю під час скролу */
.rubric-topnav::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 32px;
  background: linear-gradient(to right, transparent, var(--color-accent));
  pointer-events: none;
}
@media (min-width: 992px) {
  .rubric-topnav::after { display: none; }
  .rubric-topnav__inner {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    overflow-x: visible;
  }
}
@media (min-width: 1200px) { .rubric-topnav__inner { max-width: 1140px; } }
@media (min-width: 1400px) { .rubric-topnav__inner { max-width: 1320px; } }
.rubric-topnav__home {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-accent);
  text-decoration: none;
  opacity: .75;
}
/* на головній сторінці немає активної рубрики — активним стає домік */
.rubric-topnav__home[aria-current="page"] { opacity: 1; }
.rubric-topnav__home svg { width: 16px; height: 16px; }
.rubric-topnav__list {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.rubric-topnav__list a {
  display: inline-block;
  white-space: nowrap;
  text-decoration: none;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--color-white);
  opacity: .75;
}
/* активна рубрика — інверсія (біла пігулка), бо фон бару тепер той самий
   accent, яким раніше підсвічувався саме активний пункт */
.rubric-topnav__list a[aria-current="page"] {
  background: var(--color-white);
  color: var(--color-accent);
  opacity: 1;
}

.rubric-header { padding: 48px 0 32px; }
.rubric-eyebrow {
  display: block;
  font-size: 13px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.rubric-title { font-size: clamp(28px, 4vw, 42px); }
.rubric-desc { color: var(--color-muted); max-width: 640px; font-size: 16px; }

.cards-grid { display: grid; gap: 24px; padding-bottom: 60px; }
.cards-grid--default { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cards-grid--wide     { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.cards-grid--list     { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.cards-grid--feature  { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }

.card {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}
.card--list { flex-direction: row; }
.card--list .card__img { width: 140px; flex: 0 0 auto; aspect-ratio: 1; }
.card--list .card__body { flex: 1; }
.card__img {
  aspect-ratio: 16 / 10;
  background: repeating-linear-gradient(45deg, var(--color-surface), var(--color-surface) 10px, #e8e8e8 10px, #e8e8e8 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 12px;
  text-transform: uppercase;
}
.card__body { padding: 18px; }
.card__title { font-size: 17px; margin: 0 0 8px; }
.card__excerpt { font-size: 14px; color: var(--color-muted); }
.card__link { display: inline-block; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--color-accent); }

.rubric-bottomnav {
  position: relative;
  z-index: 1;
  padding: 28px 20px 60px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  background: var(--color-accent);
}

.rubric-bottomnav__prev, .rubric-bottomnav__next {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-white);
  font-size: 13px;
}
.rubric-bottomnav__next { justify-self: end; text-align: right; /*flex-direction: row-reverse;*/ }
.rubric-bottomnav .label { color: var(--color-white); }
.rubric-bottomnav .name { display: block; color: var(--color-white); font-size: 15px; margin-top: 2px; }
.rubric-bottomnav__home {
  justify-self: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-accent);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  opacity: .75;
}
.rubric-bottomnav__home[aria-current="page"] { opacity: 1; }
.rubric-bottomnav__home svg { width: 18px; height: 18px; }

@media (max-width: 640px) {
  .rubric-bottomnav { grid-template-columns: 1fr 1fr; grid-template-areas: "prev next" "home home"; }
  .rubric-bottomnav__prev { grid-area: prev; }
  .rubric-bottomnav__next { grid-area: next; }
  .rubric-bottomnav__home { grid-area: home; margin-top: 16px; }
  .card--list { flex-direction: column; }
  .card--list .card__img { width: 100%; aspect-ratio: 16/10; }
  .hero-title {
    font-size: 40px;
  }
}

/* CARDS */
.cards-group {
    position: relative;
    z-index: 2;
    /* width: 90%; */
    /* margin: auto; */
    margin: 0 20px 20px;
}
.cards-group img {
    border-radius: 1rem;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, .3);
    border-radius: 1rem;
    transition: all .3s ease;
    transform-origin: bottom center;
}
.cards-group__2 img {
    position: absolute;
    top: 5px;
    z-index: -1;
    transform: rotate(2deg);
}
.cards-group__3 img {
    position: absolute;
    top: 5px;
    z-index: -1;
    transform: rotate(-2deg);
}
.cards-group:hover .cards-group__1 img {
transform: scale(.95)
}
.cards-group:hover .cards-group__3 img {
transform: rotate(-4deg) translateX(-10px);
top: 10px
}
.cards-group:hover .cards-group__2 img {
transform: rotate(4deg) translateX(10px);
top: 10px;
}

.twitter-tweet iframe {
    border-radius: 1rem;
}
/* youtube-wrap — превʼю-фасад замість живого iframe: власна maxresdefault-картинка
   (завжди чітка, на відміну від постера, який іноді підбирає сам YouTube всередині
   свого iframe) + кнопка play. Реальний плеєр відкривається в Fancybox по кліку. */
.youtube-wrap  {
    position: relative;
    display: block;
    margin-bottom: 1rem;
    border-radius: 1rem;
    overflow: hidden;
}
.youtube-wrap img {
    width: 100%;
    display: block;
}
.youtube-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .15);
    transition: background .2s ease;
}
.youtube-wrap:hover::after { background: rgba(0, 0, 0, .3); }
.youtube-wrap__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: transform .2s ease;
}
.blue-button {
  background: var(--color-secondary);
  margin-top: 20px;
}
.youtube-wrap:hover .youtube-wrap__play { transform: translate(-50%, -50%) scale(1.08); }
.youtube-wrap__play::before {
    content: "";
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px; /* оптична компенсація трикутника — інакше здається зсунутим вліво */
}

.fb-wrap {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}
.fb-wrap iframe {
    margin: auto;
    border-radius: 1rem;
}
.small-disclamer {
    font-size: 14px;
    font-style: italic;
    color: var(--color-muted);
}
.rubric-content--blue .small-disclamer {
    color: #ddd;
}

.partners {
    padding: 0 40px;
    margin: 30px auto 0;
    display: flex;
    flex-wrap: wrap;           /* на вузькому екрані лого переносяться на новий рядок, а не стискаються */
    list-style: none;
    justify-content: center;
    align-items: center;
    max-width: 800px;
    gap: 20px;
}
.partners li {
    flex: 0 0 auto;             /* забороняє li стискатись по ширині — саме це і "зплющувало" img */
}
.partners img {
    filter: grayscale(1);
    opacity: .6;
    transition: all .4s ease;
    height: 80px;
    width: auto;                /* явно — щоб ширина завжди рахувалась з висоти, а не навпаки */
    max-width: 100%;            /* запобіжник, якщо саме лого ширше за екран */
}
.partners img:hover {
    filter: grayscale(0);
    opacity: 1;
}

@media (max-width: 575.98px) {
  .partners { padding: 0 20px; gap: 20px 24px; }
  .partners img { height: 56px; }
}

.twitter-tweet {
    margin-bottom: 2rem !important;
}