/*
 * Site — single news article.
 *
 * Loaded on is_singular('post') via `site-page-single-news` handle
 * in theme/inc/60-enqueue.php. Template: single.php.
 *
 * Contents:
 *   – Article hero (.article-header)
 *   – Article body (2-col: cover + text)
 *   – Image gallery (.gallery scroller, matches single-project gallery)
 *   – More news (.more-news, .more-grid)
 *   – Mobile + tablet overrides
 */

/* ─── Article hero ────────────────────────────── */
.article-header {
  position: relative;
  padding: 160px var(--gutter) 24px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
.article-header::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 70%;
  background: radial-gradient(80% 60% at 30% 40%, oklch(0.40 0.20 305 / 0.10), transparent 70%);
  pointer-events: none;
}
.article-header h1 {
  position: relative;
  /* Linear scale — 72 × 0.9 = 65px @1440 (matches the previous clamped
     value at MacBook width), 86px @1920, 115px @2560. */
  font-size: calc(72px * var(--scale)); line-height: 0.95; letter-spacing: -0.03em;
  font-weight: 500; max-width: 1100px; text-wrap: balance;
  margin: 0;
}
.article-header .article-meta {
  position: relative;
  margin-top: 24px;
  display: inline-flex; align-items: center; gap: 14px;
  font-size: calc(14px * var(--read-scale)); color: var(--ink-dim); letter-spacing: 0.02em;
}
.article-header .article-meta .date { color: var(--ink-dim); }
.article-header .article-meta .tag {
  padding: 4px 10px; border: 1px solid var(--rule-2); border-radius: 999px;
  color: var(--accent); font-weight: 500; font-size: calc(12.5px * var(--read-scale));
}

/* ─── Body ──────────────────────────────────────── */
.article-body {
  padding: calc(80px * var(--scale)) var(--gutter);
  display: grid; grid-template-columns: 2fr 3fr;
  gap: 60px;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.article-body .cover-col {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 100%);
  position: relative; overflow: hidden; border-radius: 8px;
}
.article-body .cover-col::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 50% 40%, rgba(255,255,255,0.08), transparent 70%);
}
.article-body .text p {
  font-size: calc(19px * var(--read-scale)); line-height: 1.65; color: var(--ink);
  text-wrap: pretty;
  text-align: justify; hyphens: auto;
}
.article-body .text p + p { margin-top: 22px; }

/* ─── Cover credit / image caption ──────────── */
.img-credit {
  margin-top: 10px;
  font-size: calc(11.5px * var(--read-scale)); color: var(--ink-mute); letter-spacing: 0.02em;
  text-align: left;
}
.article-body .cover-col + .img-credit { margin-top: 10px; }
.article-body .cover-wrap { display: flex; flex-direction: column; }

/* ─── Image gallery ──────────────────────────── */
.gallery {
  padding: calc(60px * var(--scale)) var(--gutter) calc(80px * var(--scale)); border-bottom: 1px solid var(--rule);
  position: relative;
}
/* Right-side fade hints at more images beyond the visible edge */
.gallery .scroller-wrap {
  position: relative;
}
.gallery .scroller-wrap::after {
  content: '';
  position: absolute; top: 0; right: 0; bottom: 0; width: 96px;
  background: linear-gradient(90deg, transparent, var(--bg) 85%);
  pointer-events: none; z-index: 2;
  opacity: 1; transition: opacity .25s;
}
.gallery .scroller-wrap[data-at-end="true"]::after { opacity: 0; }
.gallery-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 44px;
  margin-bottom: 24px;
}
.gallery-head h2 {
  font-size: calc(15px * var(--read-scale));
  color: var(--accent);
  letter-spacing: 0.06em;
  font-weight: 500;
  text-transform: uppercase;
  line-height: 1;
}
.gallery-arrows { display: flex; gap: 8px; }
.gallery-arrow {
  width: 44px; height: 44px; border-radius: 50%;
  background: transparent; border: 1px solid var(--rule);
  color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  transition: background .18s, border-color .18s, color .18s, opacity .18s;
}
.gallery-arrow:hover { color: var(--accent); border-color: var(--accent); background: transparent; }
.gallery-arrow:disabled { opacity: 0.3; cursor: default; }
.gallery-arrow:disabled:hover { background: transparent; border-color: var(--rule); color: var(--ink); }

.gallery-scroller {
  display: flex; gap: 12px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.gallery-scroller::-webkit-scrollbar { display: none; }
.gallery-item {
  /* show ~3.3 items so the next image peeks out behind the fade */
  flex: 0 0 calc((100% - 3 * 12px) / 3.3);
  scroll-snap-align: start;
  display: flex; flex-direction: column;
}
.gallery-item .img {
  position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: 8px;
  background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 100%);
  cursor: zoom-in;
}
.gallery-item .img::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(70% 60% at 30% 30%, rgba(255,255,255,0.07), transparent 70%);
}
.gallery-item .img .lbl {
  position: absolute; bottom: 12px; left: 14px;
  font-size: calc(11px * var(--read-scale)); color: rgba(255,255,255,0.5); letter-spacing: 0.18em; text-transform: uppercase;
}

/* ─── More news ──────────────────────────────── */
.more-news { padding: 0 0 calc(80px * var(--scale)); }
.more-grid {
  padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.more-grid .ncard {
  display: flex; flex-direction: column; gap: 18px; cursor: pointer;
}
.more-grid .ncard .img-wrap {
  position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: 8px;
  background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 100%);
}
.more-grid .ncard .img-wrap::before { content:''; position:absolute; inset:0; background: radial-gradient(70% 60% at 30% 30%, rgba(255,255,255,0.06), transparent 70%); }
.more-grid .ncard .img-wrap::after { content:''; position:absolute; inset:0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.5) 100%); }
.more-grid .ncard .meta { display: flex; flex-direction: column; gap: 10px; }
.more-grid .ncard .meta-top { display: inline-flex; align-items: center; gap: 14px; }
.more-grid .ncard .meta-top .date { font-size: calc(14px * var(--read-scale)); color: var(--ink-dim); letter-spacing: 0.02em; }
.more-grid .ncard .meta-top .tag {
  padding: 4px 10px; border: 1px solid var(--rule-2); border-radius: 999px;
  color: var(--accent); font-weight: 500; font-size: calc(12.5px * var(--read-scale)); letter-spacing: 0.02em;
}
.more-grid .ncard h3 { font-size: calc(20px * var(--read-scale)); font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; transition: color .2s; }
.more-grid .ncard:hover h3 { color: var(--accent); }
/* Excerpt — sjednoceno s archivem aktualit na 3 řádky (line-clamp).
   single-news.css se nikdy nepřekrývá s archive-news.css (každý se
   enqueovává na jiné šabloně), takže pravidlo zde duplikujeme. */
.more-grid .ncard .excerpt {
  font-size: calc(14.5px * var(--read-scale)); line-height: 1.55; color: var(--ink-dim); text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

@media (max-width: 768px) {
  .article-header { padding: 110px var(--gutter) 24px; }
  .article-header h1 {
    font-size: clamp(32px, 9vw, 48px);
    line-height: 0.95;
  }
  .article-body {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 48px var(--gutter);
  }
  .article-body .cover-col { aspect-ratio: 16/9; }
  .article-body .text p {
    font-size: clamp(16px, 4.4vw, 18px);
    line-height: 1.6;
  }
  .gallery { padding: 48px var(--gutter); }
  .gallery-head { margin-bottom: 16px; }
  .gallery-item {
    /* show ~1.2 items so the next image peeks out behind the fade */
    flex: 0 0 80%;
  }
  .gallery .scroller-wrap::after { width: 48px; }
  .more-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .more-news { padding-bottom: 56px; }
}

/* Tablet (769–1024px) — article body collapses to single column (no
   room for the cover photo + text side-by-side at portrait-tablet
   widths), and more-news drops 3 → 2 cols. */
@media (min-width: 769px) and (max-width: 1024px) {
  .article-body {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .article-body .cover-col { max-width: 720px; aspect-ratio: 16/9; }
  .more-grid { grid-template-columns: 1fr 1fr; }
}
