/* ============================================================================
   SIGVIN — «Polityka Prywatności» (Figma 403:23396 hero / 411:25368 контент).
   Hero (тёмное фото + 146px заголовок + дата) → док-секция: липкий SPIS TREŚCI
   слева (активный пункт = чёрный фон, скруглён сверху, scroll-spy) + 8 разделов.
   ========================================================================== */

/* ---------------- HERO ---------------- */
.polhero {
  position: relative; z-index: 1;
  width: var(--frame-w); max-width: 100%;
  height: 718px; margin: 0 auto;
  overflow: hidden; isolation: isolate;
  background: var(--dark-black);
}
.polhero__bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; z-index: 0;
}
.polhero__overlay { position: absolute; inset: 0; background: var(--dark-32); z-index: 1; pointer-events: none; }
.polhero .hero__sep { z-index: 2; }
.polhero__nav {
  position: absolute; top: var(--margin); left: 50%; transform: translateX(-50%);
  width: calc(var(--frame-w) - var(--margin) * 2); max-width: calc(100% - var(--margin) * 2);
  z-index: 5;
}
.polhero__content { position: absolute; inset: 0; z-index: 2; }
.polhero__title { position: absolute; left: 80px; top: 210px; color: var(--light-white); }
.polhero__title span { display: block; white-space: nowrap; }
.polhero__title-thin { font: 400 146px/156px "Geologica Cursive", sans-serif; letter-spacing: -0.08em; }
/* «Prywatności» — вторая строка со сдвигом вправо (x319 = 80+239) и вертикальным нахлёстом (Figma 611:1040) */
.polhero__title-bold { margin-left: 239px; margin-top: -42px; font: 700 146px/156px "adineue PRO Cyr", sans-serif; letter-spacing: -0.03em; }
.polhero__date { position: absolute; left: 80px; bottom: 140px; display: flex; flex-direction: column; gap: 8px; }
.polhero__date-label { color: var(--light-48); font: 500 14px/20px "Geist Mono", monospace; letter-spacing: -0.01em; text-transform: uppercase; }
.polhero__date-val { color: var(--light-white); font: 700 24px/32px "adineue PRO Cyr", sans-serif; letter-spacing: 0.02em; }

/* ---------------- ДОКУМЕНТ (SPIS TREŚCI + разделы) ---------------- */
.poldoc {
  position: relative; z-index: 2;
  width: var(--frame-w); max-width: 100%; margin: -48px auto 0;
  background: var(--light-white); border-radius: 40px;   /* низ тоже 40px — CTA (z1, наезд -72) виден за скруглениями */
  padding: 96px 0 120px;
}
.poldoc__inner {
  width: var(--content-w); max-width: calc(100% - 160px); margin: 0 auto;
  display: grid; grid-template-columns: 320px 1fr; gap: 80px; align-items: start;
}

/* липкое оглавление = навигация + прогресс-бар чтения (Figma 408:25159) */
.poltoc { position: sticky; top: 40px; align-self: start; }

/* шапка SPIS TREŚCI: бокс с уголками + горизонтальный серый филл, растущий по скроллу */
.poltoc__head {
  position: relative; overflow: hidden;
  display: flex; align-items: center; width: 100%; padding: 8px 16px; margin-bottom: 24px;
  color: var(--dark-black); --glass-border: var(--border-dark); --corner-color: var(--dark-48);
}
.poltoc__head-fill {
  position: absolute; inset: 0; width: 100%;
  background: var(--light-light); transform: scaleX(0); transform-origin: left center;
  transition: transform .25s ease; z-index: 0;
}
.poltoc__head-text { position: relative; z-index: 1; }

/* список: серый контейнер со скруглением, строки-пункты с разделителями; активный — тёмный */
.poltoc__list {
  display: flex; flex-direction: column;
  background: var(--light-light); border: 1px solid var(--light-white);
  border-radius: 20px; overflow: hidden;
}
.poltoc__item {
  position: relative; display: flex; align-items: center; min-height: 40px;
  padding: 10px 16px; text-decoration: none;
  color: var(--dark-64); font: 500 14px/20px "Geist Mono", monospace; letter-spacing: -0.01em; text-transform: uppercase;
  border-bottom: 1px solid var(--dark-8);
  transition: background-color .3s ease, color .3s ease, border-radius .3s ease;
}
.poltoc__item:last-child { border-bottom: 0; }
.poltoc__item:hover { color: var(--dark-black); }
.poltoc__item.is-active {
  position: relative; z-index: 2;
  background: var(--dark-black); color: var(--light-white);
  border-radius: 12px 12px 0 0; border-bottom-color: transparent;
}
/* S-образный переход низа активного пункта в серый список (Figma 677:5762) —
   готовый ассет уголка (assets/ui/toc-corner.svg, «Vector 1» из макета), а не
   самодельный radial-gradient: слева как есть, справа — зеркально по X */
.poltoc__item.is-active::before,
.poltoc__item.is-active::after {
  content: ""; position: absolute; top: 100%; width: 32px; height: 24px;
  background: url("/assets/ui/toc-corner.svg") no-repeat; background-size: 100% 100%;
}
.poltoc__item.is-active::before { left: 0; }
.poltoc__item.is-active::after { right: 0; transform: scaleX(-1); }
.poltoc__item.is-active + .poltoc__item { border-radius: 12px 12px 0 0; }

/* разделы контента */
.poldoc__content { display: flex; flex-direction: column; gap: 48px; min-width: 0; }
.polsec { scroll-margin-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.polsec__title { color: var(--dark-black); font: 700 24px/32px "adineue PRO Cyr", sans-serif; letter-spacing: 0.01em; }
.polsec__num { color: var(--dark-black); }
.polsec__text { color: var(--dark-64); font: 300 15px/24px "Geologica Cursive", sans-serif; letter-spacing: -0.05em; }
.polsec__list { display: flex; flex-direction: column; gap: 6px; padding: 0; margin: 0; list-style: none; }
.polsec__list li {
  position: relative; padding-left: 20px;
  color: var(--dark-64); font: 300 15px/24px "Geologica Cursive", sans-serif; letter-spacing: -0.05em;
}
.polsec__list li::before { content: "—"; position: absolute; left: 0; color: var(--dark-48); }
.polsec__text a, .polsec__list a { color: var(--dark-black); text-decoration: none; }
.polsec__text a:hover, .polsec__list a:hover { text-decoration: underline; }

/* подзаголовок пункта внутри секции статьи (напр. каждая "красная флага" из списка 10) —
   вместо жирного текста в начале абзаца ("1. Tytuł.") — так это раньше выглядело как
   реферат школьника; теперь отдельный подзаголовок с приглушённым номером */
.polsec__subhead {
  display: flex; align-items: baseline; gap: 10px; margin-top: 8px;
  color: var(--dark-black); font: 700 17px/26px "adineue PRO Cyr", sans-serif; letter-spacing: 0.01em;
}
.polsec__subhead-num { flex: none; color: var(--dark-32); font: 700 13px/20px "Geist Mono", monospace; letter-spacing: -0.01em; }
.polsec__text + .polsec__subhead { margin-top: 20px; }

/* Таблица сравнений/расценок внутри статьи блога — компонент Table (Figma 702:2407),
   1:1 структура: серая карточка (паддинг 4, радиус 16) → внутри ЗАГОЛОВОК лежит
   прямо на сером фоне (не в белой рамке), а строки данных — в отдельной белой
   рамке (border 1px dark-4%, радиус 16) ниже. Div-грид, не <table> — так и в
   макете (компонент "slot-table-rows" собран из div'ов, не из table/thead/tbody). */
.polsec__table-card { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.polsec__table-frame { width: 100%; padding: 4px; border-radius: 16px; background: var(--dark-4); display: flex; flex-direction: column; }
.polsec__table-head { display: flex; width: 100%; }
.polsec__table-head .polsec__table-cell { color: var(--dark-48); font: 300 16px/24px "Geologica Cursive", sans-serif; letter-spacing: -0.05em; padding-top: 10px; padding-bottom: 10px; }
.polsec__table-rows { width: 100%; overflow: hidden; border-radius: 16px; border: 1px solid rgba(17, 17, 17, 0.04); background: var(--light-white); }
.polsec__table-row { display: flex; width: 100%; border-bottom: 1px solid rgba(17, 17, 17, 0.08); }
.polsec__table-row:last-child { border-bottom: 0; }
.polsec__table-cell {
  flex: 1 1 0; min-width: 0; min-height: 40px;
  display: flex; flex-direction: column; justify-content: center;
  padding: 12px 16px;
  color: var(--dark-black); font: 700 16px/24px "adineue PRO Cyr", sans-serif; letter-spacing: 0.02em;
}
.polsec__table-cell:first-child { min-width: 200px; }
.polsec__table-cell strong { color: var(--dark-black); }

/* ============================ MOBILE (≤1024) — таблица статьи ==================== */
@media (max-width: 1024px) {
  .polsec__table-frame { border-radius: 12px; }
  .polsec__table-rows { border-radius: 12px; }
  .polsec__table-card { overflow-x: auto; }
  .polsec__table-head, .polsec__table-row { min-width: 480px; }
  .polsec__table-cell { padding: 10px 12px; font-size: 14px; line-height: 22px; }
  .polsec__table-cell:first-child { min-width: 160px; }
}

/* ---------------------------------------------------------------------------
   Блочки статьи блога для «разнообразия» контента (Figma 677:5780):
   • .polsec__callout — цветная плашка-контекст (важное/предостережение/подсказка)
   • .polsec__numlist — жирный нумерованный список (крупнее и заметнее .polsec__list)
   --------------------------------------------------------------------------- */
.polsec__callout {
  display: flex; align-items: center; width: 100%;
  padding: 12px 16px 12px 24px;
  border-left: 3px solid var(--dark-black);
  background: var(--dark-4);
  border-radius: 24px;
}
.polsec__callout-text {
  flex: 1 1 0; margin: 0;
  color: var(--dark-black); font: 700 16px/24px "adineue PRO Cyr", sans-serif; letter-spacing: 0.02em;
}
.polsec__callout-lead { display: block; }
.polsec__callout-sub { display: block; margin-top: 4px; font-weight: 400; }
.polsec__callout--danger { border-left-color: #ff3838; background: rgba(255, 56, 56, 0.08); }
.polsec__callout--warn { border-left-color: #ffbd38; background: rgba(255, 189, 56, 0.08); }
.polsec__callout--tip { border-left-color: #49ba5c; background: rgba(73, 186, 92, 0.08); }

.polsec__numlist { display: flex; flex-direction: column; gap: 8px; width: 100%; margin: 0; padding: 0; list-style: none; }
.polsec__numlist li { display: flex; gap: 4px; align-items: flex-start; width: 100%; }
.polsec__numlist-num { flex: none; width: 22px; color: var(--dark-black); font: 700 16px/24px "adineue PRO Cyr", sans-serif; letter-spacing: 0.02em; }
.polsec__numlist li p { flex: 1 1 0; margin: 0; color: var(--dark-black); font: 700 16px/24px "adineue PRO Cyr", sans-serif; letter-spacing: 0.02em; }

/* ============================ MOBILE (≤1024) — блочки статьи ==================== */
@media (max-width: 1024px) {
  .polsec__callout { padding: 10px 12px 10px 16px; border-radius: 16px; }
  .polsec__callout-text { font-size: 14px; line-height: 22px; }
  .polsec__table-card { border-radius: 12px; }
}

/* ---------------------------------------------------------------------------
   Встроенный мини-CTA внутри статьи (Figma 702:2449 «Inquiry container») —
   тёмная карточка с сеточной текстурой, заголовком и .btn-split (реюз кнопки
   с главного CTA-блока, cta.css/hero.css — те же стили, тот же JS свап).
   --------------------------------------------------------------------------- */
.polsec__cta {
  position: relative; z-index: 1;
  width: 100%; min-height: 366px; overflow: hidden; isolation: isolate;
  border-radius: 40px; background: var(--dark-black);
  display: flex; flex-direction: column; align-items: center;
  padding: 51px 24px 24px;
}
.polsec__cta::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: url("/assets/ui/dot-grid-cta.svg") center / 100% 100% no-repeat;
  pointer-events: none;
}
.polsec__cta-body {
  position: relative; z-index: 1; flex: 1 1 auto; width: 100%; max-width: 746px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center;
}
.polsec__cta-title { color: var(--light-white); font: 400 48px/56px "Geologica Cursive", sans-serif; letter-spacing: -0.08em; margin-bottom: 24px; }
.polsec__cta-title strong { font-family: "adineue PRO Cyr", sans-serif; font-weight: 700; letter-spacing: normal; }
.polsec__cta-sub { color: var(--light-white); font: 700 20px/28px "adineue PRO Cyr", sans-serif; letter-spacing: 0.02em; }
.polsec__cta-desc { color: var(--light-64); font: 300 16px/24px "Geologica Cursive", sans-serif; letter-spacing: -0.05em; }
.polsec__cta .btn-split { position: relative; z-index: 1; width: 100%; margin-top: 32px; }
.polsec__cta .btn-split .btn-split__text { flex: 1 1 auto; justify-content: center; }

/* ---------------------------------------------------------------------------
   Мини-отзыв команды внутри статьи (Figma 702:2461 «Review container») —
   светлая карточка с сеточной текстурой: аватар + имя/роль (реальные люди со
   страницы O nas), цитата, разделитель, деталь, и .btn-split в подвале.
   Скругления 24px, кроме левого верхнего угла (квадратный, Figma 702:2462).
   --------------------------------------------------------------------------- */
.polsec__review { width: 100%; border-radius: 24px; overflow: hidden; background: var(--dark-black); }
.polsec__review-content {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 16px;
  padding: 16px 24px; border-left: 3px solid var(--dark-black);
  border-radius: 0 24px 24px 24px;
  background: linear-gradient(90deg, rgba(17, 17, 17, 0.04) 0%, rgba(17, 17, 17, 0.04) 100%), var(--light-white);
}
.polsec__review-content::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: url("/assets/ui/dot-grid.svg") center top/cover no-repeat;
  pointer-events: none;
}
.polsec__review-head, .polsec__review-quote, .polsec__review-line, .polsec__review-detail { position: relative; z-index: 1; }
.polsec__review-head { display: flex; gap: 16px; align-items: center; }
.polsec__review-avatar { flex: none; width: 64px; height: 64px; border-radius: 100px; border: 1px solid var(--light-white); overflow: hidden; }
.polsec__review-avatar img { width: 100%; height: 100%; object-fit: cover; }
.polsec__review-who { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.polsec__review-name { color: var(--dark-black); font: 700 20px/28px "adineue PRO Cyr", sans-serif; letter-spacing: 0.02em; }
.polsec__review-role { color: var(--dark-64); font: 500 14px/20px "Geist Mono", monospace; letter-spacing: -0.01em; text-transform: uppercase; }
.polsec__review-quote { color: var(--dark-black); font: 700 18px/26px "adineue PRO Cyr", sans-serif; letter-spacing: 0.02em; }
.polsec__review-line { height: 0; width: 100%; border-top: 1px dashed rgba(17, 17, 17, 0.08); }
.polsec__review-detail { color: var(--dark-64); font: 300 15px/24px "Geologica Cursive", sans-serif; letter-spacing: -0.05em; }
.polsec__review .btn-split { width: calc(100% - 24px); margin: 12px; }
.polsec__review .btn-split .btn-split__text { flex: 1 1 auto; justify-content: center; }

/* «Czytaj także» — см. .projects/.proj-card + .projects--inverse в projects.css
   (переиспользуем блок «Więcej Realizacji» 1:1, только перекрашен) */

/* ============================ MOBILE (≤1024) — CTA/отзыв ==================== */
@media (max-width: 1024px) {
  .polsec__cta { padding: 32px 16px 16px; border-radius: 24px; min-height: 0; }
  .polsec__cta-title { font-size: 28px; line-height: 34px; margin-bottom: 16px; }
  .polsec__cta .btn-split { margin-top: 24px; }
  .polsec__review-content { padding: 14px 16px; border-radius: 0 16px 16px 16px; }
  .polsec__review { border-radius: 16px; }
  .polsec__review .btn-split { margin: 8px; width: calc(100% - 16px); }
}

/* ============================ MOBILE (≤1024) ==================== */
@media (max-width: 1024px) {
  /* образец O nas: hero растёт под контент, контент в ПОТОКЕ (не absolute) → ничего не режется/не наезжает */
  .polhero { width: 100%; height: auto; min-height: 100svh; display: flex; flex-direction: column; }
  .polhero__nav { position: relative; z-index: 3; flex: none; top: 0; left: 0; transform: none; width: 100%; max-width: none; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 0; }
  /* контент в потоке, заголовок+дата прижаты к низу (flex-end); низ 72 — выше наезда poldoc (-48) */
  .polhero__content { position: relative; z-index: 2; flex: 1 1 auto; inset: auto; display: flex; flex-direction: column; justify-content: flex-end; padding: 24px 16px calc(72px + env(safe-area-inset-bottom, 0px)); }
  .polhero__title { position: static; left: auto; top: auto; bottom: auto; }
  .polhero__title-thin { font: 400 60px/64px "Geologica Cursive", sans-serif; letter-spacing: -0.08em; }
  .polhero__title-bold { margin: 0; font: 700 60px/64px "adineue PRO Cyr", sans-serif; letter-spacing: -0.03em; }
  .polhero__date { position: static; left: auto; bottom: auto; margin-top: 12px; }

  /* +64px снизу: последний раздел не прячется под закреплённой панелью якорей */
  .poldoc { width: 100%; border-radius: 32px; padding: 48px 0 128px; }
  .poldoc__inner { width: 100%; max-width: 100%; padding: 0 16px; grid-template-columns: 1fr; gap: 32px; }
  .poldoc__inner > * { min-width: 0; }   /* иначе ряд-оглавление распирает грид-колонку */
  /* оглавление на мобилке — закреплённая снизу панель якорей на белом фоне (scroll-spy) */
  .poltoc {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 40; margin: 0; min-width: 0;
    background: var(--light-white);
    border-top: 1px solid var(--dark-16);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -6px 20px rgba(17, 17, 17, 0.06);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }
  .poltoc__head { display: none; }   /* «Spis treści» + прогресс скрыты — на панели только якоря */
  .poltoc__list { flex-direction: row; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0; min-width: 0; background: transparent; border: 0; border-radius: 0; overflow-y: visible; }
  .poltoc__list::-webkit-scrollbar { display: none; }
  .poltoc__item { flex: 0 0 auto; height: auto; white-space: nowrap; border-radius: 999px; padding: 9px 14px; background: var(--light-light); border-bottom: 0; font-size: 13px; transition: background .2s ease, color .2s ease; }
  .poltoc__item.is-active { background: var(--dark-black); color: var(--light-white); border-radius: 999px; border-bottom-color: transparent; }
  .poltoc__item.is-active + .poltoc__item { border-radius: 999px; }
  /* плавающую кнопку-телефон приподнимаем над закреплённой панелью якорей
     (специфичность body[data-page] бьёт responsive.css, который грузится позже) */
  body[data-page="polityka"] .hero__phone { bottom: calc(59px + 16px + env(safe-area-inset-bottom)); }
}
