/* ==========================================================================
   DJG Siegburg – Theme fuer Contao 5.7
   Nachbau des Designs von 2015, modernisiert (responsiv, groessere Schrift,
   lokale Schriften ohne Google-Server).
   ========================================================================== */

/* ---------- Schriften (lokal, SIL Open Font License) ---------- */
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/open-sans-latin-400-normal.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: "Open Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/open-sans-latin-ext-400-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/open-sans-latin-700-normal.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: "Open Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/open-sans-latin-ext-700-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/roboto-latin-400-normal.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: "Roboto"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/roboto-latin-ext-400-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/roboto-latin-700-normal.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: "Roboto"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/roboto-latin-ext-700-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Farben und Masse ---------- */
:root {
  --rot: #dc1925;          /* Rot aus Logo und Original-Design */
  --rot-dunkel: #b3121c;
  --rot-hell: #f8828a;     /* Hover-Farbe der alten Hauptnavigation */
  --text: #333;
  --ueberschrift: #444;
  --grau-hell: #f6f6f6;
  --grau-box: #ececec;
  --grau-linie: #ddd;
  --weiss: #fff;
  --breite: 990px;
  --kopf-hoehe: 90px;
  --schrift: "Open Sans", "Helvetica Neue", Arial, sans-serif;
  --schrift-titel: "Roboto", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.65 var(--schrift); color: var(--text); background: var(--weiss); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rot); text-decoration: none; }
a:hover, a:focus { color: var(--rot-dunkel); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--rot); outline-offset: 2px; }
p, ul, ol { margin: 0 0 1em; }
h1, h2, h3, h4 { font-family: var(--schrift-titel); font-weight: 400; color: var(--ueberschrift); line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.85rem; text-transform: uppercase; margin-bottom: .8em; }
h2 { font-size: 1.4rem; margin-top: 1.4em; }
h3 { font-size: 1.15rem; font-weight: 700; margin-top: 1.2em; }
main h1 + * h2:first-child, .content-headline + * > h2:first-child { margin-top: 0; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--grau-linie); margin: 2em 0; }
.invisible, .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Kopfbereich ---------- */
#header { position: relative; }
#header .inside { position: relative; }
#header .inside::before {           /* halbtransparente Logo-Leiste */
  content: ""; position: absolute; z-index: 2; inset: 0 0 auto 0; height: var(--kopf-hoehe);
  background: rgba(255, 255, 255, .88); box-shadow: 0 2px 0 rgba(0, 0, 0, .1);
}
#logo { position: absolute; z-index: 3; top: 17px; left: max(16px, calc(50% - var(--breite) / 2)); display: block; width: min(600px, 56vw); }
#logo img { width: 100%; }
#metanav { position: absolute; z-index: 3; top: 51px; right: max(16px, calc(50% - var(--breite) / 2)); font-size: .82rem; }
#metanav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; }
#metanav a, #metanav strong { color: var(--text); font-weight: 400; }
#metanav strong, #metanav a:hover { color: var(--rot); }

#mainnav { position: absolute; z-index: 4; top: var(--kopf-hoehe); left: 50%; transform: translateX(-50%);
  width: min(var(--breite), calc(100% - 32px)); background: var(--weiss); box-shadow: 0 0 3px rgba(0, 0, 0, .4); }
#mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; }
#mainnav li { flex: 1 1 auto; }
#mainnav a { display: block; padding: 10px 14px 9px; text-align: center; color: var(--text); text-decoration: none; line-height: 1.3; }
#mainnav .nav-title { display: block; font-family: var(--schrift-titel); font-weight: 700; text-transform: uppercase; font-size: .95rem; }
#mainnav .nav-sub { display: block; font-size: .8rem; }
#mainnav a:hover, #mainnav a:focus { color: var(--rot-hell); }
#mainnav .active, #mainnav .trail, #mainnav .active a, #mainnav a.trail { color: var(--rot); }
#nav-toggle { display: none; }

#headerimg { height: clamp(260px, 33vw, 420px); background: #8a8a8a center / cover no-repeat; }
body.bereich-djg #headerimg { background-image: url("../header/djg.jpg"); }
body.bereich-yuzawa #headerimg { background-image: url("../header/yuzawa.jpg"); }
body.bereich-veranstaltungen #headerimg { background-image: url("../header/veranstaltungen.jpg"); }
body.bereich-schueler #headerimg { background-image: url("../header/schuelerbegegnungen.jpg"); }
body.bereich-japan #headerimg { background-image: url("../header/japan.jpg"); }

/* ---------- Inhaltsbereich ---------- */
#container { max-width: calc(var(--breite) + 32px); margin: 40px auto 60px; padding: 0 16px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
#container:has(#left) { grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: "left main"; }
#container:has(#left) #main { grid-area: main; }
#left { grid-area: left; }
#main .inside > * + * { margin-top: 0; }
.mod_article > * { margin-bottom: 1.5em; }

/* Unternavigation links */
#subnav ul { list-style: none; margin: 0; padding: 0; }
#subnav li { border-bottom: 1px solid var(--grau-linie); }
#subnav a, #subnav strong { display: block; padding: 7px 0; color: var(--text); font-weight: 400; }
#subnav a:hover { color: var(--rot); text-decoration: none; }
#subnav strong, #subnav .trail { color: var(--rot); }
#subnav ul ul { padding-left: 12px; font-size: .92rem; }
#subnav ul ul li { border: 0; }

/* Text mit Bild */
.media::after { content: ""; display: table; clear: both; }
.media--right > figure { float: right; margin: .3em 0 1em 1.5em; max-width: 45%; }
.media--left > figure { float: left; margin: .3em 1.5em 1em 0; max-width: 45%; }
.media--above > figure { margin: 0 0 1em; }
.media--below > figure { margin: 1em 0 0; }
figure { margin: 0; }
figcaption { font-size: .85rem; color: #666; margin-top: .4em; font-style: italic; }
figure a[data-lightbox] { cursor: zoom-in; display: block; }

/* Bildergalerie */
.content-gallery ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.content-gallery--cols-3 ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.content-gallery--cols-2 ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.content-gallery li { margin: 0; }
.content-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: opacity .2s; }
.content-gallery a:hover img { opacity: .85; }

/* Datumszeile ueber Veranstaltungen */
.datum { color: var(--rot); font-weight: 700; font-size: .95rem; margin: 0 0 .2em; }
.datum + h2, h2 + .datum { margin-top: 0; }
.mod_article > .content-text h2:has(+ .rte .datum) { margin-top: 0; }

/* Akkordeon (Geschichte) */
.zeitleiste { border-top: 1px solid var(--grau-linie); }
.zeitleiste .handorgel__header { margin: 0; border-bottom: 1px solid var(--grau-linie); font-size: 1.05rem; }
.zeitleiste .handorgel__header__button { width: 100%; text-align: left; background: none; border: 0; padding: 12px 36px 12px 0;
  font: 700 1.1rem var(--schrift-titel); color: var(--ueberschrift); cursor: pointer; position: relative; }
.zeitleiste .handorgel__header__button::after { content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; color: var(--rot); font-weight: 400; }
.zeitleiste .handorgel__header--open .handorgel__header__button { color: var(--rot); }
.zeitleiste .handorgel__header--open .handorgel__header__button::after { content: "–"; }
.zeitleiste .handorgel__content { border: 0; }
.zeitleiste .handorgel__content__inner { padding: 12px 0 8px; }

/* Startseite: Teaser */
.teaser ul.teaser-liste { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.teaser ul.teaser-liste a { display: block; height: 100%; padding: 16px 18px; background: var(--grau-box); color: var(--text); border-left: 4px solid var(--rot); }
.teaser ul.teaser-liste a:hover { background: #e2e2e2; text-decoration: none; }
.teaser ul.teaser-liste strong { display: block; font-family: var(--schrift-titel); text-transform: uppercase; color: var(--ueberschrift); margin-bottom: 2px; }

/* Infobox (wie die graue Box der alten rechten Spalte) */
.infobox { background: var(--grau-box); padding: 16px 20px 4px; }
.infobox h2 { margin-top: 0; text-transform: uppercase; font-size: 1.2rem; }

/* Vorstand */
ul.vorstand { list-style: none; padding: 0; }
ul.vorstand li { padding: 8px 0; border-bottom: 1px solid var(--grau-linie); }

/* Link-Element als Schaltflaeche */
.content-hyperlink a { display: inline-block; padding: 9px 18px; background: var(--rot); color: var(--weiss); border-radius: 2px; }
.content-hyperlink a:hover { background: var(--rot-dunkel); color: var(--weiss); text-decoration: none; }

/* ---------- Fusszeile ---------- */
#footer { background: #fafafa; border-top: 1px solid #e6e6e6; font-size: .9rem; }
#footer .inside { max-width: calc(var(--breite) + 32px); margin: 0 auto; padding: 36px 16px 0; }
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; padding-bottom: 30px; }
#footer h2 { font-size: 1.15rem; text-transform: uppercase; margin: 0 0 .8em; padding-bottom: .5em; border-bottom: 1px solid var(--grau-linie); }
#footer h2:not(:first-child) { margin-top: 1.4em; }
#footer ul { list-style: none; padding: 0; margin: 0 0 1em; }
#footer a { color: var(--text); }
#footer a:hover { color: var(--rot); }
#footer p a { color: var(--rot); }
#footerbar { margin: 0 -100vmax; padding: 14px 100vmax; background: #eee; font-size: .85rem; }
#footerbar p { margin: 0; }
#footerbar .sep { color: #999; margin: 0 4px; }
#footer { overflow: hidden; }

/* ---------- Lightbox (djg.js) ---------- */
.djg-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .88); display: flex; align-items: center; justify-content: center; }
.djg-lightbox[hidden] { display: none; }
.djg-lightbox img { max-width: 92vw; max-height: 86vh; width: auto; box-shadow: 0 4px 30px rgba(0, 0, 0, .5); }
.djg-lightbox button { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; font-size: 2rem; line-height: 1;
  width: 52px; height: 52px; cursor: pointer; border-radius: 50%; }
.djg-lightbox button:hover { background: rgba(255, 255, 255, .25); }
.djg-lightbox .lb-close { top: 16px; right: 16px; }
.djg-lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.djg-lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.djg-lightbox .lb-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #ddd; font-size: .9rem; }

/* ---------- Tablet & Smartphone ---------- */
@media (max-width: 1040px) {
  :root { --kopf-hoehe: auto; }
  #header .inside::before { display: none; }
  #logo { position: static; width: auto; max-width: 560px; padding: 14px 64px 10px 16px; }
  #metanav { position: static; padding: 0 16px 10px; }
  #metanav ul { flex-wrap: wrap; gap: 4px 14px; }
  #nav-toggle { display: block; position: absolute; z-index: 5; top: 10px; right: 12px; width: 44px; height: 44px;
    background: var(--weiss); border: 1px solid var(--grau-linie); cursor: pointer; padding: 0; }
  #nav-toggle span, #nav-toggle span::before, #nav-toggle span::after { content: ""; display: block; width: 22px; height: 2px;
    background: var(--text); margin: 0 auto; position: relative; transition: transform .2s; }
  #nav-toggle span::before { position: absolute; top: -7px; }
  #nav-toggle span::after { position: absolute; top: 7px; }
  #mainnav { position: static; transform: none; width: auto; box-shadow: none; border-top: 1px solid var(--grau-linie); display: none; }
  .nav-open #mainnav { display: block; }
  #mainnav ul { flex-direction: column; }
  #mainnav a { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--grau-linie); }
  #mainnav .nav-sub { display: inline; margin-left: 8px; color: #777; }
  #headerimg { height: clamp(150px, 38vw, 300px); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  h1 { font-size: 1.5rem; }
  #container, #container:has(#left) { display: flex; flex-direction: column; gap: 0; margin-top: 24px; }
  #left { order: -1; margin-bottom: 24px; }
  #subnav ul { display: flex; flex-wrap: wrap; gap: 6px; }
  #subnav li { border: 1px solid var(--grau-linie); }
  #subnav a, #subnav strong { padding: 5px 10px; font-size: .9rem; }
  .media--right > figure, .media--left > figure { float: none; max-width: 100%; margin: 0 0 1em; }
  .content-gallery ul { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .teaser ul.teaser-liste { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
@media print {
  #header, #left, #footer { display: none; }
  #container { display: block; margin: 0; }
  a { color: #000; }
}
