/* ==========================================================================
   Strona parafii – arkusz stylów
   Kolory: bielona ściana kościoła, łupek, błękit maryjny, złocenie ołtarza.
   ========================================================================== */

:root {
  --wall: #f3f5f1;          /* bielona ściana */
  --paper: #ffffff;
  --ink: #1c2530;           /* łupek */
  --ink-soft: #46515c;
  --stone: #6a737b;
  --line: #d9ddd5;
  --line-soft: #e8ebe5;
  --marian: #24406b;        /* błękit maryjny */
  --marian-deep: #172b4a;
  --marian-tint: #e7edf5;
  --gilt: #b08a3b;          /* złocenie – tylko akcenty */
  --gilt-text: #85671f;     /* złoto czytelne na jasnym tle */
  --gilt-soft: #f4ecd9;
  --mourn: #000000;
  --ok: #2f6b45;

  --serif: 'Alegreya', Georgia, 'Times New Roman', serif;
  --sans: 'Alegreya Sans', 'Segoe UI', Arial, sans-serif;

  --wrap: 1180px;
  --r: 6px;
  --shadow: 0 1px 2px rgba(23, 43, 74, .06), 0 8px 24px -12px rgba(23, 43, 74, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--sans);
  font-feature-settings: 'kern', 'liga';
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--marian); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--marian-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gilt); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.25rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--stone); }
.small { font-size: .92rem; }
.pre { white-space: pre-line; }
.sr { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { margin-bottom: .35em; }
.empty { padding: 32px; background: var(--paper); border: 1px dashed var(--line); border-radius: var(--r); color: var(--stone); text-align: center; }
.note { color: var(--stone); font-size: .95rem; margin-top: 2em; }
.note .i { vertical-align: -2px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--marian); color: #fff; padding: 8px 14px; z-index: 100; border-radius: var(--r); }
.skip:focus { left: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .62em 1.15em; border-radius: var(--r); border: 1px solid var(--marian);
  background: var(--marian); color: #fff; font: 500 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--marian-deep); color: #fff; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--marian); }
.btn.ghost:hover { background: var(--marian-tint); color: var(--marian-deep); }

/* --- Nagłówek ------------------------------------------------------------ */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.cross { width: 18px; height: 24px; fill: var(--gilt); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font: 700 1.35rem/1.1 var(--serif); }
.brand-sub { font-size: .85rem; color: var(--stone); }

.nav > ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.nav a, .sub-toggle {
  display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: var(--r);
  color: var(--ink); text-decoration: none; font: 500 1rem/1.2 var(--sans); background: none; border: 0; cursor: pointer;
}
.nav a:hover, .sub-toggle:hover { background: var(--marian-tint); color: var(--marian-deep); }
.nav li.active > a, .nav li.active > .sub-toggle { color: var(--marian); box-shadow: inset 0 -2px 0 var(--gilt); border-radius: 0; }
.sub-toggle svg { width: 10px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.has-sub { position: relative; }
.sub {
  list-style: none; margin: 0; padding: 8px; position: absolute; top: calc(100% + 6px); left: 0; min-width: 270px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  display: none;
}
.has-sub.open .sub { display: block; }
@media (hover: hover) and (min-width: 1201px) { .has-sub:hover .sub, .has-sub:focus-within .sub { display: block; } .has-sub::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 8px; } }
.sub a { padding: 9px 12px; }
.sub a[aria-current] { color: var(--marian); font-weight: 700; }

.menu-toggle { display: none; align-items: center; gap: 8px; background: none; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; font: 500 1rem var(--sans); color: var(--ink); cursor: pointer; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
.menu-icon::before, .menu-icon::after { content: ''; position: absolute; left: 0; }
.menu-icon::before { top: -6px; } .menu-icon::after { top: 6px; }

@media (max-width: 1200px) {
  .menu-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); max-height: calc(100vh - 76px); overflow-y: auto; }
  .nav.open { display: block; }
  .nav > ul { flex-direction: column; align-items: stretch; padding: 10px 20px 20px; }
  .nav a, .sub-toggle { width: 100%; padding: 13px 8px; border-radius: 0; border-bottom: 1px solid var(--line-soft); justify-content: space-between; }
  .nav li.active > a, .nav li.active > .sub-toggle { box-shadow: inset 3px 0 0 var(--gilt); padding-left: 14px; }
  .sub { position: static; box-shadow: none; border: 0; padding: 0 0 0 16px; min-width: 0; }
}

/* --- Strona główna: nagłówek i tablica tygodnia ---------------------------- */
.hero { background: var(--paper); border-bottom: 1px solid var(--line); padding: 44px 0 56px; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: 48px; align-items: start; }
.hero h1 { margin-bottom: .15em; }
.hero-sub { color: var(--gilt-text); font: 500 1.15rem/1.3 var(--serif); font-style: italic; margin-bottom: 1.2em; }
.hero-welcome { color: var(--ink-soft); max-width: 42ch; }
.next-mass { margin-top: 28px; padding: 16px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.next-mass span { color: var(--stone); font-size: .95rem; }
.next-mass strong { font: 700 1.6rem/1.2 var(--serif); color: var(--marian); }

/* Tablica ogłoszeń przy kościele – najważniejszy element strony */
.board { background: var(--marian-deep); color: #fff; border-radius: 10px; padding: 22px 22px 6px; box-shadow: var(--shadow); position: relative; }
.board::before { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(176, 138, 59, .45); border-radius: 6px; pointer-events: none; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 0 6px 14px; position: relative; }
.board-head h2 { color: #fff; font-size: 1.35rem; margin: 0; }
.board-head a { color: #e3cf9f; font-size: .95rem; }
.board-head a:hover { color: #fff; }
.board-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; position: relative; }
.board-day {
  background: rgba(255, 255, 255, .05); border: 0; border-top: 3px solid transparent; color: #fff; border-radius: 4px;
  padding: 10px 6px 12px; text-align: left; cursor: pointer; font-family: var(--sans); display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.board-day:hover { background: rgba(255, 255, 255, .1); }
.board-day[aria-selected="true"] { background: #fff; color: var(--ink); }
.board-day.today { border-top-color: var(--gilt); }
.bd-name { font-weight: 700; font-size: 1rem; white-space: nowrap; }
.bd-name abbr { text-decoration: none; }
.bd-date { font-size: .85rem; opacity: .75; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bd-times { display: flex; flex-direction: column; margin-top: 8px; font: 700 1.25rem/1.25 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.bd-times .x { text-decoration: line-through; opacity: .5; }
.bd-times .none { font: 400 .8rem var(--sans); opacity: .6; }
.board-panel { background: #fff; color: var(--ink); border-radius: 4px; margin: 4px 0 16px; padding: 18px 20px 6px; position: relative; }
.board-panel h3 { font-size: 1.15rem; color: var(--marian); margin-bottom: .8em; }

@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 640px) {
  .board { padding: 16px 12px 4px; margin: 0 -8px; }
  .board-days { grid-template-columns: repeat(7, minmax(64px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .board-day { scroll-snap-align: start; }
}

/* --- Msze i intencje ------------------------------------------------------ */
.mass { display: grid; grid-template-columns: 92px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.mass:last-child { border-bottom: 0; }
.mass-time time { font: 700 1.45rem/1.1 var(--serif); color: var(--marian); font-variant-numeric: lining-nums tabular-nums; display: block; }
.mass-place, .mass-date { display: block; font-size: .85rem; color: var(--stone); margin-top: 2px; }
.mass.cancelled .mass-time time { text-decoration: line-through; color: var(--stone); }
.mass-note { font-style: italic; color: var(--gilt-text); margin-bottom: .3em; }
.intentions { margin: 0; padding: 0; list-style: none; }
.intentions li { padding-left: 16px; position: relative; margin-bottom: .3em; }
.intentions li::before { content: ''; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; background: var(--gilt); border-radius: 50%; }
.mass-body .muted { margin: 0; }
.int-link { display: inline-flex; vertical-align: -2px; color: var(--stone); }
.int-link:hover { color: var(--marian); }
.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }

.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 24px; }
.week-nav p { margin: 0; font-family: var(--serif); font-size: 1.2rem; text-align: center; }
.days { display: grid; gap: 16px; }
.day { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 22px 8px; display: grid; grid-template-columns: 200px 1fr; gap: 0 28px; }
.day h2 { font-size: 1.3rem; margin: 0; padding-top: 12px; }
.day h2 span { display: block; font: 400 1rem var(--sans); color: var(--stone); margin-top: 2px; }
.day h2 em { display: inline-block; margin-top: 8px; font: 700 .8rem var(--sans); color: var(--gilt-text); background: var(--gilt-soft); padding: 2px 8px; border-radius: 99px; font-style: normal; }
.day.today { border-color: var(--gilt); box-shadow: inset 4px 0 0 var(--gilt); }
.day > :not(h2) { grid-column: 2; }
.day > .muted { padding: 12px 0; }
@media (max-width: 760px) {
  .day { grid-template-columns: 1fr; padding: 14px 16px 6px; }
  .day > :not(h2) { grid-column: 1; }
  .day h2 span { display: inline; margin-left: 6px; }
  .mass { grid-template-columns: 76px 1fr; gap: 12px; }
  .week-nav { flex-wrap: wrap; } .week-nav p { order: -1; width: 100%; }
}

/* --- Sekcje ---------------------------------------------------------------- */
.section { padding: 56px 0; }
.section-sm { padding-top: 32px; padding-bottom: 64px; }
.section-title { font-size: clamp(1.45rem, 2.4vw, 1.85rem); margin-bottom: .7em; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 48px; }
.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
@media (max-width: 900px) { .two-col, .with-side { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

.page-head { background: var(--paper); border-bottom: 1px solid var(--line); padding: 28px 0 30px; }
.page-head h1 { margin: 0; }
.page-head .lead { color: var(--ink-soft); margin: .6em 0 0; max-width: 62ch; font-size: 1.2rem; }
.crumbs { font-size: .92rem; color: var(--stone); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--stone); }

/* Klepsydry */
.obits-section { background: var(--paper); border-bottom: 1px solid var(--line); }
.obits { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 24px; }
.obituary { background: var(--paper); border: 6px solid var(--mourn); padding: 5px; }
.obituary-frame { border: 1px solid var(--mourn); padding: 26px 24px 20px; text-align: center; height: 100%; display: flex; flex-direction: column; }
.obituary-cross { width: 20px; height: 27px; fill: var(--mourn); margin: 0 auto 14px; }
.obituary-intro { font-size: .98rem; color: var(--ink-soft); margin-bottom: .5em; }
.obituary-name { font: 700 1.75rem/1.15 var(--serif); margin-bottom: .1em; color: var(--mourn); }
.obituary-family { color: var(--ink-soft); font-style: italic; margin-bottom: .2em; }
.obituary-dates { font-family: var(--serif); font-variant-numeric: lining-nums; color: var(--ink-soft); margin-bottom: 1em; }
.obituary-funeral, .obituary-masses { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; font-size: 1rem; }
.obituary-funeral p, .obituary-masses p { margin-bottom: .4em; }
.obituary-masses ul { list-style: none; padding: 0; margin: 0 0 .5em; }
.obituary-pray { font: italic 500 1.02rem/1.4 var(--serif); margin: auto 0 .8em; padding-top: 12px; }
.obituary-link { font-size: .95rem; }

/* Ogłoszenia i kancelaria */
.announce-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 26px; }
.announce-date { font: italic 500 1.05rem var(--serif); color: var(--gilt-text); margin-bottom: 1em; }
.clamp { max-height: 18em; overflow: hidden; position: relative; }
.clamp::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4em; background: linear-gradient(transparent, var(--paper)); }
.more { display: inline-block; margin-top: 12px; font-weight: 500; }
.office-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; }
.office-box .tel { font: 700 1.4rem var(--serif); text-decoration: none; }
.cem-teaser { display: block; margin-top: 20px; padding: 22px 24px; background: var(--ink); color: #fff; border-radius: var(--r); text-decoration: none; }
.cem-teaser:hover { color: #fff; background: #26323f; }
.cem-teaser strong { display: block; font: 700 1.3rem var(--serif); margin-bottom: 4px; color: #fff; }
.cem-teaser span { color: #cfd5da; }

.announce-full { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 28px 32px; }
.side-list h2 { font-size: 1.2rem; }
.side-list a { display: block; padding: 8px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; }
.side-list a span { display: block; color: var(--stone); font-size: .9rem; }
.side-list a[aria-current] { font-weight: 700; }

/* Aktualności */
.news-section { padding-top: 24px; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.news-grid .large { grid-column: span 3; display: grid; grid-template-columns: 1.3fr 1fr; }
.news-grid .large.no-img { grid-template-columns: 1fr; }
.news-grid .large h3 { font-size: 1.75rem; }
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 24px; }
.news-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.news-img { display: block; aspect-ratio: 3 / 2; background: var(--line-soft); overflow: hidden; }
.news-img img { width: 100%; height: 100%; object-fit: cover; }
.news-text { padding: 18px 22px 20px; }
.news-text h3 { font-size: 1.3rem; margin-bottom: .4em; }
.news-text h3 a { color: var(--ink); text-decoration: none; }
.news-text h3 a:hover { color: var(--marian); text-decoration: underline; }
.news-text p:last-child { margin: 0; color: var(--ink-soft); }
.news-meta { display: flex; gap: 12px; align-items: center; font-size: .9rem; color: var(--stone); margin-bottom: 8px; flex-wrap: wrap; }
.cat { font-weight: 700; text-decoration: none; color: var(--marian); }
.cat-orkiestra { color: #7a4b16; } .cat-chor { color: #5a3d6e; } .cat-miejscowosc { color: var(--ok); }
@media (max-width: 900px) { .news-grid { grid-template-columns: 1fr 1fr; } .news-grid .large { grid-column: span 2; grid-template-columns: 1fr; } }
@media (max-width: 600px) { .news-grid { grid-template-columns: 1fr; } .news-grid .large { grid-column: auto; } }

.groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
.group-link { padding: 18px 22px; border: 1px solid var(--line); border-left: 4px solid var(--gilt); border-radius: var(--r); background: var(--paper); text-decoration: none; color: var(--ink); }
.group-link:hover { border-color: var(--marian); border-left-color: var(--gilt); color: var(--ink); }
.group-link strong { display: block; font: 700 1.2rem var(--serif); color: var(--marian); }
.group-link span { color: var(--stone); font-size: .98rem; }
@media (max-width: 760px) { .groups { grid-template-columns: 1fr; } }

.filters, .pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 28px; }
.filters a, .pagination a, .pagination span { padding: 7px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); text-decoration: none; color: var(--ink); }
.filters a[aria-current], .pagination span { background: var(--marian); border-color: var(--marian); color: #fff; }
.pagination { margin-top: 32px; }

.article { max-width: 780px; padding-top: 28px; padding-bottom: 48px; }
.article-img { margin: 0 0 28px; }
.article-img img { border-radius: var(--r); width: 100%; }

/* Treść z edytora */
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.5rem; margin-top: 1.4em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .3em; }
.prose blockquote { margin: 1em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--gilt); font-style: italic; color: var(--ink-soft); }
.prose img { border-radius: var(--r); margin: 1em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.page-prose { font-size: 1.15rem; line-height: 1.7; }
.intro { margin-bottom: 40px; }

/* Oś czasu historii */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 118px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 100px 1fr; gap: 36px; padding: 0 0 34px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: 113px; top: 12px; width: 11px; height: 11px; background: var(--wall); border: 2px solid var(--marian); border-radius: 50%; }
.timeline li.major::before { background: var(--gilt); border-color: var(--gilt); width: 15px; height: 15px; left: 111px; top: 10px; }
.tl-year { font: 700 1.7rem/1 var(--serif); color: var(--marian); text-align: right; margin: 0; padding-top: 4px; font-variant-numeric: lining-nums; }
.major .tl-year { color: var(--gilt-text); font-size: 2.1rem; }
.tl-body { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 22px 8px; }
.major .tl-body { border-color: var(--gilt); }
.tl-date { color: var(--stone); font-size: .92rem; margin-bottom: .2em; }
.tl-body h2 { font-size: 1.3rem; }
.tl-body img { border-radius: var(--r); margin-bottom: 1em; max-height: 360px; object-fit: cover; }
@media (max-width: 640px) {
  .timeline::before { left: 7px; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; padding-left: 30px; }
  .timeline li::before { left: 2px; } .timeline li.major::before { left: 0; }
  .tl-year { text-align: left; }
}

.group-about { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; position: sticky; top: 96px; }

/* --- Cmentarz -------------------------------------------------------------- */
.search { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; margin-bottom: 32px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.grow { flex: 1 1 260px; }
.field label { font-weight: 500; font-size: .95rem; }
.field input, .field select { font: 1.05rem var(--sans); padding: 10px 12px; border: 1px solid #b9bfb5; border-radius: var(--r); background: #fff; color: var(--ink); min-width: 120px; }
.field input:focus, .field select:focus { border-color: var(--marian); outline: 2px solid var(--marian-tint); }
.search .btn { padding: 11px 22px; }

.results { margin-bottom: 40px; }
.results h2 { font-size: 1.35rem; }
.result-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.result-list li + li { border-top: 1px solid var(--line-soft); }
.result-list a { display: grid; grid-template-columns: 2fr 1fr 1.5fr; gap: 12px; padding: 13px 18px; text-decoration: none; color: var(--ink); align-items: baseline; }
.result-list a:hover { background: var(--marian-tint); }
.r-name { font: 700 1.15rem var(--serif); color: var(--marian); }
.r-dates { font-variant-numeric: lining-nums tabular-nums; color: var(--ink-soft); }
.r-place { color: var(--stone); font-size: .95rem; }
@media (max-width: 700px) { .result-list a { grid-template-columns: 1fr; gap: 2px; } }

.cem-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
.sector-page .cem-layout, .cem-layout:has(.sector-grid-wrap) { grid-template-columns: minmax(0, 1fr) 380px; }
@media (max-width: 960px) { .cem-layout, .cem-layout:has(.sector-grid-wrap) { grid-template-columns: minmax(0, 1fr); } }

.cem-map { margin: 0; }
.cem-map svg { width: 100%; height: auto; display: block; background: #eef1ea; border: 1px solid var(--line); border-radius: var(--r); }
.cem-map figcaption { font-size: .9rem; color: var(--stone); margin-top: 8px; }
.cm-wall { fill: #f7f8f4; stroke: #9aa39a; stroke-width: 3; }
.cm-alley { stroke: #d9d2bf; stroke-width: 22; fill: none; stroke-linecap: round; }
.cm-gate rect { fill: var(--ink); }
.cm-gate text, .me-label { font: 500 20px var(--sans); fill: var(--ink-soft); }
.cm-cross circle { fill: #f7f8f4; stroke: #c7c0a9; stroke-width: 2; }
.cm-cross path { fill: var(--gilt); }
.cm-sector rect { fill: #dfe6dc; stroke: #8f9b8e; stroke-width: 1.5; transition: fill .15s; }
.cm-sector .cm-code { font: 700 44px var(--serif); fill: var(--ink); }
.cm-sector .cm-name { font: 500 19px var(--sans); fill: var(--ink-soft); }
a.cm-sector:hover rect, a.cm-sector:focus rect { fill: var(--marian-tint); stroke: var(--marian); }
.cm-sector.hl rect { fill: var(--gilt-soft); stroke: var(--gilt); stroke-width: 4; }
.cm-sector.hl .cm-code { fill: var(--gilt-text); }

.sector-list { list-style: none; margin: 0 0 12px; padding: 0; }
.sector-list a { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.sector-list a:hover .sl-code { background: var(--marian); color: #fff; }
.sl-code { width: 44px; height: 44px; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); font: 700 1.3rem var(--serif); color: var(--marian); flex: none; }
.sector-list small { display: block; color: var(--stone); }
.cem-info { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }

.sector-grid-wrap { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; overflow-x: auto; }
.sector-grid { display: inline-flex; flex-direction: column; gap: 3px; min-width: min-content; }
.grid-row { display: flex; gap: 3px; align-items: center; }
.row-no, .col-no { width: 26px; flex: none; text-align: center; font-size: .75rem; color: var(--stone); font-variant-numeric: tabular-nums; }
.col-no { width: 22px; }
.cell { width: 22px; height: 28px; border-radius: 3px; display: block; flex: none; }
.cell.vacant { background: transparent; border: 1px dashed #d3d8cf; }
.cell.taken { background: #9fadbf; }
.cell.reserved { background: #fff; border: 2px solid #9fadbf; }
a.cell:hover { background: var(--marian); border-color: var(--marian); }
.cell.hl { background: var(--gilt); box-shadow: 0 0 0 3px var(--gilt-soft), 0 0 0 5px var(--gilt); position: relative; z-index: 1; }
.grid-legend { list-style: none; padding: 0; margin: 16px 0 0; display: flex; gap: 18px; flex-wrap: wrap; font-size: .9rem; color: var(--stone); }
.grid-legend li { display: flex; align-items: center; gap: 6px; }
.grid-legend .cell { width: 14px; height: 18px; box-shadow: none; }
.grid-legend .cell.hl { box-shadow: none; }

.directions { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--gilt); border-radius: var(--r); padding: 20px 24px; margin-bottom: 28px; }
.directions h2 { font-size: 1.35rem; }
.loc-label { font: 700 1.2rem var(--serif); color: var(--marian); }
.steps { padding-left: 1.4em; margin: 0 0 1em; }
.steps li { margin-bottom: .45em; padding-left: .2em; }
.steps li::marker { font-family: var(--serif); font-weight: 700; color: var(--gilt-text); }
.nav-links { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.loc-maps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.loc-maps h3 { font-size: 1.15rem; }
@media (max-width: 900px) { .loc-maps { grid-template-columns: minmax(0, 1fr); } }

.person { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 36px; margin-bottom: 36px; align-items: start; }
@media (max-width: 860px) { .person { grid-template-columns: minmax(0, 1fr); } }
.person-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.person-photo { width: 160px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r); margin-bottom: 16px; filter: grayscale(.2); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0 0 18px; }
.facts dt { color: var(--stone); font-size: .95rem; padding-top: 2px; }
.facts dd { margin: 0; font-variant-numeric: lining-nums; }
.companions { border-top: 1px solid var(--line); padding-top: 14px; margin-bottom: 14px; }
.companions h3 { font-size: 1.05rem; font-family: var(--sans); }
.pray { font: italic 500 1.08rem/1.5 var(--serif); color: var(--ink-soft); margin: 0; border-top: 1px solid var(--line); padding-top: 14px; }
.person-masses h2 { font-size: 1.45rem; }
.mass-dates { list-style: none; padding: 0; margin: 0 0 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.mass-dates li { display: grid; grid-template-columns: 220px 1fr; gap: 2px 16px; padding: 12px 18px; }
.mass-dates li + li { border-top: 1px solid var(--line-soft); }
.md-date { font: 700 1.05rem var(--serif); color: var(--marian); }
.md-time { color: var(--ink-soft); }
.md-int { grid-column: 1 / -1; color: var(--stone); font-size: .95rem; }
.past summary { cursor: pointer; color: var(--marian); font-weight: 500; margin-bottom: 10px; }
.past-list .md-date { font: 500 1rem var(--sans); color: var(--ink-soft); }
@media (max-width: 600px) { .mass-dates li { grid-template-columns: 1fr; } }
.grave-photo { margin: 0 0 28px; max-width: 520px; }
.grave-photo img { border-radius: var(--r); }
.grave-photo figcaption { font-size: .9rem; color: var(--stone); margin-top: 6px; }
.people li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); margin: 0; }
.people span { color: var(--stone); font-size: .9rem; white-space: nowrap; }

/* --- Stopka --------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #cfd5da; padding: 48px 0 0; margin-top: 0; font-size: 1rem; }
.site-footer a { color: #fff; }
.site-footer h2 { font: 700 1.05rem var(--sans); color: #fff; margin-bottom: .7em; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 32px; }
.footer-name { font: 700 1.35rem var(--serif); color: #fff; margin-bottom: .3em; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #36424e; margin-top: 36px; padding: 18px 20px 24px; font-size: .9rem; color: #9aa5ae; }
.footer-bottom a { color: #9aa5ae; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

.error-page { padding: 80px 20px; text-align: center; }
.err-code { font: 700 5rem/1 var(--serif); color: var(--gilt); margin-bottom: .2em; }

@media print {
  .site-header, .site-footer, .board-days, .filters, .week-nav a, .search { display: none !important; }
  body { background: #fff; }
  .board-panel[hidden] { display: block !important; }
}

/* Większa siatka na stronie kwatery */
.sector-grid.big { gap: 4px; }
.sector-grid.big .grid-row { gap: 4px; }
.sector-grid.big .cell { width: 32px; height: 42px; }
.sector-grid.big .col-no { width: 32px; }
.people-section { margin-top: 40px; }
.people-section .people { columns: 3 260px; column-gap: 36px; }
.people-section .people li { break-inside: avoid; }

/* --- Galeria ------------------------------------------------------------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 24px; }
.album-card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; color: var(--ink); }
.album-card:hover { border-color: var(--marian); color: var(--ink); }
.album-card:hover strong { color: var(--marian); text-decoration: underline; }
.album-cover { display: block; aspect-ratio: 4 / 3; background: var(--line-soft); overflow: hidden; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-empty { display: grid; place-items: center; height: 100%; color: var(--stone); font-size: .95rem; }
.album-text { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 2px; }
.album-text strong { font: 700 1.2rem/1.25 var(--serif); }
.album-text span { color: var(--stone); font-size: .95rem; }
.album-desc { margin-bottom: 28px; }

.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 46%), 1fr)); gap: 8px; }
.photo-grid a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 4px; background: var(--line-soft); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.photo-grid a:hover img, .photo-grid a:focus-visible img { transform: scale(1.04); }

/* Okno podglądu zdjęć */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10, 14, 20, .94); display: grid; grid-template-rows: auto 1fr auto; color: #fff; }
.lightbox[hidden] { display: none; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; gap: 12px; }
.lb-count { font-size: .95rem; color: #c9d0d8; font-variant-numeric: tabular-nums; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 64px; touch-action: pan-y; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); user-select: none; }
.lb-caption { text-align: center; padding: 12px 20px calc(18px + env(safe-area-inset-bottom, 0px)); color: #e3e7eb; min-height: 3em; font-size: 1.02rem; }
.lb-btn { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); color: #fff; border-radius: 99px; width: 46px; height: 46px; display: grid; place-items: center; cursor: pointer; }
.lb-btn:hover { background: rgba(255, 255, 255, .22); }
.lb-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
@media (max-width: 640px) { .lb-stage { padding: 0 8px; } .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; background: rgba(0, 0, 0, .45); } }
body.lb-open { overflow: hidden; }

/* --- Orkiestra i chór: zakładki -------------------------------------------- */
.group-head { padding-bottom: 18px; border-bottom: 0; }
.group-tabs { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 76px; z-index: 20; }
.group-tabs ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; }
.group-tabs a { display: block; padding: 12px 16px; text-decoration: none; color: var(--ink-soft); font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; }
.group-tabs a:hover { color: var(--marian); }
.group-tabs a[aria-current] { color: var(--marian); border-bottom-color: var(--gilt); }
.side-block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 20px; }
.side-block h2 { font-size: 1.2rem; }
.side-news li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); margin: 0; }
.side-news span { display: block; color: var(--stone); font-size: .9rem; }
.side-block .album-card { margin-bottom: 8px; }

.groups { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .groups { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .groups { grid-template-columns: 1fr; } }

/* Podpis administratora */
.signature { color: #8d98a2; }
.signature a { color: #b8c1c9; }
@media (max-width: 700px) { .footer-bottom { flex-direction: column; gap: 6px; } }
.nav a, .sub-toggle { white-space: nowrap; }
.brand-sub { white-space: nowrap; }
@media (max-width: 420px) { .brand-sub { white-space: normal; } }
.lightbox { background: rgba(10, 14, 20, .97); height: 100%; }
.lb-stage { overflow: hidden; }
.lb-stage img { max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); width: auto; height: auto; }

/* Klepsydry – szersze karty */
.obits { grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr)); gap: 28px; }
.obits:has(> .obituary:only-child) { max-width: 820px; }
.obituary-frame { padding: 30px 36px 24px; }
.obituary-name { font-size: 2rem; }
.obituary-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 32px; text-align: left; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
.obituary-details .obituary-funeral, .obituary-details .obituary-masses { border-top: 0; padding-top: 0; margin-top: 0; }
.od-label { font-weight: 700; margin-bottom: .3em !important; }
.obituary-masses ul li { padding: 2px 0; }
.obituary-pray { text-align: center; }
@media (max-width: 520px) { .obituary-frame { padding: 24px 18px 20px; } .obituary-name { font-size: 1.65rem; } }
/* Klepsydry: szczegóły jeden pod drugim, wyśrodkowane */
.obituary-details { grid-template-columns: 1fr; text-align: center; gap: 0; }
.obituary-details .obituary-masses { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 10px; }
.obituary-details .obituary-funeral + .obituary-masses { margin-top: 12px; }
.obituary-details .obituary-funeral:only-child, .obituary-details .obituary-masses:only-child { border-top: 0; margin-top: 0; padding-top: 0; }
