/* ===== Site 7: układ „Atlas drogi”, kolory „Galeria” (biel + ceglany akcent) =====
   Nakładka na styles.css: menu u góry, strona główna z mapą drogi rodziny,
   w rozdziałach lewy margines z numerem, częścią i spisem podrozdziałów.
   Wnętrze rozdziałów (mapy, drzewa, skany, animacje) – bez zmian. */
:root {
  --serif: "Fraunces", Georgia, serif;
  --sans: "Instrument Sans", "Segoe UI", sans-serif;
  --side: 0px;
  --top: 4rem;
  --p1: #2f4a6d; --p2: #b24a26; --p3: #3d6b4f;
}
body { background: #fff; }
h1, h2, h3 { font-weight: 400; letter-spacing: -0.015em; }
main { margin-left: 0; }

/* --- Menu u góry --- */
.side {
  inset: auto; position: sticky; top: 0; width: auto; height: var(--top);
  flex-direction: row; align-items: center; gap: 0 1.7rem; flex-wrap: nowrap;
  padding: 0 4vw; overflow-x: auto; white-space: nowrap;
  background: rgba(255, 255, 255, 0.94); backdrop-filter: saturate(1.4) blur(8px);
  border-right: 0; border-bottom: 1px solid var(--line); z-index: 50;
}
/* logo „przystaněk”: cienkie szare „przy”, nazwisko pełne, háček w kolorze strony */
.brand { margin: 0 1.4rem 0 0; font-size: 1.6rem; font-weight: 500; letter-spacing: -0.02em; text-transform: none; }
.brand .b-przy { font-weight: 300; color: var(--ink-soft); }
.brand .b-hacek { color: var(--seal); }
.side a:not(.brand) {
  font-size: 0.95rem; letter-spacing: 0; text-transform: none; color: var(--ink);
  padding: 0.35rem 0; border-left: 0; border-bottom: 2px solid transparent;
}
.side a:not(.brand):hover { color: var(--seal); }
.side a.is-on { color: var(--seal); border-left: 0; border-bottom-color: var(--seal); }
.side a.admin-link { margin: 0 0 0 auto; font-size: 0.8rem; color: var(--ink-soft); }
@media (max-width: 680px) {
  .side { position: sticky; flex-wrap: nowrap; padding: 0 1rem; gap: 0 1.1rem; }
  .brand { font-size: 1.3rem; margin-right: 0.4rem; }
}

/* --- Strona główna: tytuł i mapa drogi --- */
.branches[hidden] { display: none; }
/* tylko jedna podstrona naraz – także „Historie” na szerokim ekranie (w site6 wyświetlała się pod stroną główną) */
main > section#historie.page-off { display: none; }
.atlas-hero > * { margin-left: 0; margin-right: 0; }
#start .eyebrow { color: var(--seal); }
.atlas-title { font-size: clamp(2.8rem, 5vw, 4.8rem); line-height: 1.02; margin: 0.4rem 0 0; max-width: 22ch; text-wrap: balance; }
.atlas-title i { color: var(--p1); font-style: italic; }
#start .lead { font-size: 1.12rem; margin-top: 1.4rem; max-width: 64ch; }
.atlas-route { margin: 2.4rem 0 0.6rem; max-width: none; }
.atlas-route svg { width: 100%; height: auto; display: block; overflow: visible; }
.atlas-route .rt-bg { fill: none; stroke: #e6e9ee; stroke-width: 10; stroke-linecap: round; }
.atlas-route .rt-dash { fill: none; stroke: var(--ink-soft); stroke-width: 1.6; stroke-dasharray: 2 7; stroke-linecap: round; }
.atlas-route .st .dot { fill: #fff; stroke-width: 3; }
.atlas-route .st .hit { fill: transparent; stroke: none; }
.atlas-route .st text { font-family: var(--sans); font-size: 14px; fill: var(--ink); }
.atlas-route .st[data-ch] { cursor: pointer; }
.atlas-route .st[data-ch]:hover .dot, .atlas-route .st[data-ch]:focus .dot { stroke-width: 5; fill: #fff7f3; }
.atlas-route .st[data-ch]:hover text, .atlas-route .st[data-ch]:focus text { fill: var(--seal); }
.atlas-route .st:focus { outline: none; }
.atlas-route .st:focus-visible .dot { stroke-width: 6; }
.atlas-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.4rem; }
.atlas-legend i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; margin-right: 0.45rem; vertical-align: -0.05rem; }
#start .numbers { margin-top: 2rem; }
.atlas-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem; margin-top: 3rem; padding-top: 2.2rem; border-top: 1px solid var(--line); }
.atlas-part > header { display: flex; align-items: baseline; gap: 0.8rem; border-bottom: 2px solid var(--pc); padding-bottom: 0.5rem; margin-bottom: 0.5rem; }
.atlas-part > header b { font-family: var(--serif); font-size: 2.8rem; font-weight: 300; line-height: 1; color: var(--pc); }
.atlas-part > header span { font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.atlas-part button { display: flex; gap: 0.8rem; align-items: baseline; width: 100%; text-align: left; border: 0; border-radius: 6px; padding: 0.55rem 0.6rem; background: transparent; }
.atlas-part button:hover { background: #f5f6f8; }
.atlas-part button small { font-variant-numeric: tabular-nums; font-size: 0.8rem; color: var(--ink-soft); }
.atlas-part button span { font-family: var(--serif); font-size: 1.25rem; line-height: 1.2; }
.atlas-part button:hover span { color: var(--seal); }
@media (max-width: 900px) { .atlas-parts { grid-template-columns: 1fr; gap: 1.6rem; } }

/* --- Nagłówki sekcji --- */
section > h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
.toolbar input, .toolbar select, .search input, .toolbar button { border-radius: 6px; background: #fff; }

/* --- Historie: lewy margines (numer, część, podrozdziały, spis) --- */
.chapter h4 { scroll-margin-top: calc(var(--top) + 1rem); }
.ch-rail { display: none; }
@media (min-width: 1100px) {
  #historie { grid-template-columns: 15rem minmax(0, 52rem); }
  #historie > #chapter-box { grid-column: 2; }
  #historie > #chapters.toc { grid-column: 1; top: calc(var(--top) + 1.5rem); max-height: calc(100vh - var(--top) - 3rem); }
  .ch-rail { display: block; margin-bottom: 1.6rem; }
  .ch-rail .rp { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--seal); }
  .ch-rail .rn { font-family: var(--serif); font-weight: 300; font-size: 4rem; line-height: 1; color: var(--ink); margin: 0.4rem 0 1rem; }
  .ch-rail .rs { border-left: 2px solid var(--line); padding-left: 0.8rem; display: flex; flex-direction: column; gap: 0.35rem; }
  .ch-rail .rs button { border: 0; padding: 0; text-align: left; font-size: 0.9rem; line-height: 1.3; color: var(--ink-soft); background: none; }
  .ch-rail .rs button:hover { color: var(--seal); }
  .ch-rail .rs button.on { color: var(--ink); font-weight: 600; }
  .ch-rail .rall { margin: 1.8rem 0 0.6rem; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 1rem; }
}
.toc-item[aria-pressed="true"] { background: #f5f6f8; }
@media (max-width: 1099px) { #chapters.toc { top: var(--top); background: #fff; } }

/* --- Rozdział: nagłówek i przejścia --- */
.chapter > h3 { font-size: 3.4rem; border-bottom: 0; padding-bottom: 0; }
.chapter-nav { display: grid; grid-template-columns: 1fr 1fr; }
.chapter-nav button { border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); padding: 0.9rem 1.1rem; font-size: 0.8rem; }
.chapter-nav button b { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; color: var(--ink); }
.chapter-nav button:hover { background: #f5f6f8; color: var(--ink-soft); }
.chapter-nav .ch-next { grid-column: 2; background: var(--seal); border-color: var(--seal); color: rgba(255, 255, 255, 0.8); }
.chapter-nav .ch-next b { color: #fff; }
.chapter-nav .ch-next:hover { background: #973c1d; color: #fff; }
@media (max-width: 560px) { .chapter-nav { grid-template-columns: 1fr; } .chapter-nav .ch-next { grid-column: 1; } }

/* drobne zaokrąglenia ramek interfejsu */
.trop, .dalej, .zmap-bar, .zmap-legend, .st-info, .profile, .person-story, .dtree { border-radius: 6px; }
@media (max-width: 760px) {
  .atlas-route { overflow-x: auto; margin-left: -1rem; margin-right: -1rem; padding: 0 1rem; }
  .atlas-route svg { min-width: 760px; }
}

/* --- Strona główna: „Sześć przystanków” (pocztówki) --- */
#start [hidden] { display: none !important; }
.pc-head { margin-top: 3.2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.pc-head h2 { margin: 0 0 0.2rem; }
.pc-wall { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.2rem; margin-top: 1.6rem; }
.pc-col h3 { display: flex; align-items: baseline; gap: 0.7rem; margin: 0 0 1.1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--pc);
  font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; }
.pc-col h3 span { font-family: var(--serif); font-size: 2.2rem; font-weight: 300; letter-spacing: 0; color: var(--pc); line-height: 1; }
.pc { display: block; width: 100%; margin: 0 0 1.6rem; padding: 0; border: 0; background: none; text-align: left; color: var(--ink);
  transform: rotate(var(--rot, 0deg)); transition: transform 0.2s ease; }
.pc:hover, .pc:focus-visible { transform: rotate(0deg) translateY(-4px); }
.pc:focus-visible { outline: 2px solid var(--seal); outline-offset: 4px; }
.pc img { display: block; width: 100%; height: 13.5rem; object-fit: cover; }
.pc-txt { position: relative; display: block; padding: 0.8rem 3.6rem 0.9rem 1rem; background: #f5f6f8; }
.pc-txt b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.45rem; line-height: 1.1; }
.pc-txt em { display: block; font-family: "Kalam", cursive; font-style: normal; font-size: 1.05rem; color: var(--ink-soft); margin-top: 0.2rem; }
.pc-txt small { display: block; margin-top: 0.45rem; font-size: 0.78rem; color: var(--pc); letter-spacing: 0.02em; }
.pc:hover .pc-txt small { text-decoration: underline; }
.pc-stamp { position: absolute; top: 0.8rem; right: 0.8rem; width: 2.3rem; height: 2.7rem; border: 2px dashed var(--pc); color: var(--pc);
  display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 1.05rem; background: #fff; }
@media (max-width: 900px) { .pc-wall { grid-template-columns: 1fr; gap: 1rem; } .pc img { height: 15rem; } }
@media (prefers-reduced-motion: reduce) { .pc, .pc:hover { transform: none; transition: none; } }

/* odtwarzacz utworów Wacława */
.nuty-player{margin:1.2rem 0 1.6rem;padding:1rem 0 .4rem;border-top:1px solid #e3e5ea;border-bottom:1px solid #e3e5ea}
.nuty-player .np-head{font-family:"Fraunces",serif;font-size:1.05rem;margin:0 0 .6rem;color:#111418}
.nuty-player .np-item{display:grid;grid-template-columns:11rem minmax(0,1fr);gap:.4rem 1rem;align-items:center;margin:.5rem 0}
.nuty-player .np-t{font-weight:600;color:#111418}
.nuty-player .np-t span{display:block;font-weight:400;font-size:.82rem;color:#5b6170}
.nuty-player audio{width:100%;height:38px;accent-color:#b24a26}
.nuty-player .np-note{font-size:.82rem;color:#5b6170;margin:.6rem 0 .4rem}
@media (max-width:600px){.nuty-player .np-item{grid-template-columns:minmax(0,1fr)}}
