/* ==========================================================================
   Wspólnota Papierni Prądnickich — base stylesheet
   Theme: green-accented, light & dark
   ========================================================================== */

:root {
  /* Light (default) — fresh, natural greens */
  --bg:          #f6faf2;
  --bg-elev:    #ffffff;
  --bg-alt:     #eef5e7;
  --text:       #1a2e1a;
  --text-soft:  #4a5b4a;
  --text-muted: #6b7a6b;
  --border:     #dde8d3;
  --border-strong: #c5d6b7;

  --accent:      #4caf6e;
  --accent-hover:#3d9659;
  --accent-soft: #c8ebd5;
  --accent-faint:#e8f5ec;

  --danger:      #c84a3a;
  --warning:     #c48a1d;

  --shadow-sm:  0 2px 6px rgba(40, 80, 50, 0.06);
  --shadow-md:  0 8px 24px rgba(40, 80, 50, 0.10);
  --shadow-lg:  0 20px 60px rgba(30, 60, 40, 0.15);

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;

  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --header-h: 72px;
  --container: 1200px;
}

[data-theme="dark"] {
  --bg:         #0f1611;
  --bg-elev:    #1a2620;
  --bg-alt:     #141d18;
  --text:       #e8f0e4;
  --text-soft:  #b8c5b4;
  --text-muted: #8a9586;
  --border:     #25342c;
  --border-strong: #34473b;

  --accent:      #6fd494;
  --accent-hover:#8ee0a8;
  --accent-soft: #1f3a2a;
  --accent-faint:#172a20;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ----- Reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1em; color: var(--text-soft); }

/* ----- Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .85rem clamp(1rem, 3vw, 2.5rem);
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--text);
  flex-shrink: 0;
}
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .brand-mark { color: #0f1611; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-weight: 700; font-size: 1rem; }
.brand-sub   { font-size: .75rem; color: var(--text-muted); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}
.site-nav a {
  color: var(--text-soft);
  font-weight: 500;
  font-size: .95rem;
  padding: .4rem .2rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); }
.site-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

.header-tools { display: flex; align-items: center; gap: .5rem; }

.theme-toggle, .lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 38px;
  padding: 0 .8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  transition: all .2s;
}
.theme-toggle:hover, .lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.theme-toggle { width: 38px; padding: 0; justify-content: center; }
.icon-sun, .icon-moon { display: none; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="dark"]  .icon-sun  { display: block; }

.lang-toggle .lang-code { font-weight: 600; font-size: .85rem; }
.lang-toggle .lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  border-radius: 2px;
  overflow: hidden;
}
.lang-toggle .lang-flag svg { display: block; }
.lang-toggle .lang-option {
  display: none;
  align-items: center;
  gap: .4rem;
}

html[lang="pl"] .lang-toggle .lang-option--en {
  display: inline-flex;
}

html[lang="en"] .lang-toggle .lang-option--pl {
  display: inline-flex;
}

.lang-toggle .lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  border-radius: 2px;
  overflow: hidden;
  width: 18px;
  height: 13px;
}

/* ----- Hero ----- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  /* JS-set --vh tracks visualViewport precisely (Safari/iOS, embedded webviews). */
  min-height: calc(var(--vh, 100dvh) - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem clamp(1rem, 4vw, 3rem);
  overflow: hidden;
}

/* Light-mode decorative layer — subtle pulsing radial accent.
   Together with low video opacity it gives visual texture without fighting the text. */
[data-theme="light"] .hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 60%),
    radial-gradient(ellipse 55% 45% at 18% 72%, color-mix(in srgb, var(--accent) 10%, transparent) 0%, transparent 58%);
  animation: heroPulseLight 9s ease-in-out infinite alternate;
}
@keyframes heroPulseLight {
  0%   { opacity: .7; }
  100% { opacity: 1; }
}
.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-video-wrap .hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .55;
  transition: opacity .4s, filter .4s;
}
[data-theme="light"] .hero-video-wrap .hero-video { opacity: .70; }
/* Show only the matching video per theme */
[data-theme="dark"]  #heroVideoLight { display: none; }
[data-theme="light"] #heroVideoDark  { display: none; }
[data-theme="dark"]  #heroVideoDark {
  opacity: .75;
}
/* Light mode (cinematic): dim the bright video so white text on top reads like a film title card. */
[data-theme="light"] #heroVideoLight {
  opacity: .9;
  filter: brightness(.55) saturate(.85) contrast(1.05);
}

.hero-fallback {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: -1;
}
[data-theme="dark"] .hero-fallback {
  background:
    radial-gradient(ellipse at top left, color-mix(in srgb, var(--accent) 15%, transparent) 0%, transparent 60%),
    radial-gradient(ellipse at bottom right, color-mix(in srgb, var(--accent) 20%, transparent) 0%, transparent 60%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
}

/* Soft theme-tinted wash over the video — calms the busy frame */
.hero-tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 14%, transparent) 0%,
    color-mix(in srgb, var(--accent) 6%, transparent) 60%,
    transparent 100%
  );
}
[data-theme="light"] .hero-tint {
  display: none;
}

.hero-fallback {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top left, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(ellipse at bottom right, color-mix(in srgb, var(--accent) 30%, transparent) 0%, transparent 60%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
  z-index: -1;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 30%, var(--bg) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 30%, transparent) 0%, transparent 50%);
}
[data-theme="light"] .hero-overlay {
  /* Cinematic dark gradient — deeper at the bottom to ground the hero and ease the transition into the next section. */
  background:
    linear-gradient(180deg,
      rgba(0,0,0,.55) 0%,
      rgba(0,0,0,.35) 35%,
      rgba(0,0,0,.60) 75%,
      rgba(0,0,0,.92) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
}
/* Light mode: per-line highlight replaced by cinematic white-on-dim treatment below. */

/* Staggered fade-in for hero pieces */
.hero-eyebrow,
.hero-title,
.hero-lead {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  animation: heroRise 1.4s cubic-bezier(.16, 1, .3, 1) forwards;
  will-change: transform, opacity;
}
.hero-eyebrow { animation-delay: .4s; }
.hero-title   { animation-delay: .8s; }
.hero-lead    { animation-delay: 1.2s; }

@keyframes heroRise {
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Scroll-down hint */
.scroll-hint {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: var(--text-soft);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0;
  transform: translate3d(-50%, 18px, 0);
  animation:
    scrollHintIn 1.4s cubic-bezier(.16,1,.3,1) 1.8s forwards,
    scrollBounce 2.4s ease-in-out 3.4s infinite;
  transition: color .2s;
}
.scroll-hint:hover { color: var(--accent); }
.scroll-hint svg { stroke: var(--accent); }

/* Light mode: hero bottom is now dark from the cinematic overlay, so brighten the scroll hint. */
[data-theme="light"] .scroll-hint {
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
[data-theme="light"] .scroll-hint svg {
  stroke: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55));
}
[data-theme="light"] .scroll-hint:hover { color: var(--accent); }
[data-theme="light"] .scroll-hint:hover svg { stroke: var(--accent); }

@keyframes scrollHintIn {
  to { opacity: 1; transform: translate3d(-50%, 0, 0); }
}
@keyframes scrollBounce {
  0%, 100% { transform: translate3d(-50%, 0, 0); }
  50%      { transform: translate3d(-50%, 8px, 0); }
}

.hero-eyebrow {
  display: inline-block;
  padding: .35rem .9rem;
  border-radius: 999px;
  background: var(--accent-faint);
  color: var(--accent-hover);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 1.5rem;
  border: 1px solid var(--accent-soft);
}
[data-theme="dark"] .hero-eyebrow { color: var(--accent); }

.hero-title {
  margin-bottom: 1rem;
  overflow-wrap: break-word;
  word-break: normal;
}
@media (max-width: 480px) {
  .hero-title { font-size: clamp(1.6rem, 7.5vw, 2rem); }
}
.hero-accent {
  color: var(--accent);
}
@keyframes heroShimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.hero-lead {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--text-soft);
  max-width: 640px;
  margin: 0 auto 2rem;
}
[data-theme="light"] .hero-lead {
  color: #fff;
  font-weight: 500;
}
/* Cinematic light hero: mostly white text with green accent for the building names, all over the dimmed video. */
[data-theme="light"] .hero-content .hero-title,
[data-theme="light"] .hero-content .hero-lead {
  color: #fff;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, .65),
    0 1px 2px rgba(0, 0, 0, .75);
}
[data-theme="light"] .hero-content .hero-lead {
  color: rgba(255, 255, 255, .92);
}
[data-theme="light"] .hero-accent {
  color: var(--accent);
  text-shadow:
    0 2px 8px rgba(0, 0, 0, .7),
    0 1px 2px rgba(0, 0, 0, .8),
    0 0 24px color-mix(in srgb, var(--accent) 35%, transparent);
}
[data-theme="light"] .hero-content .hero-eyebrow {
  color: #fff;
  background: color-mix(in srgb, var(--accent) 28%, rgba(0, 0, 0, .25));
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
}
.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .85rem 1.6rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: all .2s;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent);
}
[data-theme="dark"] .btn-primary { color: #0f1611; }
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 50%, transparent);
}
[data-theme="dark"] .btn-primary:hover { color: #0f1611; }
.btn-ghost {
  background: var(--bg-elev);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.video-controls {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3;
  display: flex;
  gap: .5rem;
}
.video-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 85%, transparent);
  backdrop-filter: blur(8px);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: all .2s;
}
.video-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.video-btn .icon-play,
.video-btn .icon-sound-off { display: none; }
.video-btn.paused .icon-play  { display: block; }
.video-btn.paused .icon-pause { display: none; }
.video-btn.muted .icon-sound-off { display: block; }
.video-btn.muted .icon-sound-on  { display: none; }

/* ----- Sections ----- */
.section {
  padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem);
  max-width: var(--container);
  margin: 0 auto;
}
.section-alt {
  background: var(--bg-alt);
  max-width: none;
  margin: 0;
}
.section-alt > * { max-width: var(--container); margin-left: auto; margin-right: auto; }

.section-head {
  text-align: center;
  margin-bottom: 3rem;
}
.section-head h2 { margin-bottom: .5rem; }
.section-head p { color: var(--text-muted); max-width: 600px; margin: 0 auto; }

.section-footer {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   NEWS — list + detail (Portal/Magazine style)
   ============================================================ */

/* ----- List (home + archive) ----- */
.news-grid,
.news-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* ===== HERO card (top news, image with overlay) ===== */
.news-hero-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: inherit;
  text-decoration: none;
  aspect-ratio: 16 / 9;
  min-height: 520px;
  isolation: isolate;
  transition: transform .25s, box-shadow .25s, min-height .35s ease;
}
/* ============================================================
   NEWS-FIRST PAGE — dedicated /news.html
   Magazine layout: bold hero card + tidy grid of secondary cards.
   Width is capped so it stays elegant on wide screens.
   ============================================================ */
.news-page > .section {
  padding-top: 1.5rem;
  padding-bottom: clamp(2rem, 4vw, 4rem);
  max-width: min(92vw, 1360px);
}
.news-page .news-grid {
  max-width: 100%;
  gap: clamp(1.25rem, 2vw, 2rem);
}

/* Featured hero card — prominent but proportioned, never overwhelming */
.news-page .news-hero-card {
  min-height: clamp(420px, 52vh, 600px);
  aspect-ratio: 16 / 9;
}

/* Secondary cards — clean responsive grid (2 columns on wide, 1 on narrow) */
.news-page .news-secondary-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: clamp(1rem, 1.5vw, 1.5rem);
}

/* Slightly larger ultra-wide variant — still capped */
@media (min-width: 1600px) {
  .news-page > .section {
    max-width: 1480px;
  }
  .news-page .news-hero-card {
    min-height: 640px;
  }
}

/* Narrow screens — restore a sensible hero ratio */
@media (max-width: 720px) {
  .news-page .news-hero-card {
    min-height: 460px;
    aspect-ratio: 4 / 5;
  }
}
.news-hero-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg, 0 18px 40px rgba(0,0,0,.18)); }
.news-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.news-hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s ease;
}
.news-hero-card:hover .news-hero-media img { transform: scale(1.04); }
.news-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,.05) 35%,
    rgba(0,0,0,.55) 75%,
    rgba(0,0,0,.85) 100%);
  z-index: 1;
}
.news-hero-text {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  padding: clamp(1.5rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: .85rem;
  color: #fff;
  max-width: 760px;
}
.news-hero-tag {
  align-self: flex-start;
}
.news-hero-title {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.025em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.news-hero-lead {
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.55;
  color: rgba(255,255,255,.94);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 720px;
}
.news-hero-meta {
  color: rgba(255,255,255,.85) !important;
  font-size: .85rem;
}
.news-hero-meta .news-list-author { color: #fff !important; }
.news-hero-meta time::after,
.news-hero-meta .news-list-author::after { color: rgba(255,255,255,.6) !important; }
@media (max-width: 720px) {
  .news-hero-card { aspect-ratio: 4 / 5; min-height: 460px; }
  .news-hero-title { font-size: 1.5rem; }
  .news-hero-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.55) 50%, rgba(0,0,0,.88) 100%);
  }
}

/* Very narrow phones — tighten hero so image gets more room */
@media (max-width: 480px) {
  .news-hero-card,
  .news-page .news-hero-card {
    aspect-ratio: 3 / 4;
    min-height: 380px;
  }
  .news-hero-text {
    padding: 1rem 1.1rem 1.1rem;
    gap: .55rem;
  }
  .news-hero-title {
    font-size: 1.2rem;
    line-height: 1.2;
    text-wrap: balance;
  }
  .news-hero-lead {
    font-size: .88rem;
    line-height: 1.45;
    -webkit-line-clamp: 2;
  }
  .news-hero-meta { font-size: .75rem; }
  .news-hero-tag { font-size: .6rem; padding: .15rem .5rem; }
}

/* ===== Secondary grid (cards under hero) ===== */
.news-secondary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 1.5rem;
}

/* ===== Tertiary grid (3 bigger cards below secondary) ===== */
.news-tertiary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}
@media (max-width: 980px) {
  .news-tertiary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .news-tertiary-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Compact list (older items below secondary grid) ===== */
.news-compact-heading {
  margin: 3rem 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
}
.news-compact-list {
  border-top: 1px solid var(--border);
}
.news-compact-row {
  display: grid;
  grid-template-columns: 5rem 7rem 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: .75rem .25rem;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.news-compact-row:hover {
  background: var(--bg-elev);
  color: var(--accent);
}
.news-compact-thumb {
  width: 5rem;
  height: 3.5rem;
  overflow: hidden;
  border-radius: calc(var(--radius) / 2);
  background: var(--bg-elev);
}
.news-compact-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-compact-thumb--empty {
  background: linear-gradient(135deg, var(--bg-elev), var(--bg));
  border: 1px dashed var(--border);
}
/* Skeleton placeholders for lazily-loaded news rows. */
.news-compact-row--skeleton {
  pointer-events: none;
  cursor: default;
}
.skeleton-bar {
  display: inline-block;
  min-height: 0.9em;
  border-radius: 4px;
  color: transparent !important;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--text-muted) 12%, transparent) 0%,
    color-mix(in srgb, var(--text-muted) 24%, transparent) 50%,
    color-mix(in srgb, var(--text-muted) 12%, transparent) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.news-compact-row--skeleton .news-compact-title.skeleton-bar { width: 65%; }
.news-compact-row--skeleton .news-compact-tag.skeleton-bar { width: 4.5rem; }
.news-compact-row--skeleton .news-compact-author.skeleton-bar { width: 6rem; }
.news-compact-row--skeleton .news-compact-readmin.skeleton-bar { width: 2.8rem; }
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-bar { animation: none; }
}
.news-lazy-sentinel { height: 1px; }
.news-compact-date {
  font-size: .85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.news-compact-text {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-width: 0;
}
.news-compact-tag {
  align-self: start;
  font-size: .65rem;
}
.news-compact-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.35;
  color: inherit;
}
.news-compact-row:hover .news-compact-title {
  color: var(--accent);
}
.news-compact-author {
  font-size: .85rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.news-compact-readmin {
  font-size: .8rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 3rem;
  text-align: right;
}
@media (max-width: 720px) {
  .news-compact-row {
    grid-template-columns: 4rem 1fr auto;
    grid-template-areas:
      "thumb date date"
      "thumb text text"
      "thumb author readmin";
    row-gap: .35rem;
    padding: .85rem .25rem;
  }
  .news-compact-thumb {
    grid-area: thumb;
    width: 4rem;
    height: 4rem;
    align-self: start;
  }
  .news-compact-date { grid-area: date; justify-self: end; }
  .news-compact-text { grid-area: text; }
  .news-compact-author { grid-area: author; }
  .news-compact-readmin { grid-area: readmin; }
}

.news-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-soft);
}
.news-card-media {
  aspect-ratio: 16 / 9;
  background: var(--accent-faint);
  overflow: hidden;
}
.news-card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.news-card:hover .news-card-media img { transform: scale(1.05); }
.news-card-text {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding: 1.25rem 1.25rem 1.4rem;
  flex: 1;
}
.news-card-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--text);
}
.news-card:hover .news-card-title { color: var(--accent-hover); }
[data-theme="dark"] .news-card:hover .news-card-title { color: var(--accent); }
.news-card-lead {
  margin: 0;
  font-size: .92rem;
  line-height: 1.55;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Keep old .news-featured-* selectors as fallback (some pages may still use them) */
.news-featured-card {
  display: grid;
  grid-template-columns: minmax(0, 48%) 1fr;
  gap: 2rem;
  align-items: center;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: inherit;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  margin-bottom: .25rem;
}
.news-featured-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-soft);
}
.news-featured-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--accent-faint);
  overflow: hidden;
  border-radius: calc(var(--radius) - 4px);
}
.news-featured-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.news-featured-text {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  min-width: 0;
}
.news-featured-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--text);
}
.news-featured-lead {
  margin: 0;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 720px) {
  .news-featured-card {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .news-featured-thumb { aspect-ratio: 16 / 9; }
}

.news-list-card {
  display: grid;
  grid-template-columns: minmax(0, 280px) 1fr;
  gap: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: inherit;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  align-items: stretch;
}
.news-list-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-soft);
}
.news-list-thumb {
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  aspect-ratio: 16 / 11;
  background: var(--accent-faint);
  min-width: 0;
  width: 100%;
  align-self: start;
}
.news-list-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.news-list-thumb--empty {
  background: linear-gradient(135deg, var(--accent-faint), var(--bg));
}
.news-list-text {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-width: 0;
}
.news-list-tag {
  align-self: flex-start;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: var(--accent-faint);
  color: var(--accent-hover);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}
[data-theme="dark"] .news-list-tag { color: var(--accent); }
.news-list-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--text);
}
.news-list-lead {
  margin: 0;
  color: var(--text-soft);
  font-size: .95rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-list-meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.news-list-author { font-weight: 600; color: var(--text-soft); }
.news-list-author::after,
.news-list-meta time::after {
  content: '·';
  margin-left: .4rem;
  color: var(--text-muted);
}
.news-list-meta > :last-child::after { content: none; }

/* Per-tag colors */
.news-list-tag[data-tag="energia-bierna"],
.news-detail-tag[data-tag="energia-bierna"]  { background: #fff4e6; color: #b95900; }
.news-list-tag[data-tag="reprezentacja"],
.news-detail-tag[data-tag="reprezentacja"]   { background: #ffe9e9; color: #b02323; }
.news-list-tag[data-tag="podsumowanie"],
.news-detail-tag[data-tag="podsumowanie"]    { background: #e7f0ff; color: #2256b5; }
.news-list-tag[data-tag="kompensator"],
.news-detail-tag[data-tag="kompensator"]     { background: #e9f7ec; color: #1d7a3c; }
.news-list-tag[data-tag="zmiana-zarzadcy"],
.news-detail-tag[data-tag="zmiana-zarzadcy"] { background: #f3e8ff; color: #6d28b9; }
[data-theme="dark"] .news-list-tag[data-tag="energia-bierna"],
[data-theme="dark"] .news-detail-tag[data-tag="energia-bierna"]  { background: rgba(255,159,64,.18); color: #ffb877; }
[data-theme="dark"] .news-list-tag[data-tag="reprezentacja"],
[data-theme="dark"] .news-detail-tag[data-tag="reprezentacja"]   { background: rgba(255,80,80,.18); color: #ff9292; }
[data-theme="dark"] .news-list-tag[data-tag="podsumowanie"],
[data-theme="dark"] .news-detail-tag[data-tag="podsumowanie"]    { background: rgba(90,140,255,.18); color: #9bb8ff; }
[data-theme="dark"] .news-list-tag[data-tag="kompensator"],
[data-theme="dark"] .news-detail-tag[data-tag="kompensator"]     { background: rgba(80,200,120,.18); color: #8fdca5; }
[data-theme="dark"] .news-list-tag[data-tag="zmiana-zarzadcy"],
[data-theme="dark"] .news-detail-tag[data-tag="zmiana-zarzadcy"] { background: rgba(170,110,255,.18); color: #c9a4ff; }

@media (max-width: 640px) {
  .news-list-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .news-list-thumb { aspect-ratio: 16 / 9; max-height: 220px; }
}

/* News filters (category pills) */
.news-filters {
  margin-bottom: 1.75rem;
  display: flex;
  justify-content: flex-start;
}
.news-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: flex-start;
  align-items: center;
}
.news-filter-pill {
  padding: .6rem 1.2rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg);
  color: var(--text-soft);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
  transition: all .25s ease;
  text-transform: capitalize;
  font-family: inherit;
  white-space: nowrap;
}
.news-filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: var(--accent-faint);
}
.news-filter-pill.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--accent) 60%, transparent);
}
[data-theme="dark"] .news-filter-pill { border-color: var(--border); }
[data-theme="dark"] .news-filter-pill.is-active { color: #0f1611; }

@media (max-width: 768px) {
  .news-filter-pills {
    gap: .5rem;
  }
  .news-filter-pill {
    padding: .55rem 1rem;
    font-size: .85rem;
  }
}

@media (max-width: 640px) {
  .news-filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: .4rem;
    padding: 0 .25rem;
    margin: 0 -.25rem;
  }
  .news-filter-pills::-webkit-scrollbar {
    display: none;
  }
  .news-filter-pill {
    flex: 0 0 auto;
  }
}
  .news-list-thumb { aspect-ratio: 16 / 9; max-height: 220px; }
}

/* Very narrow phones — compact news cards */
@media (max-width: 480px) {
  .news-page > .section { max-width: 100%; padding-left: 1rem; padding-right: 1rem; }
  .news-card-text { padding: 1rem 1rem 1.1rem; gap: .5rem; }
  .news-card-title { font-size: 1.05rem; line-height: 1.25; }
  .news-card-lead { font-size: .88rem; -webkit-line-clamp: 2; }
  .news-list-card { padding: 1rem; gap: .85rem; }
  .news-list-title { font-size: 1.1rem; line-height: 1.25; }
  .news-list-lead { font-size: .88rem; -webkit-line-clamp: 2; }
  .news-list-meta { font-size: .72rem; gap: .25rem; }
  .news-list-meta time::after, .news-list-author::after { margin-left: .25rem; }
  .news-compact-heading { margin: 2rem 0 .75rem; font-size: 1.05rem; }
  .news-compact-row { gap: .6rem; padding: .7rem .15rem; }
  .news-compact-thumb { width: 3.25rem !important; height: 3.25rem !important; }
  .news-compact-title { font-size: .92rem; line-height: 1.3; }
  .news-compact-date, .news-compact-author, .news-compact-readmin { font-size: .72rem; }
}

/* ----- Detail page ----- */
.news-page { min-height: 60vh; }

.news-detail {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.news-detail-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  max-width: 760px;
}
.news-detail-aside {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: .25rem;
}
.news-back {
  display: block;
  max-width: 1180px;
  margin: 0 auto 1rem;
  color: var(--text-muted);
  font-size: .9rem;
  text-decoration: none;
}
.news-back:hover { color: var(--accent-hover); }
[data-theme="dark"] .news-back:hover { color: var(--accent); }

.news-detail-tag {
  align-self: flex-start;
  padding: .3rem .75rem;
  border-radius: 999px;
  background: var(--accent-faint);
  color: var(--accent-hover);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}
[data-theme="dark"] .news-detail-tag { color: var(--accent); }

.news-detail-title {
  margin: 0;
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 800;
  color: var(--text);
}
.news-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .9rem;
  color: var(--text-muted);
}
.news-detail-author { font-weight: 600; color: var(--text-soft); }
.news-detail-author::after,
.news-detail-meta time::after {
  content: '·';
  margin-left: .5rem;
  color: var(--text-muted);
}
.news-detail-meta > :last-child::after { content: none; }

.news-detail-figure {
  margin: 1rem 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--accent-faint);
}
.news-detail-figure img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.news-detail-body {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-soft);
  margin-top: 1rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.news-detail-body p { margin: 0 0 1.1rem; }
.news-detail-body p:last-child { margin-bottom: 0; }
.news-detail-body strong { color: var(--text); font-weight: 700; }
.news-detail-body ul { margin: .6rem 0 1.2rem; padding-left: 1.4rem; }
.news-detail-body li { margin: .4rem 0; }
.news-detail-body h3,
.news-detail-body h4,
.news-detail-body h5 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
  margin: 1.8rem 0 .8rem;
}
.news-detail-body h3 { font-size: 1.45rem; }
.news-detail-body h4 { font-size: 1.2rem; }
.news-detail-body h5 { font-size: 1.05rem; }
.news-detail-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}
.news-detail-body blockquote {
  margin: 1.2rem 0;
  padding: .6rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-faint);
  border-radius: 0 8px 8px 0;
  color: var(--text);
  font-style: italic;
}
.news-detail-body blockquote p { margin: 0 0 .6rem; }
.news-detail-body blockquote p:last-child { margin-bottom: 0; }
.news-detail-body a {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}
[data-theme="dark"] .news-detail-body a { color: var(--accent); }

.news-detail-actions {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.news-post-source,
.news-post-share,
.news-post-discuss {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1rem;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}
.news-post-source,
.news-post-share {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .2s, color .2s, background .2s;
}
.news-post-source:hover,
.news-post-share:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: var(--accent-faint);
}
[data-theme="dark"] .news-post-source:hover,
[data-theme="dark"] .news-post-share:hover { color: var(--accent); }
.news-post-share.is-success {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
[data-theme="dark"] .news-post-share.is-success { color: #0f1611; }
.news-post-discuss {
  background: var(--accent-faint);
  color: var(--accent-hover);
  border: 1px solid var(--accent-soft);
}
[data-theme="dark"] .news-post-discuss { color: var(--accent); }
.news-post-discuss:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
[data-theme="dark"] .news-post-discuss:hover { color: #0f1611; }

/* ===== Aside sidebar overrides (stacked vertical layout) ===== */
.news-detail-aside .news-detail-meta {
  flex-direction: column;
  gap: .35rem;
  align-items: flex-start;
}
.news-detail-aside .news-detail-meta > * { display: block; }
.news-detail-aside .news-detail-author::after,
.news-detail-aside .news-detail-meta time::after { content: none; margin: 0; }
.news-detail-aside .news-detail-author {
  font-size: .95rem;
  color: var(--text);
}
.news-detail-aside .news-detail-meta time {
  font-size: .85rem;
}
.news-detail-aside .news-detail-read {
  font-size: .8rem;
  color: var(--text-muted);
}
.news-detail-aside .news-detail-actions {
  flex-direction: column;
  align-items: stretch;
  margin-top: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  gap: .6rem;
}
.news-detail-aside .news-post-share,
.news-detail-aside .news-post-discuss {
  justify-content: center;
  width: 100%;
}

@media (max-width: 760px) {
  .news-detail {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .news-detail-main { max-width: 100%; }
  .news-detail-aside {
    position: static;
    order: 2;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
  }
  .news-detail-aside .news-detail-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
  }
  .news-detail-aside .news-detail-author::after,
  .news-detail-aside .news-detail-meta time::after {
    content: '·';
    margin-left: .5rem;
  }
  .news-detail-aside .news-detail-meta > :last-child::after { content: none; }
  .news-detail-aside .news-detail-actions {
    flex-direction: row;
    align-items: center;
    border-top: none;
    padding-top: 0;
  }
  .news-detail-aside .news-post-share,
  .news-detail-aside .news-post-discuss {
    width: auto;
  }
}

.news-detail-missing {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.news-related-heading {
  max-width: 1180px;
  margin: 0 auto 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

/* ===== Discussion CTA (news detail) ===== */
.news-discuss-section {
  padding-top: 0;
}
.news-discuss {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.75rem;
  align-items: center;
  padding: 2.25rem 2.5rem;
  border-radius: 20px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 14%, var(--bg-soft)) 0%,
    color-mix(in srgb, var(--accent) 4%, var(--bg-soft)) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  box-shadow: 0 12px 40px -20px color-mix(in srgb, var(--accent) 60%, transparent);
}
.news-discuss-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}
.news-discuss-body { min-width: 0; }
.news-discuss-eyebrow {
  margin: 0 0 .35rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.news-discuss-title {
  margin: 0 0 .75rem;
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.news-discuss-lead {
  margin: 0 0 1.5rem;
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.55;
}
.news-discuss-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .85rem 1.25rem;
  margin-bottom: 1rem;
}
.news-discuss-cta {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .75rem 1.4rem;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease;
}
.news-discuss-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.news-discuss-cta svg { flex-shrink: 0; }
.news-discuss-alt {
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--text-soft) 45%, transparent);
  padding-bottom: 2px;
  transition: color .15s ease, border-color .15s ease;
}
.news-discuss-alt:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.news-discuss-note {
  margin: 0;
  font-size: .85rem;
  color: var(--text-muted, var(--text-soft));
  opacity: .8;
}
@media (max-width: 640px) {
  .news-discuss {
    grid-template-columns: 1fr;
    padding: 1.5rem 1.25rem;
    gap: 1rem;
  }
  .news-discuss-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }
  .news-discuss-icon svg { width: 28px; height: 28px; }
}

#newsRelated .news-list {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 1.25rem;
}

/* Banner (green stripe) spans full viewport, but content stays centered */
.news-page > .section#newsRelated {
  max-width: 100%;
  width: 100%;
  padding-left: clamp(1rem, 5vw, 4rem);
  padding-right: clamp(1rem, 5vw, 4rem);
}

#newsRelated .news-list-card {
  grid-template-columns: minmax(0, 130px) minmax(0, 1fr);
  gap: .9rem;
  padding: .9rem;
}
#newsRelated .news-list-thumb { aspect-ratio: 4 / 3; }
#newsRelated .news-list-title { font-size: 1rem; line-height: 1.3; }
#newsRelated .news-list-lead { -webkit-line-clamp: 2; font-size: .85rem; }
#newsRelated .news-list-tag { font-size: .6rem; }
#newsRelated .news-list-meta { font-size: .72rem; }

@media (max-width: 640px) {
  #newsRelated .news-list { grid-template-columns: 1fr; }
  #newsRelated .news-list-card {
    grid-template-columns: minmax(0, 90px) minmax(0, 1fr);
    gap: .75rem;
    padding: .75rem;
  }
  #newsRelated .news-list-thumb { aspect-ratio: 1 / 1; }
  #newsRelated .news-list-title { font-size: .95rem; }
  #newsRelated .news-list-lead { display: none; }
}

.news-loading { text-align: center; color: var(--text-muted); padding: 2rem 0; }

.news-more-wrap {
  text-align: center;
  margin-top: 2rem;
}
.news-more {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.4rem;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  background: var(--accent-faint);
  color: var(--accent-hover);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, color .2s, transform .2s;
}
[data-theme="dark"] .news-more { color: var(--accent); }
.news-more:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}
[data-theme="dark"] .news-more:hover { color: #0f1611; }
.news-body-img {
  border-radius: 1rem;
}

/* ----- Community ----- */
.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1.5rem;
}
.community-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.75rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: all .2s;
}
.community-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  color: var(--text);
}
.community-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
}
.community-fb .community-icon  { background: #1877f2; }
.community-msg .community-icon { background: linear-gradient(135deg, #00b2ff, #006aff); }
.community-text { flex: 1; }
.community-text h3 { margin: 0 0 .25rem; }
.community-text p  { margin: 0; font-size: .9rem; color: var(--text-muted); }
.community-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
  transition: transform .2s, color .2s;
}
.community-card:hover .community-arrow { color: var(--accent); transform: translateX(4px); }

/* ----- Quick cards ----- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1.5rem;
}
.quick-card {
  display: block;
  padding: 2rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: all .2s;
}
.quick-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  color: var(--text);
}
.quick-icon { font-size: 2rem; margin-bottom: .75rem; }
.quick-card h3 { margin-bottom: .35rem; }
.quick-card p  { margin: 0; font-size: .9rem; color: var(--text-muted); }

/* ===== CTA section ===== */
.cta-section {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(4rem, 9vw, 7.5rem) clamp(1rem, 4vw, 3rem);
  overflow: hidden;
  isolation: isolate;
}
.cta-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--accent) 8%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 100%, color-mix(in srgb, var(--accent-hover) 7%, transparent) 0%, transparent 55%);
  z-index: -1;
  pointer-events: none;
}
.cta-section > .cta-card {
  max-width: 1200px;
  margin: 0 auto;
}
.cta-card {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 14%, var(--bg-elev)) 0%,
      var(--bg-elev) 55%,
      color-mix(in srgb, var(--accent-hover) 10%, var(--bg-elev)) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2rem;
  padding: 3rem clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.cta-deco {
  position: absolute;
  top: -60%;
  right: -10%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 28%, transparent) 0%, transparent 65%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}
.cta-content { position: relative; z-index: 1; }
.cta-eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .85rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: var(--accent-faint);
  border: 1px solid var(--accent-soft);
}
.cta-content h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin: 0 0 .85rem;
  line-height: 1.15;
}
.cta-content p {
  color: var(--text-soft);
  font-size: 1rem;
  margin: 0 0 1.75rem;
  max-width: 56ch;
}
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
}
.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .9rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s;
}
[data-theme="dark"] .cta-primary { color: #0f1611; }
.cta-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}
.cta-secondary {
  display: inline-flex;
  align-items: center;
  padding: .9rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
}
.cta-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: var(--accent-faint);
}
[data-theme="dark"] .cta-secondary:hover { color: var(--accent); }

.cta-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.cta-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.cta-stat-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
[data-theme="dark"] .cta-stat-num { color: var(--accent); }
.cta-stat-label {
  font-size: .8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

@media (max-width: 860px) {
  .cta-card {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
  }
  .cta-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .cta-stat { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .cta-deco { width: 280px; height: 280px; }
}

/* ----- Page (handbook / gallery) ----- */
.page {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1rem, 4vw, 3rem);
}
.page-head { text-align: center; margin-bottom: 3rem; }
.page-head h1 { margin-bottom: .5rem; }
.page-head p  { color: var(--text-muted); }
.page-eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: .35rem .85rem;
  border-radius: 999px;
  background: var(--accent-faint);
  margin-bottom: 1rem;
}

/* Sections inside handbook (community + niezbędnik) */
.hb-section { margin-bottom: 4rem; }
.hb-section:last-child { margin-bottom: 0; }
.hb-section-head {
  text-align: center;
  margin-bottom: 2rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.hb-section-kicker {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .5rem;
  position: relative;
  padding: 0 1.25rem;
}
.hb-section-kicker::before,
.hb-section-kicker::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 1.5rem;
  height: 1px;
  background: var(--border);
}
.hb-section-kicker::before { right: 100%; }
.hb-section-kicker::after  { left: 100%; }
.hb-section-head h2 { margin: 0 0 .5rem; font-size: 1.85rem; }
.hb-section-head p  { color: var(--text-muted); margin: 0; }

/* Handbook */
.handbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 1.5rem;
}
.info-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.info-card-wide { grid-column: 1 / -1; }
.info-emergency {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--danger) 4%, transparent), transparent 40%),
    var(--bg-elev);
}
.info-head { margin-bottom: 1rem; }
.info-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: .6rem;
}
.info-badge-accent {
  background: var(--accent-faint);
  color: var(--accent-hover);
}
[data-theme="dark"] .info-badge-accent { color: var(--accent); }
.info-head h2 { margin: 0; font-size: 1.25rem; }
.info-desc { font-size: .9rem; color: var(--text-muted); margin-bottom: 1rem; }
.info-note { font-size: .8rem; color: var(--text-muted); margin-top: .75rem; font-style: italic; }

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.contact-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px dashed var(--border);
}
.contact-list li:last-child { border-bottom: none; }
.contact-label { color: var(--text-muted); font-size: .9rem; }
.contact-value {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.contact-value:hover { color: var(--accent); }

.info-address { font-style: normal; line-height: 1.7; color: var(--text); }

/* Multi-column layout inside wide info card */
.info-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1.5rem 2rem;
}
.info-subheading {
  margin: 0 0 .6rem;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
.contact-value-email {
  font-size: .82rem;
  word-break: break-all;
  text-align: right;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: .5rem 0;
}
.info-list li {
  padding: .4rem 0;
  padding-left: 1.25rem;
  position: relative;
  color: var(--text-soft);
  font-size: .92rem;
}
.info-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.info-highlight {
  font-size: 1.05rem;
  font-weight: 600;
  margin: .25rem 0 1rem;
}
.info-highlight a {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}
[data-theme="dark"] .info-highlight a { color: var(--accent); }

.info-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.info-links li a {
  display: block;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  transition: border-color .2s, background .2s, transform .2s;
}
.info-links li a:hover {
  border-color: var(--accent);
  background: var(--accent-faint);
  color: var(--accent-hover);
  transform: translateY(-1px);
}
[data-theme="dark"] .info-links li a:hover { color: var(--accent); }

.faq-list { display: flex; flex-direction: column; gap: .5rem; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  background: var(--bg);
  transition: border-color .2s;
}
.faq-item[open] { border-color: var(--accent-soft); }
.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::after {
  content: '+';
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
  transition: transform .2s;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin: .75rem 0 0; font-size: .9rem; color: var(--text-soft); }

/* ----- Gallery ----- */
.albums { display: flex; flex-direction: column; gap: 4rem; }
.album-head { margin-bottom: 1rem; }
.album-head h2 { margin-bottom: .25rem; font-size: 1.65rem; }
.album-head .album-meta { color: var(--text-muted); font-size: .9rem; }

.page-stats {
  margin: .75rem 0 0;
  color: var(--text-muted);
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 500;
}

.album-cover {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-alt);
  aspect-ratio: 16 / 9;
  position: relative;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.album-cover:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.album-cover:hover img { transform: scale(1.03); }

.album-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .65rem;
  margin-top: .65rem;
}
.album-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: calc(var(--radius) / 1.5);
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg-alt);
  padding: 0;
}
.album-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
  display: block;
}
.album-thumb:hover img { transform: scale(1.08); }
.album-thumb:hover { border-color: var(--accent); }

.album-thumb--more img { filter: brightness(.45); }
.album-more-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  pointer-events: none;
}

@media (max-width: 720px) {
  .album-preview-grid { grid-template-columns: repeat(3, 1fr); }
  .album-cover { aspect-ratio: 4 / 3; }
}

.gallery-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  background: var(--bg-elev);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, .92);
  display: grid;
  place-items: center;
  padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.lightbox-caption {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: .9rem;
  background: rgba(0,0,0,.5);
  padding: .35rem .8rem;
  border-radius: 8px;
  margin: 0;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  display: grid;
  place-items: center;
  transition: background .2s;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,.25); }
.lightbox-close { top: 1.5rem; right: 1.5rem; }
.lightbox-prev  { left: 1.5rem;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 1.5rem; top: 50%; transform: translateY(-50%); }

/* ----- Footer ----- */
.site-footer {
  margin-top: 4rem;
  padding: 2.5rem clamp(1rem, 4vw, 3rem);
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: center;
}
.footer-brand { margin: 0; color: var(--text); font-size: .95rem; }
.footer-meta  { margin: 0; color: var(--text-muted); font-size: .85rem; }
.footer-meta span { display: block; }

.footer-social {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: background .2s, color .2s, transform .2s, border-color .2s;
}
.footer-social a:hover {
  transform: translateY(-2px);
  color: #fff;
  border-color: transparent;
}
.footer-social a[aria-label="Facebook"]:hover { background: #1877f2; }
.footer-social a[aria-label="Messenger"]:hover { background: #0084ff; }
.footer-social svg { width: 22px; height: 22px; }

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .hero-video-wrap video { display: none; }
}

/* ----- Mobile ----- */
@media (max-width: 768px) {
  .site-header { gap: .5rem; flex-wrap: wrap; height: auto; padding: .75rem 1rem; }
  .brand-sub { display: none; }
  .site-nav { order: 3; width: 100%; justify-content: center; gap: 1rem; flex-wrap: wrap; }
  .site-nav a { font-size: .85rem; }
  .header-tools { margin-left: auto; }
  .hero {
    /* match desktop: fill the visible viewport below the (now auto-sized) header */
    min-height: calc(var(--vh, 100dvh) - var(--header-h));
  }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ----- Small phones ----- */
@media (max-width: 480px) {
  html, body { overflow-x: clip; }
  .site-header { padding: .4rem .6rem; gap: .35rem; }
  .brand { gap: .4rem; flex: 0 1 auto; min-width: 0; }
  .brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
  .brand-title { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header-tools { gap: .25rem; flex-shrink: 0; }
  .theme-toggle, .lang-toggle, .search-toggle { height: 32px; border-radius: 8px; }
  .theme-toggle, .search-toggle { width: 32px; padding: 0; }
  .lang-toggle { padding: 0 .5rem; }
  .lang-toggle .lang-code { font-size: .78rem; }
  .lang-toggle svg { width: 14px; height: 14px; }
  .site-nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: flex-start;
    gap: .25rem;
    padding: 0 .25rem;
    margin: 0 -.25rem;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a {
    font-size: .78rem;
    padding: .25rem .55rem;
    white-space: nowrap;
    flex: 0 0 auto;
    letter-spacing: -0.01em;
  }
  .cta-section { padding: 3rem 1rem; }
  .cta-card { padding: 1.75rem 1.25rem; }
  .cta-stats { grid-template-columns: 1fr; }
  .cta-stat { flex-direction: row; align-items: baseline; justify-content: space-between; }
  .cta-stat-num { font-size: 1.5rem; }
  .cta-content h2 { font-size: 1.5rem; }
  .hero-title { font-size: clamp(1.4rem, 7vw, 1.8rem); word-break: break-word; hyphens: auto; }
  .hero-content { padding: 0 1rem; }
  .news-detail-body { font-size: 1rem; }
  .news-detail-title { font-size: 1.6rem !important; }
  main .section { padding-left: 1rem; padding-right: 1rem; }
}

@media (max-width: 360px) {
  .brand-text { display: none; }
}

/* ================== STREFA MIESZKAŃCA (handbook) ================== */
.hb-page { max-width: 1180px; }

.hb-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3.5rem;
  align-items: start;
}

.hb-sidebar { position: sticky; top: 96px; }
.hb-toc { padding: .5rem 0; border-left: 2px solid var(--border); }
.hb-toc-title {
  margin: 0 0 .5rem 1rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
}
.hb-toc ol { list-style: none; padding: 0; margin: 0; }
.hb-toc li { margin: 0; }
.hb-toc a {
  display: block;
  padding: .4rem 1rem;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .92rem;
  line-height: 1.35;
  transition: color .15s, border-color .15s;
}
.hb-toc a:hover { color: var(--text); }
.hb-toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.hb-doc { min-width: 0; }
.hb-doc-section {
  margin-bottom: 3rem;
  scroll-margin-top: calc(var(--header-h, 72px) + 16px);
}
.hb-doc-section:last-child { margin-bottom: 0; }
.hb-doc-section h2 {
  font-size: 1.6rem;
  margin: 0 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.hb-doc-section h3 {
  font-size: 1rem;
  margin: 1.75rem 0 .5rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.hb-doc-lead { color: var(--text-muted); margin: 0 0 1rem; }
.hb-doc-section ul { padding-left: 1.25rem; margin: .5rem 0; }
.hb-doc-section ul li { margin: .25rem 0; }
.hb-doc-section a { color: var(--accent); }
.hb-doc-section a:hover { text-decoration: underline; }

/* ===== Search ===== */
.search-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.search-toggle:hover {
  background: var(--accent-faint);
  border-color: var(--accent-soft);
  color: var(--accent);
}

body.search-open { overflow: hidden; }

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2rem, 8vh, 6rem) 1rem 2rem;
}
.search-modal[hidden] { display: none; }
.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: searchFade .18s ease-out;
}
@keyframes searchFade { from { opacity: 0; } to { opacity: 1; } }
.search-panel {
  position: relative;
  width: 100%;
  max-width: 680px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  animation: searchSlide .22s cubic-bezier(.16, 1, .3, 1);
}
@keyframes searchSlide { from { transform: translateY(-12px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.search-input-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.search-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
}
.search-close {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  padding: .2rem .55rem;
  border-radius: 6px;
  cursor: pointer;
}
.search-close:hover { color: var(--accent); border-color: var(--accent-soft); }
.search-results {
  overflow-y: auto;
  padding: .5rem 0 1rem;
}
.search-hint,
.search-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem 1rem;
  margin: 0;
  font-size: .95rem;
}
.search-group { padding: .5rem 0; }
.search-group-title {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-muted);
  padding: .5rem 1rem;
  margin: 0;
}
.search-list { list-style: none; margin: 0; padding: 0; }
.search-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .65rem 1rem;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .12s, border-color .12s;
}
.search-item:hover {
  background: var(--accent-faint);
  border-left-color: var(--accent);
}
.search-item-title { font-weight: 600; font-size: .98rem; }
.search-item-excerpt {
  color: var(--text-muted);
  font-size: .85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-item mark {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

.hb-doc-address { line-height: 1.65; margin: .5rem 0; font-size: 1.05rem; }

.hb-defs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .55rem 1.5rem;
  margin: .5rem 0;
  min-width: 0;
}
.hb-defs dt { color: var(--text-muted); font-size: .92rem; align-self: center; }
.hb-defs dd { margin: 0; min-width: 0; }
.hb-defs dd a { overflow-wrap: anywhere; word-break: break-word; }
.hb-defs-2col { grid-template-columns: max-content 1fr max-content 1fr; gap: .55rem 1.5rem; }

@media (max-width: 560px) {
  .hb-defs,
  .hb-defs-2col { grid-template-columns: 1fr; gap: .15rem .5rem; }
  .hb-defs dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin-top: .4rem; }
  .hb-defs dt:first-of-type { margin-top: 0; }
}

.hb-doc-urgent {
  position: relative;
  border-left: 3px solid var(--accent);
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  background: linear-gradient(to right, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.hb-doc-urgent h2 { border-bottom: none; padding-bottom: 0; margin-top: .25rem; }
.hb-doc-flag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: .25rem;
}
.hb-call {
  font-size: 1.85rem;
  font-weight: 600;
  margin: .75rem 0;
  letter-spacing: -.01em;
}
.hb-call a { color: var(--accent); text-decoration: none; }
.hb-call a:hover { text-decoration: underline; }

.hb-doc-links { list-style: none; padding: 0; margin: 0; }
.hb-doc-links li {
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
}
.hb-doc-links li:last-child { border-bottom: none; }
.hb-doc-links a {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.hb-doc-links a::after {
  content: "→";
  color: var(--text-muted);
  transition: transform .15s, color .15s;
}
.hb-doc-links a:hover { color: var(--accent); }
.hb-doc-links a:hover::after { color: var(--accent); transform: translateX(3px); }

/* ----- FAQ accordion ----- */
.hb-faq {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: 1rem;
}
.hb-faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.hb-faq-item[open] {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.hb-faq-item > summary {
  cursor: pointer;
  list-style: none;
  padding: .9rem 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  color: var(--text);
}
.hb-faq-item > summary::-webkit-details-marker { display: none; }
.hb-faq-item > summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.hb-faq-item[open] > summary::after { transform: rotate(45deg); }
.hb-faq-item > summary:hover { color: var(--accent); }
.hb-faq-item > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.hb-faq-body {
  padding: 0 1.1rem 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.hb-faq-body p { margin: .25rem 0; }
.hb-faq-body a { color: var(--accent); }

/* 404 page ----------------------------------------------------------------- */
.not-found-page { min-height: calc(100vh - 200px); display: flex; align-items: center; }
.not-found {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 1rem;
}
.not-found-code {
  font-size: clamp(4rem, 18vw, 7rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin: 0 0 .5rem;
  letter-spacing: -.04em;
}
.not-found-title {
  font-size: clamp(1.4rem, 5vw, 2rem);
  margin: 0 0 .75rem;
}
.not-found-lead {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  line-height: 1.6;
}
.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.not-found-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .5rem;
  text-align: left;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}
.not-found-links li {
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
}
.not-found-links a {
  color: var(--text);
  text-decoration: none;
  display: block;
}
.not-found-links a:hover { color: var(--accent); }

/* RSS note ----------------------------------------------------------------- */
.news-rss-note {
  margin: 2rem 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}
.news-rss-note a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: .35rem .75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color .2s, border-color .2s, background .2s;
}
.news-rss-note a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.hb-faq-body a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .hb-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .hb-sidebar {
    position: sticky;
    top: calc(var(--header-h, 72px) + 8px);
    z-index: 20;
    background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 6px 20px -10px rgba(0,0,0,0.18);
  }
  .hb-doc-section {
    scroll-margin-top: calc(var(--header-h, 72px) + 80px);
  }
  .hb-toc { border: none; padding: 0; }
  .hb-toc-title { display: none; }
  .hb-toc ol {
    display: flex;
    flex-wrap: nowrap;
    gap: .35rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: .4rem .55rem;
    margin: 0;
    scroll-padding-inline: .55rem;
  }
  .hb-toc ol::-webkit-scrollbar { display: none; }
  .hb-toc li { flex: 0 0 auto; scroll-snap-align: center; }
  .hb-toc a {
    margin-left: 0;
    border-left: none;
    padding: .35rem .8rem;
    border-radius: 999px;
    background: transparent;
    font-size: .82rem;
    white-space: nowrap;
    color: var(--text-soft);
    transition: background .15s, color .15s;
  }
  .hb-toc a:hover { color: var(--text); background: var(--bg-alt); }
  .hb-toc a.active {
    border-left: none;
    background: var(--accent);
    color: var(--bg);
    font-weight: 600;
  }
  .hb-defs-2col { grid-template-columns: max-content 1fr; }
  .hb-call { font-size: 1.5rem; }
}

/* noscript fallback */
.noscript-warning {
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin: 2rem auto;
  max-width: 720px;
}
.noscript-warning h2 { margin-top: 0; color: var(--accent); }
.noscript-warning code { background: rgba(0,0,0,.08); padding: 2px 6px; border-radius: 4px; }

/* ================== SKELETON LOADERS ================== */
@keyframes sk-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--border) 35%, transparent) 0%,
    color-mix(in srgb, var(--border) 60%, transparent) 50%,
    color-mix(in srgb, var(--border) 35%, transparent) 100%
  );
  background-size: 200% 100%;
  animation: sk-shimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* News card skeleton (used in .news-grid) */
.sk-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sk-card .skeleton.sk-img { aspect-ratio: 16 / 9; border-radius: 0; }
.sk-card-body { padding: 1.25rem 1.25rem 1.5rem; display: flex; flex-direction: column; gap: .65rem; }
.sk-card-body .skeleton.sk-tag   { width: 90px;  height: 18px; border-radius: 999px; }
.sk-card-body .skeleton.sk-title { width: 85%;   height: 22px; margin-top: .25rem; }
.sk-card-body .skeleton.sk-line  { width: 100%;  height: 12px; }
.sk-card-body .skeleton.sk-line.short { width: 60%; }
.sk-card-body .skeleton.sk-meta  { width: 55%;   height: 12px; margin-top: .5rem; }

/* Album skeleton */
.sk-album {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.sk-album .skeleton.sk-album-title { width: 220px; height: 28px; }
.sk-album .skeleton.sk-album-meta  { width: 320px; height: 14px; }
.sk-album .skeleton.sk-cover       { aspect-ratio: 16 / 9; width: 100%; border-radius: var(--radius); }
.sk-album-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
}
.sk-album-thumbs .skeleton { aspect-ratio: 1 / 1; border-radius: 6px; }
@media (max-width: 555px) {
  .sk-album-thumbs { grid-template-columns: repeat(3, 1fr); }
}

/* News detail skeleton */
.sk-detail { display: flex; flex-direction: column; gap: 1rem; max-width: 880px; margin: 0 auto; }
.sk-detail .skeleton.sk-hero  { aspect-ratio: 16 / 9; width: 100%; border-radius: var(--radius); }
.sk-detail .skeleton.sk-tag   { width: 110px; height: 22px; border-radius: 999px; }
.sk-detail .skeleton.sk-title { width: 80%;   height: 36px; }
.sk-detail .skeleton.sk-meta  { width: 240px; height: 14px; }
.sk-detail .skeleton.sk-line  { width: 100%;  height: 14px; }
.sk-detail .skeleton.sk-line.short { width: 70%; }


/* ====================================================================
   HISTORY PAGE — Stara papiernia
   ==================================================================== */

.history-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ===== Book / chapters ===== */
.book-stage {
  position: relative;
  container-type: inline-size;
  container-name: bookstage;
}

/* When stage gets narrow (tabs would wrap), hide titles and show only Roman numerals */
@container bookstage (max-width: 640px) {
  .book-tab-title { display: none; }
}

/* Tabs wrapper provides edge fades when scrollable */
.book-tabs-wrap {
  position: relative;
}
.book-tabs-wrap.is-overflow::before,
.book-tabs-wrap.is-overflow::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 28px;
  pointer-events: none;
  z-index: 5;
}
.book-tabs-wrap.is-overflow.has-left::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg) 0%, transparent 100%);
}
.book-tabs-wrap.is-overflow.has-right::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg) 0%, transparent 100%);
}
.book-tabs-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--muted);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.10), 0 0 0 4px var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}
.book-tabs-arrow.is-visible {
  opacity: 1;
  visibility: visible;
}
.book-tabs-arrow:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.06);
}
.book-tabs-arrow:active { transform: translateY(-50%) scale(0.94); }
.book-tabs-arrow svg { display: block; }
.book-tabs-arrow--left { left: -10px; }
.book-tabs-arrow--right { right: -10px; }

/* Tabs — file-folder style, attached to the chapter via a baseline border */
.book-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  background: transparent;
  border-bottom: 0;
  position: relative;
  z-index: 4;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Hide scrollbar visually but keep scroll functionality */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.book-tabs::-webkit-scrollbar { display: none; width: 0; height: 0; }
.book-tab {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.4rem;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--bg-alt);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.01em;
  text-align: left;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.book-tab:hover:not(.is-active) {
  background: var(--bg-elev);
  color: var(--text);
}
.book-tab.is-active {
  /* default — overridden per data-chapter below to match hero diagonal gradient at each position */
  background: linear-gradient(180deg, var(--bg-elev) 0%, color-mix(in srgb, var(--accent) 10%, var(--bg)) 100%);
  color: var(--accent);
  border-color: var(--border);
  z-index: 2;
}
/* hero gradient is 135deg with 10% accent at top-left, fading toward top-right -> tabs follow that on their bottom edge */
.book-tab.is-active[data-chapter="papiernia"] {
  background: linear-gradient(180deg, var(--bg-elev) 0%, color-mix(in srgb, var(--accent) 14%, var(--bg)) 100%);
}
.book-tab.is-active[data-chapter="witkowice"] {
  background: linear-gradient(180deg, var(--bg-elev) 0%, color-mix(in srgb, var(--accent) 7%, var(--bg)) 100%);
}
.book-tab-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  min-width: 1.2em;
  text-align: center;
  opacity: 0.85;
}
.book-tab.is-active .book-tab-num { opacity: 1; }
.book-tab-title { font-weight: 600; font-size: 1.05rem; }

/* Compact mode: distant (non-adjacent) tabs show only their Roman numeral.
   Set dynamically by JS. */
.book-tab--compact .book-tab-title { display: none; }
.book-tab--compact { padding-left: 1rem; padding-right: 1rem; }

/* Book page — no paper-card wrapper, tabs hang above the chapter heading */
.book-pager {
  position: relative;
  min-height: 400px;
}
/* overflow:hidden only during page flip — otherwise it breaks position:sticky in the TOC */
.book-stage.is-flipping .book-pager { overflow: hidden; }

/* Pre-paint initial chapter selection to avoid FOUC of chapter 1 when hash points to chapter 2 */
[data-book-init="witkowice"] .book-page[data-chapter="papiernia"] { display: none !important; }
[data-book-init="witkowice"] .book-page[data-chapter="witkowice"] { display: block !important; }
[data-book-init="witkowice"] .book-tab[data-chapter="papiernia"] { background: var(--bg-alt); color: var(--muted); }
[data-book-init="witkowice"] .book-tab[data-chapter="witkowice"] { background: linear-gradient(180deg, var(--bg-elev) 0%, color-mix(in srgb, var(--accent) 7%, var(--bg)) 100%); color: var(--accent); }
.book-page {
  will-change: transform, opacity;
}
.book-page[hidden] { display: none; }
.book-page.is-active { display: block; opacity: 1; }

.book-stage.is-flipping { position: relative; }
.book-stage.is-flipping .book-page { display: block !important; }
.book-stage.is-flipping .book-page:not(.is-active):not(.book-page--enter-next):not(.book-page--enter-prev):not(.book-page--exit-next):not(.book-page--exit-prev) { display: none !important; }

/* Page-turn: pure crossfade — no motion, no scale.
   Most accessible variant: shows page change without any sliding. */
@keyframes bookExitNext { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bookEnterNext { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes bookExitPrev { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bookEnterPrev { 0% { opacity: 0; } 100% { opacity: 1; } }
.book-page--exit-next,
.book-page--exit-prev {
  position: absolute;
  inset: 0;
  z-index: 2;
  animation-duration: 0.2s;
  animation-timing-function: cubic-bezier(.4,0,.2,1);
  animation-fill-mode: forwards;
}
.book-page--exit-next  { animation-name: bookExitNext; }
.book-page--exit-prev  { animation-name: bookExitPrev; }
.book-page--enter-next,
.book-page--enter-prev {
  position: relative;
  z-index: 1;
  animation-duration: 0.25s;
  animation-delay: 0.05s;
  animation-timing-function: cubic-bezier(.2,.6,.3,1);
  animation-fill-mode: both;
}
.book-page--enter-next { animation-name: bookEnterNext; }
.book-page--enter-prev { animation-name: bookEnterPrev; }

/* Pager nav */
.book-pager-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0.9rem 1.25rem;
  border-radius: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  position: relative;
}
.book-pager-nav::before,
.book-pager-nav::after { display: none; }
.book-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.book-nav-btn:hover:not(:disabled) {
  background: var(--accent-faint);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.book-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.book-pager-indicator {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-style: italic;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.book-pager-current { font-weight: 700; font-style: normal; color: var(--accent); }

/* Witkowice hero variant — paper/forest motif */
.history-hero--witkowice .history-hero-media {
  background: linear-gradient(135deg, rgba(76,175,110,0.08), rgba(76,175,110,0.02));
}
.history-hero-media--static .history-hero-media-fallback {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  height: 100%;
  color: var(--accent, #4caf6e);
}

[data-theme="light"] .history-hero--witkowice .history-hero-media {
  background: linear-gradient(135deg, rgba(76,175,110,0.18), rgba(76,175,110,0.04));
}

/* Reduced motion: no flip, just fade */
@media (prefers-reduced-motion: reduce) {
  .book-page { transition: opacity 0.2s ease; transform: none !important; }
  .book-page--exit-next, .book-page--exit-prev,
  .book-page--enter-next, .book-page--enter-prev { transform: none !important; }
}

/* Mobile tabs */
@media (max-width: 600px) {
  .book-tabs { gap: 0.2rem; }
  .book-tab {
    padding: 0.5rem 0.86rem;
    border-radius: 10px 10px 0 0;
  }
  .book-tab-title { display: none; }
  .book-tab-num {
    font-size: 1.2rem;
    min-width: auto;
  }
  .book-tabs-wrap.is-overflow::before,
  .book-tabs-wrap.is-overflow::after { width: 20px; }
  .book-tabs-arrow {
    width: 30px;
    height: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 0 0 3px var(--bg);
  }
  .book-tabs-arrow svg {
    width: 16px;
    height: 16px;
  }
  .book-tabs-arrow--left { left: -7px; }
  .book-tabs-arrow--right { right: -7px; }
  .book-pager-nav { flex-direction: column; gap: 0.75rem; }
  .book-nav-btn { width: 100%; justify-content: center; }
  /* Hide ornament ❦ on mobile — it overlaps with stacked indicator text */
  .book-pager-nav::before, .book-pager-nav::after { display: none; }
}

/* Hero */
.history-hero {
  position: relative;
  margin: 0 0 3rem;
  padding: 2rem 2rem 3rem;
  background: linear-gradient(135deg, rgba(76,175,110,0.10), rgba(76,175,110,0.02) 60%);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}
[data-theme="dark"] .history-hero {
  background: linear-gradient(135deg, rgba(76,175,110,0.18), rgba(20,30,25,0.6) 60%);
}
.history-hero-inner { position: relative; z-index: 2; max-width: 760px; }
.history-hero-decor {
  position: absolute; inset: 0; z-index: 1;
  color: var(--accent);
  opacity: 0.25;
  pointer-events: none;
}
.history-hero-decor svg { position: absolute; right: -40px; top: -40px; width: 380px; height: 380px; }

/* Hero media (intro video) */
.history-hero-media {
  position: relative;
  z-index: 2;
  aspect-ratio: 16 / 11;
  border-radius: calc(var(--radius) - 6px);
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  box-shadow: 0 12px 32px -16px rgba(0,0,0,0.35);
  isolation: isolate;
}
.history-hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.history-hero-media-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}
.history-hero-controls {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  display: flex;
  gap: 0.4rem;
  z-index: 3;
}
.history-hero-controls .video-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.55);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 120ms ease, transform 120ms ease;
}
.history-hero-controls .video-btn:hover { background: rgba(0,0,0,0.75); transform: scale(1.05); }
.history-hero-controls .video-btn .icon-sound-off,
.history-hero-controls .video-btn .icon-play { display: none; }
.history-hero-controls .video-btn.muted .icon-sound-on { display: none; }
.history-hero-controls .video-btn.muted .icon-sound-off { display: inline-block; }
.history-hero-controls .video-btn.paused .icon-pause { display: none; }
.history-hero-controls .video-btn.paused .icon-play { display: inline-block; }

@media (max-width: 820px) {
  .history-hero {
    grid-template-columns: 1fr;
    padding: 2rem 1.25rem 2rem;
  }
  .history-hero-media {
    aspect-ratio: 16 / 9;
    order: -1;
    margin-bottom: 0.5rem;
  }
}

.history-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.history-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.history-lead {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  max-width: 640px;
  text-wrap: pretty;
}
.history-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.history-pill {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Layout: sidebar + doc */
.history-layout {
  display: grid;
  grid-template-columns: minmax(min(220px, 100%), 240px) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

/* Sidebar TOC */
.history-sidebar { position: sticky; top: 96px; }
.history-toc { padding: 1rem 0; }
.history-toc-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
}
.history-toc ol {
  list-style: none;
  margin: 0; padding: 0;
  border-left: 1px solid var(--border);
}
.history-toc li { margin: 0; }
.history-toc a {
  display: block;
  padding: 0.45rem 0 0.45rem 1rem;
  margin-left: -1px;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.history-toc a:hover { color: var(--text); }
.history-toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

@media (max-width: 900px) {
  .history-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .history-sidebar {
    position: sticky;
    top: calc(var(--header-h, 72px) + 8px);
    z-index: 20;
    background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 6px 20px -10px rgba(0,0,0,0.18);
    padding: 0;
  }
  .history-toc { padding: 0; }
  .history-toc-title { display: none; }
  .history-toc ol {
    display: flex;
    flex-wrap: nowrap;
    gap: .35rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: .25rem .4rem;
    margin: 0;
    scroll-padding-inline: .4rem;
    border-left: none;
  }
  .history-toc ol::-webkit-scrollbar { display: none; }
  .history-toc li { flex: 0 0 auto; scroll-snap-align: center; }
  .history-toc a {
    display: block;
    margin-left: 0;
    padding: .3rem .7rem;
    border-left: none;
    border-radius: 999px;
    background: transparent;
    font-size: .78rem;
    line-height: 1.2;
    white-space: nowrap;
    color: var(--text-soft);
  }
  .history-toc a:hover { color: var(--text); background: var(--bg-alt); }
  .history-toc a.active {
    background: var(--accent);
    color: var(--bg);
    font-weight: 600;
    border-left-color: transparent;
  }
  .history-section { scroll-margin-top: calc(var(--header-h, 72px) + 80px); }
}

/* Doc / sections */
.history-doc { max-width: 720px; }
.history-section { margin: 0 0 3.5rem; scroll-margin-top: calc(var(--header-h, 72px) + 16px); }
.history-section h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
  letter-spacing: -0.005em;
}
.history-section p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 1rem;
  text-wrap: pretty;
}
.history-section strong { color: var(--text); font-weight: 600; }
.history-section em { font-style: italic; color: var(--text-muted); }

/* Drop cap */
.history-drop { position: relative; }
.history-dropcap {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 4.2rem;
  font-weight: 600;
  float: left;
  line-height: 0.9;
  margin: 0.2rem 0.6rem 0 0;
  color: var(--accent);
}

/* Quote */
.history-quote {
  position: relative;
  margin: 2rem 0;
  padding: 1.5rem 1.75rem 1.5rem 2rem;
  background: var(--bg-elev);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--text);
}
.history-quote cite {
  display: block;
  margin-top: 0.85rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-style: normal;
  color: var(--text-muted);
}

/* Callout */
.history-callout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.history-callout-mark {
  flex-shrink: 0;
  font-size: 1.8rem;
  line-height: 1;
  margin-top: 0.1rem;
}
.history-callout p { margin: 0; font-size: 1rem; }

.history-aside {
  padding: 0.85rem 1rem;
  background: rgba(76,175,110,0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem !important;
  color: var(--text-muted) !important;
  font-style: italic;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0; padding: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border) 90%);
  border-radius: 1px;
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(100px, 130px) 1fr;
  gap: 1.5rem;
  padding: 0 0 1.75rem 28px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
  z-index: 1;
}
.timeline-highlight::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px rgba(76,175,110,0.25);
}
.timeline-year {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.2;
  padding-top: 2px;
}
.timeline-highlight .timeline-year { font-size: 1.6rem; }
.timeline-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--text);
}
.timeline-body p {
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
  margin: 0 !important;
  color: var(--text-muted) !important;
}
.timeline-highlight .timeline-body h3 { color: var(--accent); }

@media (max-width: 600px) {
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding-left: 28px;
  }
  .timeline-year { font-size: 1.2rem; }
}

/* Sources */
.history-sources ul {
  list-style: none;
  margin: 0; padding: 0;
}
.history-sources li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.history-sources li:last-child { border-bottom: 0; }
.history-sources a { color: var(--accent); text-decoration: none; font-weight: 500; }
.history-sources a:hover { text-decoration: underline; }
.history-source-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.history-license {
  margin-top: 1.5rem !important;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
}
.history-license a { color: var(--accent); }

/* ===== Teaser kącika historycznego (home) ===== */
.history-teaser-section {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(4rem, 9vw, 7.5rem) clamp(16px, 4vw, 32px);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(184, 134, 78, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 10% 100%, rgba(138, 90, 31, 0.08) 0%, transparent 55%);
}
[data-theme="dark"] .history-teaser-section {
  background:
    radial-gradient(ellipse at 80% 0%, rgba(184, 134, 78, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 10% 100%, rgba(212, 165, 116, 0.08) 0%, transparent 55%);
}
.history-teaser-section > .history-teaser {
  max-width: 1180px;
  margin: 0 auto;
}
.history-teaser {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  padding: clamp(28px, 5vw, 56px);
  border-radius: 24px;
  background:
    radial-gradient(ellipse at top right, rgba(184, 134, 78, 0.18), transparent 60%),
    linear-gradient(135deg, #f8f1e4 0%, #ede1c9 100%);
  color: #3a2d1a;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 12px 36px -16px rgba(74, 51, 22, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(184, 134, 78, 0.25);
}
.history-teaser:hover,
.history-teaser:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 48px -16px rgba(74, 51, 22, 0.45);
  outline: none;
}
.history-teaser-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: #b8864e;
  opacity: 0.35;
}
.history-teaser-deco svg {
  width: 100%;
  height: 100%;
  display: block;
}
.history-teaser-body {
  position: relative;
  z-index: 1;
  max-width: 640px;
}
.history-teaser-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a5a1f;
  margin-bottom: 14px;
}
.history-teaser-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 600;
  line-height: 1.05;
  margin: 0 0 16px;
  color: #3a2d1a;
  letter-spacing: -0.01em;
}
.history-teaser-lead {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.65;
  margin: 0 0 22px;
  color: #5a4527;
}
.history-teaser-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  border-radius: 999px;
  background: #3a2d1a;
  color: #f8f1e4;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s ease, gap 0.2s ease;
}
.history-teaser:hover .history-teaser-cta {
  background: #1f1810;
  gap: 14px;
}
.history-teaser-year {
  position: relative;
  z-index: 1;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(4.5rem, 12vw, 9rem);
  font-weight: 500;
  line-height: 1;
  color: rgba(138, 90, 31, 0.35);
  letter-spacing: -0.03em;
  user-select: none;
}
@media (max-width: 720px) {
  .history-teaser {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .history-teaser-year {
    justify-self: end;
    margin-top: -10px;
  }
}
[data-theme="dark"] .history-teaser {
  background:
    radial-gradient(ellipse at top right, rgba(184, 134, 78, 0.22), transparent 60%),
    linear-gradient(135deg, #2a2118 0%, #1d1610 100%);
  color: #ede1c9;
  border-color: rgba(184, 134, 78, 0.3);
}
[data-theme="dark"] .history-teaser-title { color: #f0e2c4; }
[data-theme="dark"] .history-teaser-lead { color: #c9b896; }
[data-theme="dark"] .history-teaser-eyebrow { color: #d4a574; }
[data-theme="dark"] .history-teaser-cta {
  background: #f0e2c4;
  color: #2a2118;
}
[data-theme="dark"] .history-teaser:hover .history-teaser-cta { background: #fff; }
[data-theme="dark"] .history-teaser-year { color: rgba(212, 165, 116, 0.3); }

/* ===== Scroll reveal animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-revealed {
  opacity: 1;
  transform: none;
}
.reveal > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: 0s;
}
.reveal.is-revealed > * {
  opacity: 1;
  transform: none;
  transition-delay: 0.12s;
}
.reveal.is-revealed > *:nth-child(2) { transition-delay: 0.22s; }
.reveal.is-revealed > *:nth-child(3) { transition-delay: 0.32s; }
.reveal.is-revealed > *:nth-child(4) { transition-delay: 0.42s; }
.news-grid.is-revealed > *,
.reveal.is-revealed .news-grid > * {
  transition-delay: 0.2s;
}

/* Stronger portfolio-style reveal for showcase sections on home */
.cta-section.reveal > .cta-card,
.history-teaser-section.reveal > .history-teaser {
  opacity: 0;
  transform: translateY(56px) scale(0.97);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.cta-section.reveal.is-revealed > .cta-card,
.history-teaser-section.reveal.is-revealed > .history-teaser {
  opacity: 1;
  transform: none;
  transition-delay: 0.05s;
}
/* Suppress generic ".reveal > *" inside these sections so only the card animates */
.cta-section.reveal > .cta-card > *,
.history-teaser-section.reveal > .history-teaser > * {
  opacity: 1;
  transform: none;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal > *,
  .cta-section.reveal > .cta-card,
  .history-teaser-section.reveal > .history-teaser {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ===== CTA "Strefa mieszkanca" v2 — bardziej portfolio ===== */
.cta-card-v2 {
  position: relative;
  overflow: hidden;
}
.cta-card-v2 .cta-badge {
  position: absolute;
  top: clamp(20px, 3vw, 32px);
  right: clamp(20px, 3vw, 32px);
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  z-index: 2;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.cta-card-v2:hover .cta-badge {
  transform: rotate(-6deg) scale(1.05);
}
.cta-card-v2::after {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 70%;
  height: 180%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.cta-card-v2 .cta-content,
.cta-card-v2 .cta-stats {
  position: relative;
  z-index: 1;
}
.cta-card-v2 .cta-eyebrow {
  position: relative;
  padding-left: 28px;
}
.cta-card-v2 .cta-eyebrow::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 20px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.cta-card-v2 .cta-stat {
  position: relative;
  transition: transform 0.3s ease;
}
.cta-card-v2:hover .cta-stat { transform: translateY(-2px); }
.cta-card-v2 .cta-stat-num {
  background: linear-gradient(135deg, currentColor 0%, currentColor 70%, transparent 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ===== History teaser ribbon ===== */
.history-teaser-ribbon {
  position: absolute;
  top: 18px;
  left: -40px;
  transform: rotate(-45deg);
  background: #8a5a1f;
  color: #f8f1e4;
  padding: 6px 50px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(74, 51, 22, 0.3);
  z-index: 3;
  pointer-events: none;
}
[data-theme="dark"] .history-teaser-ribbon {
  background: #d4a574;
  color: #1d1610;
}
.history-teaser {
  position: relative;
}
.history-teaser-year {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s ease;
}
.history-teaser:hover .history-teaser-year {
  transform: translateX(-8px) scale(1.05);
  color: rgba(138, 90, 31, 0.55);
}
[data-theme="dark"] .history-teaser:hover .history-teaser-year {
  color: rgba(212, 165, 116, 0.5);
}


/* ==========================================================================
   Showcase sections on home (Strefa mieszkanca + Stara papiernia)
   Full-bleed, magazine/portfolio look
   ========================================================================== */

.showcase {
  position: relative;
  width: 100%;
  isolation: isolate;
  overflow: hidden;
}

/* ===== Showcase CTA (Strefa mieszkanca) ===== */
.showcase--cta {
  background: var(--bg);
  padding: clamp(3rem, 8vw, 6rem) 0;
}
.showcase-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: 0 clamp(1rem, 4vw, 3rem);
  align-items: center;
}
.showcase-visual {
  position: relative;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: 0 24px 60px -24px rgba(0,0,0,0.35), 0 8px 20px -10px rgba(0,0,0,0.2);
  transform: translateZ(0);
}
.showcase-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.showcase--cta:hover .showcase-visual img { transform: scale(1.04); }
.showcase-visual-tag {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 8px 14px;
  background: rgba(20, 22, 25, 0.78);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.showcase-body { min-width: 0; }
.showcase-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}
.showcase-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}
.showcase-title {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
  color: var(--text);
}
.showcase-lead {
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.65;
  color: var(--text-soft);
  margin: 0 0 1.8rem;
  max-width: 52ch;
}
.showcase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}
.showcase-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.showcase-link--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 55%, transparent);
}
[data-theme="dark"] .showcase-link--primary { color: #0f1611; }
.showcase-link--primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--accent) 65%, transparent);
}
[data-theme="dark"] .showcase-link--primary:hover { color: #0f1611; }
.showcase-link--primary svg { transition: transform 0.3s; }
.showcase-link--primary:hover svg { transform: translateX(4px); }
.showcase-link--ghost {
  color: var(--text);
  border: 1px solid var(--border);
}
.showcase-link--ghost:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: var(--accent-faint);
}
[data-theme="dark"] .showcase-link--ghost:hover { color: var(--accent); }

@media (max-width: 860px) {
  .showcase-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .showcase-visual { aspect-ratio: 16 / 11; }
}

/* ===== Showcase History (Stara papiernia) ===== */
.showcase--history {
  background: var(--bg);
  color: var(--text);
  padding: clamp(4rem, 10vw, 8rem) 0;
}
[data-theme="dark"] .showcase--history {
  background: var(--bg);
  color: var(--text);
}
.showcase-history-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.showcase-history-watermark {
  position: absolute;
  right: clamp(-40px, -3vw, -10px);
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: clamp(14rem, 28vw, 32rem);
  line-height: 0.85;
  color: rgba(138, 90, 31, 0.10);
  letter-spacing: -0.04em;
  user-select: none;
  white-space: nowrap;
}
[data-theme="dark"] .showcase-history-watermark { color: rgba(212, 165, 116, 0.10); }
.showcase-history-inner {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.showcase-history-text { max-width: 640px; min-width: 0; }
.showcase-history-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8a5a1f;
  margin: 0 0 1.3rem;
}
.showcase-history-eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
[data-theme="dark"] .showcase-history-eyebrow { color: #d4a574; }
.showcase-history-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
  color: #3a2d1a;
}
[data-theme="dark"] .showcase-history-title { color: #f0e2c4; }
.showcase-history-lead {
  font-size: clamp(1.05rem, 1.4vw, 1.18rem);
  line-height: 1.7;
  color: #5a4527;
  margin: 0 0 2rem;
  max-width: 56ch;
}
[data-theme="dark"] .showcase-history-lead { color: #c9b896; }
.showcase-history-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.8rem;
  background: #3a2d1a;
  color: #f8f1e4;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.25s, transform 0.25s, gap 0.25s, box-shadow 0.25s;
  box-shadow: 0 10px 24px -10px rgba(58, 45, 26, 0.45);
}
.showcase-history-link svg { transition: transform 0.3s; }
.showcase-history-link:hover {
  background: #1f1810;
  gap: 1rem;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(58, 45, 26, 0.55);
}
.showcase-history-link:hover svg { transform: translateX(4px); }
[data-theme="dark"] .showcase-history-link {
  background: #f0e2c4;
  color: #2a2118;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,0.5);
}
[data-theme="dark"] .showcase-history-link:hover { background: #fff; }

.showcase-history-mark {
  position: relative;
  z-index: 1;
  margin: 0;
  width: clamp(160px, 22vw, 280px);
  flex-shrink: 0;
}
.showcase-history-mark img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow:
    0 24px 60px -24px rgba(58, 45, 26, 0.55),
    0 8px 18px -10px rgba(58, 45, 26, 0.35),
    inset 0 0 0 1px rgba(138, 90, 31, 0.25);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  filter: sepia(0.15) contrast(1.05);
}
.showcase--history:hover .showcase-history-mark img {
  transform: rotate(1.2deg) translateY(-3px);
}
.showcase-history-mark-cap {
  margin-top: 0.7rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.35;
  font-style: normal;
}
.showcase-history-mark-cap em {
  font-style: italic;
  color: var(--text);
  font-weight: 600;
}
.showcase-history-mark-cap span {
  display: block;
  font-size: 0.62rem;
  opacity: 0.7;
  margin-top: 2px;
}
[data-theme="dark"] .showcase-history-mark img {
  box-shadow:
    0 24px 60px -24px rgba(0, 0, 0, 0.7),
    0 8px 18px -10px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(212, 165, 116, 0.25);
  filter: sepia(0.20) contrast(0.95) brightness(0.95);
}


@media (max-width: 860px) {
  .showcase-history-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .showcase-history-mark {
    width: clamp(160px, 42vw, 240px);
    margin: 0 auto;
    order: -1;
  }
  .showcase-history-text { order: 1; }
  .showcase-history-watermark { font-size: 22rem; right: -60px; }
}

/* Reveal overrides specific to showcase sections */
.showcase.reveal > * {
  opacity: 0;
  transform: translateY(48px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.showcase.reveal.is-revealed > * {
  opacity: 1;
  transform: none;
}
.showcase--cta.reveal .showcase-visual {
  opacity: 0;
  transform: translateX(-40px) scale(0.97);
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: 0.05s;
}
.showcase--cta.reveal .showcase-body > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.showcase--cta.reveal.is-revealed .showcase-visual { opacity: 1; transform: none; }
.showcase--cta.reveal.is-revealed .showcase-body > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.25s; }
.showcase--cta.reveal.is-revealed .showcase-body > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.35s; }
.showcase--cta.reveal.is-revealed .showcase-body > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.45s; }
.showcase--cta.reveal.is-revealed .showcase-body > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.55s; }

.showcase--history.reveal .showcase-history-watermark {
  opacity: 0;
  transform: translateY(-50%) translateX(60px) scale(0.95);
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.showcase--history.reveal .showcase-history-text > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.showcase--history.reveal .showcase-history-mark {
  opacity: 0;
  transform: scale(0.85) rotate(-5deg);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.showcase--history.reveal.is-revealed .showcase-history-watermark { opacity: 1; transform: translateY(-50%); }
.showcase--history.reveal.is-revealed .showcase-history-text > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.15s; }
.showcase--history.reveal.is-revealed .showcase-history-text > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.28s; }
.showcase--history.reveal.is-revealed .showcase-history-text > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.40s; }
.showcase--history.reveal.is-revealed .showcase-history-text > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.52s; }
.showcase--history.reveal.is-revealed .showcase-history-mark { opacity: 1; transform: none; transition-delay: 0.35s; }

@media (prefers-reduced-motion: reduce) {
  .showcase.reveal > *,
  .showcase--cta.reveal .showcase-visual,
  .showcase--cta.reveal .showcase-body > *,
  .showcase--history.reveal .showcase-history-watermark,
  .showcase--history.reveal .showcase-history-text > *,
  .showcase--history.reveal .showcase-history-mark {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ===== Showcase history mini timeline ===== */
.showcase-history-axis {
  list-style: none;
  margin: 0 0 2rem;
  padding: 1.4rem 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  position: relative;
  max-width: 540px;
}
.showcase-history-axis::before {
  content: "";
  position: absolute;
  top: calc(1.4rem + 5px);
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, rgba(138, 90, 31, 0.0) 0%, rgba(138, 90, 31, 0.55) 15%, rgba(138, 90, 31, 0.55) 85%, rgba(138, 90, 31, 0.0) 100%);
  z-index: 0;
}
[data-theme="dark"] .showcase-history-axis::before {
  background: linear-gradient(90deg, rgba(212, 165, 116, 0.0) 0%, rgba(212, 165, 116, 0.5) 15%, rgba(212, 165, 116, 0.5) 85%, rgba(212, 165, 116, 0.0) 100%);
}
.axis-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 1rem;
  gap: 0.3rem;
}
.axis-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f8f1e4;
  border: 2px solid #8a5a1f;
  box-shadow: 0 0 0 4px rgba(138, 90, 31, 0.12);
  z-index: 1;
  transition: transform 0.3s, box-shadow 0.3s;
}
[data-theme="dark"] .axis-step::before {
  background: #2a2118;
  border-color: #d4a574;
  box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.12);
}
.axis-step--mark::before {
  width: 16px;
  height: 16px;
  top: -2px;
  background: #8a5a1f;
  box-shadow: 0 0 0 5px rgba(138, 90, 31, 0.20);
}
[data-theme="dark"] .axis-step--mark::before {
  background: #d4a574;
  box-shadow: 0 0 0 5px rgba(212, 165, 116, 0.20);
}
.axis-year {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #3a2d1a;
  line-height: 1;
}
[data-theme="dark"] .axis-year { color: #f0e2c4; }
.axis-step--mark .axis-year {
  color: #6b3f0a;
  font-size: 1.4rem;
}
[data-theme="dark"] .axis-step--mark .axis-year { color: #f4d49a; }
.axis-year--now {
  font-style: italic;
  font-size: 1.1rem;
}
.axis-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b5536;
  line-height: 1.2;
}
[data-theme="dark"] .axis-label { color: #c9b896; }

@media (max-width: 560px) {
  .showcase-history-axis {
    grid-template-columns: 1fr;
    row-gap: 0.9rem;
    max-width: 320px;
    padding-top: 0.4rem;
    position: relative;
  }
  .showcase-history-axis::before {
    display: block;
    top: 1rem;
    bottom: 0.4rem;
    left: 6px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, rgba(138, 90, 31, 0.0) 0%, rgba(138, 90, 31, 0.55) 10%, rgba(138, 90, 31, 0.55) 90%, rgba(138, 90, 31, 0.0) 100%);
  }
  [data-theme="dark"] .showcase-history-axis::before {
    background: linear-gradient(180deg, rgba(212, 165, 116, 0.0) 0%, rgba(212, 165, 116, 0.5) 10%, rgba(212, 165, 116, 0.5) 90%, rgba(212, 165, 116, 0.0) 100%);
  }
  .axis-step { padding-top: 0; align-items: flex-start; text-align: left; padding-left: 26px; flex-direction: row; gap: 0.6rem; flex-wrap: wrap; }
  .axis-step::before { left: 0; top: 6px; transform: none; }
  .axis-step--mark::before { top: 4px; left: -2px; }
  .axis-year { font-size: 1.1rem; }
  .axis-step--mark .axis-year { font-size: 1.2rem; }
  .axis-label { font-size: 0.78rem; }
}

/* Reveal: axis dots pop in sequentially after lead */
.showcase--history.reveal .showcase-history-axis {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.showcase--history.reveal.is-revealed .showcase-history-axis {
  opacity: 1;
  transform: none;
  transition-delay: 0.55s;
}
.showcase--history.reveal .axis-step {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.showcase--history.reveal.is-revealed .axis-step:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.70s; }
.showcase--history.reveal.is-revealed .axis-step:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.85s; }
.showcase--history.reveal.is-revealed .axis-step:nth-child(3) { opacity: 1; transform: none; transition-delay: 1.00s; }
.showcase--history.reveal.is-revealed .axis-step:nth-child(4) { opacity: 1; transform: none; transition-delay: 1.15s; }
.showcase--history.reveal.is-revealed .axis-step--mark::before {
  animation: axisMarkPulse 0.6s 1.20s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes axisMarkPulse {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.5); }
  100% { transform: translateX(-50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .showcase--history.reveal .showcase-history-axis,
  .showcase--history.reveal .axis-step {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Adjust text reveal stagger now that axis sits between lead and link */
.showcase--history.reveal.is-revealed .showcase-history-text > *:nth-child(5) {
  opacity: 1;
  transform: none;
  transition-delay: 1.25s;
}

html[lang="en"]:not(.i18n-ready) body {
  opacity: 0;
}

html[lang="en"].i18n-ready body {
  transition: opacity 0.15s ease-in;
}

/* ==========================================================================
   Comic intro
   ========================================================================== */

.showcase--comic {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-faint) 58%, var(--bg)) 0%, var(--bg) 100%);
  max-height: 1400px;
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}
.comic-guide-seen .showcase--comic,
.showcase--comic[hidden] {
  display: none;
}
.showcase--comic.is-hiding {
  animation: comicCtaHide 0.42s ease forwards;
  pointer-events: none;
}
@keyframes comicCtaHide {
  to {
    opacity: 0;
    transform: translateY(-18px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
  }
}
.showcase-visual--comic {
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.showcase-visual--comic::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
  pointer-events: none;
}
.comic-dismiss {
  color: var(--text);
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
}
[data-theme="dark"] .comic-dismiss {
  color: var(--text);
  background: color-mix(in srgb, var(--bg-elev) 82%, #000);
  border-color: var(--border-strong);
}
.comic-slide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
  min-width: min(360px, 100%);
}
.comic-slide-links.is-empty {
  display: none;
  min-width: 0;
}
.comic-slide-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.comic-slide-link svg {
  flex: 0 0 auto;
}
.comic-slide-link:hover {
  transform: translateY(-1px);
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-faint);
  box-shadow: var(--shadow-md), 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.comic-slide-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 68%, #fff);
  outline-offset: 4px;
}
.showcase-link:focus-visible,
.comic-btn:focus-visible,
.comic-dot:focus-visible,
.comic-fullscreen:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 68%, #fff);
  outline-offset: 4px;
}

.comic-page {
  min-height: calc(100vh - var(--header-h));
  background:
    radial-gradient(circle at 14% 12%, color-mix(in srgb, var(--accent-soft) 36%, transparent) 0 220px, transparent 360px),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem) clamp(3rem, 7vw, 5rem);
}
.comic-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.comic-viewer {
  max-width: min(1640px, calc(100vw - 2rem));
  margin: 0 auto;
}
.comic-mobile-intro {
  display: none;
}
.comic-desktop-intro {
  display: none;
}
.comic-sidebar-count,
.comic-sidebar-progress,
.comic-step-list,
.comic-tip {
  display: none;
}
.comic-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 1.15rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.comic-kicker::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.comic-kicker-icon {
  display: none;
  color: currentColor;
  line-height: 0;
}
.comic-kicker-icon svg,
.comic-mobile-step-icon svg {
  display: block;
  overflow: visible;
}
.comic-mobile-step-icon svg {
  transform: translateY(1px);
}
.comic-kicker-icon svg {
  color: var(--accent);
}
.comic-card {
  position: relative;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.comic-image-wrap {
  position: relative;
  border-radius: calc(var(--radius-lg) - 8px);
  overflow: hidden;
  background: var(--accent-faint);
}
.comic-image-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--accent-faint) 72%, var(--bg-elev)) 0%,
      color-mix(in srgb, var(--bg-elev) 86%, var(--accent-faint)) 45%,
      color-mix(in srgb, var(--accent-faint) 72%, var(--bg-elev)) 100%);
  background-size: 220% 100%;
  transition: opacity 0.16s ease;
}
.comic-image-wrap img {
  width: 100%;
  height: auto;
  object-fit: initial;
  transition: opacity 0.16s ease;
}
.comic-fullscreen {
  position: absolute;
  right: clamp(1rem, 2.4vw, 1.8rem);
  bottom: clamp(1rem, 2.4vw, 1.8rem);
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elev) 90%, transparent);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s, border-color 0.2s, background 0.2s, color 0.2s;
}
.comic-fullscreen:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--accent-faint);
  color: var(--accent);
}
.comic-fullscreen-close {
  display: none;
}
.comic-fullscreen-nav {
  display: none;
}
.comic-card:fullscreen {
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  background: #050805;
}
.comic-card:fullscreen .comic-image-wrap {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
}
.comic-card:fullscreen .comic-image-wrap img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 1.5rem);
}
.comic-card:fullscreen .comic-progress,
.comic-card:fullscreen .comic-slide-links {
  display: none;
}
.comic-card:fullscreen .comic-fullscreen {
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.92);
  color: #0f1611;
}
.comic-card:fullscreen .comic-fullscreen-open {
  display: none;
}
.comic-card:fullscreen .comic-fullscreen-close {
  display: block;
}
.comic-card:fullscreen .comic-fullscreen-nav {
  position: fixed;
  top: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: clamp(44px, 7vw, 58px);
  height: clamp(44px, 7vw, 58px);
  padding: 0;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  color: #0f1611;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  transform: translateY(-50%);
  transition: transform 0.2s, background 0.2s, opacity 0.2s;
}
.comic-card:fullscreen .comic-fullscreen-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.04);
}
.comic-card:fullscreen .comic-fullscreen-nav:disabled {
  cursor: not-allowed;
  opacity: 0.32;
  transform: translateY(-50%);
}
.comic-card:fullscreen .comic-fullscreen-nav:disabled:hover {
  background: rgba(255,255,255,0.9);
}
.comic-card:fullscreen .comic-fullscreen-nav--prev {
  left: max(1rem, env(safe-area-inset-left));
}
.comic-card:fullscreen .comic-fullscreen-nav--next {
  right: max(1rem, env(safe-area-inset-right));
}
.comic-card:fullscreen .comic-fullscreen-nav:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 68%, #fff);
  outline-offset: 4px;
}
@media (max-width: 820px) {
  .comic-card:fullscreen .comic-fullscreen-nav {
    width: 42px;
    height: 42px;
    opacity: 0.9;
  }
  .comic-card:fullscreen .comic-fullscreen-nav--prev {
    left: max(0.5rem, env(safe-area-inset-left));
  }
  .comic-card:fullscreen .comic-fullscreen-nav--next {
    right: max(0.5rem, env(safe-area-inset-right));
  }
}
.comic-card.is-loading .comic-image-wrap::before {
  opacity: 1;
  animation: comicSkeleton 1.05s ease-in-out infinite;
}
.comic-card.is-loading .comic-image-wrap img {
  opacity: 0;
}
@keyframes comicSkeleton {
  0% { background-position: 140% 0; }
  100% { background-position: -140% 0; }
}
.comic-progress {
  position: absolute;
  top: clamp(1rem, 2.4vw, 1.8rem);
  right: clamp(1rem, 2.4vw, 1.8rem);
  z-index: 2;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.comic-card.is-changing .comic-image-wrap {
  animation: comicFade 0.32s ease both;
}
@keyframes comicFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.comic-controls {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr minmax(120px, auto);
  gap: 1rem;
  align-items: center;
  margin: 1.25rem 0 0;
}
.comic-btn {
  min-height: 46px;
  padding: 0.85rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 800;
  color: var(--text);
  background: var(--bg-elev);
  transition: transform 0.2s, background 0.2s, border-color 0.2s, opacity 0.2s;
}
.comic-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.comic-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
.comic-btn--primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
[data-theme="dark"] .comic-btn--primary {
  color: #0f1611;
}
.comic-btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.comic-dots {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
}
.comic-dot {
  width: 14px;
  height: 14px;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-elev);
  color: transparent;
  font-size: 0;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.comic-dot:hover,
.comic-dot.is-active {
  border-color: var(--accent);
  background: var(--accent);
  transform: scale(1.12);
}
@media (min-width: 821px) {
  .comic-page {
    padding: clamp(2rem, 4vw, 3.2rem) clamp(1.25rem, 2.6vw, 3.5rem) clamp(3rem, 5vw, 4.5rem);
  }
  .comic-viewer {
    display: grid;
    grid-template-columns: clamp(280px, 21vw, 360px) minmax(0, 1fr);
    gap: clamp(1.25rem, 2vw, 2.25rem);
    align-items: stretch;
  }
  .comic-sidebar,
  .comic-stage {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--bg-elev) 96%, transparent);
    box-shadow: var(--shadow-md);
  }
  .comic-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 1.25rem);
    align-self: start;
    padding: clamp(1.4rem, 2.4vw, 2rem);
  }
  .comic-stage {
    min-width: 0;
    padding: clamp(1.6rem, 2.2vw, 2.65rem);
  }
  .comic-kicker {
    margin: 0 0 1.15rem;
    color: var(--accent);
    font-size: 0.88rem;
    line-height: 1.12;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }
  .comic-kicker::before {
    display: block;
  }
  .comic-kicker-icon {
    display: none;
  }
  .comic-sidebar-count {
    display: block;
    margin: 0 0 0.65rem;
    color: var(--text-soft);
    font-weight: 600;
  }
  .comic-sidebar-progress {
    display: block;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border) 72%, var(--bg-elev));
  }
  .comic-sidebar-progress span {
    display: block;
    width: 16.666%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.25s ease;
  }
  .comic-step-list {
    position: relative;
    display: grid;
    gap: 0.55rem;
    margin: 1.8rem 0 2rem;
    padding: 0;
    list-style: none;
  }
  .comic-step-list::before {
    content: "";
    position: absolute;
    top: 26px;
    bottom: 26px;
    left: 22px;
    width: 1px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border) 82%, transparent);
  }
  .comic-step-list li {
    position: relative;
    z-index: 1;
  }
  .comic-step {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 0.8rem;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 0.4rem 0.75rem 0.4rem 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--text);
    text-align: left;
    transition: background 0.2s, color 0.2s, transform 0.2s;
  }
  .comic-step span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-elev);
    color: var(--text);
    font-weight: 800;
  }
  .comic-step strong {
    font-size: 0.98rem;
    font-weight: 700;
  }
  .comic-step:hover,
  .comic-step.is-active {
    background: color-mix(in srgb, var(--accent-faint) 78%, transparent);
  }
  .comic-step:hover span,
  .comic-step.is-active span {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
  }
  [data-theme="dark"] .comic-step:hover span,
  [data-theme="dark"] .comic-step.is-active span {
    color: #0f1611;
  }
  .comic-tip {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.1rem 0.85rem;
    align-items: start;
    margin-top: auto;
    padding: 1rem;
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent-faint) 74%, var(--bg-elev));
  }
  .comic-tip-icon {
    grid-row: span 2;
    color: var(--accent);
    line-height: 0;
  }
  .comic-tip strong {
    color: var(--accent-hover);
    font-size: 0.98rem;
  }
  .comic-tip p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.85rem;
    line-height: 1.4;
  }
  .comic-desktop-intro {
    display: none;
  }
  .comic-desktop-intro h2 {
    margin: 0 0 0.35rem;
    color: var(--text);
    font-size: clamp(2.25rem, 4.1vw, 3.6rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
  }
  .comic-desktop-intro p {
    margin: 0;
    color: var(--text-soft);
    font-size: clamp(1rem, 1.45vw, 1.25rem);
  }
  .comic-card {
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: transparent;
    box-shadow: none;
  }
  .comic-progress {
    display: none;
  }
  .comic-image-wrap {
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
  }
  .comic-image-wrap img {
    max-height: min(58vh, 720px);
    object-fit: contain;
  }
  .comic-fullscreen {
    right: 1rem;
    bottom: 1rem;
    width: 44px;
    height: 44px;
  }
  .comic-resources {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    min-height: 96px;
    margin-top: 1.15rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--accent-faint) 42%, var(--bg-elev));
  }
  .comic-resources h3 {
    margin: 0 0 0.28rem;
    color: var(--text);
    font-size: 1.08rem;
  }
  .comic-resources p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.42;
  }
  .comic-controls {
    grid-template-columns: 1fr auto auto;
    margin-top: 1.15rem;
  }
  .comic-dots {
    display: none;
  }
  .comic-btn {
    min-width: 140px;
  }
  .comic-btn--ghost {
    grid-column: 2;
    color: var(--accent);
    border-color: var(--accent);
    background: transparent;
  }
  .comic-btn--primary {
    grid-column: 3;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  }
  .comic-btn--primary::after {
    content: "→";
    margin-left: 0.55rem;
    font-size: 1.25em;
    line-height: 0;
  }
  .comic-btn--primary.is-finish::after {
    content: "";
    margin-left: 0;
  }
}
@media (min-width: 1600px) {
  .comic-viewer {
    max-width: min(1700px, calc(100vw - 3rem));
    grid-template-columns: 340px minmax(0, 1fr);
  }
  .comic-stage {
    padding: clamp(1.8rem, 1.8vw, 2.55rem);
  }
}
@media (min-width: 821px) and (max-height: 860px) {
  .comic-page {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
  }
  .comic-stage {
    padding: 1.45rem;
  }
  .comic-image-wrap img {
    max-height: 50vh;
  }
  .comic-find {
    margin-top: 1rem;
  }
  .comic-controls {
    margin-top: 1rem;
  }
}
@media (max-width: 820px) {
  body:has(.comic-page) .site-header {
    position: static;
  }
  body:has(.comic-page) .site-footer {
    display: none;
  }
  .comic-sidebar {
    display: contents;
  }
  .comic-sidebar-count,
  .comic-sidebar-progress,
  .comic-step-list,
  .comic-tip,
  .comic-desktop-intro {
    display: none;
  }
  .comic-page {
    min-height: calc(100dvh - var(--header-h));
    padding: 1.4rem 0.9rem 11.5rem;
    background:
      radial-gradient(circle at 5% 2%, color-mix(in srgb, var(--accent-soft) 42%, transparent) 0 190px, transparent 330px),
      linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  }
  .comic-viewer {
    max-width: none;
  }
  .comic-kicker {
    gap: 0.65rem;
    margin: 0 0 1.45rem 0.35rem;
    font-size: 1.12rem;
    letter-spacing: 0;
    text-transform: none;
  }
  .comic-kicker::before {
    display: none;
  }
  .comic-kicker-icon {
    display: inline-flex;
  }
  .comic-mobile-intro {
    display: block;
    margin: 0 0 1.15rem;
  }
  .comic-mobile-step {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 0.95rem;
    align-items: center;
    margin-bottom: 1.8rem;
  }
  .comic-mobile-step-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent-soft) 62%, transparent);
  }
  [data-theme="dark"] .comic-mobile-step-icon {
    color: var(--accent-hover);
    background: color-mix(in srgb, var(--accent-soft) 76%, var(--bg-elev));
  }
  .comic-mobile-step strong {
    color: var(--text);
    font-size: 1.12rem;
    line-height: 1;
  }
  .comic-mobile-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border) 72%, var(--bg-elev));
  }
  .comic-mobile-progress span {
    display: block;
    width: 16.666%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.25s ease;
  }
  .comic-mobile-intro h2 {
    display: none;
  }
  .comic-mobile-intro p {
    display: none;
  }
  .comic-resources {
    min-height: 0;
    margin: 0.85rem 0 0;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--accent-faint) 42%, var(--bg-elev));
  }
  .comic-resources.has-links {
    min-height: 128px;
  }
  .comic-resources h3 {
    margin: 0 0 0.25rem;
    color: var(--text);
    font-size: 0.98rem;
  }
  .comic-resources p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.84rem;
    line-height: 1.38;
  }
  .comic-resources .comic-slide-links {
    justify-content: flex-start;
    min-width: 0;
    margin-top: 0.75rem;
  }
  .comic-resources .comic-slide-links.is-empty {
    display: none;
    margin-top: 0;
  }
  .comic-card {
    padding: 0.58rem;
    border-radius: 24px;
    background: color-mix(in srgb, var(--bg-elev) 96%, transparent);
  }
  .comic-image-wrap {
    border-radius: 18px;
  }
  .comic-progress {
    display: none;
  }
  .comic-controls {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    grid-template-columns: 1fr 1fr;
    gap: 1.3rem;
    margin: 0;
    padding: 1.05rem max(0.9rem, env(safe-area-inset-left)) calc(1rem + env(safe-area-inset-bottom)) max(0.9rem, env(safe-area-inset-right));
    background:
      linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--bg-alt) 82%, transparent) 20%, var(--bg-alt) 100%);
    border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    box-shadow: 0 -16px 34px rgba(40, 80, 50, 0.10);
  }
  .comic-dots {
    display: none;
  }
  .comic-dot {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-width: 1px;
    color: var(--text-muted);
    background: transparent;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
  }
  .comic-dot:hover,
  .comic-dot.is-active {
    color: #fff;
    background: var(--accent);
    transform: none;
  }
  [data-theme="dark"] .comic-dot:hover,
  [data-theme="dark"] .comic-dot.is-active {
    color: #0f1611;
  }
  .comic-btn {
    min-height: 64px;
    border-width: 2px;
    border-radius: 999px;
    font-size: 1.28rem;
    box-shadow: none;
  }
  .comic-btn--ghost {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--bg-elev);
  }
  .comic-btn--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  }
  [data-theme="dark"] .comic-btn--primary {
    color: #0f1611;
  }
  .comic-btn--primary::after {
    content: "→";
    margin-left: 0.55rem;
    font-size: 1.35em;
    line-height: 0;
  }
  .comic-btn--primary.is-finish::after {
    content: "";
    margin-left: 0;
  }
  .comic-btn--primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  }
}

@media (max-width: 520px) {
  .comic-page {
    padding-left: 0.1rem;
    padding-right: 0.1rem;
  }
  .comic-viewer {
    max-width: none;
  }
  .comic-kicker,
  .comic-mobile-intro {
    margin-left: 0.8rem;
    margin-right: 0.8rem;
  }
  .comic-card {
    padding: 0.3rem;
    border-radius: 18px;
    box-shadow: var(--shadow-md);
  }
  .comic-image-wrap {
    border-radius: 14px;
  }
  .comic-controls {
    gap: 0.75rem;
    padding: 1.05rem 0.9rem 1.2rem;
  }
  .comic-fullscreen {
    right: 0.85rem;
    bottom: 0.85rem;
    width: 38px;
    height: 38px;
  }
  .comic-slide-link {
    min-height: 32px;
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
  }
  .comic-btn {
    width: 100%;
    min-height: 58px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    font-size: 1.12rem;
  }
  .comic-dot {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .comic-card.is-changing .comic-image-wrap {
    animation: none;
  }
}
