/* ==========================================================================
   art.css — strona artykułu (art.php) i lista artykułów (art_list.php).
   Wymaga components.css (panele, .testy-card, .tag, .yt-facade, .comment).
   Mobile-first, tokeny z global.css.
   ========================================================================== */

.art-page,
.art-list{ padding-top: 16px; }
.art-page [id]{ scroll-margin-top: 72px; } /* sticky header po zwinięciu */

/* ---------- Hero artykułu ----------
   Zdjęcie na całą szerokość w proporcjach wersji v2 (1200x576) — bez kadrowania.
   Mobile / tablet (< 900px): zdjęcie jest niskie (375px -> ~180px), więc na
   zdjęcie wchodzi tylko dział + tytuł (ujemny margines), autor i tagi ciągną
   się dalej na tym samym ciemnym tle.
   Desktop (>= 900px): zdjęcie i nagłówek w jednej komórce gridu, nagłówek
   przy dolnej krawędzi. Gdyby nagłówek (np. przy 20 tagach) był wyższy od
   zdjęcia, komórka rośnie zamiast ucinać tytuł. */

.art-hero{
  position: relative;
  background: var(--main-color-dark);
  border-color: var(--main-color-dark);
}
.art-hero__media{
  aspect-ratio: 1200 / 576;     /* v2 = 1200x576 — rezerwuje miejsce, CLS 0 */
  background: var(--main-color-dark);
  overflow: hidden;
}
.art-hero__media img{
  width: 100%;
  height: 100%;
  object-fit: contain;          /* proporcje kontenera = proporcje pliku, nic nie ucina */
}

.art-hero__head{
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  margin-top: -64px;
  padding: 36px 16px 20px;
  background: linear-gradient(to bottom,
    transparent 0,
    rgba(16,21,28,.78) 36px,
    var(--main-color-dark) 80px);
  color: #fff;
}
.art-hero--nophoto .art-hero__head{
  margin-top: 0;
  padding-top: 22px;
  background: var(--main-color-dark);
}

.art-hero__eyebrow{
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #fff;
  transition: background-color .15s ease;
}
.art-hero__eyebrow:hover{ background: var(--accent-dark); }
.art-hero__title{
  font-size: 25px;
  line-height: 1.15;
  color: #fff;
  margin: 0;
  text-wrap: balance;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}

.art-meta{
  display: flex;
  align-items: center;
  gap: 12px;
}
.art-meta__avatar{
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.85);
  object-fit: cover;
  background: var(--paper);
}
.art-meta__text{
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.4;
}
.art-meta__author{ font-size: 14px; font-weight: 700; color: #fff; }
.art-meta__info{ font-size: 13px; color: #cdd8e4; }
.art-meta__info a{ color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.art-meta__info a:hover{ color: var(--accent); }
.art-meta__sep{ margin: 0 6px; opacity: .6; }

/* Tagi na ciemnym tle — te same .testy-card__tag, odwrócone kolory */
.art-hero__tags{ margin: 2px 0 0; }
.art-hero .testy-card__tag{
  color: #dfe4ea;
  border-color: rgba(255,255,255,.35);
  background: rgba(0,0,0,.18);
}
.art-hero .testy-card__tag--model{
  color: #fff;
  border-color: #fff;
}
.art-hero .testy-card__tag:hover,
.art-hero .testy-card__tag--model:hover{
  background: #fff;
  border-color: #fff;
  color: var(--main-color);
}

/* ---------- Treść ---------- */

.art-body{ margin-top: 20px; }
.art-body__inner{
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 28px;
}

.art-content{
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  overflow-wrap: break-word;
}
.art-content::after{ content: ""; display: table; clear: both; } /* opływane zdjęcia */
.art-content p{ margin: 0 0 1em; }
.art-content a{ color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.art-content a:hover{ color: var(--main-color); }
.art-content strong{ font-weight: 700; }
.art-content img{ height: auto; }
.art-content iframe{ max-width: 100%; }
.art-content ul,
.art-content ol{ margin: 0 0 1em; padding-left: 1.4em; }
.art-content ul{ list-style: disc; }
.art-content ol{ list-style: decimal; }
.art-content blockquote{
  margin: 0 0 1em;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
}
/* stare tabele z edytora — przewijane, a nie rozpychające stronę */
.art-content table{
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 1em;
  font-size: 15px;
  line-height: 1.5;
}
.art-content th,
.art-content td{ border: 1px solid var(--line); padding: 6px 10px; text-align: left; }

/* Nagłówki sekcji — akcent jak w .section__heading: bez zaokrągleń, 16px,
   dolną krawędzią na linii bazowej tekstu, 2px od tekstu */
.art-content h2{
  display: flex;
  align-items: baseline;
  gap: 2px;
  clear: both;
  font-size: 23px;
  line-height: 1.25;
  color: var(--main-color);
  margin: 36px 0 12px;
}
.art-content h2::before{
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 4px;
  border-radius: 0;
  background: var(--accent);
}
.art-content h3{
  font-size: 19px;
  line-height: 1.3;
  color: var(--main-color);
  margin: 24px 0 8px;
}

/* Lead (wstęp artykułów z sekcjami) — większy, ciemniejszy, z akcentem z lewej
   jak nagłówki sekcji; od reszty oddzielony linią. */
.art-lead{
  position: relative;
  margin: 0 0 28px;
  padding: 2px 0 22px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--main-color);
}
.art-lead::before{
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 26px;
  width: 4px;
  border-radius: 0;
  background: var(--accent);
}
.art-lead::after{ content: ""; display: table; clear: both; } /* opływane zdjęcia w leadzie */
.art-lead a{ font-weight: 700; }

/* Spis treści */
.art-toc{
  margin: 0 0 24px;
  padding: 16px 20px;
  border-radius: 10px;
  background: var(--paper);
  font-size: 15.5px;
  line-height: 1.5;
}
.art-toc__title{
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-soft);
}
.art-content .art-toc ol{ margin: 0; padding-left: 1.3em; }
.art-toc li + li{ margin-top: 4px; }
.art-toc li::marker{ color: var(--accent-dark); font-weight: 700; }
.art-content .art-toc a{ color: var(--main-color); text-decoration: none; }
.art-content .art-toc a:hover{ color: var(--accent-dark); text-decoration: underline; }

/* Zdjęcia w treści ([imageN], left/right ignorowane) — zawsze na szerokość
   kolumny tekstu, w proporcjach wersji v2 (1200x576), bez kadrowania.
   Wcześniej opływane miniatury kolidowały z nagłówkami kolejnych sekcji. */
.art-fig{ margin: 8px 0 24px; clear: both; }
.art-fig a{
  display: block;
  aspect-ratio: 1200 / 576;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}
.art-fig img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .3s ease;
}
.art-fig a:hover img{ transform: scale(1.02); }
.art-fig figcaption{
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.art-video{ clear: both; margin: 8px 0 24px; }
.art-body__inner > .art-video{ margin: 24px 0 0; }

/* Dopiski (partner, autor zewnętrzny, polecane materiały) */
.art-note{
  clear: both;
  margin: 20px 0 0;
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--paper);
  font-size: 14.5px;
  line-height: 1.6;
}
.art-note a{ color: var(--accent-dark); text-decoration: underline; }
.art-note__label{
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent-dark);
}
.art-pixel{ position: absolute; width: 1px; height: 1px; overflow: hidden; }

/* Autor */
.art-author{
  clear: both;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.art-author__avatar{
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper);
}
.art-author__label{
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-soft);
}
.art-author__name{
  margin: 0;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.art-author__desc{
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ---------- Galeria ---------- */

.art-gallery{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 16px;
}
.art-gallery__item{
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}
.art-gallery__item img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.art-gallery__item:hover img{ transform: scale(1.05); }
.art-gallery__more{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20,24,31,.62);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

/* ---------- Karty filmów ---------- */

.art-video-card .testy-card__media{ aspect-ratio: 16 / 9; background: #000; }
.art-video-card__play{
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 36px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(20,24,31,.8);
  color: #fff;
  transition: background-color .2s ease;
}
.art-video-card__play svg{ width: 22px; height: 22px; }
.art-video-card:hover .art-video-card__play{ background: #e62117; }

/* ---------- Paginacja ---------- */

.pager{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 20px 24px;
  font-family: var(--font-heading);
}
.pager__pages{ display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager__page,
.pager__step{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--main-color);
  font-size: 15px;
  font-weight: 700;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.pager__step svg{ width: 15px; height: 15px; flex: 0 0 auto; }
.pager__page:hover,
.pager__step:hover{ border-color: var(--accent); color: var(--accent-dark); }
.pager__page:focus-visible,
.pager__step:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }
.pager__page.is-current{
  background: var(--main-color);
  border-color: var(--main-color);
  color: #fff;
}
.pager__gap{ min-width: 20px; text-align: center; color: var(--ink-soft); }

@media (max-width: 599px){
  .pager__step{ padding: 0; width: 40px; }
  .pager__step-text{
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
  }
}

/* ---------- 404 / pusta lista ---------- */

.art-404{ padding: 20px; }
.art-404 p{ margin: 0 0 14px; }
.section__panel .art-404 .tag-list{ padding: 0; }

/* ==========================================================================
   >= 600px
   ========================================================================== */
@media (min-width: 600px){
  .art-gallery{ grid-template-columns: repeat(4, 1fr); }
}

/* ==========================================================================
   >= 700px — lista: siatka 6-kolumnowa, żeby 1 + 2 + 9 kart dało pełne rzędy
   ========================================================================== */
@media (min-width: 700px){
  .art-hero__head{ margin-top: -80px; padding: 48px 28px 24px; }
  .art-hero__title{ font-size: 30px; }
  .art-hero--nophoto .art-hero__head{ padding: 28px; }

  .testy-grid--list{ grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .testy-grid--list > .testy-card{ grid-column: span 2; }
  .testy-grid--list > .testy-card--half{ grid-column: span 3; }
  .testy-grid--list > .testy-card--featured{ grid-column: 1 / -1; }
  .testy-card--half .testy-card__title{ font-size: 19px; }
}

/* ==========================================================================
   >= 900px
   ========================================================================== */
@media (min-width: 900px){
  /* nagłówek w całości na zdjęciu */
  .art-hero:not(.art-hero--nophoto){ display: grid; }
  .art-hero:not(.art-hero--nophoto) > .art-hero__media,
  .art-hero:not(.art-hero--nophoto) > .art-hero__head{ grid-area: 1 / 1; }
  .art-hero:not(.art-hero--nophoto) > .art-hero__media{ align-self: start; }
  .art-hero:not(.art-hero--nophoto) .art-hero__head{
    align-self: end;
    margin-top: 0;
    padding: 80px 36px 28px;
    background: linear-gradient(to top,
      rgba(10,14,20,.88) 0%,
      rgba(10,14,20,.6) 55%,
      transparent 100%);
  }
  .art-hero__head > *{ max-width: 900px; }
  .art-hero__title{ font-size: 36px; }

  .art-body__inner{ padding: 36px 32px 40px; }
  .art-content h2{ font-size: 25px; }
  .art-lead{ font-size: 21px; padding-left: 24px; }
  /* szersza kolumna (880px) -> większy font, żeby linia nie przekroczyła ~85 znaków */
  .art-content{ font-size: 18px; }

  .art-gallery{ grid-template-columns: repeat(6, 1fr); }
}