/*
 * Article presentation. Mobile-first; content JSON carries no styling, so
 * everything visual about articles lives here and in templates/articles/.
 *
 * Color tokens are bare HSL channels so they can be used as hsl(var(--x))
 * or with alpha: hsl(var(--x) / 0.5).
 */

:root {
  --a-bg: 0 0% 100%;
  --a-fg: 0 0% 8%;
  --a-muted: 0 0% 45%;
  --a-surface: 0 0% 96%;
  --a-border: 0 0% 88%;
  --a-primary: 0 0% 8%;
  --a-primary-fg: 0 0% 98%;
  --a-link: 211 80% 38%;
  --a-info: 211 80% 45%;
  --a-tip: 145 55% 32%;
  --a-warning: 32 95% 44%;
  --a-horse: 23 64% 33%;      /* chestnut */
  --a-electric: 183 81% 24%;  /* lake */
  --a-bus: 211 60% 40%;
  --a-car: 0 0% 40%;
  --a-bike: 95 45% 35%;
  --a-foot: 180 8% 57%;       /* stone */

  --a-radius: 0.5rem;
  --a-measure: 68ch;          /* comfortable reading line length */
  --a-gutter: 16px;
  --a-space: 1.25em;
  --a-font: 'DM Sans', system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --a-bg: 0 0% 8%;
    --a-fg: 0 0% 92%;
    --a-muted: 0 0% 62%;
    --a-surface: 0 0% 13%;
    --a-border: 0 0% 22%;
    --a-primary: 0 0% 4%;
    --a-link: 211 90% 70%;
    --a-info: 211 90% 65%;
    --a-tip: 145 50% 55%;
    --a-warning: 32 95% 60%;
    --a-horse: 27 63% 67%;
    --a-electric: 181 47% 58%;
    --a-bus: 211 70% 65%;
    --a-car: 0 0% 65%;
    --a-bike: 95 40% 60%;
    --a-foot: 180 7% 47%;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--a-font);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  background: hsl(var(--a-bg));
  color: hsl(var(--a-fg));
  -webkit-text-size-adjust: 100%;
}

a { color: hsl(var(--a-link)); text-underline-offset: 0.15em; }

/* ---------- Site chrome ---------- */

/* The site header comes from partials/site_header.html + site-header.css. */

.a-site-footer {
  /* Matches .footer-bar on the main page: page background, body text colour. */
  background: hsl(var(--a-bg));
  color: hsl(var(--a-fg));
  padding: 29px var(--a-gutter);
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.a-site-footer a { color: inherit; text-decoration: none; font-size: 0.875rem; }
.a-site-footer a:hover { text-decoration: underline; }
.a-site-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }

/* ---------- Layout ---------- */

.a-page {
  padding: 1.5rem var(--a-gutter) 0;
}

.a-article {
  max-width: var(--a-measure);
  margin: 0 auto;
}

/* ---------- Back link ---------- */

.a-back {
  max-width: var(--a-measure);
  margin: 0 auto 1.25rem;
}

.a-back__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;            /* comfortable touch target */
  padding: 0 14px 0 10px;
  border-radius: var(--a-radius);
  border: 1px solid hsl(var(--a-border));
  background: hsl(var(--a-surface));
  color: hsl(var(--a-fg));
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}
.a-back__link:hover { background: hsl(var(--a-border)); }
.a-back__link:hover i { transform: translateX(-2px); }
.a-back__link i { font-size: 18px; transition: transform 0.2s ease; }

/* ---------- Article header ---------- */

.a-kicker {
  margin: 0 0 0.6rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: hsl(var(--a-electric));
}

.a-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}
.a-tags li {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: hsl(var(--a-surface));
  color: hsl(var(--a-muted));
}

.a-title {
  font-size: clamp(1.75rem, 1.3rem + 2.2vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.a-lead {
  font-size: 1.15em;
  color: hsl(var(--a-fg) / 0.85);
  margin: 0 0 0.75rem;
}

.a-meta {
  font-size: 0.875rem;
  color: hsl(var(--a-muted));
  margin: 0 0 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid hsl(var(--a-border));
}

/* ---------- Body blocks ---------- */

.a-body > * { margin-top: 0; margin-bottom: var(--a-space); }

.a-heading { line-height: 1.25; scroll-margin-top: 1rem; text-wrap: balance; }
.a-heading--2 { font-size: 1.5em; margin-top: 2em; }
.a-heading--3 { font-size: 1.2em; margin-top: 1.6em; }

.a-paragraph { text-wrap: pretty; }

.a-list { padding-left: 1.4em; }
.a-list li + li { margin-top: 0.5em; }

.a-quote {
  margin-left: 0;
  margin-right: 0;
  padding: 0.25em 0 0.25em 1em;
  border-left: 4px solid hsl(var(--a-fg) / 0.8);
}
.a-quote blockquote {
  margin: 0;
  font-size: 1.15em;
  font-style: italic;
}
.a-quote figcaption {
  margin-top: 0.5em;
  font-size: 0.875rem;
  color: hsl(var(--a-muted));
}

.a-figure { margin-left: 0; margin-right: 0; }
.a-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--a-radius);
}
.a-cover { margin: 0 0 1rem; }
.a-cover img { width: 100%; }

.a-figure figcaption {
  margin-top: 0.5em;
  font-size: 0.875rem;
  color: hsl(var(--a-muted));
}
.a-credit { opacity: 0.8; }

.a-video video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
  border-radius: var(--a-radius);
}
/* Phone-shot vertical clips: cap the height so the player fits the screen. */
.a-video--portrait video {
  width: auto;
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
}
.a-video--portrait figcaption { text-align: center; }

.a-callout {
  --tone: var(--a-info);
  padding: 0.9em 1.1em;
  border-radius: var(--a-radius);
  border-left: 4px solid hsl(var(--tone));
  background: hsl(var(--tone) / 0.08);
}
.a-callout--tip { --tone: var(--a-tip); }
.a-callout--warning { --tone: var(--a-warning); }
.a-callout p { margin: 0; }
.a-callout__title { font-weight: 700; margin-bottom: 0.25em !important; }

.a-facts {
  background: hsl(var(--a-surface));
  border-radius: var(--a-radius);
  padding: 0.5em 1.1em;
}
.a-facts__title { margin: 0.5em 0; font-size: 1em; }
.a-facts dl { margin: 0; }
.a-facts__row {
  padding: 0.6em 0;
  border-bottom: 1px solid hsl(var(--a-border));
}
.a-facts__row:last-child { border-bottom: 0; }
.a-facts dt {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--a-muted));
}
.a-facts dd { margin: 0; font-weight: 600; }

.a-embed { margin-left: 0; margin-right: 0; }
.a-embed iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--a-radius);
}

.a-embed figcaption {
  margin-top: 0.5em;
  font-size: 0.875em;
  color: hsl(var(--a-muted));
}
.a-embed--social { max-width: 540px; }
.a-embed__consent {
  padding: 1em 1.25em;
  background: hsl(var(--a-surface));
  border: 1px solid hsl(var(--a-border));
  border-radius: var(--a-radius);
}
.a-embed__consent p { margin: 0 0 0.5em; }
.a-embed__label { font-weight: 600; }
.a-embed__note { font-size: 0.875em; color: hsl(var(--a-muted)); }
.a-embed__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75em 1.25em;
  margin-top: 0.75em;
}
.a-embed__load {
  font: inherit;
  font-weight: 600;
  padding: 0.5em 1.1em;
  color: hsl(var(--a-primary-fg));
  background: hsl(var(--a-primary));
  border: 0;
  border-radius: var(--a-radius);
  cursor: pointer;
}
.a-embed__actions a { color: hsl(var(--a-link)); }
.a-embed__open { margin: 0.5em 0 0; font-size: 0.875em; }
.a-embed__open a { color: hsl(var(--a-link)); }
.a-embed--social iframe {
  aspect-ratio: auto;
  height: 760px;
  max-width: 540px;
  background: hsl(0 0% 100%);
}
.a-embed--facebook iframe { height: 680px; }
.a-embed--facebook-reel iframe { width: 267px; max-width: 100%; height: 591px; }

.a-divider {
  border: 0;
  border-top: 1px solid hsl(var(--a-border));
  margin: 2em 0;
}

/* Route: proportional bar + legend. Colors come from the segment's mode. */
.a-route { margin-left: 0; margin-right: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.a-route__bar { display: flex; height: 14px; gap: 2px; border-radius: 3px; overflow: hidden; }
.a-route__seg { display: block; min-width: 4px; }
.a-route__legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; font-size: 0.95em; line-height: 1.45; }
.a-route__legend li { display: grid; grid-template-columns: 0.8rem 1fr; gap: 0.6rem; align-items: baseline; }
.a-route__swatch { width: 0.8rem; height: 0.8rem; display: block; border-radius: 2px; }
.a-route--horse { background: hsl(var(--a-horse)); }
.a-route--electric { background: hsl(var(--a-electric)); }
.a-route--bus { background: hsl(var(--a-bus)); }
.a-route--car { background: hsl(var(--a-car)); }
.a-route--bike { background: hsl(var(--a-bike)); }
.a-route--foot { background: hsl(var(--a-foot)); }

/* Arguments: one topic per row; for/against stack on mobile, side by side when wide. */
.a-args { display: flex; flex-direction: column; gap: 1.75rem; }
.a-args__topic { padding-top: 1.25rem; border-top: 1px solid hsl(var(--a-border)); }
.a-args__title { margin: 0 0 0.75rem; font-size: 1.125em; line-height: 1.3; }
.a-args__sides { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
.a-args__side p { margin: 0; font-size: 0.97em; line-height: 1.6; }
.a-args__side .a-args__label {
  margin-bottom: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.a-args__side--for .a-args__label { color: hsl(var(--a-horse)); }
.a-args__side--against .a-args__label { color: hsl(var(--a-electric)); }

/* ---------- Sources ---------- */

.a-sources {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--a-border));
  font-size: 0.875rem;
  color: hsl(var(--a-muted));
}
.a-sources__title { font-size: 1rem; margin: 0 0 0.5rem; color: hsl(var(--a-fg)); }
.a-sources ul { margin: 0; padding-left: 1.2em; }
.a-sources li + li { margin-top: 0.35em; }

/* ---------- Article cards (/articles/ and "Czytaj także") ---------- */

.a-wide { max-width: 1200px; margin-left: auto; margin-right: auto; }
.a-index-header { margin-bottom: 1.5rem; }

.a-cards {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 20px;
}
.a-card {
  border: 1px solid hsl(var(--a-border));
  border-radius: var(--a-radius);
  overflow: hidden;
  background: hsl(var(--a-bg));
}
.a-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.a-card__link:hover .a-card__title { text-decoration: underline; }
.a-card__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: hsl(var(--a-surface)); }
.a-card__text { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.9rem 1rem 1rem; }
.a-card__kicker { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--a-muted)); }
.a-card__title { font-weight: 700; line-height: 1.3; }
.a-card__date { font-size: 0.8rem; color: hsl(var(--a-muted)); }

.a-related {
  max-width: var(--a-measure);
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--a-border));
}
.a-related__title { font-size: 1.25rem; margin: 0 0 1rem; }
.a-related .a-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.a-related .a-card__title { font-size: 0.95rem; }
.a-related__all { margin: 1rem 0 0; font-weight: 600; }

/* ---------- Games column next to an article (wide screens only) ---------- */

.a-games { display: none; }

@media (min-width: 1200px) {
  /* Article stays centred; the games column sits in the right-hand gutter. */
  .a-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--a-measure)) minmax(0, 1fr);
    column-gap: 40px;
    align-items: start;
  }
  .a-layout > .a-article { grid-column: 2; margin: 0; }
  .a-games {
    display: block;
    grid-column: 3;
    max-width: 260px;
    position: sticky;
    top: 24px;
  }
  .a-games__title {
    font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: hsl(var(--a-muted)); margin: 0 0 0.75rem;
  }
  .a-games .g-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
  .a-games .g-links__item {
    display: flex; flex-direction: column; color: inherit; text-decoration: none;
    border: 1px solid hsl(var(--a-border)); border-radius: var(--a-radius); overflow: hidden;
    background: hsl(var(--a-bg));
  }
  .a-games .g-links__item:hover .g-links__name { text-decoration: underline; }
  .a-games .g-links__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: hsl(var(--a-surface)); }
  .a-games .g-links__text { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.6rem 0.8rem 0.75rem; }
  .a-games .g-links__name { font-size: 0.9rem; line-height: 1.3; }
  .a-games .g-links__blurb { font-size: 0.8rem; line-height: 1.4; color: hsl(var(--a-muted)); }
}

/* ---------- Wider screens ---------- */

@media (min-width: 720px) {
  :root { --a-gutter: 32px; }
  .a-page { padding-top: 3rem; }

  .a-args__sides { grid-template-columns: 1fr 1fr; gap: 1.75rem; }

  /* Facts become a two-column label/value table when there is room. */
  .a-facts__row {
    display: grid;
    grid-template-columns: 12em 1fr;
    gap: 1em;
    align-items: baseline;
  }
}
