/*
Theme Name: HDK Klub
Theme URI: https://krew.krakow.pl
Author: Klub HDK
Description: Lekki, autorski motyw dla klubu Honorowych Dawców Krwi. Bez page builderów, bez frameworków. Mobile-first, wysoki kontrast, duża czytelna typografia.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: hdk
*/

/* ==========================================================================
   1. Tokeny
   ========================================================================== */
:root {
  --red: #b3122b;          /* krwista czerwień – akcent (kontrast na bieli 6.9:1) */
  --red-dark: #8a0d21;
  --red-soft: #fcebee;
  --ink: #1b1f24;
  --muted: #555e69;        /* kontrast na bieli 6.3:1 */
  --line: #e3e6ea;
  --white: #fff;
  --paper: #faf7f6;
  --soft: #f4f5f7;
  --ph: #dee2e7;           /* tło placeholderów na zdjęcia */
  --radius: 12px;
  --radius-lg: 28px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --font: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   2. Reset i typografia
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.125rem;      /* 18px bazowo – czytelne dla starszych osób */
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.2; font-weight: 800; letter-spacing: -.015em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.75rem); letter-spacing: -.025em; line-height: 1.08; }
h2 { font-size: clamp(1.65rem, 3.6vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--red-dark); text-underline-offset: .18em; }
a:hover { color: var(--red); }
ul, ol { margin: 0 0 1em; padding-left: 1.25rem; }
.lead { font-size: clamp(1.15rem, 2.2vw, 1.35rem); color: var(--muted); max-width: 40em; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: .5rem; left: .5rem; z-index: 100; width: auto; height: auto; margin: 0;
  clip: auto; padding: .75rem 1.25rem; background: var(--ink); color: #fff; border-radius: 8px;
}

/* ==========================================================================
   3. Układ
   ========================================================================== */
.container { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 760px; }
.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section--soft { background: var(--soft); }
.section--paper { background: var(--paper); }
.section__head { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 2rem; }
.section__head h2 { margin: 0; }
.section__intro { color: var(--muted); max-width: 42em; margin: 0; }

@media (min-width: 700px) {
  .section__head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}

/* ==========================================================================
   4. Przyciski
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 52px; padding: .7rem 1.6rem;
  border: 2px solid transparent; border-radius: 999px;
  font: inherit; font-size: 1.05rem; font-weight: 800; line-height: 1.2; text-decoration: none;
  cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); color: #fff; }
.btn--ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--outline { border-color: var(--red); color: var(--red-dark); background: transparent; }
.btn--outline:hover { background: var(--red); color: #fff; }
.btn--white { background: #fff; color: var(--red-dark); }
.btn--white:hover { background: var(--ink); color: #fff; }
.btn--sm { min-height: 44px; padding: .45rem 1.2rem; font-size: 1rem; }

.icon { width: 1.5rem; height: 1.5rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   5. Nagłówek i nawigacja
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; min-height: 76px; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand img { height: 56px; width: auto; }
.brand__name { font-size: 1.15rem; font-weight: 800; line-height: 1.15; }
.brand__sub { display: block; font-size: .85rem; font-weight: 400; color: var(--muted); }

.nav-toggle {
  display: none; align-items: center; gap: .6rem; min-height: 48px; padding: .4rem 1rem;
  border: 2px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink);
  font: inherit; font-weight: 800; cursor: pointer;
}
.nav-toggle__bars { position: relative; width: 20px; height: 2px; background: currentColor; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: currentColor; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.js .nav-toggle { display: inline-flex; }

.nav { flex-basis: 100%; }
.js .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: .5rem var(--gutter) 1.5rem; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(20, 24, 30, .08); }
.js .nav.is-open { display: block; }
.nav__list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.nav__list a { display: block; padding: .9rem .25rem; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 700; text-decoration: none; }
.nav__list a:hover { color: var(--red); }
.nav__list .current-menu-item > a,
.nav__list .current_page_item > a,
.nav__list .current-menu-ancestor > a { color: var(--red); }
.nav__cta { margin-top: 1.25rem; width: 100%; }

@media (min-width: 980px) {
  .site-header__inner { flex-wrap: nowrap; }
  .nav, .js .nav, .js .nav.is-open {
    display: flex; flex: 1 1 auto; align-items: center; justify-content: flex-end; gap: 1.75rem;
    position: static; padding: 0; background: none; border: 0; box-shadow: none;
  }
  .js .nav-toggle { display: none; }
  .nav__list { flex-direction: row; gap: 1.5rem; }
  .nav__list a { padding: .4rem 0; border-bottom: 3px solid transparent; }
  .nav__list a:hover { border-bottom-color: var(--line); }
  .nav__list .current-menu-item > a,
  .nav__list .current_page_item > a { border-bottom-color: var(--red); }
  .nav__cta { margin: 0; width: auto; }
}

/* ==========================================================================
   6. Hero (strona główna)
   ========================================================================== */
.hero { background: var(--paper); overflow: hidden; }
.hero__grid { display: grid; gap: 2.5rem; align-items: center; padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.hero__text h1 { max-width: 14em; margin-bottom: .45em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 1.5rem; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0; padding: 0; list-style: none; font-weight: 700; font-size: 1rem; }
.checks li { display: flex; align-items: center; gap: .4rem; }
.checks .icon { width: 1.25rem; height: 1.25rem; color: var(--red); stroke-width: 3; }

/* Kropla krwi z logo – element „zapamiętywalny” strony */
.hero__art { position: relative; width: min(100%, 340px); aspect-ratio: 1; margin-inline: auto; }
.hero__drop { position: absolute; inset: 8%; background: var(--red); border-radius: 50% 0 50% 50%; transform: rotate(-45deg); }
.hero__logo {
  position: absolute; inset: 0; margin: auto; width: 46%; height: fit-content;
  padding: .9rem; background: #fff; border-radius: 22px; box-shadow: 0 18px 40px rgba(138, 13, 33, .35);
}
.hero__logo img { width: 100%; }

@media (min-width: 860px) {
  .hero__grid { grid-template-columns: 1.25fr .75fr; }
  .hero__art { width: min(100%, 420px); }
}

/* ==========================================================================
   7. Najbliższa akcja (karta)
   ========================================================================== */
.action { display: grid; overflow: hidden; border: 2px solid var(--ink); border-radius: var(--radius-lg); background: #fff; }
.action__date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.5rem 2rem; background: var(--red); color: #fff; text-align: center; line-height: 1;
}
.action__day { font-size: clamp(4rem, 12vw, 5.5rem); font-weight: 800; letter-spacing: -.04em; }
.action__month { margin-top: .35rem; font-size: 1.6rem; font-weight: 800; text-transform: lowercase; }
.action__year { margin-top: .4rem; font-size: 1.1rem; opacity: .9; }
.action__body { padding: clamp(1.5rem, 4vw, 2.5rem); }
.action__title { margin-bottom: 1rem; }
.facts { display: grid; gap: 1rem; margin: 0 0 1.25rem; }
.facts > div { display: flex; gap: .85rem; align-items: flex-start; }
.facts .icon { margin-top: .15rem; color: var(--red); }
.facts dt { font-size: .9rem; color: var(--muted); }
.facts dd { margin: 0; font-size: 1.2rem; font-weight: 700; }
.action__info { padding: 1rem 1.25rem; margin-bottom: 1.5rem; background: var(--soft); border-radius: var(--radius); }
.action__info p:last-child { margin: 0; }
.action--empty { padding: clamp(1.5rem, 4vw, 2.5rem); border-style: dashed; border-color: var(--muted); }
.action--empty .btn { margin-top: .5rem; }

@media (min-width: 760px) {
  .action { grid-template-columns: 240px 1fr; }
  .facts { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

/* ==========================================================================
   8. Karty aktualności i placeholdery
   ========================================================================== */
.grid { display: grid; gap: 1.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: border-color .15s; }
.card:hover, .card:focus-within { border-color: var(--red); }
.card__media { display: block; aspect-ratio: 800 / 520; overflow: hidden; background: var(--ph); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { display: flex; flex: 1; flex-direction: column; padding: 1.25rem 1.4rem 1.5rem; }
.card__meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-bottom: .6rem; font-size: .95rem; color: var(--muted); }
.card__cat { font-weight: 800; color: var(--red-dark); }
.card__title { margin-bottom: .5rem; font-size: 1.3rem; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--red); text-decoration: underline; }
.card__excerpt { color: var(--muted); font-size: 1.02rem; }
.card .btn { align-self: flex-start; margin-top: auto; }

.ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; height: 100%; min-height: 160px; background: var(--ph); color: #6b7480; font-size: .95rem; text-align: center;
}
.ph .icon { width: 2.25rem; height: 2.25rem; stroke-width: 1.5; }
.ph--fill { aspect-ratio: 800 / 520; height: auto; }

/* ==========================================================================
   9. Strony wewnętrzne
   ========================================================================== */
.page-hero { padding-block: clamp(2.5rem, 6vw, 4.5rem); background: var(--paper); border-bottom: 1px solid var(--line); }
.page-hero h1 { margin-bottom: .35em; }
.page-hero .lead { margin: 0; }

.two-col { display: grid; gap: 1.75rem; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; } }

.panel { padding: clamp(1.5rem, 3vw, 2.25rem); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.panel--accent { background: var(--red-soft); border-color: transparent; }
.panel--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.panel h3 { margin-bottom: .75rem; }
.panel > :last-child { margin-bottom: 0; }

.price { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .75rem; }
.price strong { font-size: 3rem; line-height: 1; letter-spacing: -.03em; color: var(--red); }

.ticks { margin: 0 0 1em; padding: 0; list-style: none; }
.ticks li { position: relative; padding: .35rem 0 .35rem 2rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .6rem; width: 1.2rem; height: .65rem;
  border-left: 3px solid var(--red); border-bottom: 3px solid var(--red); transform: rotate(-45deg) scale(.85); transform-origin: center;
}
.panel--dark .ticks li::before { border-color: #fff; }

/* Oś czasu – historia */
.timeline { margin: 0; padding: 0 0 0 1.75rem; list-style: none; border-left: 3px solid var(--red); }
.timeline li { position: relative; padding-bottom: 1.75rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: calc(-1.75rem - 9px); top: .45rem; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 4px solid var(--red); }
.timeline__year { display: block; font-size: 1.5rem; font-weight: 800; color: var(--red); line-height: 1.2; }
.timeline p { margin: .15rem 0 0; max-width: 46em; }

/* Kroki – jak zostać klubowiczem */
.steps { display: grid; gap: 1.25rem; margin: 0 0 2rem; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 1.5rem 1.5rem 1.5rem 5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 1.25rem; top: 1.35rem; display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--red); color: #fff; font-size: 1.3rem; font-weight: 800;
}
.steps h3 { margin-bottom: .25rem; font-size: 1.2rem; }
.steps p { margin: 0; color: var(--muted); }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(2, 1fr); } }

/* Trzy kolumny – przygotowanie do oddania krwi */
.cols-3 { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .cols-3 { grid-template-columns: repeat(3, 1fr); } }
.panel__label { display: inline-block; margin-bottom: .75rem; padding: .2rem .8rem; border-radius: 999px; background: var(--red); color: #fff; font-size: .95rem; font-weight: 800; }

/* FAQ – natywny <details>, działa bez JS */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { position: relative; padding: 1.1rem 3rem 1.1rem 0; font-weight: 800; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); font-size: 1.75rem; font-weight: 400; color: var(--red); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 1.1rem; margin: 0; color: var(--muted); }

/* Kafelki kontaktowe */
.tiles { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.tile { padding: 1.75rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.tile__icon { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; margin-bottom: 1rem; border-radius: 50%; background: var(--red-soft); color: var(--red); }
.tile h3 { margin-bottom: .35rem; font-size: 1.1rem; color: var(--muted); font-weight: 700; letter-spacing: 0; }
.tile p { margin: 0; font-size: 1.3rem; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.tile a { color: var(--ink); text-decoration-color: var(--red); }
.tile a:hover { color: var(--red); }
.tile small { display: block; margin-top: .5rem; font-size: .95rem; font-weight: 400; color: var(--muted); }
.map-ph { margin-top: 1.25rem; min-height: 320px; border-radius: var(--radius); }

/* Pasek wezwania do działania */
.cta-band { background: var(--red); color: #fff; }
.cta-band__inner { display: flex; flex-direction: column; gap: 1.5rem; align-items: flex-start; padding-block: clamp(2.5rem, 6vw, 4rem); }
.cta-band h2 { margin: 0 0 .25em; }
.cta-band p { margin: 0; max-width: 36em; }
@media (min-width: 760px) { .cta-band__inner { flex-direction: row; align-items: center; justify-content: space-between; } }

/* ==========================================================================
   10. Aktualności: filtry, paginacja
   ========================================================================== */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 2.25rem; padding: 0; list-style: none; }
.filters a {
  display: inline-flex; align-items: center; min-height: 46px; padding: .4rem 1.2rem;
  border: 2px solid var(--line); border-radius: 999px; color: var(--ink); font-weight: 700; text-decoration: none;
}
.filters a:hover { border-color: var(--ink); }
.filters .is-active a { background: var(--red); border-color: var(--red); color: #fff; }

.pagination { margin-top: 3rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.pagination .page-numbers {
  display: inline-grid; place-items: center; min-width: 48px; min-height: 48px; padding: 0 1rem;
  border: 2px solid var(--line); border-radius: 999px; color: var(--ink); font-weight: 700; text-decoration: none;
}
.pagination a.page-numbers:hover { border-color: var(--ink); }
.pagination .current { background: var(--ink); border-color: var(--ink); color: #fff; }

.empty { padding: 2.5rem; border: 2px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }

/* ==========================================================================
   11. Pojedynczy wpis
   ========================================================================== */
.article-hero { margin-top: clamp(1.25rem, 3vw, 2.5rem); }
.article-hero__media { aspect-ratio: 2 / 1; overflow: hidden; border-radius: var(--radius-lg); background: var(--ph); }
.article-hero__media img, .article-hero__media .ph { width: 100%; height: 100%; object-fit: cover; }
.article { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem); }
.article__back { display: inline-block; margin-bottom: 1.5rem; font-weight: 700; }
.article__meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-bottom: 1rem; color: var(--muted); font-size: 1rem; }
.article__meta a { font-weight: 800; text-decoration: none; }
.article h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1.25rem; }

.content { font-size: 1.1875rem; line-height: 1.75; }
.content > * + * { margin-top: 1.25em; margin-bottom: 0; }
.content h2, .content h3 { margin-top: 2em; }
.content a { text-decoration: underline; }
.content img { border-radius: var(--radius); }
.content blockquote { margin-inline: 0; padding: .25rem 0 .25rem 1.5rem; border-left: 4px solid var(--red); font-size: 1.25rem; font-weight: 700; }
.content figure { margin-inline: 0; }
.content figcaption { margin-top: .5rem; font-size: .95rem; color: var(--muted); }
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { margin-inline: auto; }

.post-nav { display: grid; gap: 1rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.post-nav a { display: block; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 800; text-decoration: none; }
.post-nav a:hover { border-color: var(--red); }
.post-nav small { display: block; font-weight: 400; color: var(--muted); }
@media (min-width: 700px) { .post-nav { grid-template-columns: 1fr 1fr; } .post-nav__next { text-align: right; } }

/* ==========================================================================
   12. Stopka
   ========================================================================== */
.site-footer { background: var(--ink); color: #d9dde2; font-size: 1rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #ffc2cb; }
.footer__grid { display: grid; gap: 2.5rem; padding-block: 3.5rem; }
.footer__brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.footer__brand img { height: 64px; width: auto; padding: 6px; background: #fff; border-radius: 10px; }
.footer__brand strong { color: #fff; font-size: 1.15rem; line-height: 1.2; }
.footer__title { margin-bottom: .75rem; font-size: 1.05rem; color: #fff; }
.footer__list { margin: 0; padding: 0; list-style: none; }
.footer__list li { padding: .25rem 0; }
.footer__bottom { padding-block: 1.25rem; border-top: 1px solid #343b44; font-size: .9rem; color: #aab1ba; }
@media (min-width: 800px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
