/*
Theme Name: Popularny Sygnał
Theme URI: https://fakszkomorki.pl/
Author: AA
Version: 1.0.0
Text Domain: aa-fakszkomorki-popularny
*/
/* ============================================================
   Faks z komórki — wspólny arkusz stylów
   Kierunek: terrakota + krem, ciepły prosty landing (2026)
   ============================================================ */

:root {
  /* Paleta — terrakota + krem */
  --cream:          #FBF4E8;
  --cream-2:        #F6E9D6;
  --card:           #FFFDF9;
  --sand:           #F3E4CE;
  --terracotta:     #BE5A38;
  --terracotta-deep:#9C4426;
  --terracotta-soft:#E4A183;
  --clay:           #D98A6A;
  --ink:            #2E211B;
  --muted:          #75594a; /* było #806656: 4,86:1 na kremie, ale 4,4 na dolnej stopce (krem + 6% terakoty) i 4,25 na piasku; teraz ≥5,1 wszędzie — Fable 2026-09-08 */
  --line:           #E9D8C1;

  /* Typografia */
  --font-head: Georgia, "Times New Roman", "Noto Serif", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Skala / detale */
  --maxw: 1120px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(46, 33, 27, .06), 0 2px 8px rgba(46, 33, 27, .05);
  --shadow-md: 0 8px 24px rgba(120, 60, 34, .12), 0 2px 6px rgba(46, 33, 27, .06);
  --shadow-lg: 0 22px 55px rgba(120, 60, 34, .18);
  --transition: 180ms cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Reset uzupełniający ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.25vw, 1.075rem);
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(1200px 520px at 82% -8%, rgba(217, 138, 106, .22), transparent 60%),
    radial-gradient(900px 480px at -10% 8%, rgba(190, 90, 56, .12), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--terracotta-deep); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--terracotta); }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; color: var(--ink); font-weight: 700; }

/* ---------- Dostępność ---------- */
:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 2px;
  border-radius: 4px;
}
.skip-link {
  position: absolute;
  left: 12px; top: -120px; /* było -60px: przy piśmie 20 px (1920) dolny brzeg linku wystawał 1 px u góry kadru — Fable 2026-09-08 */
  background: var(--ink);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--transition);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Układ pomocniczy ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }

/* ============================================================
   NAGŁÓWEK + NAWIGACJA
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 244, 232, .86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.05rem, 1rem + 0.6vw, 1.3rem);
  letter-spacing: .2px;
}
.brand .mark {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--terracotta), var(--terracotta-deep));
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.brand .mark svg { width: 22px; height: 22px; }
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .72rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }

/* Menu — details/summary (działa bez JS) */
.menu { position: relative; }
.site-header nav { position: relative; } /* kotwica listy rozwijanej — lista jest rodzeństwem <details> (poprawka 2026-09-08) */
.menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  font-size: .95rem;
  box-shadow: var(--shadow-sm);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary .bars { position: relative; width: 18px; height: 12px; }
.menu > summary .bars span,
.menu > summary .bars::before,
.menu > summary .bars::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: var(--terracotta-deep);
}
.menu > summary .bars::before { top: 0; }
.menu > summary .bars span { top: 5px; }
.menu > summary .bars::after { bottom: 0; }
.menu[open] > summary { border-color: var(--terracotta-soft); }

.menu-list {
  list-style: none;
  margin: 0; padding: .5rem;
  display: none; /* telefon: ukryta, dopóki <details> nie jest otwarty */
  flex-direction: column;
  gap: .25rem;
}
.menu[open] + .menu-list {
  display: flex;
  position: absolute;
  right: 0; top: calc(100% + 10px);
  min-width: 260px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 120;
}
.menu-list a {
  display: block;
  padding: .6rem .8rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}
.menu-list a:hover,
.menu-list a[aria-current="page"] { background: var(--cream-2); color: var(--terracotta-deep); }
.menu-list a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--terracotta); }

/* Desktop: menu poziome, ukryj przycisk */
@media (min-width: 860px) {
  .menu { display: none; }
  .menu[open] + .menu-list,
  .menu-list {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: .3rem;
    min-width: 0;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .menu-list a { padding: .5rem .85rem; border-radius: var(--radius-pill); }
  .menu-list a[aria-current="page"] { box-shadow: none; background: var(--terracotta-deep); color: #fff; } /* biel na #BE5A38 = 4,46:1 (poniżej AA); na terracotta-deep 6,4:1 — poprawka Fable 2026-09-08 */
}

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: clamp(2rem, 5vw, 4.5rem) 0 clamp(1.5rem, 4vw, 3rem); }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
@media (min-width: 940px) {
  .hero-grid { grid-template-columns: 1.15fr .85fr; }
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--terracotta-deep);
  background: var(--card);
  border: 1px solid var(--line);
  padding: .4rem .8rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--terracotta); }
.hero h1 {
  font-size: clamp(2rem, 1.3rem + 3.6vw, 3.4rem);
  margin: 1rem 0 .6rem;
  letter-spacing: -0.01em;
}
.hero .lead { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.2rem); color: var(--muted); max-width: 60ch; }
.hero-cta { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: .75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.35rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn-primary { background: linear-gradient(150deg, #B85335, var(--terracotta-deep)); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: #fff; }
.btn-ghost { background: var(--card); color: var(--terracotta-deep); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--terracotta-soft); }

/* Ilustracja hero */
.hero-art {
  position: relative;
  background: linear-gradient(160deg, var(--sand), var(--cream-2));
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  padding: clamp(1.2rem, 3vw, 2rem);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.hero-art::after {
  content: "";
  position: absolute; inset: auto -30% -40% auto;
  width: 60%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(190,90,56,.18), transparent 70%);
}
.hero-art svg { width: 100%; height: auto; position: relative; }

/* ============================================================
   SEKCJE
   ============================================================ */
.section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section-head { max-width: 62ch; margin-bottom: clamp(1.2rem, 3vw, 2rem); }
.section-head .kicker { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--terracotta-deep); }
.section-head h2 { font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.2rem); margin: .4rem 0 .3rem; }
.section-head p { color: var(--muted); margin: 0; }

/* Karty */
.card-grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 2.5vw, 1.6rem);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  gap: .6rem;
  text-decoration: none;
  color: inherit;
}
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--terracotta-soft); }
.card .card-ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--cream-2);
  color: var(--terracotta-deep);
  box-shadow: inset 0 0 0 1px var(--line);
}
.card .card-ico svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.2rem; margin: .2rem 0 0; }
.card p { margin: 0; color: var(--muted); font-size: .97rem; }
.card .more { margin-top: auto; font-weight: 700; color: var(--terracotta-deep); font-size: .92rem; display: inline-flex; align-items: center; gap: .35rem; }
a.card:hover .more { gap: .55rem; }

/* Indeks / chipy */
.index-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 3vw, 1.8rem);
  box-shadow: var(--shadow-sm);
}
.index-columns { display: grid; gap: 1.5rem clamp(1.5rem, 4vw, 3rem); grid-template-columns: 1fr; }
@media (min-width: 720px) { .index-columns { grid-template-columns: 1fr 1fr; } }
.index-columns h3 { font-size: 1.05rem; margin: 0 0 .7rem; padding-bottom: .5rem; border-bottom: 2px solid var(--cream-2); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips a {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .85rem;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.chips a:hover { background: var(--terracotta-deep); color: #fff; border-color: var(--terracotta-deep); } /* jw. 6,4:1 */
.stack-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .1rem; }
.stack-links a { display: block; padding: .5rem .2rem; text-decoration: none; color: var(--ink); border-bottom: 1px dashed var(--line); font-weight: 600; }
.stack-links a:hover { color: var(--terracotta-deep); }

/* Placeholder OBRAZ */
figure.ph { margin: 0; }
.ph-box {
  position: relative;
  border: 1px dashed var(--terracotta-soft);
  background:
    repeating-linear-gradient(135deg, rgba(217,138,106,.10) 0 10px, transparent 10px 20px),
    var(--sand);
  border-radius: var(--radius-sm);
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 1.4rem;
  text-align: center;
}
.ph-box svg { width: 44px; height: 44px; color: var(--terracotta-deep); opacity: .8; }
figure.ph figcaption { margin-top: .6rem; font-size: .82rem; color: var(--muted); text-align: center; font-style: italic; }
figure.ph.small .ph-box { min-height: 90px; }

/* ============================================================
   ARTYKUŁ / TREŚĆ (wpis, podstrona)
   ============================================================ */
.page-hero {
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(1rem, 3vw, 1.5rem);
}
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.breadcrumbs a:hover { color: var(--terracotta-deep); }
.breadcrumbs span[aria-current] { color: var(--ink); }
.page-hero h1 { font-size: clamp(1.9rem, 1.3rem + 3vw, 3rem); margin: .3rem 0 0; max-width: 22ch; }
.post-meta { margin-top: .9rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .85rem; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: .35rem; background: var(--cream-2); border: 1px solid var(--line); padding: .3rem .7rem; border-radius: var(--radius-pill); font-weight: 700; color: var(--terracotta-deep); font-size: .78rem; }

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(2rem, 5vw, 4rem);
}
@media (min-width: 960px) {
  .layout.has-aside { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
}
.prose {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 4vw, 2.6rem);
  box-shadow: var(--shadow-sm);
}
.prose > * + * { margin-top: 1.15rem; }
.prose p { margin: 0; }
.prose p:first-of-type { font-size: 1.1em; }
.prose h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); margin-top: 2rem; }
.prose h3 { font-size: 1.2rem; margin-top: 1.6rem; }
.prose strong { color: var(--ink); }
.prose a { font-weight: 600; }
.prose .callout {
  border-left: 4px solid var(--terracotta);
  background: linear-gradient(90deg, rgba(217,138,106,.10), transparent);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.prose .callout p { margin: 0; }
.prose .callout p + p { margin-top: .5rem; }

/* Aside */
.aside { display: grid; gap: 1.2rem; position: sticky; top: 88px; }
.aside .box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow-sm);
}
.aside .box h2, .aside .box h3 { font-size: 1.05rem; margin: 0 0 .8rem; }
.aside .box.accent { background: linear-gradient(155deg, #B0502F, var(--terracotta-deep)); color: #fff; border-color: transparent; } /* jaśniejszy koniec #B0502F zamiast #BE5A38: biel 5,2:1 (było 4,46) — Fable 2026-09-08 */
.aside .box.accent h2, .aside .box.accent h3 { color: #fff; }
.aside .box.accent p { color: #fff; font-size: .95rem; } /* pełna biel (było .9 → 3,9:1 na jaśniejszym końcu) */
.aside .box.accent .btn { margin-top: .9rem; background: #fff; color: var(--terracotta-deep); }
.aside .box.accent .btn:hover { background: var(--cream); }
.fact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.fact-list li { display: flex; gap: .6rem; font-size: .92rem; }
.fact-list .k { color: var(--muted); }
.fact-list .v { margin-left: auto; font-weight: 700; text-align: right; }

/* Paginacja (komponent — serwis nie ma paginacji, ale wg wymagań gotowy do użycia) */
.pagination { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: center; margin-top: 1.5rem; }
.pagination a, .pagination span {
  min-width: 42px; height: 42px; padding: 0 .5rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none; color: var(--ink); font-weight: 700;
}
.pagination a:hover { border-color: var(--terracotta-soft); color: var(--terracotta-deep); }
.pagination .current { background: var(--terracotta-deep); color: #fff; border-color: var(--terracotta-deep); } /* jw. 6,4:1 */
.pagination .disabled { opacity: .45; pointer-events: none; }

/* Nawigacja między wpisami */
.post-nav { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: 1.5rem; }
@media (min-width: 620px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav a {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.2rem; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border-color var(--transition);
}
.post-nav a:hover { transform: translateY(-3px); border-color: var(--terracotta-soft); }
.post-nav .dir { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.post-nav .ttl { font-weight: 700; color: var(--terracotta-deep); }
.post-nav a.next { text-align: right; }

/* ============================================================
   STOPKA
   ============================================================ */
.site-footer {
  margin-top: clamp(2rem, 6vw, 4rem);
  background: linear-gradient(180deg, transparent, rgba(162,67,35,.06)), var(--cream);
  border-top: 1px solid var(--line);
  padding: clamp(2rem, 5vw, 3rem) 0 1.5rem;
}
.footer-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-brand .brand { margin-bottom: .8rem; }
.footer-brand p { color: var(--muted); max-width: 40ch; margin: 0; font-size: .95rem; }
.footer-col h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 .8rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-col a { text-decoration: none; color: var(--ink); font-weight: 600; }
.footer-col a:hover { color: var(--terracotta-deep); }
.rss-link { display: inline-flex; align-items: center; gap: .5rem; }
.rss-link .rss-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--terracotta); color: #fff; }
.rss-link .rss-ico svg { width: 16px; height: 16px; }
.footer-bottom {
  margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: .85rem;
}
.footer-bottom a { color: var(--muted); }

/* Redukcja ruchu */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* =========================================================================
   Skala powyżej 1366 px (przegląd przed K4, Fable 2026-09-08)
   Pismo rośnie płynnie 16 → 20 px, kontener trzyma ~95 px marginesu
   bocznego aż do 1920 px; kolumny boczne w rem, żeby rosły z pismem.
   ========================================================================= */
@media (min-width: 1367px) {
  html { font-size: clamp(1rem, 0.384rem + 0.722vw, 1.25rem); }  /* 16 px przy 1366 → 20 px przy 1920 */
  :root { --maxw: clamp(1120px, 100vw - 190px, 1730px); }
  .layout.has-aside { grid-template-columns: minmax(0, 1fr) 19rem; }
}

/* =========================================================================
   Menu główne POZA <details> (poprawka Fable 2026-09-08, przegląd przed K4)
   Zamknięty <details> nie renderuje swojej zawartości, więc menu trzymane
   w środku było NIEWIDOCZNE na desktopie (przycisk ukryty, lista w zamkniętym
   details). Teraz <details> jest tylko przełącznikiem, a lista jego
   rodzeństwem: telefon — rozwijana przez .menu[open] + lista (bez JS),
   desktop — lista statyczna, przycisk ukryty.
   ========================================================================= */
/* (reguły naniesione w blokach „Menu” i „Desktop” powyżej) */
