/* Archiv und Bibliothek der Honterusgemeinde.
   Colours and type follow honterusgemeinde.ro (WordPress, Porto theme: red #af1e22, Lora). The catalogue
   runs on its own and, mostly, inside two iframes side by side on honterusgemeinde.ro (html.is-embedded):
   each about 540 px wide, 550 px high and without scrollbars, on an ochre section. There only the
   catalogue shows, on a white panel, and the results scroll inside the frame.
   Light only on purpose: a dark catalogue inside the parish's white page would look broken. */

@font-face { font-family: "Lora"; src: url("/assets/lora-latin-1c7159ba.woff2") format("woff2"); font-weight: 400 700; font-display: swap;
  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: "Lora"; src: url("/assets/lora-latin-ext-b9f60747.woff2") format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lora"; src: url("/assets/lora-italic-latin-5ecfc3f2.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --red: #af1e22;
  --red-dark: #84171a;
  --text: #262626;
  --muted: #5c5654;          /* 7.0:1 on white */
  --rule: #e6dedb;
  --tint: #faf6f4;            /* striped rows, panels */
  --field: #ffffff;
  --border: #8a817e;          /* form controls, 3.9:1 */
  --focus: #1f5fbf;
  --font: "Lora", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--text); font: 400 16px/1.55 var(--font); }
a { color: var(--red); text-underline-offset: 2px; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1 { margin: 0 0 12px; font-size: 1.45rem; line-height: 1.25; font-weight: 600; color: var(--red); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skiplink { position: absolute; left: -999px; top: 8px; padding: 8px 12px; background: #fff; z-index: 10; }
.skiplink:focus { left: 8px; }

/* Site chrome (only when the catalogue runs on its own) */
.site-header { border-bottom: 3px solid var(--red); }
.site-header__inner, .site-footer__inner, .page { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; padding-top: 14px; padding-bottom: 10px; }
.site-header__name { color: var(--text); text-decoration: none; font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
.site-header__parish { display: block; color: var(--red); font-size: .85rem; font-weight: 400; letter-spacing: .02em; }
.site-header__catalogues { display: flex; gap: 4px; }
.site-header__catalogues a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; }
.site-header__catalogues a[aria-current] { color: var(--text); font-weight: 600; box-shadow: inset 0 -3px 0 var(--red); }
.page { padding-top: 20px; padding-bottom: 32px; }
.site-footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: .875rem; }
.site-footer__inner { padding-top: 12px; padding-bottom: 20px; }
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--muted); }

/* Catalogue head: name and the two searches */
.catalogue-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 10px; }
.catalogue-head h1 { margin: 0; }
.tabs { display: flex; gap: 2px; }
.tabs a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; border-radius: 4px; text-decoration: none; font-size: .95rem; }
.tabs a[aria-current] { background: var(--tint); color: var(--text); font-weight: 600; }

/* Forms */
input, select, button { font: inherit; color: inherit; }
input[type=search], select { min-height: 40px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--field); }
button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 4px; background: var(--red); color: #fff; font-weight: 600; cursor: pointer; }
button:hover { background: var(--red-dark); }
.search { display: flex; gap: 8px; margin-bottom: 14px; }
.search input { flex: 1; min-width: 0; }
.advanced { margin-bottom: 14px; }
.advanced > summary { cursor: pointer; color: var(--red); min-height: 32px; }
.advanced[open] > summary { display: none; }
.advanced__row { display: grid; grid-template-columns: 9.5em 1fr 4.5em; gap: 6px; margin: 0 0 6px; padding: 0; border: 0; }
.advanced__row:last-of-type { grid-template-columns: 9.5em 1fr; }
.advanced__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: .85rem; }
.notice { padding: 8px 12px; border-left: 3px solid var(--red); background: var(--tint); }

/* Results */
.results__summary { margin: 0 0 8px; }
.results__range { color: var(--muted); }
.results__print { margin-left: 8px; font-size: .9rem; }
.records { margin: 0; padding: 0; list-style: none; }
.records > li { padding: 8px 10px; border-top: 1px solid var(--rule); }
.records > li:nth-child(odd) { background: var(--tint); }
.record__core, .record__details, .entry__fields, .print-list dl { display: grid; grid-template-columns: max-content 1fr; gap: 1px 12px; margin: 0; }
dt { color: var(--muted); font-size: .9rem; }
dd { margin: 0; overflow-wrap: anywhere; }
.record__title { font-weight: 600; }
.record__more { margin-top: 4px; }
.record__more > summary { cursor: pointer; color: var(--red); font-size: .9rem; width: max-content; }
.record__details { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--rule); }
.record__link { margin: 6px 0 0; font-size: .9rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 10px; }
.pager a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 8px; }
.pager__position { color: var(--muted); font-size: .9rem; }

/* One entry */
.breadcrumbs { margin-bottom: 8px; font-size: .9rem; }
.entry h1 { font-size: 1.35rem; color: var(--text); }
.entry__fields { gap: 4px 16px; }

/* Narrow screens and frames: labels above the values */
@media (max-width: 480px) {
  .record__core, .record__details, .entry__fields { grid-template-columns: 1fr; }
  dd + dt { margin-top: 4px; }
  .advanced__row, .advanced__row:last-of-type { grid-template-columns: 1fr 1fr; }
  .advanced__row input { grid-column: 1 / -1; grid-row: 1; }
}

/* Inside honterusgemeinde.ro: only the catalogue, on its own white panel (the frames sit on an ochre
   section with a photo behind, #e2a700, where red text and unstriped rows would be hard to read); the
   results scroll inside the frame */
.is-embedded body { background: transparent; font-size: 15px; }
.is-embedded .site-header, .is-embedded .site-footer { display: none; }
.is-embedded .page { max-width: none; height: 100vh; overflow-y: auto; padding: 10px 12px 14px; background: #fff; border-radius: 6px; }
.is-embedded h1 { font-size: 1.15rem; }

/* Print view and printing any page */
.print .page { max-width: none; padding: 0 8px; }
.print-list { padding-left: 1.6em; }
.print-list > li { padding: 6px 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
@media print {
  .site-header, .site-footer, .search, .advanced, .tabs, .pager, .results__print, .record__link, .breadcrumbs { display: none !important; }
  body { font-size: 10.5pt; }
  .page { height: auto !important; overflow: visible !important; padding: 0; }
  .records > li { background: none !important; }
}
