/* Brygada 1918: polski krój z 1918 r., pełne znaki diakrytyczne, kursywa do nazw łacińskich. */
@font-face { font-family: "Brygada 1918"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/brygada-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Brygada 1918"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/brygada-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Brygada 1918"; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url(../fonts/brygada-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Brygada 1918"; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url(../fonts/brygada-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+2000-206F, U+20AC, U+2122, U+2212; }

:root {
  --paper: #f2f3f0;      /* tło strony */
  --tile: #e2e5e0;       /* tło kafla przed załadowaniem zdjęcia */
  --ink: #1b2a25;        /* świerkowa czerń: tekst i pasek górny */
  --muted: #65706a;      /* podpisy drugiego rzędu */
  --accent: #0d6a7d;     /* błękit zimorodka: stan aktywny, fokus */
  --reed: #e5e0cf;       /* trzcina: pas wykazu alfabetycznego */
  --gap: 10px;
  --serif: "Brygada 1918", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.55 var(--serif); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2 { font-weight: 500; line-height: 1.15; margin: 0; }
.wrap { width: min(100% - 2.5rem, 84rem); margin-inline: auto; }

/* Pasek górny: język i wyszukiwarka */
.strip { background: var(--ink); color: var(--paper); font-size: .875rem; }
.strip__in > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.75rem; }
.strip a:hover { color: #fff; }
.strip .links { display: flex; gap: .9rem; list-style: none; margin: 0; padding: 0; }
.strip .language-link { font-size: 0; text-decoration: none; letter-spacing: .12em; }
.strip .language-link::before { content: attr(hreflang); font-size: .8125rem; text-transform: uppercase; }
.strip .language-link.is-active::before { border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.strip form { margin: 0; }
.strip form { display: flex; align-items: center; }
.strip label { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.strip input[type="text"] {
  width: min(52vw, 19rem); height: 1.875rem; padding: 0 .7rem; border: 1px solid #ffffff4d; border-right: 0;
  background: transparent; color: inherit; font: inherit;
}
.strip input[type="text"]::placeholder { color: #ffffffa6; font-style: italic; }
.strip input[type="text"]:focus-visible { outline-color: #fff; outline-offset: 0; }
.strip input[type="submit"] {
  height: 1.875rem; padding: 0 .85rem; border: 1px solid #ffffff4d; background: var(--paper); color: var(--ink);
  font: inherit; cursor: pointer;
}
.strip input[type="submit"]:hover { background: #fff; }

/* Winieta i nawigacja kategorii */
.masthead { text-align: center; padding: 3.25rem 0 2.25rem; }
.masthead a { text-decoration: none; }
.site-name { display: block; font-size: clamp(1.6rem, 1rem + 3vw, 2.625rem); font-weight: 500; letter-spacing: .34em; margin-right: -.34em; text-transform: uppercase; line-height: 1.1; }
.site-slogan { margin-bottom: 0; font-style: italic; color: var(--muted); margin-top: .5rem; }
.sections { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1.9rem; margin-top: 2rem; font-size: 1.125rem; letter-spacing: .05em; }
.sections :not(a, h2, .contextual, .contextual *) { display: contents; }
.sections a { order: 1; padding-bottom: 3px; border-bottom: 1px solid transparent; }
.sections nav li:first-child a { order: 0; }
.sections nav li:last-child a { order: 2; font-style: italic; }
.sections a:hover, .sections a.is-active { border-bottom-color: currentColor; }
.sections a.is-active { color: var(--accent); }

/* Ścieżka */
.path nav ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0 0 .9rem; padding: 0; font-size: .9375rem; color: var(--muted); }
.path nav li + li::before { content: "/"; margin: 0 .55rem; }

/* Nagłówki stron i sekcji */
.main { padding-bottom: 4.5rem; min-height: 40vh; }
h1 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem); margin-bottom: 1.5rem; }
.lead { margin: -1.15rem 0 1.75rem; }
.lead p { margin: 0; }
.lead__latin { font-style: italic; font-size: 1.25rem; }
.lead__note { color: var(--muted); font-size: .9375rem; }
.lead .field--name-description, .lead > div { max-width: 68ch; margin-top: .75rem; }
.main h2 { font-size: 1.625rem; margin: 4rem 0 1.1rem; }

/* Siatka kafli: kategorie, podkategorie, galerie, zdjęcia */
.view__rows { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.75rem var(--gap); }
.tile__link { display: block; text-decoration: none; }
.tile__img { display: block; background: var(--tile); aspect-ratio: 3 / 2; overflow: hidden; }
.tile__img img { width: 100%; height: 100%; object-fit: cover; }
.tile__name { display: block; margin-top: .6rem; line-height: 1.25; }
.tile__note { display: block; color: var(--muted); font-size: .875rem; }
.tile__note[lang="la"] { font-style: italic; }
.tile__link:hover .tile__name { text-decoration: underline; text-decoration-thickness: 1px; }
.tile--category .tile__name { font-size: 1.1875rem; letter-spacing: .04em; }

/* Strona główna: pierwsza kategoria zajmuje pół siatki */
.view--kategorie--page-1 .view__rows > :first-child { grid-column: span 2; grid-row: span 2; display: flex; }
.view--kategorie--page-1 .view__rows > :first-child .tile { display: flex; flex: 1; }
.view--kategorie--page-1 .view__rows > :first-child .tile__link { display: flex; flex-direction: column; flex: 1; }
.view--kategorie--page-1 .view__rows > :first-child .tile__img { flex: 1; aspect-ratio: auto; min-height: 0; }
.view--kategorie--page-1 .view__rows > :first-child .tile__name { font-size: 1.5rem; }
.more-link { margin-top: 1.5rem; }

/* Galeria: zdjęcia */
.gallery .field__items, .gallery .photoswipe-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.gallery .photoswipe-gallery a { display: block; background: var(--tile); aspect-ratio: 3 / 2; overflow: hidden; }
.gallery .photoswipe-gallery img { width: 100%; height: 100%; object-fit: cover; }

/* Wykaz alfabetyczny: indeks jak w atlasie */
.view--wykaz--page-1 .view__rows { display: block; columns: 4 15rem; column-gap: 2.5rem; }
.view--wykaz--page-1 h3 { font-size: 1.75rem; font-weight: 500; margin: 0 0 .25rem; color: var(--accent); break-after: avoid; }
.view--wykaz--page-1 .view__rows > div { break-inside: avoid; line-height: 1.3; margin-bottom: .45rem; }
.view--wykaz--page-1 h3 ~ h3, .view--wykaz--page-1 div + h3 { margin-top: 1.5rem; }
.view--wykaz--page-1 .latin { display: block; color: var(--muted); font-style: italic; font-size: .875rem; }

.view--wykaz--page-1 a { text-decoration: none; }
.view--wykaz--page-1 a:hover { text-decoration: underline; }

/* Pas z literami: wykaz dostępny z każdej strony */
.index-band { background: var(--reed); padding: 2.5rem 0 2.75rem; text-align: center; }
.index-band h2 { font-size: 1.125rem; font-style: italic; font-weight: 400; margin-bottom: 1rem; }
.index-band .view__rows { display: flex; flex-wrap: wrap; justify-content: center; gap: .15rem .3rem; }
.index-band .view a { display: inline-block; min-width: 2.5rem; padding: .2rem .35rem; font-size: 1.75rem; line-height: 1.3; text-decoration: none; border-bottom: 1px solid transparent; }
.index-band .view a:hover { border-bottom-color: currentColor; }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding: 1.5rem 0 2rem; font-size: .875rem; color: var(--muted); }
.footer p { margin: 0; }

/* Drupal: komunikaty i zakładki redaktora */
[data-drupal-messages] { border-left: 3px solid var(--accent); background: #fff; padding: .75rem 1rem; margin-bottom: 1.5rem; }
.main > div > nav ul, .tabs { display: flex; flex-wrap: wrap; gap: 1.25rem; list-style: none; margin: 0 0 1.5rem; padding: 0; font-size: .9375rem; }

@media (max-width: 62rem) {
  .view__rows, .gallery .photoswipe-gallery, .gallery .field__items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 44rem) {
  .view__rows, .gallery .photoswipe-gallery, .gallery .field__items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .masthead { padding: 2.25rem 0 1.5rem; }
  .site-name { letter-spacing: .22em; margin-right: -.22em; }
  .sections { gap: .25rem 1.25rem; font-size: 1rem; margin-top: 1.5rem; }
  .index-band .view a { font-size: 1.375rem; min-width: 2.1rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .tile__img img { transition: transform .5s ease; }
  .tile__link:hover .tile__img img { transform: scale(1.03); }
}
