/*
Theme Name: Mój Szlak
Theme URI: https://mojszlak.pl
Author: Riomega
Description: Editorial mountain journal — kremowy papier, czerwień szlaku, longform reading. Vanilla JS, lokalne fonty, auto-TOC z IntersectionObserver. RankMath compatible.
Version: 1.0.0
License: GPL-2.0-or-later
Text Domain: mojszlak
*/

/* =========================================================================
   1. FONTY (latin + latin-ext)
   Folder: /fonts/{newsreader, inter-tight, jetbrains-mono}/
   Każdy font ma 2 pliki woff2 (latin + latin-ext) per waga.
   ========================================================================= */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/newsreader/newsreader-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/newsreader/newsreader-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/newsreader/newsreader-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/newsreader/newsreader-italic-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-tight/intertight-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-tight/intertight-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/jetbrains-mono/jetbrainsmono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/jetbrains-mono/jetbrainsmono-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+1E00-1EFF, U+20A0-20AB, U+2C60-2C7F;
}

/* =========================================================================
   2. DESIGN TOKENS
   ========================================================================= */
:root {
  /* paleta przewodnikowa */
  --c-paper:        #F5F1E8;
  --c-paper-dim:    #EAE3D2;
  --c-paper-deep:   #DDD3BC;
  --c-ink:          #1C2120;
  --c-ink-soft:     #4A4F4D;
  --c-stone:        #6E7783;
  --c-stone-light:  #A8AEB1;
  --c-moss:         #2B3A2A;
  --c-trail:        #B73E2D;     /* oznaczenie szlaku czerwonego */
  --c-trail-deep:   #8E2E20;
  --c-line:         #C9C0A8;     /* hairline na papierze */

  /* fonty */
  --f-display: 'Newsreader', 'Newsreader Fallback', Georgia, 'Times New Roman', serif;
  --f-body:    'Inter Tight', 'Inter Tight Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono:    'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

  /* skala typo (modular ~1.25 + tweaks) */
  --t-xs:   0.78rem;
  --t-sm:   0.9rem;
  --t-base: 1.0625rem;   /* 17px body — czytelność longform */
  --t-md:   1.25rem;
  --t-lg:   1.5rem;
  --t-xl:   2rem;
  --t-2xl:  2.75rem;
  --t-3xl:  3.75rem;
  --t-4xl:  clamp(2.75rem, 6vw + 0.5rem, 5.25rem);

  /* miary */
  --measure: 64ch;          /* ~720px max szerokość prosy */
  --container: 1240px;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  /* odstępy */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-5: 3rem;
  --s-6: 4rem;
  --s-7: 6rem;
  --s-8: 8rem;

  /* layout single */
  --aside-w: 240px;
  --aside-gap: 4rem;
}

/* fallback metrics (ograniczają CLS przy ładowaniu fontów) */
@font-face {
  font-family: 'Newsreader Fallback';
  src: local('Georgia');
  ascent-override: 92%;
  descent-override: 24%;
  line-gap-override: 0%;
  size-adjust: 102%;
}
@font-face {
  font-family: 'Inter Tight Fallback';
  src: local('Arial');
  ascent-override: 95%;
  descent-override: 22%;
  line-gap-override: 0%;
  size-adjust: 105%;
}

/* =========================================================================
   3. RESET + BASE
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.65;
  color: var(--c-ink);
  background-color: var(--c-paper);
  background-image:
    radial-gradient(rgba(28,33,32,0.025) 1px, transparent 1px),
    radial-gradient(rgba(28,33,32,0.018) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern','liga','calt';
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
a {
  color: var(--c-ink);
  text-decoration-color: var(--c-trail);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s ease, text-decoration-color .2s ease;
}
a:hover { color: var(--c-trail); text-decoration-color: currentColor; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
hr {
  border: 0;
  height: 6px;
  margin: var(--s-5) 0;
  background:
    linear-gradient(to bottom,
      var(--c-paper) 0, var(--c-paper) 1px,
      var(--c-trail) 1px, var(--c-trail) 5px,
      var(--c-paper) 5px, var(--c-paper) 6px);
}
::selection { background: var(--c-trail); color: var(--c-paper); }

/* skip link a11y */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--c-ink); color: var(--c-paper);
  padding: var(--s-2); z-index: 999;
}
.skip-link:focus { left: var(--s-2); top: var(--s-2); }

/* container */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* =========================================================================
   4. HEADER + NAV
   ========================================================================= */
.site-header {
  border-bottom: 1px solid var(--c-line);
  background: var(--c-paper);
  position: relative;
}
.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding-block: var(--s-3);
}
.site-brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--f-display);
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.site-brand strong {
  font-weight: 600;
  font-style: italic;
  color: var(--c-ink);
}
.site-brand em {
  font-family: var(--f-mono);
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-trail);
  padding-left: 0.6rem;
  border-left: 1px solid var(--c-line);
}
.site-nav {
  justify-self: center;
}
.site-nav ul {
  display: flex;
  gap: var(--s-4);
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-nav a {
  text-decoration: none;
  color: var(--c-ink-soft);
  position: relative;
  padding-block: 0.4rem;
}
.site-nav a:hover,
.site-nav .current-menu-item a {
  color: var(--c-ink);
}
.site-nav .current-menu-item a::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: var(--c-trail);
}
.site-nav-toggle {
  display: none;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--c-ink);
}
.header-meta {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-stone);
  text-align: right;
}

@media (max-width: 880px) {
  .site-header__inner {
    grid-template-columns: 1fr auto;
  }
  .site-nav {
    display: none;
    grid-column: 1 / -1;
    justify-self: stretch;
    border-top: 1px solid var(--c-line);
    padding-top: var(--s-3);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: var(--s-2); }
  .site-nav-toggle { display: inline-block; }
  .header-meta { display: none; }
}

/* =========================================================================
   5. HERO ARTICLE (single)
   ========================================================================= */
.hero {
  position: relative;
  margin-bottom: var(--s-6);
}
.hero__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--c-paper-deep);
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* lekka „papierowa" desaturacja, jak druk z lat 70 */
  filter: saturate(0.85) contrast(1.02);
}
.hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28,33,32,0) 55%, rgba(28,33,32,0.45) 100%);
  pointer-events: none;
}
.hero__caption {
  position: absolute;
  bottom: var(--s-4);
  left: 0;
  right: 0;
  color: var(--c-paper);
  padding-inline: var(--gutter);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hero__caption span { opacity: 0.8; }

.article-head {
  margin-top: calc(-1 * var(--s-6));
  position: relative;
  z-index: 2;
}
.article-head__inner {
  background: var(--c-paper);
  max-width: 880px;
  margin: 0 auto;
  padding: var(--s-5) var(--s-5) 0;
  border-top: 1px solid var(--c-line);
}
.article-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-trail);
  margin-bottom: var(--s-3);
}
.article-kicker::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 6px;
  background:
    linear-gradient(to bottom,
      var(--c-paper) 0, var(--c-paper) 1px,
      var(--c-trail) 1px, var(--c-trail) 5px,
      var(--c-paper) 5px, var(--c-paper) 6px);
}
.article-title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: var(--t-4xl);
  line-height: 1.04;
  letter-spacing: -0.018em;
  color: var(--c-ink);
  text-wrap: balance;
}
.article-title em {
  font-style: italic;
  color: var(--c-ink-soft);
}
.article-lede {
  font-family: var(--f-display);
  font-style: italic;
  font-size: var(--t-md);
  line-height: 1.55;
  color: var(--c-ink-soft);
  max-width: 56ch;
  margin-top: var(--s-3);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--c-line);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-stone);
}
.article-meta b {
  font-weight: 600;
  color: var(--c-ink);
  margin-left: 0.4rem;
}

/* =========================================================================
   6. SINGLE LAYOUT (3 kolumny: TOC | proza | rezerwa)
   ========================================================================= */
.single-grid {
  display: grid;
  gap: var(--s-5);
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-5) var(--gutter) var(--s-7);
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .single-grid {
    grid-template-columns: var(--aside-w) minmax(0, 1fr) var(--aside-w);
    gap: var(--aside-gap);
    align-items: start;
  }
}

/* =========================================================================
   7. TABLE OF CONTENTS (sticky desktop / accordion mobile)
   ========================================================================= */
.toc {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  line-height: 1.45;
  letter-spacing: 0.04em;
}
.toc__label {
  display: block;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--c-trail);
  margin-bottom: var(--s-2);
  padding-bottom: var(--s-1);
  border-bottom: 1px solid var(--c-line);
}
.toc__list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  counter-reset: tocchapter;
}
.toc__list li.lvl-2 { counter-increment: tocchapter; }
.toc__list a {
  display: block;
  position: relative;
  padding: 0.25rem 0 0.25rem 2.4rem;
  text-decoration: none;
  color: var(--c-ink-soft);
  border-left: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.toc__list li.lvl-2 > a::before {
  content: counter(tocchapter, upper-roman) '.';
  position: absolute;
  left: 0.5rem;
  top: 0.25rem;
  font-weight: 600;
  color: var(--c-stone-light);
  letter-spacing: 0.04em;
}
.toc__list li.lvl-3 a {
  padding-left: 3.4rem;
  font-size: 0.78rem;
  color: var(--c-stone);
}
.toc__list a:hover { color: var(--c-ink); }
.toc__list a.is-active {
  color: var(--c-ink);
  border-left-color: var(--c-trail);
  background: linear-gradient(to right, rgba(183,62,45,0.06), transparent 60%);
}
.toc__list a.is-active::before { color: var(--c-trail); }

/* desktop sticky */
@media (min-width: 1024px) {
  .toc--desktop {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding-right: 0.5rem;
  }
  .toc--desktop::-webkit-scrollbar { width: 4px; }
  .toc--desktop::-webkit-scrollbar-thumb { background: var(--c-paper-deep); }
  .toc--mobile { display: none; }
}

/* mobile accordion */
@media (max-width: 1023px) {
  .toc--desktop { display: none; }
  .toc--mobile {
    margin-bottom: var(--s-4);
    border: 1px solid var(--c-line);
    background: var(--c-paper-dim);
    padding: var(--s-2) var(--s-3);
  }
  .toc--mobile summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--f-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-trail);
    font-weight: 600;
  }
  .toc--mobile summary::-webkit-details-marker { display: none; }
  .toc--mobile summary::after {
    content: '+';
    font-family: var(--f-mono);
    font-size: 1.1rem;
    color: var(--c-stone);
    transition: transform .25s ease;
  }
  .toc--mobile[open] summary::after { content: '−'; }
  .toc--mobile .toc__list { margin-top: var(--s-2); }
  .toc--mobile .toc__label { display: none; }
}

/* =========================================================================
   8. PROZA (single content)
   ========================================================================= */
.prose {
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.7;
  color: var(--c-ink);
  max-width: var(--measure);
  margin-inline: auto;
}
.prose > * { margin-block: 1.1em; }
.prose > *:first-child { margin-top: 0; }

.prose p { hyphens: auto; }
.prose p > strong { font-weight: 600; }
.prose p > em { font-style: italic; color: var(--c-ink-soft); }

.prose > p:first-of-type::first-letter {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 4.6em;
  line-height: 0.85;
  float: left;
  padding: 0.06em 0.12em 0 0;
  margin-bottom: -0.05em;
  color: var(--c-trail);
}

.prose h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: var(--t-2xl);
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin-top: 2.2em;
  margin-bottom: 0.6em;
  color: var(--c-ink);
  scroll-margin-top: 80px;
  text-wrap: balance;
}
.prose h2::before {
  content: '';
  display: block;
  width: 40px;
  height: 6px;
  margin-bottom: var(--s-2);
  background:
    linear-gradient(to bottom,
      var(--c-paper) 0, var(--c-paper) 1px,
      var(--c-trail) 1px, var(--c-trail) 5px,
      var(--c-paper) 5px, var(--c-paper) 6px);
}
.prose h3 {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-moss);
  margin-top: 2em;
  margin-bottom: 0.5em;
  scroll-margin-top: 80px;
}
.prose h4 {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: var(--t-md);
  color: var(--c-ink-soft);
  margin-top: 1.6em;
}

.prose ul, .prose ol {
  padding-left: 1.4em;
}
.prose ul li { list-style-type: '— '; padding-left: 0.4em; }
.prose ul li::marker { color: var(--c-trail); }
.prose ol li { padding-left: 0.4em; }
.prose ol li::marker { font-family: var(--f-mono); color: var(--c-trail); font-weight: 600; }

.prose blockquote {
  margin-block: 1.8em;
  padding: var(--s-2) 0 var(--s-2) var(--s-4);
  border-left: 3px solid var(--c-trail);
  font-family: var(--f-display);
  font-style: italic;
  font-size: var(--t-md);
  color: var(--c-ink-soft);
}
.prose blockquote cite {
  display: block;
  margin-top: var(--s-2);
  font-family: var(--f-mono);
  font-style: normal;
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-stone);
}

.prose figure {
  margin-block: 2em;
}
.prose figure img {
  width: 100%;
  height: auto;
  background: var(--c-paper-deep);
}
.prose figure figcaption {
  margin-top: var(--s-2);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--c-stone);
  padding-left: var(--s-3);
  border-left: 2px solid var(--c-trail);
}

.prose .alignwide,
.prose .alignfull {
  margin-inline: calc(50% - 50vw);
  width: 100vw;
  max-width: 100vw;
}
@media (min-width: 1024px) {
  .prose .alignwide {
    margin-inline: calc(-1 * (var(--aside-w) + var(--aside-gap)));
    width: calc(100% + 2 * (var(--aside-w) + var(--aside-gap)));
  }
}

.prose code {
  font-family: var(--f-mono);
  font-size: 0.92em;
  background: var(--c-paper-dim);
  padding: 0.1em 0.4em;
  border-radius: 2px;
}
.prose pre {
  background: var(--c-ink);
  color: var(--c-paper);
  padding: var(--s-3);
  overflow-x: auto;
  font-family: var(--f-mono);
  font-size: 0.92rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-block: 1.6em;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--c-line);
}
.prose th {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-stone);
  border-bottom-color: var(--c-ink);
}

/* numbery wewnętrzne (godziny przejścia, wysokości) — dla autora */
.prose .data,
.prose .num {
  font-family: var(--f-mono);
  font-feature-settings: 'tnum' 1;
  letter-spacing: -0.01em;
}

/* link wewnątrz prozy — pasek szlaku zamiast underline */
.prose a {
  text-decoration: none;
  background-image: linear-gradient(transparent 60%, rgba(183,62,45,0.18) 60%);
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transition: background-size .25s ease, color .2s ease;
}
.prose a:hover {
  color: var(--c-trail);
  background-size: 100% 100%;
  background-image: linear-gradient(transparent 92%, var(--c-trail) 92%);
}

/* =========================================================================
   9. ARCHIWA / HOME
   ========================================================================= */
.intro-band {
  border-bottom: 1px solid var(--c-line);
  padding-block: var(--s-6) var(--s-5);
}
.intro-band__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
  align-items: end;
}
@media (min-width: 880px) {
  .intro-band__inner {
    grid-template-columns: 1.4fr 1fr;
  }
}
.intro-band h1 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: var(--t-3xl);
  line-height: 1.05;
  letter-spacing: -0.018em;
  color: var(--c-ink);
  text-wrap: balance;
}
.intro-band h1 em { font-style: italic; color: var(--c-ink-soft); }
.intro-band p {
  font-family: var(--f-display);
  font-style: italic;
  font-size: var(--t-md);
  line-height: 1.55;
  color: var(--c-ink-soft);
  max-width: 50ch;
}

.posts-feed {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-6) var(--gutter) var(--s-7);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
@media (min-width: 880px) {
  .posts-feed { grid-template-columns: 2fr 1fr; gap: var(--s-6); }
}

.post-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--c-line);
}
@media (min-width: 720px) {
  .post-card { grid-template-columns: 280px 1fr; gap: var(--s-4); }
}
.post-card__media {
  aspect-ratio: 4 / 3;
  background: var(--c-paper-deep);
  overflow: hidden;
}
.post-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.9);
  transition: transform .5s ease;
}
.post-card:hover .post-card__media img { transform: scale(1.04); }
.post-card__kicker {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-trail);
  margin-bottom: 0.6rem;
}
.post-card h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.012em;
  color: var(--c-ink);
}
.post-card h2 a {
  text-decoration: none;
  background-image: linear-gradient(transparent 92%, var(--c-trail) 92%);
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size .35s ease;
}
.post-card:hover h2 a { background-size: 100% 100%; }
.post-card__excerpt {
  margin-top: var(--s-2);
  color: var(--c-ink-soft);
  max-width: 60ch;
}
.post-card__meta {
  margin-top: var(--s-2);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-stone);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

/* sidebar w archiwum (powiązane kategorie) */
.posts-sidebar {
  font-size: var(--t-sm);
}
.posts-sidebar h3 {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-trail);
  border-bottom: 1px solid var(--c-line);
  padding-bottom: 0.5rem;
  margin-bottom: var(--s-3);
}
.posts-sidebar ul { list-style: none; padding: 0; margin: 0 0 var(--s-5); display: flex; flex-direction: column; gap: 0.5rem; }
.posts-sidebar a { text-decoration: none; color: var(--c-ink-soft); }
.posts-sidebar a:hover { color: var(--c-trail); }

/* paginacja */
.pagination {
  max-width: var(--container);
  margin: var(--s-5) auto 0;
  padding: 0 var(--gutter) var(--s-7);
  display: flex;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.pagination .page-numbers {
  padding: 0.6rem 0.95rem;
  border: 1px solid var(--c-line);
  text-decoration: none;
  color: var(--c-ink-soft);
}
.pagination .current {
  background: var(--c-ink);
  color: var(--c-paper);
  border-color: var(--c-ink);
}

/* =========================================================================
   10. FOOTER
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--c-line);
  background: var(--c-paper-dim);
  margin-top: var(--s-8);
}
.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-5) var(--gutter);
  display: grid;
  gap: var(--s-4);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .site-footer__inner { grid-template-columns: 1.5fr 1fr 1fr; }
}
.site-footer h4 {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-trail);
  margin-bottom: var(--s-2);
}
.site-footer__brand {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 1.4rem;
}
.site-footer__sub {
  font-size: var(--t-sm);
  color: var(--c-ink-soft);
  max-width: 36ch;
  margin-top: 0.5rem;
}
.site-footer__bottom {
  border-top: 1px solid var(--c-line);
  padding: var(--s-3) var(--gutter);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-stone);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-2);
}

/* =========================================================================
   11. AUTHOR / RELATED / 404
   ========================================================================= */
.related {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--s-7);
}
.related h3 {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-trail);
  border-bottom: 1px solid var(--c-line);
  padding-bottom: 0.5rem;
  margin-bottom: var(--s-4);
}
.related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 720px) { .related__grid { grid-template-columns: repeat(3, 1fr); } }
.related__card a {
  display: block;
  text-decoration: none;
  font-family: var(--f-display);
  font-size: var(--t-md);
  line-height: 1.2;
  color: var(--c-ink);
}
.related__card .meta {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-trail);
  margin-bottom: 0.4rem;
}
.related__card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: var(--s-2);
  background: var(--c-paper-deep);
}
.related__card img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.9);
  transition: transform .5s ease;
}
.related__card:hover img { transform: scale(1.04); }

.error-404 {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: var(--s-7) var(--gutter);
}
.error-404 h1 {
  font-family: var(--f-display);
  font-size: var(--t-4xl);
  line-height: 1;
  font-weight: 500;
}
.error-404 h1 em { font-style: italic; color: var(--c-trail); }
.error-404 p {
  margin-top: var(--s-3);
  font-family: var(--f-display);
  font-style: italic;
  font-size: var(--t-md);
  color: var(--c-ink-soft);
}

/* search form */
.search-form {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--c-ink);
  max-width: 320px;
}
.search-form input[type="search"] {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 0.6rem 0;
  font: inherit;
  font-family: var(--f-body);
  color: var(--c-ink);
  outline: 0;
}
.search-form button {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-trail);
  padding: 0 0.5rem;
}

/* =========================================================================
   12. RIOMEGA AUTHOR BOX — accent override
   ========================================================================= */
.rab-author-box {
  --rab-accent: var(--c-trail);
  background: var(--c-paper-dim) !important;
  border: 1px solid var(--c-line) !important;
  border-radius: 0 !important;
  margin-block: var(--s-5) !important;
  font-family: var(--f-body) !important;
}
.rab-author-box .rab-name {
  font-family: var(--f-display) !important;
  font-weight: 500 !important;
}
.rab-author-box .rab-speciality,
.rab-author-box .rab-credentials {
  font-family: var(--f-mono) !important;
  letter-spacing: 0.04em !important;
}

/* =========================================================================
   13. PRINT (przewodnikowy fallback dla schowania w plecak)
   ========================================================================= */
@media print {
  .site-header, .site-footer, .toc, .related,
  .rab-author-box .rab-social { display: none !important; }
  body { background: white; color: black; font-size: 11pt; }
  .prose { max-width: 100%; }
  a { color: black; text-decoration: none; }
  .article-title { font-size: 28pt; }
}

/* =========================================================================
   14. REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================================
   15. ENTRY ANIMATIONS (subtle, page-load only)
   ========================================================================= */
@keyframes mj-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.article-kicker, .article-title, .article-lede, .article-meta {
  animation: mj-rise .7s cubic-bezier(.2,.7,.2,1) both;
}
.article-title    { animation-delay: .05s; }
.article-lede     { animation-delay: .15s; }
.article-meta     { animation-delay: .25s; }
