/* Holbein-Schule: Aussehen der eigenen Blöcke. Farben kommen aus dem Theme (theme.json), die Werte
   dahinter sind der Notbehelf, falls ein anderes Theme aktiv ist.
   Formensprache: runde Ecken, Flächen aus mattem Glas (durchscheinend, weichgezeichnet), darauf als
   einziger Schmuck die kurzen farbigen Balken aus dem Schullogo. */
:root {
  --hg-papier: var(--wp--preset--color--base, #fff);
  --hg-tinte: var(--wp--preset--color--contrast, #10222e);
  --hg-blau: var(--wp--preset--color--accent-1, #04adec);
  --hg-magenta: var(--wp--preset--color--accent-2, #e5048c);
  --hg-limette: var(--wp--preset--color--accent-3, #cadb2e);
  --hg-grau: var(--wp--preset--color--accent-4, #4a5d69);
  --hg-nebel: var(--wp--preset--color--accent-5, #eef6fa);
  --hg-linie: var(--wp--preset--color--accent-6, #d3e2ea);
  --hg-blau-tief: var(--wp--preset--color--blau-tief, #086a94);
  --hg-rund: 1.5rem;
  --hg-rund-klein: .9rem;
  --hg-glas: rgba(255, 255, 255, .62);
  --hg-glas-dicht: rgba(255, 255, 255, .88);
  --hg-glas-rand: rgba(255, 255, 255, .8);
  --hg-glas-schatten: inset 0 1px 0 rgba(255, 255, 255, .9), 0 18px 48px -20px rgba(16, 34, 46, .3), 0 2px 6px -2px rgba(16, 34, 46, .08);
  --hg-weich: blur(22px) saturate(170%);
}
/* Wer weniger Durchsicht wünscht oder einen Browser ohne Weichzeichner hat, bekommt dichte Flächen. */
@media (prefers-reduced-transparency: reduce) {
  :root { --hg-glas: #fff; --hg-glas-dicht: #fff; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --hg-glas: rgba(255, 255, 255, .94); --hg-glas-dicht: #fff; }
}

/* Glasfläche: für die eigenen Blöcke und als Stil „Glas“ an jeder Gruppe wählbar */
.is-style-glas, .hg-termine-block, .hg-nachbarn, .hg-bereich section {
  background: var(--hg-glas); -webkit-backdrop-filter: var(--hg-weich); backdrop-filter: var(--hg-weich);
  border: 1px solid var(--hg-glas-rand); box-shadow: var(--hg-glas-schatten); border-radius: var(--hg-rund);
}
.is-style-glas { padding: clamp(1.25rem, 2.5vw, 2rem); }

.hg-entwurf { margin: 0; padding: .4rem 1rem; background: var(--hg-limette); color: var(--hg-tinte); font-size: .88rem; font-weight: 600; text-align: center; }

.hg-knopf { display: inline-block; background: var(--hg-tinte); color: #fff; font-weight: 700; padding: .8rem 1.4rem; text-decoration: none; border-radius: 999px; }
.hg-knopf:hover, .hg-knopf:focus-visible { background: var(--hg-blau-tief); color: #fff; }
.hg-knopf-leise { background: transparent; color: var(--hg-tinte); box-shadow: inset 0 0 0 2px var(--hg-tinte); }
.hg-knopf-leise:hover { background: var(--hg-tinte); color: #fff; }
.hg-pfeil { width: 2.75rem; height: 2.75rem; display: inline-grid; place-items: center; border: 1px solid var(--hg-glas-rand); padding: 0; border-radius: 50%; background: var(--hg-glas-dicht); color: var(--hg-tinte); box-shadow: 0 6px 16px -8px rgba(16, 34, 46, .35); cursor: pointer; }
.hg-pfeil:hover { background: var(--hg-tinte); color: #fff; }
.hg-pfeil:focus-visible, .hg-knopf:focus-visible, .hg-meldung a:focus-visible, .hg-blick-spur:focus-visible { outline: 3px solid var(--hg-magenta); outline-offset: 2px; }

/* ---------- Logo mit Fenstern ---------- */
.hg-logo-fenster svg { display: block; width: 100%; height: auto; max-height: 36rem; }
.hg-balken-blau { fill: var(--hg-blau); }
.hg-balken-magenta { fill: var(--hg-magenta); }
.hg-balken-limette { fill: var(--hg-limette); }
@media (prefers-reduced-motion: no-preference) {
  .hg-balken { transform-box: fill-box; transform-origin: left center; animation: hg-balken .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
  .hg-logo-fenster image { animation: hg-ein 1.1s ease-out .55s both; }
}
@keyframes hg-balken { from { transform: scaleX(0); } }
@keyframes hg-ein { from { opacity: 0; } }

/* ---------- Termine ---------- */
.hg-termine-block { padding: .4rem clamp(1rem, 2vw, 1.5rem); }
.hg-termine { list-style: none; margin: 0; padding: 0; }
.hg-termin { display: grid; grid-template-columns: 4.25rem 1fr; gap: 1.1rem; align-items: center; padding: .9rem 0; }
.hg-termin + .hg-termin { border-top: 1px solid var(--hg-linie); }
.hg-termin time { display: grid; text-align: center; line-height: 1; padding: .6rem 0 .55rem; border-radius: var(--hg-rund-klein); background: var(--hg-papier); box-shadow: 0 6px 16px -10px rgba(16, 34, 46, .4); position: relative; overflow: hidden; }
/* kurzer runder Balken in einer Logofarbe, wie an den Karten: kein Farbrand über die ganze Kante */
.hg-termin time::before { content: ""; position: absolute; top: .4rem; left: 50%; width: 1.5rem; height: .28rem; margin-left: -.75rem; border-radius: 999px; background: var(--hg-magenta); }
.hg-termin:nth-child(3n + 2) time::before { background: var(--hg-blau); }
.hg-termin:nth-child(3n) time::before { background: var(--hg-limette); }
.hg-termin-tag { font-size: 1.6rem; font-weight: 800; margin-top: .4rem; }
.hg-termin-monat { font-size: .82rem; font-weight: 600; margin-top: .2rem; }
.hg-termin strong { display: block; font-size: 1.05rem; }
.hg-termin-dazu { display: block; color: var(--hg-grau); font-size: .95rem; }
.hg-termine-leer { color: var(--hg-grau); }
.hg-termine-abo { display: grid; gap: .7rem; justify-items: start; margin: .5rem 0 1rem; padding-top: 1.1rem; border-top: 1px solid var(--hg-linie); font-size: .92rem; color: var(--hg-grau); }
.hg-termine-abo a:not(.hg-knopf) { overflow-wrap: anywhere; }

/* ---------- Meldungen ---------- */
.hg-meldungen-kopf { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: 1.5rem; }
.hg-meldungen-kopf h2 { margin: 0; }
.hg-meldungen-kopf-rechts { display: flex; align-items: center; gap: 1.25rem; margin: 0 0 0 auto; }
.hg-meldungen-alle { font-weight: 700; }
/* Die Pfeile erscheinen erst, wenn das Skript läuft (Klasse hg-band-bereit). Ohne Skript wischt oder rollt man das Band. */
.hg-band-pfeile { display: none; gap: .4rem; }
.hg-band-bereit .hg-band-pfeile { display: flex; }
.hg-meldungen { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 2.25rem 1.75rem; }
.hg-meldung a { display: block; color: inherit; text-decoration: none; }
.hg-meldung-bild { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--hg-nebel); border-radius: var(--hg-rund); box-shadow: 0 14px 30px -18px rgba(16, 34, 46, .45); }
.hg-meldung-bild img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.hg-meldung a:hover .hg-meldung-bild img { transform: scale(1.04); }
.hg-meldung-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin: .9rem 0 0; font-size: .875rem; color: var(--hg-grau); }
.hg-fach { display: inline-block; background: var(--hg-limette); color: var(--hg-tinte); font-size: .78rem; font-weight: 700; line-height: 1.6; padding: 0 .65rem; border-radius: 999px; text-decoration: none; }
a.hg-fach:hover { background: var(--hg-tinte); color: #fff; }
.hg-meldung-titel { font-size: 1.2rem; line-height: 1.25; margin: .3rem 0 .4rem; font-weight: 800; }
.hg-meldung a:hover .hg-meldung-titel { color: var(--hg-blau-tief); text-decoration: underline; text-underline-offset: .18em; }
.hg-meldung-text { display: block; color: var(--hg-grau); font-size: .98rem; }

/* Band: eine Reihe zum Wischen, rastet an den Karten ein. Der Rand unten lässt Platz für den Schatten. */
.hg-meldungen-band { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(21rem, 80vw); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: .25rem .25rem 1.25rem; margin: -.25rem; overscroll-behavior-x: contain; }
.hg-meldungen-band::-webkit-scrollbar { display: none; }
.hg-meldungen-band .hg-meldung { scroll-snap-align: start; }
/* Zwei Reihen: Die Meldungen laufen spaltenweise (1 und 2 übereinander, dann 3 und 4), die neuesten stehen links.
   Die Karten sind schmaler und ohne Textauszug, sonst würde der Abschnitt zu hoch. Der Auszug steht in der Kurzansicht. */
.hg-zwei-reihen { grid-template-rows: repeat(2, auto); grid-auto-columns: min(17.5rem, 68vw); gap: 1.75rem 1.5rem; }
.hg-zwei-reihen .hg-meldung-text { display: none; }
.hg-zwei-reihen .hg-meldung-titel { font-size: 1.08rem; }

/* Kurzansicht zum Durchblättern */
.hg-blick { width: min(66rem, 100vw - 2rem); max-width: none; height: min(42rem, 100dvh - 2rem); max-height: none; padding: 0; border: 1px solid var(--hg-glas-rand); border-radius: 1.75rem; background: var(--hg-glas-dicht); -webkit-backdrop-filter: var(--hg-weich); backdrop-filter: var(--hg-weich); color: var(--hg-tinte); overflow: hidden; box-shadow: 0 2.5rem 6rem -1.5rem rgba(16, 34, 46, .6); }
.hg-blick[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.hg-blick::backdrop { background: rgba(16, 34, 46, .5); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.hg-blick-leiste { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem .6rem .6rem 1.5rem; }
.hg-blick-zaehler { margin: 0; font-size: .9rem; font-weight: 600; color: var(--hg-grau); }
.hg-blick-spur { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.hg-blick-spur::-webkit-scrollbar { display: none; }
.hg-blick-folie { box-sizing: border-box; flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; display: grid; grid-template-columns: 1.2fr 1fr; overflow-y: auto; padding: 0 .6rem; }
.hg-blick-folie:not(:has(.hg-blick-bild)) { grid-template-columns: 1fr; }
.hg-blick-bild { min-height: 0; background: var(--hg-nebel); border-radius: 1.25rem; overflow: hidden; }
.hg-blick-bild img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hg-blick-text { align-self: center; padding: clamp(1.25rem, 3vw, 2.75rem); }
.hg-blick-text .hg-meldung-meta { margin: 0; }
.hg-blick-text h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.15; margin: .5rem 0 .8rem; }
.hg-blick-text h2:focus { outline: none; }
/* position: relative hält den nur vorgelesenen Zusatz („weitere: …“) im Band. Ohne das ragte er aus dem Rollbereich und machte die Seite am Handy breiter. */
.hg-fach-mehr { background: var(--hg-nebel); position: relative; }
.hg-blick-text p { margin: 0 0 1.25rem; }
.hg-blick-text p:last-child { margin-bottom: 0; }
.hg-blick-fuss { display: flex; justify-content: flex-end; gap: .4rem; padding: .6rem; }
@media (prefers-reduced-motion: no-preference) {
  .hg-blick[open] { animation: hg-blick-auf .25s cubic-bezier(.2, .7, .2, 1); }
  .hg-blick[open]::backdrop { animation: hg-ein .25s ease-out; }
}
@keyframes hg-blick-auf { from { opacity: 0; transform: translateY(.75rem) scale(.985); } }
@media (max-width: 48rem) {
  .hg-blick { width: calc(100vw - 1rem); height: calc(100dvh - 1rem); border-radius: 1.5rem; }
  .hg-blick-folie { grid-template-columns: 1fr; align-content: start; }
  .hg-blick-bild img { height: auto; aspect-ratio: 3 / 2; }
  .hg-blick-text { align-self: start; padding-inline: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hg-meldung-bild img { transition: none; }
}

/* ---------- Bereichsübersicht, Nachbarseiten, Pfad, Stand, Schülerprojekte ---------- */
.hg-bereich { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem; }
.hg-bereich section { padding: 1.4rem 1.5rem 1.1rem; }
.hg-bereich h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
.hg-bereich h2::before, .hg-nachbarn-titel::before { content: ""; display: block; width: 2.75rem; height: .4rem; border-radius: 999px; background: var(--hg-blau); margin-bottom: .8rem; }
.hg-bereich section:nth-child(4n + 2) h2::before { background: var(--hg-magenta); }
.hg-bereich section:nth-child(4n + 3) h2::before { background: var(--hg-limette); }
.hg-bereich section:nth-child(4n) h2::before { background: var(--hg-tinte); }
.hg-bereich ul, .hg-nachbarn ul, .hg-projekte { list-style: none; margin: 0; padding: 0; }
.hg-bereich a { display: block; padding: .5rem 0; font-weight: 600; text-decoration: none; }
.hg-bereich li + li a { border-top: 1px solid var(--hg-linie); }
.hg-bereich a:hover { text-decoration: underline; }
.hg-nachbarn { font-size: .97rem; padding: 1.25rem 1.4rem; }
.hg-nachbarn-titel { font-weight: 800; margin: 0 0 .5rem; }
.hg-nachbarn-titel::before { background: var(--hg-magenta); }
.hg-nachbarn a { display: block; padding: .32rem 0; color: var(--hg-tinte); text-decoration: none; }
.hg-nachbarn a:hover { text-decoration: underline; }
.hg-nachbarn [aria-current] { font-weight: 800; color: var(--hg-blau-tief); }
.hg-pfad { margin: 0 0 .4rem; font-weight: 600; font-size: .95rem; }
.hg-pfad a { text-decoration: none; }
.hg-pfad a::after { content: " /"; color: var(--hg-grau); }
.hg-stand { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin: 2.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--hg-linie); font-size: .88rem; color: var(--hg-grau); }
.hg-projekte li { padding: .15rem 0; }
.hg-meldung-meta-seite { margin-top: .75rem; }
.hg-meldung-meta-seite .wp-block-post-date { margin: 0; }

/* ---------- Zeitfenster ---------- */
.hg-zeitfenster-hinweis { margin: 0 0 .6rem; font-size: .85rem; font-weight: 600; color: var(--hg-grau); }
.hg-zeitfenster-vorschau { outline: 2px dashed var(--hg-linie); outline-offset: .5rem; border-radius: var(--hg-rund); }
.hg-zeitfenster-vorschau > .wp-block-holbein-zeitfenster { max-width: none; }
