/* Design angelehnt an gymnasium-soltau.de: PT Sans, Blau #2f4960, dunkler Hintergrund, weiße Karten mit 20px Rundung */
@font-face { font-family: "PT Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/ptsans-400.woff2) format("woff2"); }
@font-face { font-family: "PT Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/ptsans-400i.woff2) format("woff2"); }
@font-face { font-family: "PT Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/ptsans-700.woff2) format("woff2"); }

:root {
  --blue: #2f4960;
  --blue-dark: #2b3843;
  --bg: #343e50;
  --orange: #f59038;
  --text: rgba(0, 0, 0, .79);
  --line: #e8e8e8;
  --soft: #f6f9fd;
  --radius: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 16px/1.7 "PT Sans", sans-serif; color: var(--text); background: var(--bg);
}
a { color: var(--blue); }
img, video { max-width: 100%; }

/* ---------- Kopfzeile ---------- */
#main-header { background: var(--blue); color: #fff; }
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 18px 30px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
}
.logo { justify-self: start; display: block; }
.logo img { display: block; height: 58px; width: auto; }
.headline { text-align: center; }
.site-title {
  margin: 0; font-size: clamp(30px, 5vw, 52px); line-height: 1.1; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: #fff;
}
.site-sub {
  margin: 8px auto 0; display: inline-block; padding-bottom: 6px; font-size: 17px; letter-spacing: .06em; color: rgba(255,255,255,.85);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--orange), rgba(245,144,56,0)) 1;
}
.topnav { justify-self: end; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topnav a, .topnav button {
  color: #fff; text-decoration: none; font: inherit; font-size: 15px; background: none; border: 0; cursor: pointer;
  padding: 6px 12px; border-radius: 8px;
}
.topnav a:hover, .topnav button:hover { background: rgba(255,255,255,.14); }
.topnav form { margin: 0; }

@media (max-width: 760px) {
  .header-inner { grid-template-columns: 1fr; justify-items: center; padding: 16px 20px 22px; gap: 12px; }
  .logo, .topnav { justify-self: center; }
  .logo img { height: 48px; }
}

/* ---------- Inhalt ---------- */
#main-content { flex: 1; padding: 40px 0 60px; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 30px; }
.container.narrow { max-width: 520px; }
@media (max-width: 600px) { .container { padding: 0 14px; } #main-content { padding-top: 24px; } }

.module { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.1); overflow: hidden; }
.module-head { padding: 22px 30px 18px; }
.module-head.split { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.module-head h2 {
  margin: 0; font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: #2e4960;
}
.module-body { padding: 4px 30px 34px; }
@media (max-width: 600px) { .module-head { padding: 18px 18px 12px; } .module-body { padding: 4px 18px 26px; } }
.empty { text-align: center; color: #777; padding: 40px 0; }

/* ---------- Projekt-Raster ---------- */
/* Immer 2 Projekte nebeneinander; ein einzelnes Projekt nimmt die ganze Breite ein und wird größer. */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; margin-top: 8px; }
.card:only-child { grid-column: 1 / -1; }
.card:only-child .thumb { aspect-ratio: 21 / 9; }
.card:only-child .card-body { padding: 22px 28px 26px; }
.card:only-child .card-body h3 { font-size: 30px; }
.card:only-child .card-body p { font-size: 18px; -webkit-line-clamp: 4; }
.card:only-child .grp { font-size: 14px; }
.card:only-child .more { font-size: 17px; }
@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
  .card:only-child .thumb { aspect-ratio: 16 / 10; }
  .card:only-child .card-body h3 { font-size: 24px; }
}
.card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(47,73,96,.22); }
.thumb { position: relative; aspect-ratio: 16 / 10; background: var(--blue); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.card:hover .thumb img { transform: scale(1.05); }
.thumb .ph {
  display: grid; place-items: center; width: 100%; height: 100%; font-size: 64px; font-weight: 700; color: rgba(255,255,255,.55);
  background: linear-gradient(135deg, var(--blue), #4a6b88);
}
.badge { position: absolute; top: 10px; left: 10px; background: var(--orange); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 99px; }
.card-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 4px; flex: 1; border-top: 3px solid var(--orange); }
.card-body h3 { margin: 0; font-size: 20px; line-height: 1.25; color: #2e4960; letter-spacing: .3px; }
.card-body p { margin: 4px 0 0; color: #555; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.grp { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: #7a8a99; font-weight: 700; }
.more { margin-top: auto; padding-top: 12px; font-weight: 700; color: var(--blue); font-size: 15px; }
.card:hover .more { color: var(--orange); }

/* ---------- Projekt-Seite ---------- */
.back { text-decoration: none; font-weight: 700; color: var(--blue); }
.back:hover { color: var(--orange); }
.project .module-body { max-width: 900px; margin: 0 auto; }
.project-title { margin: 4px 0 8px; font-size: clamp(26px, 4vw, 38px); line-height: 1.15; text-transform: uppercase; letter-spacing: 1.2px; color: #2e4960; font-weight: 700; }
.lead { font-size: 20px; line-height: 1.55; color: #444; margin: 8px 0 22px; padding-left: 16px; border-left: 4px solid var(--orange); }
.notice { background: #fff4e8; border: 1px solid var(--orange); color: #8a4a0f; border-radius: 10px; padding: 8px 14px; margin-bottom: 14px; }
.hero { margin: 0 0 26px; }
.hero img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 14px; display: block; }
.block { margin: 0 0 26px; }
.block-text h3 { margin: 28px 0 8px; font-size: 22px; color: #2e4960; letter-spacing: .5px; }
.block-text p, .block-text ul { margin: 0 0 14px; font-size: 18px; }
.block-text ul { padding-left: 24px; }
.block-text a { color: var(--blue); text-decoration-color: var(--orange); text-underline-offset: 3px; }
figure { margin: 0; }
figcaption { font-size: 14px; color: #666; margin-top: 6px; font-style: italic; }

.block-images { display: grid; gap: 14px; grid-template-columns: 1fr; }
.block-images.n2 { grid-template-columns: repeat(2, 1fr); }
.block-images.n3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.block-images img { width: 100%; display: block; border-radius: 12px; }
.block-images.n2 img, .block-images.n3 img { aspect-ratio: 4/3; object-fit: cover; }
.block-images a { display: block; cursor: zoom-in; }
@media (max-width: 560px) { .block-images.n2 { grid-template-columns: 1fr; } }

.block-video video { width: 100%; border-radius: 12px; background: #000; display: block; }
.embed { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.block-audio audio { width: 100%; }

.link-card, .file-card {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; text-decoration: none; color: inherit;
  background: var(--soft); border: 1px solid #dde6f0; border-left: 5px solid var(--orange); border-radius: 12px;
  transition: background .2s, transform .2s;
}
.link-card:hover, .file-card:hover { background: #eaf1fa; transform: translateX(3px); }
.link-card strong, .file-card strong { color: #2e4960; font-size: 18px; }
.link-card small, .file-card small { color: #7a8a99; }
.file-card { flex-direction: row; align-items: center; gap: 16px; }
.file-card .icon { flex: none; width: 52px; height: 52px; border-radius: 10px; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.file-card .txt { display: flex; flex-direction: column; min-width: 0; }
.file-card strong { overflow-wrap: anywhere; }

/* ---------- Bild-Vergrößerung ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(15, 20, 30, .92); display: grid; place-items: center; padding: 30px; cursor: zoom-out; }
.lightbox figure { max-width: 100%; max-height: 100%; text-align: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 8px; }
.lightbox figcaption { color: #fff; font-size: 16px; margin-top: 10px; font-style: normal; }
.lightbox button { position: absolute; top: 14px; right: 18px; background: none; border: 0; color: #fff; font-size: 38px; cursor: pointer; line-height: 1; }

/* ---------- Fußzeile ---------- */
#footer { background: #232323; color: rgba(255,255,255,.75); font-size: 14px; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 22px 30px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#footer a { color: rgba(255,255,255,.6); text-decoration: none; }
#footer a:hover { color: var(--orange); }

/* ---------- Formulare (Login) ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: #2e4960; }
input[type=text], input[type=password], input[type=url], textarea, select {
  font: inherit; padding: 10px 12px; border: 1px solid #c9d3de; border-radius: 10px; background: #fff; color: #222; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(245,144,56,.35); border-color: var(--orange); }
.btn {
  display: inline-block; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center;
  padding: 9px 18px; border-radius: 10px; border: 1px solid #c9d3de; background: #fff; color: var(--blue);
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--soft); border-color: var(--blue); }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.primary:hover { background: var(--orange); border-color: var(--orange); }
.btn.danger { color: #b3261e; }
.btn.danger:hover { background: #b3261e; color: #fff; border-color: #b3261e; }
.btn.small { padding: 5px 12px; font-size: 14px; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.error { background: #fdeceb; color: #b3261e; border: 1px solid #f3b8b4; padding: 10px 14px; border-radius: 10px; }

.preview-bar { background: var(--orange); color: #fff; text-align: center; padding: 6px 14px; font-size: 15px; }
.preview-bar a { color: #fff; font-weight: 700; margin-left: 8px; }

/* ---------- Memory ---------- */
.memory-title { margin: 6px 0 4px; font-size: 22px; color: #2e4960; letter-spacing: .5px; text-transform: uppercase; }
.memory { background: var(--soft); border: 1px solid #dde6f0; border-left: 5px solid var(--orange); border-radius: 14px; padding: 18px; }
.memory-hint { margin: 0 0 14px; color: #555; }
.memory-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin: 0 auto; }
.mcard { position: relative; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; perspective: 900px; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.mface {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-radius: 12px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .45s, box-shadow .2s, border-color .2s;
}
.mback { background: linear-gradient(135deg, var(--blue), #4a6b88); color: rgba(255,255,255,.85); font-size: 44px; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.25); border: 3px solid #fff; }
.mfront { background: #fff; border: 3px solid var(--orange); padding: 8px; text-align: center; transform: rotateY(180deg); }
.mfront img { flex: 1; min-height: 0; width: 100%; object-fit: cover; border-radius: 6px; display: block; }
.mtext { font-weight: 700; color: #2e4960; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; max-height: 100%; overflow: hidden; }
.mfront img + .mtext { font-size: 14px; flex: none; }
.mcard:hover .mback { box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.mcard:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 14px; }
/* Ohne JavaScript sind alle Karten offen sichtbar */
.memory:not(.ready) .mback { display: none; }
.memory:not(.ready) .mfront { transform: none; position: relative; min-height: 120px; }
.memory:not(.ready) .mcard { cursor: default; }
.memory.ready .mcard.open .mback, .memory.ready .mcard.matched .mback { transform: rotateY(180deg); }
.memory.ready .mcard.open .mfront, .memory.ready .mcard.matched .mfront { transform: rotateY(0); }
.mcard.matched { cursor: default; }
.mcard.matched .mfront { border-color: #2e9e45; box-shadow: 0 0 0 3px rgba(46,158,69,.25); }
.memory-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-weight: 700; color: #2e4960; }
.memory:not(.ready) .memory-bar { display: none; }
.mwin { margin-top: 14px; padding: 14px 18px; border-radius: 12px; background: #e3f4e1; border: 1px solid #b6dfb2; color: #1d4f1a; font-weight: 700; font-size: 18px; text-align: center; }
@media (prefers-reduced-motion: reduce) { .mface { transition: none; } }
@media (max-width: 560px) { .mback { font-size: 32px; } .mtext { font-size: 14px; } }
