/* Aktualności: najnowszy wpis w całości, starsze jako karty w archiwum. Ładowany tylko w aktualnosci.html. */

.news { max-width: 1000px; margin: 0 auto; padding: 56px 24px 88px; color: var(--text); }

.news-meta { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 13px; color: var(--text-dim); }
.news-tag {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  background: var(--blue-lt); color: var(--blue);
}
.news-tag--event { background: var(--red); color: #fff; }

/* Jubileusz: duża liczba jako znak wydarzenia */
.news-feature { margin-bottom: 72px; }
.jubilee {
  display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center;
  background: var(--bg-dark); color: #fff; border-radius: var(--radius-xl);
  padding: 40px 44px; position: relative; overflow: hidden;
}
.jubilee::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 90% at 0% 50%, rgba(212, 43, 32, 0.28) 0%, transparent 60%),
              radial-gradient(ellipse 50% 80% at 100% 0%, rgba(76, 136, 228, 0.22) 0%, transparent 60%);
}
.jubilee > * { position: relative; }
.jubilee-mark { text-align: center; }
.jubilee-num {
  display: block; font-size: clamp(88px, 13vw, 148px); font-weight: 800; line-height: .9; letter-spacing: -0.06em;
  background: linear-gradient(180deg, #fff 30%, #8fb8f5 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.jubilee-years {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: 3px; color: var(--text-inv-dim);
}
.jubilee-years i { display: block; width: 24px; height: 2px; background: var(--red); }
.jubilee .news-meta { color: var(--text-inv-dim); }
.jubilee h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 14px; color: #fff; text-wrap: balance; }
.news-lead { font-size: 17px; line-height: 1.6; color: rgba(255, 255, 255, 0.88); margin: 0; }

.news-body { max-width: 720px; margin: 36px 0 0; font-size: 16px; line-height: 1.75; color: var(--text-mid); }
.news-body p { margin: 0 0 16px; }

.gallery-title { font-size: 20px; font-weight: 700; margin: 40px 0 16px; color: var(--text); }
.news-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.news-gallery a, .news-gallery figure { display: block; margin: 0; aspect-ratio: 4 / 3; border-radius: var(--radius-lg); overflow: hidden; background: var(--border-lt); }
.news-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.news-gallery a:hover img { transform: scale(1.04); }
/* Pierwsze zdjęcie większe, gdy jest ich co najmniej 4 */
.news-gallery > :first-child:nth-last-child(n+4) { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.news-gallery .ph { display: flex; align-items: center; justify-content: center; border: 2px dashed var(--border); background: var(--bg); color: var(--text-dim); font-size: 13px; }

/* Zwykły wpis: zdjęcie obok tekstu, pod spodem opcjonalna specyfikacja */
.news-post { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px 40px; align-items: center; }
.news-post-photo a { display: block; border-radius: var(--radius-xl); overflow: hidden; background: var(--border-lt); }
.news-post-photo img { display: block; width: 100%; height: auto; transition: transform .3s ease; }
.news-post-photo a:hover img { transform: scale(1.03); }
.news-post h2 { font-size: clamp(26px, 2.8vw, 34px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 0; color: var(--text); text-wrap: balance; }
.news-post .news-body { margin: 16px 0 20px; }
.news-post .news-body p:last-child { margin-bottom: 0; }
.news-specs { grid-column: 1 / -1; }
.news-specs .gallery-title { margin-top: 16px; }
.news-specs dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 40px; margin: 0; }
.news-specs dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-lt); font-size: 15px; }
.news-specs dt { color: var(--text-mid); }
.news-specs dd { margin: 0; font-weight: 600; color: var(--text); text-align: right; }
.news-specs-note { margin: 12px 0 0; font-size: 13px; color: var(--text-dim); }
@media (max-width: 768px) {
  .news-post { grid-template-columns: 1fr; margin-bottom: 48px; }
  .news-specs dl { grid-template-columns: 1fr; }
}

/* Archiwum */
.news-archive h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 20px; padding-top: 32px; border-top: 1px solid var(--border); color: var(--text); }
.news-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.news-card { background: var(--surface); border: 1px solid var(--border-lt); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; }
.news-card h3 { font-size: 18px; font-weight: 700; line-height: 1.3; margin: 0 0 10px; color: var(--text); }
.news-card p:not(.news-meta) { font-size: 15px; line-height: 1.6; color: var(--text-mid); margin: 0 0 16px; }
.news-more { margin-top: auto; font-weight: 600; font-size: 14px; color: var(--blue); text-decoration: none; }
.news-more:hover { text-decoration: underline; }

/* Podgląd zdjęcia */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(5, 10, 20, 0.88); }
.lightbox img { display: block; max-width: 94vw; max-height: 92vh; border-radius: var(--radius-lg); }
.lightbox-close {
  position: fixed; top: 16px; right: 16px; width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 30px; line-height: 1; cursor: pointer;
}

@media (max-width: 768px) {
  .news { padding: 32px 16px 64px; }
  .jubilee { grid-template-columns: 1fr; gap: 20px; padding: 28px 22px; text-align: left; }
  .jubilee-mark { text-align: left; }
  .jubilee-years { justify-content: flex-start; }
  .news-gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .news-list { grid-template-columns: 1fr; }
}

/* Jubileusz: zdjęcie z festynu pod przyciemnieniem, liczba i tekst na wierzchu */
.jubilee {
  background:
    linear-gradient(90deg, rgba(13, 27, 46, 0.96) 0%, rgba(13, 27, 46, 0.88) 45%, rgba(13, 27, 46, 0.62) 100%),
    url('img/aktualnosci/35-lecie/02-m.webp') center / cover no-repeat,
    var(--bg-dark);
}
@media (max-width: 768px) {
  .jubilee { background: linear-gradient(180deg, rgba(13, 27, 46, 0.9) 0%, rgba(13, 27, 46, 0.95) 100%), url('img/aktualnosci/35-lecie/02-m.webp') center / cover no-repeat, var(--bg-dark); }
}

/* Duże pierwsze zdjęcie nie dyktuje wysokości rzędów: wypełnia dwa rzędy wyznaczone przez miniatury 4:3 */
.news-gallery > :first-child:nth-last-child(n+4) { position: relative; }
.news-gallery > :first-child:nth-last-child(n+4) img { position: absolute; inset: 0; }
@media (max-width: 768px) {
  .news-gallery > :first-child:nth-last-child(n+4) { aspect-ratio: 4 / 3; grid-row: auto; }
}

/* Jubileusz: "35" wychodzi ponad górną krawędź ramki.
   Tło (zdjęcie + poświaty) przeniesione na pseudo-elementy z zaokrągleniem, sama ramka bez overflow:hidden. */
.news-feature { margin-top: 48px; }
.jubilee { overflow: visible; background: none; isolation: isolate; }
.jubilee::after {
  content: ''; position: absolute; inset: 0; z-index: -2; border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(13, 27, 46, 0.96) 0%, rgba(13, 27, 46, 0.88) 45%, rgba(13, 27, 46, 0.62) 100%),
    url('img/aktualnosci/35-lecie/02-m.webp') center / cover no-repeat,
    var(--bg-dark);
}
.jubilee::before { z-index: -1; border-radius: inherit; }
.jubilee-mark { align-self: start; margin-top: -96px; }
.jubilee-num {
  font-size: clamp(120px, 15vw, 196px);
  filter: drop-shadow(0 14px 28px rgba(13, 27, 46, 0.45));
}
@media (max-width: 768px) {
  .news-feature { margin-top: 40px; }
  .jubilee::after { background: linear-gradient(180deg, rgba(13, 27, 46, 0.9) 0%, rgba(13, 27, 46, 0.95) 100%), url('img/aktualnosci/35-lecie/02-m.webp') center / cover no-repeat, var(--bg-dark); }
  .jubilee-mark { margin-top: -64px; }
  .jubilee-num { font-size: 112px; }
}

/* "35" jak złote balony z festynu: metaliczny gradient, ciemny kontur dla kontrastu na jasnym tle, jeden błysk po wejściu */
.jubilee-num {
  position: relative;
  font-size: clamp(132px, 16vw, 216px);
  background: linear-gradient(170deg, #fff6c9 0%, #f9d55b 22%, #d99a1b 48%, #f7d45e 62%, #fff1b3 74%, #c8860e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1px rgba(122, 76, 0, 0.35);
  filter: drop-shadow(0 2px 0 #8a5a00) drop-shadow(0 16px 26px rgba(13, 27, 46, 0.5));
}
.jubilee-num::after {
  content: '35'; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.95) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 0;
  animation: jubilee-shine 1.6s ease-out .4s 1 both;
}
@keyframes jubilee-shine { to { background-position: 150% 0; } }
@media (prefers-reduced-motion: reduce) { .jubilee-num::after { animation: none; display: none; } }
.jubilee-years { color: #f3d27a; }
.jubilee-years i { background: #f3d27a; }
@media (max-width: 768px) { .jubilee-num { font-size: 120px; } }

/* Poprawka: "35" duże, wyśrodkowane w pionie i wystające równo górą i dołem ramki.
   Ujemne marginesy w gridzie zmniejszają wkład elementu w wysokość rzędu, więc liczba wychodzi poza obrys.
   Padding po bokach, bo złoty gradient (background-clip: text) obcinał ostatnią cyfrę przy ciasnym kerningu. */
.jubilee { grid-template-columns: auto 1fr; gap: 32px; padding: 44px 48px 44px 28px; }
.jubilee-mark { align-self: center; margin: -88px 0; }
.jubilee-num {
  display: block; font-size: clamp(200px, 22vw, 300px); line-height: .8;
  letter-spacing: -0.04em; padding: 0 .1em 0 .04em;
}
.jubilee-num::after { padding: inherit; }
.jubilee-years { display: inline-flex; margin: 0; font-size: 12px; letter-spacing: 2px; }
@media (max-width: 768px) {
  .jubilee { grid-template-columns: 1fr; gap: 12px; padding: 0 22px 28px; }
  .jubilee-mark { align-self: start; margin: -72px 0 0 -6px; }
  .jubilee-num { font-size: 150px; }
  .news-feature { margin-top: 72px; }
}

/* Układ v3: baner niski (meta + tytuł), "35" przypięte do dolnej krawędzi i mocno wychodzące górą.
   Lead pod banerem jako pierwszy, większy akapit. */
.news-body .news-lead { font-size: 19px; line-height: 1.6; color: var(--text); font-weight: 500; }
@media (min-width: 769px) {
  .news-feature { margin-top: 120px; }
  .jubilee { display: block; padding: 40px 48px 40px clamp(330px, 38%, 410px); min-height: 0; }
  .jubilee-mark { position: absolute; left: 12px; bottom: 6px; margin: 0; }
  .jubilee-num { font-size: clamp(280px, 30vw, 350px); line-height: .78; }
  .jubilee h2 { font-size: clamp(28px, 3vw, 38px); }
}
@media (max-width: 768px) {
  .jubilee { padding: 0 22px 26px; }
}

/* Wymiary z pomiaru: szerokość "35" (z paddingiem) = 1,35 x font-size, widoczna wysokość cyfr ok. 0,73 x font-size.
   Kolumna tekstu startuje za liczbą, baner zostaje niski, więc cyfry wychodzą górą o kilkadziesiąt pikseli. */
@media (min-width: 769px) {
  .jubilee { --n: clamp(300px, 26vw, 370px); padding-left: calc(var(--n) * 1.25 + 40px); padding-top: 36px; padding-bottom: 36px; }
  .jubilee-mark { left: 10px; bottom: 20px; }
  .jubilee-num { font-size: var(--n); }
  .jubilee h2 { font-size: clamp(26px, 2.4vw, 32px); margin-bottom: 0; }
}
.news-meta { flex-wrap: wrap; row-gap: 6px; }
.news-meta time { white-space: nowrap; }

/* "35" wystaje jednocześnie z lewej, z góry i z dołu: przesunięte poza lewą krawędź i poniżej dolnej.
   Kolumna tekstu przesuwa się o tyle samo w lewo. */
@media (min-width: 769px) {
  .news-feature { margin-bottom: 104px; }
  .jubilee { padding-left: calc(var(--n) * 1.25 - 16px); }
  .jubilee-mark { left: -56px; bottom: -58px; }
}

/* Wysokość cyfr (~0,73 x --n) musi przewyższać baner o oba wystające kawałki; pod banerem miejsce na dolny wystający fragment */
@media (min-width: 769px) {
  .jubilee { --n: clamp(340px, 30vw, 440px); margin-bottom: calc(var(--n) * 0.16); }
  .news-feature { margin-top: calc(clamp(340px, 30vw, 440px) * 0.32); }
  .jubilee-mark { bottom: calc(var(--n) * -0.12); }
}

/* Konfetti: warstwa między zdjęciem w tle a treścią, przycięta do zaokrąglonej ramki */
.jubilee-confetti { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; border-radius: inherit; pointer-events: none; }

/* Link z hero (#35-lecie): kotwica zatrzymuje się nad wystającym "35", nie pod stałą nawigacją */
.news-feature { scroll-margin-top: calc(96px + clamp(340px, 30vw, 440px) * 0.3); }
@media (max-width: 768px) { .news-feature { scroll-margin-top: 160px; } }
