/* ==========================================================================
   Dzielnica Rodzica — nowa strona główna
   Design tokens
   ========================================================================== */

:root {
  /* Kolory */
  --paper:    #FBFAF7;   /* tło strony */
  --card:     #FFFFFF;
  --ink:      #1A1A1A;   /* tekst główny */
  --muted:    #58595B;   /* metadane, podpisy */
  --enamel:   #005E6D;   /* emaliowany błękit — tabliczki, linki, nagłówki sekcji */
  --enamel-d: #00464F;
  --amber:    #808E49;   /* akcent — brwi sekcji, podkreślenia */
  --menu:     #005E6D;   /* kolor linków górnego menu (niezależny od koloru tekstu) */
  --head:     #1A1A1A;   /* kolor nagłówków i śródtytułów (niezależny od tekstu) */
  --footer:   #1A1A1A;   /* tło stopki (niezależne od koloru tekstu) */
  --line:     #E3E0D9;   /* włoskowate linie */
  --line-2:   #CFCBC1;

  /* Kadrowanie zdjęć w kartach.
     Szare ramki wtopione w grafiki redakcyjne zostały wycięte z samych plików,
     więc powiększenie nie jest już potrzebne (1 = bez powiększenia). Gdyby
     pojawiły się nowe grafiki z ramką, wystarczy podnieść tę wartość.
     --media-bg to tło kadru widoczne, zanim zdjęcie się wczyta. */
  --img-zoom: 1;
  --media-bg: #ECEAE6;

  /* Typografia */
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body:    "Source Serif 4", Georgia, "Times New Roman", serif;
  --util:    "Archivo", system-ui, -apple-system, sans-serif;

  /* Siatka */
  --max: 1240px;
  --gap: 32px;
  --radius: 3px;
}

/* ==========================================================================
   Reset / baza
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  font-optical-sizing: auto;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
  color: var(--head);
}

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: 20px; }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--enamel); color: #fff; padding: 10px 16px; z-index: 100;
  font-family: var(--util); font-size: 14px;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* ==========================================================================
   Tabliczka emaliowana — element sygnaturowy
   Motyw „dzielnicy": granatowa emalia jak warszawskie tabliczki z nazwą ulicy
   ========================================================================== */

.plate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--enamel);
  color: #fff;
  font-family: var(--util);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35),
              inset 0 0 0 3px var(--enamel);
}

.plate--amber { background: var(--amber); color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.2), inset 0 0 0 3px var(--amber); }

/* ==========================================================================
   Nagłówek
   ========================================================================== */

.topbar {
  background: var(--enamel);
  color: #fff;
  font-family: var(--util);
  font-size: 13px;
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 38px; gap: 16px;
}
.topbar a { opacity: .9; }
.topbar a:hover { opacity: 1; text-decoration: underline; }
.topbar nav { display: flex; gap: 18px; flex-wrap: wrap; }

.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 50;
}
.masthead .wrap {
  display: flex; align-items: center; gap: 28px;
  min-height: 76px;
}
.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand__logo { height: 46px; width: auto; display: block; }
.brand__name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.04em;
}
.brand__claim {
  font-family: var(--util); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}

.mainnav { margin-left: auto; }
.mainnav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.mainnav a {
  font-family: var(--util); font-size: 15px; font-weight: 600;
  padding: 6px 0; display: inline-block; position: relative;
  color: var(--menu);
}
.mainnav a:hover, .mainnav a[aria-current] { color: var(--enamel-d); }
.mainnav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: var(--amber); transform: scaleX(0);
  transform-origin: left; transition: transform .18s ease;
}
.mainnav a:hover::after, .mainnav a[aria-current]::after { transform: scaleX(1); }

.search-btn {
  font-family: var(--util); font-size: 14px; font-weight: 600;
  border: 1px solid var(--line-2); background: transparent;
  padding: 8px 14px; border-radius: var(--radius); cursor: pointer;
  color: var(--ink);
}
.search-btn:hover { border-color: var(--enamel); color: var(--enamel); }

.burger { display: none; }

/* ==========================================================================
   Sekcje
   ========================================================================== */

section { margin-block: 56px; }

.sec-head {
  display: flex; align-items: baseline; gap: 16px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px; margin-bottom: 28px;
}
.sec-head h2 { font-size: 26px; }
.sec-head .more {
  margin-left: auto; font-family: var(--util); font-size: 14px;
  font-weight: 600; color: var(--enamel);
}
.sec-head .more:hover { text-decoration: underline; }

/* ==========================================================================
   Hero — 1 tekst wiodący + 2 boczne
   ========================================================================== */

.hero { margin-top: 40px; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: var(--gap);
}
.hero__side { display: grid; gap: 24px; align-content: start; }

.lead__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--media-bg); }
.lead__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--img-zoom)); }
.lead__plate { position: absolute; left: 14px; bottom: 14px; }
.lead h1 { font-size: clamp(30px, 3.4vw, 46px); margin: 18px 0 12px; }
.lead p { margin: 0 0 14px; color: #2A2F38; font-size: 19px; }

.side-item { display: grid; grid-template-columns: 104px 1fr; gap: 16px; }
/* Wpis bez zdjęcia wyróżniającego — tekst zajmuje całą szerokość, bez pustej kolumny. */
.side-item--noimg { grid-template-columns: 1fr; }
/* Tylko odnośnik ze zdjęciem (bezpośredni potomek) przycina kadr — nie ten z tytułem. */
.side-item > a { display: block; overflow: hidden; }
.side-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--media-bg); transform: scale(var(--img-zoom)); }
.side-item h3 { font-size: 18px; margin-bottom: 6px; }

.meta {
  font-family: var(--util); font-size: 12.5px; color: var(--muted);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.meta .cat { color: var(--enamel); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); }

a.card-link h1:hover, a.card-link h2:hover, a.card-link h3:hover { color: var(--enamel); }

/* ==========================================================================
   Kwartały — nawigacja po wieku dziecka (element sygnaturowy)
   ========================================================================== */

.quarters { margin-block: 48px; }
.quarters__rail {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.quarter {
  display: block;
  background: var(--enamel);
  color: #fff;
  padding: 16px 14px;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), inset 0 0 0 4px var(--enamel);
  transition: background .18s ease, transform .18s ease;
}
.quarter:hover { background: var(--enamel-d); transform: translateY(-2px); }
.quarter__age {
  font-family: var(--util); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; opacity: .75; display: block; margin-bottom: 4px;
}
.quarter__name { font-family: var(--display); font-weight: 700; font-size: 17px; }

.quarters__note {
  font-family: var(--util); font-size: 13px; color: var(--muted); margin-top: 12px;
}

/* ==========================================================================
   Układ dwukolumnowy: treść + sidebar
   ========================================================================== */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  align-items: start;
}

/* Siatka kart */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px 32px;
}
.card__media { aspect-ratio: 3 / 2; overflow: hidden; background: var(--media-bg); margin-bottom: 14px; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--img-zoom)); transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(calc(var(--img-zoom) * 1.03)); }
.card h3 { font-size: 21px; margin-bottom: 8px; }
.card p { margin: 0 0 10px; font-size: 16.5px; color: #333944; }

/* Lista pozioma (sekcja zdrowie) */
.rows { display: grid; gap: 22px; }
.row {
  display: grid; grid-template-columns: 160px 1fr; gap: 20px;
  padding-bottom: 22px; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row > a { display: block; overflow: hidden; }
.row img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--media-bg); transform: scale(var(--img-zoom)); }
.row h3 { font-size: 19px; margin-bottom: 6px; }

/* ==========================================================================
   Miejsca reklamowe
   ========================================================================== */

.ad {
  margin-block: 40px;
  text-align: center;
}
.ad__label {
  font-family: var(--util); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.ad__slot {
  border: 1px dashed var(--line-2);
  background: #F4F2ED;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--util); font-size: 12px; color: var(--muted);
  border-radius: var(--radius);
}
/* Zarezerwowana wysokość = zero CLS. Nie usuwaj min-height. */
.ad--billboard .ad__slot { min-height: 250px; }
.ad--infeed   .ad__slot { min-height: 250px; }
.ad--rect     .ad__slot { min-height: 600px; }
.ad--multi    .ad__slot { min-height: 400px; }

@media (max-width: 900px) {
  .ad--billboard .ad__slot { min-height: 280px; }
  .ad--rect     .ad__slot { min-height: 280px; }
}

/* In-feed: reklama wpięta w siatkę kart, ale wyraźnie oddzielona */
.grid .ad--infeed { grid-column: 1 / -1; margin-block: 8px; }

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar { display: grid; gap: 36px; }
.sidebar__sticky { position: sticky; top: 96px; }

.widget h3 {
  font-family: var(--util); font-size: 13px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  padding-bottom: 8px; border-bottom: 2px solid var(--ink); margin-bottom: 16px;
}

.newsletter {
  background: var(--enamel); color: #fff; padding: 24px;
  border-radius: var(--radius);
}
.newsletter h3 { border-color: rgba(255,255,255,.35); color: #fff; }
.newsletter p { font-size: 15.5px; margin: 0 0 16px; }
.newsletter input {
  width: 100%; padding: 11px 12px; border: 0; border-radius: var(--radius);
  font-family: var(--util); font-size: 15px; margin-bottom: 10px;
}
.newsletter button {
  width: 100%; padding: 11px; border: 0; border-radius: var(--radius);
  background: var(--amber); color: var(--ink);
  font-family: var(--util); font-weight: 700; font-size: 15px; cursor: pointer;
}
.newsletter button:hover { filter: brightness(1.06); }
.newsletter small { display: block; margin-top: 10px; font-size: 12px; opacity: .8; font-family: var(--util); }

/* Formularz newslettera */
.nl-form { margin: 0; }
.nl-field { display: flex; gap: 8px; }
.nl-field .nl-email { flex: 1; margin-bottom: 0; }
.nl-field .nl-btn {
  width: auto; flex: none; padding: 11px 16px; border: 0; border-radius: var(--radius);
  background: var(--amber); color: var(--ink);
  font-family: var(--util); font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
}
.nl-field .nl-btn:hover { filter: brightness(1.06); }
.nl-field .nl-btn:disabled { opacity: .6; cursor: default; }
.nl-consent {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 12px;
  font-family: var(--util); font-size: 12px; line-height: 1.4; opacity: .92;
}
.nl-consent input { width: auto; margin: 2px 0 0; flex: none; }
.nl-consent a { color: #fff; text-decoration: underline; }
.nl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.nl-status { min-height: 1em; margin: 10px 0 0; font-family: var(--util); font-size: 13px; font-weight: 600; }

/* Karta Facebooka (lekka — bez SDK, bez cookies) */
.fb-card { padding: 0; overflow: hidden; }
.fb-card__link {
  display: flex; gap: 14px; align-items: center; padding: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); transition: border-color .15s ease, transform .15s ease;
}
.fb-card__link:hover { border-color: #1877F2; transform: translateY(-1px); }
.fb-card__icon {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: #1877F2; color: #fff;
}
.fb-card__text { display: flex; flex-direction: column; gap: 3px; }
.fb-card__text strong { font-family: var(--display); font-size: 16px; line-height: 1.2; }
.fb-card__desc { font-family: var(--util); font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.fb-card__cta { font-family: var(--util); font-size: 13px; font-weight: 700; color: #1877F2; margin-top: 3px; }

/* Kafel „Zaufana redakcja" (E-E-A-T) */
.trust {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; position: relative;
}
.trust__badge {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--enamel); color: #fff; margin-bottom: 10px;
}
.trust h3 { border: 0; margin: 0 0 6px; padding: 0; }
.trust p { font-family: var(--util); font-size: 13.5px; line-height: 1.5; color: var(--muted); margin: 0 0 14px; }
.trust p strong { color: var(--ink); }
.trust__avatars { display: flex; margin-bottom: 14px; }
.trust__avatar {
  width: 40px; height: 40px; border-radius: 50%; margin-left: -10px;
  display: grid; place-items: center; color: #fff; border: 2px solid var(--card);
  font-family: var(--util); font-weight: 700; font-size: 14px; letter-spacing: .02em;
}
.trust__avatar:first-child { margin-left: 0; }
.trust__more { font-family: var(--util); font-size: 13px; font-weight: 700; color: var(--enamel); }
.trust__more:hover { text-decoration: underline; }

.popular { list-style: none; margin: 0; padding: 0; counter-reset: p; }
.popular li {
  counter-increment: p;
  display: grid; grid-template-columns: 30px 1fr; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.popular li:last-child { border-bottom: 0; }
.popular li::before {
  content: counter(p);
  font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--amber);
}
.popular h4 { font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.3; margin: 0; }
.popular a:hover h4 { color: var(--enamel); }

.tools { display: grid; gap: 10px; }
.tool {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--radius);
  font-family: var(--util); font-weight: 600; font-size: 15px;
}
.tool:hover { border-color: var(--enamel); color: var(--enamel); }
.tool span { color: var(--amber); font-size: 18px; }

/* ==========================================================================
   Blok partnerski — zawsze oznaczony
   ========================================================================== */

.partner {
  border: 1px solid var(--line-2);
  border-left: 4px solid var(--amber);
  padding: 22px 24px;
  background: var(--card);
  display: grid; grid-template-columns: 120px 1fr; gap: 22px; align-items: center;
}
.partner__label {
  font-family: var(--util); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.partner h3 { font-size: 20px; margin-bottom: 8px; }
.partner p { margin: 0; font-size: 16px; }

/* ==========================================================================
   Stopka
   ========================================================================== */

.footer {
  margin-top: 72px;
  background: var(--footer); color: #E8E6E1;
  padding-block: 48px 28px;
}
.footer a { color: #E8E6E1; }
.footer a:hover { color: var(--amber); }
.footer__cols {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,.14);
}
.footer h4 {
  font-family: var(--util); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; margin-bottom: 14px; color: #fff;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer li { font-family: var(--util); font-size: 15px; }
.footer p { font-size: 15.5px; color: #B9B6B0; margin: 0 0 14px; }
.footer__bottom {
  padding-top: 22px; display: flex; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; font-family: var(--util); font-size: 13px; color: #9C9992;
}

/* ==========================================================================
   Responsywność
   ========================================================================== */

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; gap: 56px; }
  .sidebar { grid-template-columns: repeat(2, 1fr); align-items: start; }
  .sidebar__sticky { position: static; }
  .quarters__rail { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 780px) {
  body { font-size: 17px; }
  .masthead .wrap { min-height: 62px; gap: 12px; }
  .mainnav { display: none; }
  .burger {
    display: inline-flex; margin-left: auto; background: none; border: 1px solid var(--line-2);
    border-radius: var(--radius); padding: 9px 12px; font-family: var(--util);
    font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink);
  }
  .search-btn { display: none; }
  .topbar nav { display: none; }
  .hero__grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; gap: 32px; }
  .sidebar { grid-template-columns: 1fr; }
  .row { grid-template-columns: 108px 1fr; gap: 14px; }
  .partner { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: 1fr 1fr; gap: 28px; }
  section { margin-block: 44px; }
}

@media (max-width: 480px) {
  .quarters__rail { grid-template-columns: repeat(2, 1fr); }
  .footer__cols { grid-template-columns: 1fr; }
}

/* Kotwica reklamowa na mobile — miejsce zarezerwowane, żeby nie zasłaniała treści */
.anchor-ad { display: none; }
@media (max-width: 780px) {
  .anchor-ad {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: #F4F2ED; border-top: 1px solid var(--line-2);
    text-align: center; padding: 4px 0 6px;
  }
  .anchor-ad .ad__slot { min-height: 50px; border: 0; background: transparent; }
  body { padding-bottom: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  /* Wyłączamy tylko przybliżenie na hover — bazowe kadrowanie zostaje,
     inaczej wróciłaby szara ramka wtopiona w grafiki. */
  .card:hover .card__media img { transform: scale(var(--img-zoom)); }
}
