/* Szablon „Podgórz – Kronika (starodruk)”. Kolory i wymiary tylko jako zmienne z :root – zmiana wyglądu w jednym miejscu.
   Bloki treści (kronika, szpalty, ryciny, glosy, mural) – README.md szablonu. */

@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("../fonts/eb-garamond-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("../fonts/eb-garamond-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400 800; font-display: swap;
  src: url("../fonts/eb-garamond-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400 800; font-display: swap;
  src: url("../fonts/eb-garamond-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Grenze Gotisch"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("../fonts/grenze-gotisch-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Grenze Gotisch"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("../fonts/grenze-gotisch-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --mural-bottom-gap: 30px;
  --parchment: #e9dcc0;       /* tło strony */
  --plate: #efe4cc;           /* passe-partout rycin, karty */
  --ink: #2b2116;             /* druk */
  --rubric: #9b2a1c;          /* czerwień rubryk */
  --rubric-dark: #6e1d13;
  --rule: #b9a27a;            /* cienkie linie, szpalty */
  --muted: #5e4f39;           /* teksty pomocnicze */
  --gold: #e3a35a;            /* ozdobniki w stopce */
  --on-ink: #e9dcc0;          /* tekst na ciemnym */
  --font-text: "EB Garamond", Garamond, Georgia, serif;
  --font-gothic: "Grenze Gotisch", "EB Garamond", Georgia, serif;
  --width: 1200px;
  --width-text: 860px;
  --gutter: 40px;
  --plate-border: max(2px, .25cqw);
  --plate-pad: max(3px, .7cqw);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--parchment); color: var(--ink); font-family: var(--font-text); font-size: 19px; line-height: 1.6;
  font-variant-ligatures: common-ligatures discretionary-ligatures; }
img { max-width: 100%; height: auto; }
a { color: var(--rubric); text-decoration: none; }
a:hover { color: var(--rubric-dark); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--rubric); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.15; }

.container { max-width: var(--width); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--on-ink); padding: 8px 16px; z-index: 10; }
.skip-link:focus { left: 16px; }

/* ── Pasek i nagłówek ─────────────────────────────────────────────── */
.topbar { margin: 0; background: var(--ink); color: var(--on-ink); font-size: 14px; letter-spacing: .18em; text-transform: uppercase; text-align: center; padding: 8px 16px; }
.site-header { padding-top: 32px; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-bottom: 3px double var(--ink); padding-bottom: 20px; }
.masthead-herb { width: 230px; }
.masthead-sign { width: 140px; }
.masthead-title { flex: 1 1 360px; text-align: center; }
.kicker { margin: 0; font-size: 15px; letter-spacing: .3em; text-transform: uppercase; color: var(--rubric); }
.brand { display: inline-block; font-family: var(--font-gothic); font-weight: 700; font-size: 112px; line-height: 1; color: var(--ink); }
.brand:hover { color: var(--ink); text-decoration: none; }
.tagline { margin: 0; font-style: italic; font-size: 20px; }

/* Rycina w ramce: gruba linia, jasny passe-partout – grubość proporcjonalna do szerokości (jednostki cqw). */
.plate { container-type: inline-size; min-width: 0; }
.plate img { display: block; width: 100%; height: auto; border: var(--plate-border) solid var(--ink); padding: var(--plate-pad); background: var(--plate); }
.plate-round img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; }

.navbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 24px; padding: 10px 0; border-bottom: 1px solid var(--ink); font-variant: small-caps; letter-spacing: .08em; font-size: 20px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; }
.main-nav > ul > li { position: relative; display: flex; align-items: center; }
.main-nav > ul > li + li::before { content: "❦"; color: var(--rubric); padding: 0 14px; font-variant: normal; }
.main-nav a, .main-nav span, .search-link { display: inline-block; padding: 6px 0; }
.main-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rubric); text-underline-offset: 4px; }
.main-nav li ul { position: absolute; top: 100%; left: 28px; z-index: 5; min-width: 220px; background: var(--plate); border: 1px solid var(--ink); padding: 6px 14px; display: none; text-align: left; }
.main-nav li:hover > ul, .main-nav li:focus-within > ul { display: block; }
.search-link::before { content: "⚲ "; font-variant: normal; }
.nav-toggle { display: none; font: inherit; font-variant: small-caps; background: var(--plate); color: var(--ink); border: 1px solid var(--ink); min-height: 44px; padding: 0 18px; cursor: pointer; }
.languages ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; font-size: 16px; }

/* ── Nagłówek strony ─────────────────────────────────────────────── */
main { counter-reset: rycina; padding-top: 32px; padding-bottom: 48px; }
.page-header { margin-bottom: 28px; }
.page-header h1 { margin: 0; font-family: var(--font-gothic); font-weight: 500; font-size: 56px; }
.page-header-ornate { text-align: center; margin: 24px 0 0; }
.page-header-ornate + .prose { padding-top: 12px; }
.ornament { margin: 0; color: var(--rubric); font-size: 28px; letter-spacing: .5em; }
.lead { font-style: italic; font-size: 21px; }
.meta { color: var(--muted); font-size: 16px; }
.article { max-width: var(--width-text); margin: 0 auto; }
.container-wide .article { max-width: none; }

/* ── Treść ───────────────────────────────────────────────────────── */
.prose > *:first-child { margin-top: 0; }
.prose h2 { margin: 32px 0 12px; font-variant: small-caps; letter-spacing: .06em; font-size: 24px; font-weight: 500; color: var(--rubric); }
.prose h3 { margin: 24px 0 8px; font-variant: small-caps; letter-spacing: .06em; font-size: 22px; font-weight: 500; }
.prose blockquote { margin: 28px 0; padding: 20px 28px; border-top: 3px double var(--ink); border-bottom: 3px double var(--ink); text-align: center; font-style: italic; font-size: 21px; }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 6px 10px; text-align: left; }
.podtytul { margin: -12px 0 28px; text-align: center; font-style: italic; }
.zrodlo { font-size: 15px; text-align: center; }

/* Inicjał – pierwszy akapit szpalt albo element z klasą .inicjal */
.szpalty > p:first-child::first-letter, .inicjal::first-letter {
  float: left; font-family: var(--font-gothic); font-size: 86px; line-height: 72px; padding: 6px 10px 0 0; color: var(--rubric); }

/* Szpalty: dwie kolumny wyjustowane z linią, akapity z wcięciem */
.szpalty { column-count: 2; column-gap: 48px; column-rule: 1px solid var(--rule); text-align: justify; hyphens: auto; }
.szpalty p { margin: 0 0 14px; text-indent: 1.4em; }
.szpalty > p:first-child { text-indent: 0; }

/* Kronika: tekst + glosy na marginesie */
.kronika { display: flex; flex-wrap: wrap; gap: var(--gutter); }
.kronika-tekst { flex: 999 1 620px; min-width: 0; }
.glosy { flex: 1 1 300px; min-width: 0; border-left: 1px solid var(--rule); padding-left: 28px; font-size: 17px; }
.glosy-tytul { margin: 0; font-family: var(--font-gothic); font-size: 34px; line-height: 1.1; color: var(--rubric); font-variant: normal; letter-spacing: 0; }
.prose .glosy h2.glosy-tytul { margin: 0; font-size: 34px; font-weight: 400; font-variant: normal; letter-spacing: 0; color: var(--rubric); }
.glosy-podtytul { margin: 0 0 16px; font-style: italic; }
.prose .glosy h3 { color: var(--ink); }
.dane { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 12px 0; }
.dane dt { font-variant: small-caps; color: var(--rubric); }
.dane dd { margin: 0; }
.kalendarium { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.kalendarium b, .kalendarium strong { color: var(--rubric); }
.glosy ul { padding-left: 18px; }
.glosy-zrodlo { font-size: 14px; margin-top: 16px; }

/* Ryciny: okładka (.rycina) i obrazy w treści – ramka i numeracja „Rycina I.” w kolejności na stronie */
figure.rycina, .prose figure.cms-image { margin: 24px 0; container-type: inline-size; }
figure.rycina img, .prose figure.cms-image img { display: block; width: 100%; height: auto;
  border: var(--plate-border) solid var(--ink); padding: var(--plate-pad); background: var(--plate); }
figure.rycina figcaption, .prose figure.cms-image figcaption { margin-top: 10px; font-style: italic; font-size: 17px; text-align: center; }
figure.rycina, .prose figure.cms-image { counter-increment: rycina; }
figure.rycina figcaption::before, .prose figure.cms-image figcaption::before {
  content: var(--figure-label, "Rycina") " " counter(rycina, upper-roman) ". "; color: var(--rubric); font-style: normal; font-variant: small-caps; }
.glosy figure.cms-image, .bez-numeru figure.cms-image { counter-increment: none; }
.glosy figure.cms-image figcaption::before, .bez-numeru figure.cms-image figcaption::before { content: none; }
.prose .glosy figure.cms-image figcaption { text-align: left; font-size: 15px; }

/* Stare fotografie – sepia (owiń krótki kod w <div class="fotografia">) */
.fotografia img, .prose .fotografia figure.cms-image img { filter: sepia(.55) contrast(1.05); mix-blend-mode: multiply; border-width: max(1px, .12cqw); }

/* Rycina obok podpisu (.obok – obraz z lewej; .obok-prawa – obraz z prawej) */
.obok figure.cms-image, .obok-prawa figure.cms-image { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.obok figure.cms-image img, .obok-prawa figure.cms-image img { flex: 1 1 340px; width: auto; min-width: 0; }
.obok figure.cms-image figcaption, .obok-prawa figure.cms-image figcaption { flex: 1 1 200px; margin: 0; text-align: left; }
.obok-prawa figure.cms-image { flex-direction: row-reverse; }
.obok-prawa figure.cms-image figcaption { text-align: right; }

/* Mural – znak w pełnych kolorach bez ramki */
.mural { margin-top: 48px; margin-bottom: var(--mural-bottom-gap); padding-top: 28px; border-top: 3px double var(--ink); display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
.mural > figure.cms-image { flex: 0 1 320px; margin: 0; }
.prose .mural figure.cms-image img { border: 0; padding: 0; background: none; }
.mural-opis { flex: 1 1 320px; min-width: 0; }
.mural-opis h2 { margin-top: 0; }
.do-uzupelnienia { font-style: italic; color: var(--muted); }

/* ── Listy aktualności ───────────────────────────────────────────── */
.latest { margin-top: 48px; padding-top: 24px; border-top: 3px double var(--ink); }
.latest h2 { font-family: var(--font-gothic); font-weight: 500; font-size: 40px; text-align: center; margin: 0 0 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px; }
.card { background: var(--plate); border: 1px solid var(--ink); display: flex; flex-direction: column; }
.card-image img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-bottom: 1px solid var(--ink); filter: sepia(.25); }
.card-body { padding: 16px 20px 20px; }
.card-title { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.card-title a { color: var(--ink); }
.card-body p { margin: 0 0 8px; }
.more-wrap { text-align: center; }
.more { font-variant: small-caps; letter-spacing: .08em; }
.tag { display: inline-block; margin-left: 8px; font-variant: small-caps; }
.breadcrumbs ol { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 16px; }
.breadcrumbs li + li::before { content: "·"; margin-right: 8px; color: var(--rubric); }
.pagination ul { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pagination a, .pagination span { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; border: 1px solid var(--rule); padding: 0 10px; }
.pagination [aria-current] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.attachments { margin-top: 32px; border-top: 1px solid var(--rule); }

/* ── Wyszukiwarka ────────────────────────────────────────────────── */
.search-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 24px; }
.search-form label { width: 100%; font-variant: small-caps; }
.search-form input { flex: 1 1 260px; min-height: 44px; font: inherit; background: var(--plate); color: var(--ink); border: 1px solid var(--ink); padding: 0 12px; }
.search-form button, .cms-ticket-submit, .cms-consent-button { min-height: 44px; font: inherit; font-variant: small-caps; letter-spacing: .06em; background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); padding: 0 20px; cursor: pointer; }
.search-form button:hover, .cms-ticket-submit:hover, .cms-consent-button:hover { background: var(--rubric); border-color: var(--rubric); }
.cms-search-summary { font-style: italic; }
.cms-search-list { list-style: none; padding: 0; }
.cms-search-item { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.cms-search-title { font-size: 21px; }
.cms-search-excerpt { margin: 4px 0; }
.cms-search-meta { margin: 0; color: var(--muted); font-size: 15px; }

/* ── Elementy CMS w treści ───────────────────────────────────────── */
.prose figure.cms-embed, .prose figure.cms-video, .prose figure.cms-media-video { margin: 24px 0; }
.cms-embed { position: relative; aspect-ratio: 16 / 9; background: var(--ink); color: var(--on-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; text-align: center; }
.cms-embed a { color: var(--on-ink); }
.cms-embed-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cms-embed-play, .cms-video-play { min-height: 44px; font: inherit; background: var(--rubric); color: var(--on-ink); border: 0; padding: 0 20px; cursor: pointer; }
.cms-embed-notice { font-size: 14px; margin: 0; }
.cms-video video, .cms-media-video video { width: 100%; display: block; background: var(--ink); }
.cms-attachment-meta { color: var(--muted); font-size: 15px; margin-left: 6px; }

/* Komunikat o ciastkach */
.cms-consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20; max-width: 760px; margin: 0 auto; background: var(--plate); color: var(--ink); border: 2px solid var(--ink); padding: 20px; box-shadow: 0 4px 24px rgba(43, 33, 22, .35); }
.cms-consent-title { margin: 0 0 6px; font-family: var(--font-gothic); font-size: 26px; }
.cms-consent-text { margin: 0 0 12px; font-size: 17px; }
.cms-consent-options { display: grid; gap: 8px; margin-bottom: 12px; }
.cms-consent-option { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; font-size: 16px; }
.cms-consent-option-name { font-weight: 600; }
.cms-consent-option-text { grid-column: 2; color: var(--muted); }
.cms-consent-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* Formularz zgłoszeń */
.cms-ticket-form { background: var(--plate); border: 1px solid var(--ink); padding: 24px; margin: 24px 0; }
.cms-ticket-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cms-ticket-field { display: flex; flex-direction: column; gap: 4px; }
.cms-ticket-field-email, .cms-ticket-field-phone, .cms-ticket-field-message { grid-column: 1 / -1; }
.cms-ticket-field label { font-variant: small-caps; }
.cms-ticket-field input, .cms-ticket-field textarea { font: inherit; background: var(--parchment); color: var(--ink); border: 1px solid var(--ink); padding: 8px 10px; min-height: 44px; }
.cms-ticket-field [aria-invalid="true"] { border-color: var(--rubric); outline: 1px solid var(--rubric); }
.cms-ticket-field-error { color: var(--rubric); font-size: 15px; }
.cms-ticket-privacy { font-size: 15px; color: var(--muted); }
.cms-ticket-status[data-state="success"] { color: #2f5a22; }
.cms-ticket-status[data-state="error"] { color: var(--rubric); }
.cms-ticket-message { display: none; }
.cms-ticket-message:target { display: block; }

/* ── Stopka ──────────────────────────────────────────────────────── */
.site-footer { background: var(--ink); color: var(--on-ink); text-align: center; padding: 32px 0; font-size: 16px; }
.site-footer a { color: var(--on-ink); text-decoration: underline; }
.footer-brand { margin: 0; font-family: var(--font-gothic); font-size: 32px; }
.footer-tagline { margin: 0; font-style: italic; }
.footer-menu { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }
.footer-ornament { color: var(--gold); margin: 8px 0; letter-spacing: .5em; }
.copyright, .footer-consent { margin: 4px 0; }

/* ── Telefon ─────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  body { font-size: 18px; }
  .brand { font-size: 72px; }
  .masthead-herb { width: 150px; }
  .masthead-sign { width: 96px; }
  .masthead-title { order: -1; flex-basis: 100%; }
  .masthead { justify-content: center; }
  .page-header h1 { font-size: 42px; }
  .szpalty { column-count: 1; }
  .glosy { border-left: 0; padding-left: 0; border-top: 3px double var(--ink); padding-top: 20px; }
  .cms-ticket-fields { grid-template-columns: 1fr; }
  .js .nav-toggle { display: inline-flex; align-items: center; }
  .js .main-nav { display: none; width: 100%; }
  .js .main-nav.is-open { display: block; }
  .main-nav > ul { flex-direction: column; align-items: center; }
  .main-nav > ul > li { flex-direction: column; }
  .main-nav > ul > li + li::before { padding: 0; }
  .main-nav li ul { position: static; display: block; border: 0; background: none; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .topbar, .navbar, .site-footer, .skip-link, .cms-consent { display: none; }
  body { background: #fff; }
}
