:root {
  color-scheme: light;
  --ink: #172f3b;
  --ink-soft: #435763;
  --paper: #f7f6f1;
  --surface: #fffefa;
  --line: #d8dad5;
  --accent: #7d2138;
  --accent-dark: #5f1629;
  --pale: #efe9e4;
  --shadow: 0 12px 32px rgb(17 42 54 / 5%);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; min-width: 0; overflow-x: clip; background: var(--paper); color: var(--ink); font-size: 1rem; line-height: 1.55; }
button, input { font: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #b35c72; outline-offset: 3px; }
.shell { width: calc(100% - 3rem); max-width: 1200px; margin-inline: auto; }
.skip-link { position: absolute; top: -5rem; left: 1rem; z-index: 100; background: var(--accent); color: white; padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; color: white; }

.site-header { position: relative; isolation: isolate; overflow: hidden; background: var(--ink); color: white; border-bottom: 4px solid var(--accent); }
.site-header::before { content: ""; position: absolute; inset: 0 0 0 auto; width: min(43%, 540px); background: url('figures/cover.png') center 54% / cover no-repeat; clip-path: polygon(13% 0, 100% 0, 100% 100%, 0 100%); pointer-events: none; }
.site-header::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--ink) 0%, rgb(23 47 59 / 97%) 48%, rgb(23 47 59 / 58%) 78%, rgb(23 47 59 / 28%) 100%); pointer-events: none; }
.header-inner { position: relative; z-index: 1; width: calc(100% - 3rem); max-width: 1200px; margin: auto; min-height: 116px; padding-block: .9rem .7rem; display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; grid-template-areas: 'brand nav language'; align-items: center; gap: 1rem 1.35rem; }
.brand { grid-area: brand; color: white; text-decoration: none; display: block; min-width: 0; }
.brand:hover { color: white; }
.brand strong, .brand small { display: block; }
.brand strong { font: bold 1.2rem Georgia, serif; letter-spacing: .01em; line-height: 1.2; }
.brand small { color: #bdcbd0; font-size: .8rem; margin-top: .18rem; letter-spacing: .03em; }
.main-nav { grid-area: nav; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: .25rem .5rem; min-width: 0; margin-left: 0; }
.main-nav a { color: #dce4e5; text-decoration: none; font-size: .9rem; padding: .55rem .7rem; border-radius: .2rem; white-space: nowrap; }
.main-nav a:hover, .main-nav a[aria-current] { color: white; background: rgb(255 255 255 / 12%); }
.main-nav a[aria-current] { box-shadow: inset 0 -2px #d899a8; }

.catalogue-head { padding-block: 3rem 2.2rem; border-bottom: 1px solid var(--line); }
.eyebrow { display: block; font-weight: 700; color: var(--accent); font-size: .82rem; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow span { margin-inline: .5rem; color: #aaa8a0; }
.heading-row { display: flex; justify-content: space-between; align-items: end; gap: 2rem; min-width: 0; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
h1 { font-size: clamp(2.2rem, 4.4vw, 3.7rem); line-height: 1.12; margin: .55rem 0 .65rem; font-weight: 600; }
.full-title { font: 1.08rem/1.55 Georgia, serif; color: var(--ink-soft); margin: 0; max-width: 62ch; }
.catalogue-count { margin: 0 0 .3rem; text-align: right; border-left: 3px solid var(--accent); padding-left: 1.2rem; flex: none; line-height: 1.1; }
.catalogue-count strong { font: 2.4rem Georgia, serif; display: block; }
.catalogue-count span { color: var(--ink-soft); font-size: .84rem; }
.catalogue-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(2rem, 4vw, 4.5rem); padding-block: 2.8rem 5rem; align-items: start; }
.letter-rail, .catalogue-content, .search-form, .input-wrap { min-width: 0; }
.letter-rail { position: sticky; top: 1.5rem; }
.rail-label { margin: 0 0 1rem; font-size: .87rem; font-weight: 700; color: var(--ink-soft); }
.letter-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .28rem; }
.letter { min-height: 2.15rem; border: 1px solid transparent; border-radius: .15rem; background: transparent; color: var(--ink); cursor: pointer; font-size: .88rem; font-weight: 600; }
.letter:hover { border-color: var(--accent); }
.letter.active { color: white; background: var(--accent); }
.letter:first-child { grid-column: span 5; text-align: left; padding-left: .55rem; }
.rail-link { display: block; margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .87rem; font-weight: 600; text-decoration: none; }
.rail-link span { margin-left: .2rem; }
.search-form label, .place-label { display: block; font-size: .9rem; font-weight: 700; margin: 0 0 .55rem; }
.input-wrap { position: relative; }
.input-wrap svg { position: absolute; top: 50%; left: 1.1rem; transform: translateY(-50%); pointer-events: none; color: var(--accent); }
.search-form input, .place-query { display: block; width: 100%; min-width: 0; max-width: 100%; border: 1px solid #aeb9bc; border-radius: .25rem; background: white; color: var(--ink); min-height: 3.6rem; padding: .85rem 1rem; font-size: 1rem; box-shadow: var(--shadow); }
.search-form input { padding-left: 3.2rem; }
.search-form input::placeholder, .place-query::placeholder { color: #687981; opacity: 1; }
.search-form input:focus, .place-query:focus { outline: 3px solid #ddb5c0; border-color: var(--accent); }
.active-place { margin-top: 1rem; padding: .65rem 1rem; background: #f0e7e8; border-left: 3px solid var(--accent); font-size: .92rem; }
.active-place button { color: var(--accent); font-weight: 700; border: 0; background: transparent; text-decoration: underline; cursor: pointer; margin-left: .5rem; }
.results-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 2.3rem; border-bottom: 1px solid var(--line); }
.results-heading h2 { font-size: 1.6rem; margin: 0 0 .6rem; }
.results-heading p { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding-top: 1.2rem; }
.result-card { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid #9d7b84; padding: 1.25rem 1.3rem 1.15rem; min-width: 0; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.result-card h3 { margin: 0 0 .65rem; font-size: 1.28rem; line-height: 1.25; }
.result-card h3 a { color: var(--ink); text-decoration: none; }
.result-card h3 a:hover { color: var(--accent); text-decoration: underline; }
.result-card p { color: var(--ink-soft); margin: 0 0 1.2rem; font-size: .96rem; line-height: 1.55; }
.result-card .read-link { margin-top: auto; text-decoration: none; font-size: .89rem; font-weight: 700; }
.result-card .read-link:hover { text-decoration: underline; }
.more-button { display: block; margin: 1.6rem auto 0; min-height: 2.8rem; border: 1px solid var(--accent); background: transparent; color: var(--accent); padding: .55rem 1.4rem; cursor: pointer; font-weight: 700; }
.more-button:hover { color: white; background: var(--accent); }
.static-index { columns: 2; column-gap: 2rem; padding: 1.2rem 0 0 1.45rem; margin: 0; }
.static-index li { break-inside: avoid; padding: .38rem .3rem; border-bottom: 1px solid var(--line); }
.static-index a { color: var(--ink); text-decoration: none; }
.static-index a:hover { color: var(--accent); text-decoration: underline; }
.search-error { background: #fff0ed; padding: 1rem; }
.empty-results { grid-column: 1 / -1; padding: 2rem; background: white; border: 1px solid var(--line); color: var(--ink-soft); }

.page-shell, .detail-shell { padding-block: 2.2rem 5rem; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; color: var(--ink-soft); font-size: .83rem; margin-bottom: 2.3rem; }
.crumbs a { color: var(--accent); }
.crumbs span:last-child { overflow-wrap: anywhere; }
.page-heading { border-bottom: 1px solid var(--line); max-width: 800px; padding-bottom: 1.8rem; margin-bottom: 2.2rem; }
.page-heading h1 { margin-block: .3rem .65rem; }
.page-heading p { margin: 0; font-size: 1.05rem; color: var(--ink-soft); }
.biography { max-width: 970px; margin: auto; min-height: 40vh; }
.detail-heading { border-bottom: 1px solid var(--line); margin-bottom: 2.3rem; padding-bottom: 1.1rem; }
.detail-heading h1 { overflow-wrap: anywhere; }
.bio-text { max-width: 760px; overflow-wrap: anywhere; font: 1.12rem/1.75 Georgia, "Times New Roman", serif; }
.bio-text p { margin: 0 0 1.3rem; }
.bio-text a, .long-read a, .sources a { overflow-wrap: anywhere; }
.sources { border-top: 2px solid var(--accent); max-width: 760px; margin-top: 3rem; padding-top: 1.1rem; }
.sources h2 { font-size: 1.35rem; margin: 0 0 .6rem; }
.sources p { color: var(--ink-soft); font-size: .9rem; line-height: 1.6; overflow-wrap: anywhere; }
.editorial-note { max-width: 760px; background: #f0e7e8; padding: .75rem 1rem; border-left: 3px solid var(--accent); font-size: .9rem; }
.adjacent { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 4rem auto 0; max-width: 970px; border-top: 1px solid var(--line); padding-top: 1.3rem; }
.adjacent a { display: block; text-decoration: none; padding: .8rem 1rem; border: 1px solid var(--line); background: var(--surface); }
.adjacent a:last-child { text-align: right; }
.adjacent span, .adjacent strong { display: block; }
.adjacent span { font-size: .8rem; color: var(--ink-soft); margin-bottom: .3rem; }
.adjacent strong { font: 1rem/1.3 Georgia, serif; color: var(--ink); }
.adjacent a:hover strong { color: var(--accent); }

.intro-page { max-width: 1040px; }
.intro-top { max-width: 850px; padding: .8rem 0 2rem; border-bottom: 1px solid var(--line); }
.intro-top h1 { font-size: clamp(2.1rem, 4vw, 3.5rem); overflow-wrap: anywhere; }
.subtitle { color: var(--ink-soft); font-family: Georgia, serif; font-size: 1.15rem; }
.intro-browse { display: inline-block; margin-top: .65rem; font-size: .95rem; font-weight: 700; text-decoration: none; border-bottom: 1px solid currentColor; }
.intro-browse:hover { border-bottom-color: transparent; }
.long-read { max-width: 770px; overflow-wrap: anywhere; font: 1.08rem/1.72 Georgia, "Times New Roman", serif; padding-top: 1.5rem; }
.long-read h2 { font-size: 2rem; line-height: 1.2; margin: 2.6rem 0 1rem; scroll-margin-top: 1rem; }
.long-read h3 { font-size: 1.45rem; line-height: 1.3; margin: 2.2rem 0 .8rem; scroll-margin-top: 1rem; }
.long-read p { margin: 0 0 1.1rem; }
.long-read li { margin-bottom: .45rem; }

.place-query { max-width: 550px; }
.place-count { margin: 1.2rem 0 .7rem; color: var(--ink-soft); font-size: .88rem; }
.places-list { padding: 0; margin: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem 1rem; }
.places-list li { min-width: 0; }
.places-list a { background: white; border: 1px solid var(--line); text-decoration: none; padding: .65rem .8rem; display: flex; justify-content: space-between; align-items: baseline; gap: .4rem; min-height: 3rem; }
.places-list a:hover { border-color: var(--accent); }
.places-list span { overflow-wrap: anywhere; color: var(--ink); }
.places-list small { color: var(--ink-soft); white-space: nowrap; font-size: .73rem; }
.site-footer { background: #e9eae4; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .82rem; }
.footer-inner { min-height: 85px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem 2rem; padding-block: 1.5rem; }
.footer-inner a { text-decoration: none; }

@media (max-width: 960px) {
  .header-inner { padding-block: .8rem .65rem; }
  .catalogue-layout { grid-template-columns: 1fr; gap: 2rem; }
  .letter-rail { position: static; }
  .letter-grid { display: flex; overflow-x: auto; gap: .25rem; padding-bottom: .3rem; }
  .letter { flex: 0 0 2.3rem; }
  .letter:first-child { flex-basis: 5.2rem; padding-left: 0; text-align: center; }
  .rail-link { display: none; }
  .places-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .shell, .header-inner { width: calc(100% - 2rem); }
  .site-header { border-bottom-width: 3px; }
  .site-header::before { width: 67%; background-position: center 54%; }
  .site-header::after { background: linear-gradient(90deg, var(--ink) 0%, rgb(23 47 59 / 95%) 42%, rgb(23 47 59 / 62%) 100%); }
  .header-inner { min-height: 108px; }
  .brand { min-width: 0; }
  .brand strong { font-size: 1rem; overflow-wrap: anywhere; }
  .main-nav { width: 100%; max-width: 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
  .main-nav a { font-size: .86rem; padding: .55rem .65rem; }
  .catalogue-head { padding-block: 2rem 1.6rem; }
  .heading-row { align-items: start; flex-direction: column; gap: 1.2rem; }
  .catalogue-count { display: flex; align-items: baseline; gap: .5rem; text-align: left; }
  .catalogue-count strong { font-size: 1.8rem; }
  .catalogue-layout { padding-block: 1.7rem 3.5rem; }
  .result-grid { grid-template-columns: minmax(0, 1fr); }
  .result-card h3, .result-card p, .full-title, .page-heading h1 { overflow-wrap: anywhere; }
  .letter-grid { max-width: 100%; }
  .static-index { columns: 1; }
  .results-heading { margin-top: 1.8rem; }
  .bio-text { font-size: 1.05rem; }
  .adjacent { grid-template-columns: minmax(0, 1fr); }
  .adjacent a:last-child { text-align: left; }
  .places-list { grid-template-columns: minmax(0, 1fr); }
  .page-shell, .detail-shell { padding-block: 1.4rem 3.5rem; }
  .crumbs { margin-bottom: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Google Analytics — zgoda użytkownika */
.analytics-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  padding: 14px;
  background: rgba(16, 35, 45, .98);
  color: #fff;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, .22);
}
.analytics-consent__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.analytics-consent__text {
  display: grid;
  gap: 4px;
  line-height: 1.45;
}
.analytics-consent__text strong { font-size: 1rem; }
.analytics-consent__text span { font-size: .92rem; opacity: .94; }
.analytics-consent__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}
.analytics-consent__button,
.analytics-settings-button {
  font: inherit;
  cursor: pointer;
}
.analytics-consent__button {
  border-radius: 6px;
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.5);
}
.analytics-consent__button--primary {
  background: #fff;
  color: #172f3b;
}
.analytics-consent__button--secondary {
  background: transparent;
  color: #fff;
}
.analytics-settings-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: .85;
}
.analytics-settings-button:hover { opacity: 1; }
@media (max-width: 720px) {
  .analytics-consent__inner { align-items: stretch; flex-direction: column; gap: 12px; }
  .analytics-consent__actions { width: 100%; }
  .analytics-consent__button { flex: 1 1 0; }
}

/* Przełącznik języka i tłumaczenie automatyczne */
.language-tools {
  grid-area: language;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .28rem;
  color: #fff;
  font-size: .78rem;
}
.language-tools__row {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  padding: .22rem;
  border-radius: .35rem;
  background: rgba(8, 24, 32, .62);
}
.language-tools__icon { margin-right: .08rem; font-size: .95rem; line-height: 1; }
.language-tools__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: .28rem;
  min-width: 2.45rem;
  min-height: 2rem;
  padding: .25rem .52rem;
  text-align: center;
  font-weight: 800;
  letter-spacing: .04em;
  background: rgba(23,47,59,.88);
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.language-tools__link:hover,
.language-tools__link:focus-visible { color: #172f3b; border-color: #fff; background: #fff; }
.language-tools__link.is-active { color: #172f3b; background: #fff; border-color: #fff; }
.language-tools__note {
  color: #fff;
  opacity: .9;
  white-space: nowrap;
  font-size: .72rem;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.translation-notice {
  width: calc(100% - 3rem);
  max-width: 1200px;
  margin: 1rem auto 0;
  padding: .65rem .85rem;
  border-left: 3px solid var(--accent);
  background: #f0e7e8;
  color: var(--ink-soft);
  font-size: .86rem;
  line-height: 1.45;
}
@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-areas:
      'brand language'
      'nav nav';
    align-items: center;
  }
  .main-nav { width: 100%; }
}
@media (max-width: 650px) {
  .header-inner {
    width: calc(100% - 2rem);
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-areas:
      'brand language'
      'nav nav';
    gap: .55rem .7rem;
  }
  .language-tools { align-items: flex-end; }
  .language-tools__row { gap: .3rem; }
  .language-tools__link { min-width: 2.15rem; min-height: 1.85rem; padding: .2rem .4rem; }
  .language-tools__note { display: none; }
  .translation-notice { width: calc(100% - 2rem); margin-top: .7rem; }
}
