/*
 * Baza — wspolny arkusz stron artykulowych / programowych.
 *
 * JEDNO ZRODLO PRAWDY dla ukladu tresc + sidebar (jak /egzamin-osmoklasisty-2027).
 * Nowa strona nie kopiuje juz calego <style> — wystarczy:
 *   <link rel="stylesheet" href="/assets/article.css?v=1">
 *   <link rel="stylesheet" href="/assets/public-theme.css?v=..."> (nadpisania jasnego motywu)
 * a sidebar z pobieraniem renderuje /assets/app-download.js z placeholdera.
 *
 * Sekcja "komponenty tresci" na dole (.key-list, .example-box, .def-grid,
 * .compare-table, .topic-pills) sluzy do pisania merytoryki bez inline CSS.
 */

:root {
  --bg: #0a0e17;
  --surface: #111827;
  --surface2: #1a2236;
  --border: #1e293b;
  --border-bright: #2d3f5e;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --accent: #00d4aa;
  --accent-glow: rgba(0, 212, 170, 0.25);
  --warn: #fbbf24;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  background: radial-gradient(1200px 500px at 50% -20%, #113344 0%, rgba(17, 51, 68, 0) 65%), var(--bg);
  color: var(--text);
  font-family: "Outfit", sans-serif;
  min-height: 100vh;
}

.wrap { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 118px 20px 56px; }
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}
.page-main { display: grid; gap: 16px; min-width: 0; }

.hero {
  border: 1px solid var(--border-bright);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.9), rgba(17, 24, 39, 0.65));
  padding: 26px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  top: -220px;
  right: -120px;
  background: radial-gradient(circle, var(--accent-glow), rgba(0, 212, 170, 0));
  pointer-events: none;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  border: 1px solid rgba(0, 212, 170, 0.45);
  background: rgba(0, 212, 170, 0.12);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
h1 { margin: 14px 0 8px; font-size: clamp(30px, 5.4vw, 50px); line-height: 1.05; letter-spacing: -1px; }
.lead { margin: 0; color: var(--text-dim); max-width: 780px; font-size: 18px; line-height: 1.6; }

.duration-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.duration-card { border: 1px solid var(--border-bright); background: rgba(10, 14, 23, 0.82); border-radius: 14px; padding: 16px 14px; text-align: center; }
.duration-value {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(20px, 4.2vw, 30px);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 14px var(--accent-glow);
}
.duration-label { margin-top: 8px; font-size: 12px; text-transform: uppercase; color: var(--text-dim); letter-spacing: .08em; font-weight: 700; }

.cards { margin-top: 0; display: grid; grid-template-columns: 1fr; gap: 14px; }
.card { border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 16px; min-width: 0; }
.card h2 { margin: 0 0 12px; font-size: 21px; letter-spacing: -.3px; }
.card h3 { margin: 18px 0 8px; font-size: 17px; }
.card p { margin: 0 0 10px; color: var(--text-dim); line-height: 1.6; }
.card p:last-child { margin-bottom: 0; }
.card strong { color: var(--text); }
.card a { color: var(--accent); }

.schedule-wrap { overflow-x: auto; margin-top: 4px; border: 1px solid var(--border-bright); border-radius: 12px; }
table.schedule { width: 100%; border-collapse: collapse; min-width: 480px; font-size: 13.5px; }
table.schedule th, table.schedule td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.schedule th { background: var(--surface2); color: var(--text-dim); text-transform: uppercase; font-size: 10.5px; letter-spacing: .06em; }
table.schedule tr:last-child td { border-bottom: none; }
table.schedule td.date-cell { font-family: "JetBrains Mono", monospace; color: var(--accent); white-space: nowrap; font-weight: 700; }

.timeline { display: grid; gap: 10px; }
.timeline-item { border: 1px solid var(--border-bright); background: var(--surface2); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.timeline-item .date { font-family: "JetBrains Mono", monospace; color: var(--accent); font-weight: 700; font-size: 13px; }
.timeline-item .name { font-size: 15px; font-weight: 700; }
.timeline-item .sub { color: var(--text-dim); font-size: 13px; }

.source { margin-top: 12px; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.source a { color: var(--accent); }

.seo-block { border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 16px; }
.seo-block h2 { margin: 0 0 10px; font-size: 22px; }
.seo-block p { margin: 0 0 10px; color: var(--text-dim); line-height: 1.6; }

.faq-item { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.faq-item:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.faq-item h3 { margin: 0 0 6px; font-size: 18px; }
.faq-item p { margin: 0; color: var(--text-dim); }

.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.related-card {
  display: block; text-decoration: none; color: inherit; padding: 14px; border-radius: 12px;
  border: 1px solid var(--border-bright); background: rgba(15, 23, 42, 0.65);
  transition: border-color .2s ease, transform .2s ease;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.related-card h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.2; color: var(--text); }
.related-card p { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.35; }

/* --- sticky app promo (sidebar) --- */
.page-side { display: flex; }
.page-side .app-download-block {
  margin-top: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 112px;
  padding: 24px;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(0, 212, 170, 0.18), transparent 38%),
    radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.14), transparent 34%),
    linear-gradient(145deg, #07111d 0%, #0e1728 52%, #071420 100%);
  border: 1px solid rgba(82, 102, 134, 0.45);
  box-shadow: 0 24px 50px rgba(1, 9, 21, 0.34);
}
.page-side .app-download-block::after {
  content: "";
  position: absolute;
  inset: auto -18% 8% 32%;
  height: 180px;
  border: 1px solid rgba(0, 212, 170, 0.18);
  border-radius: 999px;
  transform: rotate(-12deg);
  pointer-events: none;
}
.page-side .app-download-block h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.05; margin: 0 0 10px; }
.page-side .app-download-block p { margin: 0; max-width: 34ch; font-size: 16px; color: #d7e5f4; line-height: 1.5; }
.app-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.app-point {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 999px;
  border: 1px solid rgba(24, 243, 197, .22); background: rgba(255, 255, 255, .04);
  color: #e9f8f5; font-size: 13px; font-weight: 700; letter-spacing: .01em;
}
.app-point::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: #18f3c5; box-shadow: 0 0 12px rgba(24, 243, 197, .35); flex: 0 0 auto; }
.app-benefits { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0; }
.app-benefit { display: flex; align-items: flex-start; gap: 12px; border: 1px solid rgba(148, 163, 184, .2); border-radius: 16px; background: rgba(255, 255, 255, 0.045); padding: 14px 15px; backdrop-filter: blur(8px); }
.app-benefit strong { display: block; color: #ffffff; font-size: 15px; margin-bottom: 4px; line-height: 1.25; }
.app-benefit span { color: #c5d4e5; font-size: 13.5px; line-height: 1.45; }
.app-benefit-icon {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0, 212, 170, 0.14); border: 1px solid rgba(0, 212, 170, 0.24); color: #6ff0cc; font-size: 16px; margin-top: 1px;
}
.app-download-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px;
  background: linear-gradient(135deg, #18f3c5, #00d4aa); color: #041418; border: 1px solid rgba(24, 243, 197, .75);
  text-decoration: none; font-weight: 800; font-size: 16px; padding: 15px 20px; width: 100%;
  margin-top: 16px;
  box-shadow: 0 16px 28px rgba(0, 212, 170, .18);
}
.app-footnote { margin-top: 10px; color: #8fa8bb; font-size: 12.5px; line-height: 1.5; }

/* =========================================================
   Komponenty tresci (do pisania merytoryki bez inline CSS)
   ========================================================= */

/* Lista "co musisz umiec" z zielonym ptaszkiem */
.key-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.key-list li { position: relative; padding-left: 30px; color: var(--text-dim); line-height: 1.55; }
.key-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #041418;
  background: linear-gradient(135deg, #18f3c5, #00d4aa);
}
.key-list li strong { color: var(--text); }

/* Zwykla lista punktowana w karcie */
.card ul:not(.key-list):not(.app-benefits),
.seo-block ul { margin: 0 0 10px; padding-left: 20px; color: var(--text-dim); line-height: 1.6; }
.card ul:not(.key-list):not(.app-benefits) li,
.seo-block ul li { margin-bottom: 6px; }
.card ol { margin: 0 0 10px; padding-left: 20px; color: var(--text-dim); line-height: 1.6; }
.card ol li { margin-bottom: 6px; }

/* Ramka z przykladem / obliczeniem (neutralno-teal) */
.example-box {
  border: 1px solid rgba(0, 212, 170, 0.3);
  background: rgba(0, 212, 170, 0.07);
  border-radius: 12px; padding: 14px 15px; margin: 12px 0;
}
.example-box .eb-label {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px;
}
.example-box p { margin: 0 0 8px; color: var(--text); line-height: 1.6; }
.example-box p:last-child { margin-bottom: 0; }
.example-box code, .card code, .seo-block code {
  font-family: "JetBrains Mono", monospace; font-size: 0.92em;
  background: rgba(148, 163, 184, 0.16); padding: 1px 6px; border-radius: 6px; color: #e9f8f5;
}

/* Ramka "warto wiedziec" (cieply akcent) */
.summary-box {
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  border-radius: 12px; padding: 14px; margin: 12px 0;
}
.summary-box p { margin: 0 0 8px; color: var(--text-dim); line-height: 1.6; }
.summary-box p:last-child { margin-bottom: 0; }
.summary-box strong { color: var(--warn); }

/* Siatka definicji / pojec (pojecie -> opis) */
.def-grid { display: grid; gap: 10px; margin: 4px 0 0; }
.def-grid .def {
  border: 1px solid var(--border-bright); background: var(--surface2);
  border-radius: 12px; padding: 12px 14px;
}
.def-grid .def dt, .def-grid .def .term { font-weight: 800; color: var(--text); margin: 0 0 4px; font-size: 15px; }
.def-grid .def dd, .def-grid .def .desc { margin: 0; color: var(--text-dim); line-height: 1.55; font-size: 14px; }

/* Tabela porownawcza (alias wizualny schedule, ale dla porownan) */
.compare-wrap { overflow-x: auto; margin: 8px 0; border: 1px solid var(--border-bright); border-radius: 12px; }
table.compare { width: 100%; border-collapse: collapse; min-width: 460px; font-size: 13.5px; }
table.compare th, table.compare td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.compare thead th { background: var(--surface2); color: var(--text-dim); text-transform: uppercase; font-size: 10.5px; letter-spacing: .06em; }
table.compare tbody th { color: var(--text); font-weight: 700; white-space: nowrap; }
table.compare tr:last-child td, table.compare tr:last-child th { border-bottom: none; }
table.compare td { color: var(--text-dim); }

/* Chipy tematow (spis dzialow) */
.topic-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; }
.topic-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--border-bright); background: rgba(15, 23, 42, 0.6);
  color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none;
}
.topic-pill:hover { border-color: var(--accent); }

@media (max-width: 980px) {
  .page-layout { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .duration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-side .app-download-block { position: static; }
}
@media (max-width: 768px) {
  .wrap { padding-top: 108px; }
}
