/* ==========================================================================
   components.css: komponenty wielokrotnego użytku
   ========================================================================== */

/* ---------- Fale (nawiązanie do postów kampanii) ---------- */
.wave {
  position: absolute; left: 0; right: 0; height: var(--wave-h); pointer-events: none; z-index: 1;
  -webkit-mask: url("../img/decor/wave-top.svg") center / 100% 100% no-repeat;
          mask: url("../img/decor/wave-top.svg") center / 100% 100% no-repeat;
}
.wave--top    { bottom: calc(100% - 1px); }
.wave--bottom { bottom: -1px; }
.wave--white  { background: var(--c-white); }
.wave--tint   { background: var(--c-tint); }
.wave--blue   { background: var(--c-navy); }

/* Przerywana linia biegnąca równolegle do fali (sekcja z pakietem), jak w postach kampanii */
.section--blue::after {
  content: ""; position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none;
  top: calc(var(--wave-h) * -1 + 16px); height: var(--wave-h);
  background: url("../img/decor/wave-dash-white.svg") center / 100% 100% no-repeat;
}

/* Przerywana obwódka wokół zdjęć i kart (motyw trasy) */
.dash-frame { position: relative; }
.dash-frame::after {
  content: ""; position: absolute; inset: -12px; z-index: 0; pointer-events: none;
  border: 2px dashed var(--dash-color, var(--dash-orange)); border-radius: calc(var(--radius-lg) + 12px);
}

/* ---------- Nagłówek sekcji ---------- */
.section-head { max-width: 760px; margin: 0 auto clamp(32px, 4vw, 56px); text-align: center; }
.section-head .eyebrow { justify-content: center; }
.section-head__lead { font-size: var(--fs-lg); color: var(--c-muted); margin-top: .75rem; }
.section-head--light h2, .section-head--light .section-head__lead { color: #fff; }
.section-head--light .section-head__lead { color: rgba(255,255,255,.85); }
.section-head--left { text-align: left; margin-inline: 0; }
.section-head--left .eyebrow { justify-content: flex-start; }
.section-head--row { max-width: none; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; text-align: left; }
.section-head--row .eyebrow { justify-content: flex-start; }
.section-head--row h2 { margin: 0; }

/* ---------- Okruszki ---------- */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: var(--fs-xs); color: rgba(255,255,255,.75); margin-bottom: 28px; }
.breadcrumb li + li::before { content: "/"; margin: 0 .55em; opacity: .6; }
.breadcrumb a { color: #fff; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Chipy z datami ---------- */
.date-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 32px; }
.date-chip {
  display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24); border-radius: var(--radius-pill);
  color: #fff; font-size: var(--fs-sm); line-height: 1.25;
}
.date-chip__day {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--c-orange); font: 800 1.5rem/1 var(--f-display); color: #fff;
}
.date-chip__txt b { display: block; color: #fff; font-size: 1rem; }

/* ---------- Status zapisów ---------- */
.race { display: flex; flex-direction: column; }
.race > .race-card { flex: 1; }
.status {
  align-self: center; display: inline-flex; align-items: center; margin-bottom: 14px; padding: 7px 16px; border-radius: var(--radius-pill);
  font-size: .875rem; font-weight: 700; letter-spacing: .02em; color: #fff; box-shadow: var(--shadow-sm);
}
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #fff; vertical-align: 1px; }
.status--open { background: #12a150; }
.status--open::before { animation: pulse 1.6s infinite; }
.status--soon { background: var(--c-plum); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------- Karta biegu ---------- */
.race-card {
  display: flex; flex-direction: column; background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); scroll-margin-top: 90px;
}
.race-card__media { position: relative; aspect-ratio: 5 / 3; background: var(--c-sky); }
.race-card__media img { width: 100%; height: 100%; object-fit: cover; }
.race-card__body { display: flex; flex-direction: column; flex: 1; padding: clamp(22px, 3vw, 36px); }
.race-card__season { margin: 0 0 .4rem; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--c-plum); }
.race-card__title { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-bottom: 1rem; }
.race-card__title span { display: block; margin-top: .25rem; font-family: var(--f-body); font-size: 1.0625rem; font-weight: 700; color: var(--c-orange); }
.race-card__facts { list-style: none; display: grid; gap: .65rem; margin-bottom: 1.75rem; font-size: var(--fs-sm); }
.race-card__facts li { padding-left: 1.1rem; position: relative; }
.race-card__facts li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--c-blue); }
.race-card__cta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }

/* ---------- Kroki zapisu ---------- */
.steps { list-style: none; counter-reset: step; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.steps > li { min-width: 0; }
.step {
  counter-increment: step; position: relative; padding: 20px 22px 20px 82px;
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s;
}
.step:hover { border-color: #b9d6ee; box-shadow: var(--shadow-sm); }
.step::before {
  content: counter(step); position: absolute; left: 20px; top: 18px;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--c-tint); color: var(--c-navy); font: 800 1.35rem/1 var(--f-display);
}
.step__title { font-size: 1.125rem; margin-bottom: .3rem; }
.step p { font-size: var(--fs-sm); margin: 0; }
.step--highlight { border: 2px dashed var(--c-orange); background: var(--c-orange-soft); }
.step--highlight::before { background: var(--c-orange); color: #fff; }
.step--finish { background: var(--c-navy); border-color: var(--c-navy); }
.step--finish .step__title, .step--finish p { color: #fff; }
.step--finish::before { content: "♥"; background: #fff; color: var(--c-orange); font-size: 1.2rem; }

/* ---------- Wskazówki ---------- */
.tips {
  position: relative; padding: 32px 28px; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--c-plum) 0%, var(--c-plum-dark) 100%); color: #fff;
}
.tips h3 { color: #fff; font-size: 1.5rem; }
.tips ul { list-style: none; display: grid; gap: .8rem; margin: 1.25rem 0 1.75rem; font-size: var(--fs-sm); }
.tips li { padding-left: 1.6rem; position: relative; }
.tips li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: #ffc49d; }
.tips a { color: #fff; }
.tips__burst { position: absolute; top: -40px; right: 4px; width: 84px; height: auto; filter: brightness(1.15); }

/* ---------- Pakiet ---------- */
.pack-grid { list-style: none; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
@media (min-width: 900px) { .pack-grid { grid-template-columns: repeat(3, 1fr); } }
.pack-item { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.pack-item img { aspect-ratio: 4 / 3.4; object-fit: cover; width: 100%; }
.pack-item img.pos-top { object-position: 50% 12%; }
.pack-item img.pos-bag { object-position: 50% 68%; }
.pack-item img.pos-frame { object-position: 50% 30%; }
.pack-item h3 { font-size: 1.1875rem; margin: 18px 20px 6px; }
.pack-item p { margin: 0 20px 22px; font-size: var(--fs-sm); color: var(--c-muted); }

/* ---------- Galeria ---------- */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 28px; }
.filter {
  min-height: 42px; padding: 8px 18px; border: 2px solid var(--c-line); border-radius: var(--radius-pill);
  background: #fff; color: var(--c-ink); font: 600 var(--fs-sm)/1 var(--f-body); cursor: pointer; transition: .2s;
}
.filter:hover { border-color: var(--c-blue); color: var(--c-navy); }
.filter.is-active { background: var(--c-navy); border-color: var(--c-navy); color: #fff; }

.gallery { list-style: none; columns: 2 160px; column-gap: 12px; }
@media (min-width: 700px) { .gallery { columns: 3; column-gap: 16px; } }
@media (min-width: 1024px) { .gallery { columns: 4; } }
.gallery__item { break-inside: avoid; margin-bottom: 12px; }
@media (min-width: 700px) { .gallery__item { margin-bottom: 16px; } }
.gallery__item[hidden] { display: none; }
.gallery__item.is-in { animation: gal-in .45s var(--ease) both; }
@keyframes gal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.filter__count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--c-tint); color: var(--c-navy); font-size: .75rem; }
.filter.is-active .filter__count { background: rgba(255,255,255,.22); color: #fff; }
.gallery__item a { display: block; position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--c-tint); }
.gallery__item img { width: 100%; transition: transform .5s var(--ease); }
.gallery__item a::after {
  content: ""; position: absolute; inset: 0; background: rgba(48,101,181,.0); transition: background-color .3s;
}
.gallery__item a:hover img { transform: scale(1.05); }
.gallery__item a:hover::after { background: rgba(48,101,181,.18); }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(13, 26, 46, .94); color: #fff;
}
.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox::backdrop { background: rgba(13,26,46,.6); }
.lightbox__figure { display: grid; justify-items: center; gap: 12px; padding: 56px 0 24px; max-height: 100vh; }
.lightbox__figure img { max-width: 100%; max-height: calc(100vh - 140px); width: auto; height: auto; border-radius: 8px; }
.lightbox__figure figcaption { font-size: var(--fs-sm); color: rgba(255,255,255,.85); text-align: center; padding: 0 12px; }
.lightbox__close, .lightbox__nav {
  border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; border-radius: 50%;
  width: 48px; height: 48px; font-size: 2rem; line-height: 1; display: grid; place-items: center; justify-self: center;
}
.lightbox__close { position: absolute; top: 14px; right: 14px; }
.lightbox__close:hover, .lightbox__nav:hover { background: var(--c-orange); }
@media (max-width: 600px) {
  .lightbox[open] { grid-template-columns: 1fr; }
  .lightbox__nav { position: absolute; bottom: 18px; }
  .lightbox__nav--prev { left: calc(50% - 60px); }
  .lightbox__nav--next { right: calc(50% - 60px); }
}

/* ---------- Wideo (lekki odtwarzacz YouTube) ---------- */
.video-grid { display: grid; gap: 24px; }
.video-grid--single { display: block; max-width: 900px; margin-inline: auto; }
.video-grid--single .video__frame { min-height: 0 !important; aspect-ratio: 16 / 9 !important; }
@media (min-width: 900px) {
  .video-grid { grid-template-columns: 2fr 1fr; grid-template-rows: auto auto; }
  .video--main { grid-row: span 2; }
  .video--main .video__frame { flex: 1 1 auto; aspect-ratio: auto; min-height: 340px; }
}
.video { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.video__frame {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; cursor: pointer;
  background: #0d1a2e; overflow: hidden;
}
.video__frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), opacity .3s; }
.video__frame:hover img { transform: scale(1.04); }
.video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__play {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px;
  border-radius: 50%; background: var(--c-orange); box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .2s var(--ease);
}
.video__play::after { content: ""; position: absolute; left: 31px; top: 24px; border-style: solid; border-width: 14px 0 14px 22px; border-color: transparent transparent transparent #fff; }
.video__frame:hover .video__play { transform: scale(1.08); }
.video figcaption { padding: 18px 22px 22px; }
.video figcaption h3 { font-size: 1.1875rem; margin-bottom: .3rem; }
.video figcaption p { font-size: var(--fs-sm); color: var(--c-muted); margin: 0; }
.video--main figcaption h3 { font-size: 1.5rem; }
.video.is-placeholder .video__frame { cursor: default; }
.video.is-placeholder .video__frame img { opacity: .55; filter: grayscale(.3); }
.video.is-placeholder .video__play { display: none; }
.video.is-placeholder .video__frame::after {
  content: "Film wkrótce"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 8px 18px; border-radius: var(--radius-pill); background: rgba(13,26,46,.75); color: #fff; font-weight: 700; font-size: var(--fs-sm);
}

/* ---------- FAQ (akordeon) ---------- */
.accordion { display: grid; gap: 12px; }
.qa { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s; }
.qa[open] { border-color: #b9d6ee; box-shadow: var(--shadow-sm); }
.qa summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; cursor: pointer;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary h3 { margin: 0; font-size: 1.125rem; }
.qa summary::after {
  content: "+"; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--c-tint); color: var(--c-navy); font: 700 1.3rem/1 var(--f-body); transition: transform .25s var(--ease), background-color .2s;
}
.qa[open] summary::after { transform: rotate(45deg); background: var(--c-orange); color: #fff; }
.qa__a { padding: 0 22px 20px; font-size: var(--fs-sm); }

/* ---------- Kontakt w FAQ ---------- */
.contact-cards { list-style: none; display: grid; gap: 12px; margin-top: 1.25rem; }
.contact-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px 14px 14px;
  background: #fff; border: 2px solid var(--c-line); border-radius: var(--radius);
  color: var(--c-ink); font: 700 1.125rem/1.25 var(--f-body); text-decoration: none;
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.contact-card small { display: block; margin-bottom: 2px; font-size: var(--fs-xs); font-weight: 600; color: var(--c-muted); }
.contact-card:hover { border-color: var(--c-orange); box-shadow: var(--shadow-sm); transform: translateY(-2px); color: var(--c-navy); }
.contact-card__icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--c-orange); }
.contact-card__icon svg { width: 22px; height: 22px; fill: #fff; }

/* ---------- Archiwum ---------- */
.archive-list { list-style: none; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.archive-list a {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 18px 20px;
  background: #fff; border-radius: var(--radius); border: 2px dashed var(--dash-orange);
  color: var(--c-ink); text-decoration: none; font-weight: 600; line-height: 1.4; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.archive-list a:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--c-orange); color: var(--c-navy); }
.archive-list time { font-size: var(--fs-xs); font-weight: 700; color: var(--c-muted); }

/* ---------- Drobne ---------- */
.note { max-width: 860px; margin: 32px auto 0; font-size: var(--fs-sm); color: var(--c-muted); text-align: center; }
.callout { padding: 16px 20px; border-radius: var(--radius); background: #fff; border: 2px dashed rgba(31, 149, 210, .6); font-size: var(--fs-sm); }

/* Wyróżnienie liczby miejsc w karcie półmaratonu */
.race-card__alert { margin: -0.75rem 0 1.5rem; padding: .7rem 1rem; border: 2px dashed var(--c-orange); border-radius: 14px; background: var(--c-orange-soft); color: var(--c-ink); font-size: var(--fs-sm); }
.race-card__alert b { color: var(--c-orange-dark); }

/* Strony fotorelacji */
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.pager[hidden] { display: none; }
.pager__pages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pager__btn {
  min-width: 44px; height: 44px; padding: 0 12px; border: 2px solid var(--c-line); border-radius: 14px;
  background: #fff; color: var(--c-ink); font: 700 1rem/1 var(--f-display); cursor: pointer;
  transition: transform .2s var(--ease), background .2s, border-color .2s, color .2s;
}
.pager__btn:hover:not(:disabled) { border-color: var(--c-navy); color: var(--c-navy); transform: translateY(-2px); }
.pager__btn[aria-current="page"] { background: var(--c-navy); border-color: var(--c-navy); color: #fff; box-shadow: 0 8px 18px rgba(48,101,181,.3); }
.pager__btn--arrow { font-size: 1.5rem; border-style: dashed; }
.pager__btn:disabled { opacity: .35; cursor: default; }
.pager__btn:focus-visible { outline: 3px solid var(--c-orange); outline-offset: 2px; }
.pager__gap { padding: 0 4px; color: var(--c-muted); font-weight: 700; }

/* Nowość 2027 r.: Pasta Party na tle fioletowo-pomarańczowym */
.pasta {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 240px; align-items: center; gap: 24px;
  max-width: 920px; margin: 0 auto 44px; padding: 36px 40px; border-radius: 28px; color: #fff;
  background: linear-gradient(120deg, #5b1a8c 0%, var(--c-plum) 48%, var(--c-orange) 100%);
  box-shadow: 0 22px 44px rgba(10,30,70,.35);
}
.pasta__main { position: static; }
.pasta__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 8px; font-size: var(--fs-sm); font-weight: 600; color: rgba(255,255,255,.88); }
.pasta__new {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px;
  background: #ffd23f; color: #4a1070; font: 800 .875rem/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase;
}
.pasta__new::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-orange); }
.section--blue .pasta__title, .pasta__title { margin: 0; font: 800 clamp(2.5rem, 1.9rem + 2.8vw, 4rem)/.95 var(--f-display); color: #fff; }
.pasta__title span { color: #ffd23f; }
.pasta__lead { max-width: 32em; margin: 14px 0 0; font-size: 1.0625rem; line-height: 1.55; color: rgba(255,255,255,.94); }
.pasta__art { display: grid; place-items: center; }
.pasta__badge { position: relative; width: 220px; aspect-ratio: 1; display: grid; place-items: center; }
.pasta__ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: pasta-spin 24s linear infinite; }
@keyframes pasta-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pasta__ring { animation: none; } }
.pasta__ring text { font: 800 15px var(--f-display); letter-spacing: 1px; fill: #fff; }
.pasta__photo { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 12px 26px rgba(40,0,40,.4); }
@media (max-width: 860px) {
  .pasta { grid-template-columns: 1fr; padding: 28px 22px; gap: 8px; }
    .pasta__art { order: -1; justify-self: start; }
  .pasta__badge { width: 150px; }
  .pasta__photo { width: 110px; height: 110px; }
}

/* Fotorelacja w układzie „bento” (włączany przez gallery.js) */
.gallery.is-bento { columns: auto; display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; grid-auto-flow: dense; gap: 10px; }
@media (min-width: 700px) { .gallery.is-bento { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 180px; gap: 14px; } }
@media (min-width: 1024px) { .gallery.is-bento { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 16px; } }
.gallery.is-bento .gallery__item { margin: 0; min-width: 0; }
.gallery.is-bento .gallery__item a { height: 100%; }
.gallery.is-bento .gallery__item img { height: 100%; object-fit: cover; }
.gallery.is-bento .gallery__item[data-span="big"] { grid-column: span 2; grid-row: span 2; }
.gallery.is-bento .gallery__item[data-span="tall"] { grid-row: span 2; }
.gallery.is-bento .gallery__item[data-span="wide"] { grid-column: span 2; }
.gallery.is-bento .gallery__item.is-portrait:not([data-span="tall"]) img { object-position: 50% 28%; }
