/*
Theme Name: Klassenkino
Theme URI: https://xn--agenturfrideen-nsb.de/
Author: Max Althammer · agentur für ideen
Description: Animationen und Simulationen für den Unterricht – im Look der Arbeitsblätter. Block-Theme mit Simulations-Datenbank (Fächer, Klassenstufen, Arten), Anfrageformular und Partnerseite. Alles im Website-Editor änderbar.
Version: 1.2.1
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: klassenkino
*/

/* ==========================================================================
   Klassenkino – Gestaltung im Look der Arbeitsblätter (AB-Layout)
   Farben, Schrift, Rahmen und Kästen wie in Max' Arbeits- und
   Präsentationsvorlage; Logo und Akzent aus der Klassenkino-Kachel.
   ========================================================================== */

:root {
	--rahmen: #4F81BD;       /* AB-Rahmen, Etiketten, Merke-Linie */
	--kopf: #365F91;         /* Kopfzeile, Überschriften */
	--titel-rand: #95B3D7;   /* Titelkasten- und Kastenrand */
	--titel-verlauf: #B9CDE5;
	--merke: #DCE6F2;
	--material: #F7F9FC;
	--symbol: #667AB3;
	--symbol-hell: #C3CCE7;
	--kino: #6A79AF;         /* Klassenkino-Kachel */
	--kino-dunkel: #4E5C93;
	--text: #1F2A3D;
	--text-leise: #5B6478;
	--schrift: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: #FFFFFF;
	color: var(--text);
	font-family: var(--schrift);
	font-size: 18px;
	line-height: 1.5;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--kopf); }
a:hover { color: var(--rahmen); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
	outline: 3px solid var(--rahmen); outline-offset: 2px; border-radius: 6px;
}

/* AB-Rahmen: gehört zur Seite und scrollt mit ihr; läuft rechts und unten absichtlich aus dem Bild */
.ab-rahmen {
	position: absolute; top: 16px; left: 16px; right: -60px; bottom: -60px;
	border: 3px solid var(--rahmen); border-radius: 26px;
	pointer-events: none; z-index: 50;
}

.seite { position: relative; min-height: 100vh; padding: 34px 0 0 44px; overflow: hidden; }
.innen { max-width: 1180px; margin: 0 auto; padding: 0 40px 0 12px; }

/* ---------- Kopf ---------- */
.kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 6px 0 18px; }
.marke { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--kino-dunkel); }
.marke img { width: 78px; height: auto; }
.marke-name { display: block; font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -0.01em; }
.marke-zusatz { display: block; font-size: 13px; color: var(--text-leise); margin-top: 4px; }

.menue ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.menue a {
	display: block; padding: 8px 14px; border-radius: 8px;
	text-decoration: none; color: var(--kopf); font-weight: 700; font-size: 17px;
}
.menue a:hover, .menue a[aria-current="page"] { background: var(--merke); color: var(--kopf); }
.menue a.knopf-menue { background: var(--rahmen); color: #FFFFFF; }
.menue a.knopf-menue:hover { background: var(--kopf); color: #FFFFFF; }

/* Kopfzeile wie auf dem AB: Fach · Klasse · Thema */
.kopfzeile { font-size: 14px; color: var(--kopf); border-bottom: 1px solid var(--titel-rand); padding-bottom: 6px; margin-bottom: 22px; }

/* ---------- Titelzeile: Symbol + Titelkasten (rechts angeschnitten) ---------- */
.titelzeile { display: flex; align-items: center; gap: 18px; margin: 8px 0 26px; }
.titelzeile .symbol { width: 92px; height: 92px; flex-shrink: 0; }
.titelkasten {
	flex: 1;
	background: linear-gradient(180deg, #FFFFFF 0%, var(--titel-verlauf) 100%);
	border: 2px solid var(--titel-rand);
	border-radius: 14px;
	box-shadow: 2px 3px 4px rgba(54, 95, 145, .45);
	margin-right: -80px;
	padding: 16px 100px 16px 24px;
}
.titelkasten h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; color: var(--text); }
.titelkasten p { margin: 6px 0 0; color: var(--text-leise); font-size: 19px; }

/* ---------- Überschriften, Kästen ---------- */
h2 { color: var(--kopf); font-size: 28px; margin: 40px 0 16px; padding-bottom: 6px; border-bottom: 1px solid var(--titel-rand); }
h3 { color: var(--kopf); font-size: 21px; margin: 0 0 8px; }
p { margin: 0 0 12px; }

.kasten { background: var(--material); border: 1.5px solid var(--titel-rand); border-radius: 12px; padding: 18px 20px; }
.merke { background: var(--merke); border-left: 6px solid var(--rahmen); border-radius: 0 12px 12px 0; padding: 16px 20px; }
.etikett {
	display: inline-block; background: var(--rahmen); color: #FFFFFF; font-weight: 700;
	font-size: 14px; padding: 3px 10px; border-radius: 6px; margin-bottom: 8px; letter-spacing: .02em;
}
.leise { color: var(--text-leise); }
.klein { font-size: 15px; }

.raster { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.raster-3 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.spalten { display: grid; gap: 26px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 880px) { .spalten { grid-template-columns: 1fr; } }

/* ---------- Knöpfe ---------- */
.knopf {
	display: inline-block; background: var(--rahmen); color: #FFFFFF; font-weight: 700;
	font-family: var(--schrift); font-size: 17px; text-decoration: none;
	padding: 11px 20px; border-radius: 10px; border: 0; cursor: pointer;
	box-shadow: 1px 2px 3px rgba(54, 95, 145, .35);
}
.knopf:hover { background: var(--kopf); color: #FFFFFF; }
.knopf-hell { background: #FFFFFF; color: var(--kopf); border: 1.5px solid var(--titel-rand); box-shadow: none; }
.knopf-hell:hover { background: var(--merke); color: var(--kopf); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ---------- Kachel (wie auf der Agentur-Webseite) ---------- */
.kino-kachel {
	background: #FFFFFF; border: 1.5px solid var(--titel-rand); border-radius: 24px;
	padding: 24px; color: var(--kino); display: flex; flex-direction: column; justify-content: space-between;
	aspect-ratio: 1 / 1; max-width: 360px; box-shadow: 2px 3px 4px rgba(54, 95, 145, .25);
}
.kino-kachel .status { align-self: flex-start; border: 1.5px solid var(--kino-dunkel); color: var(--kino-dunkel); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 700; }
.kino-kachel img { width: 70%; align-self: center; }
.kino-kachel .name { font-size: 34px; font-weight: 700; line-height: 1; }

/* ---------- Fächer ---------- */
.fach {
	display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text);
	background: var(--material); border: 1.5px solid var(--titel-rand); border-radius: 12px; padding: 12px 14px;
}
.fach:hover { background: var(--merke); color: var(--text); }
.fach-symbol {
	width: 52px; height: 52px; border-radius: 10px; flex-shrink: 0; background: #FFFFFF;
	border: 1.5px solid var(--symbol-hell); display: flex; align-items: center; justify-content: center;
	color: var(--symbol); font-weight: 700; font-size: 20px;
}
.fach-symbol img { width: 40px; height: 40px; }
.fach-name { font-weight: 700; font-size: 18px; line-height: 1.2; }
.fach-zahl { font-size: 14px; color: var(--text-leise); }
.fach-gruppe { font-size: 15px; font-weight: 700; color: var(--kopf); text-transform: uppercase; letter-spacing: .06em; margin: 26px 0 10px; }

/* ---------- Simulations-Karten ---------- */
.sim {
	background: #FFFFFF; border: 1.5px solid var(--titel-rand); border-radius: 14px; overflow: hidden;
	display: flex; flex-direction: column; text-decoration: none; color: var(--text);
	box-shadow: 1px 2px 3px rgba(54, 95, 145, .18);
}
.sim:hover { box-shadow: 2px 4px 8px rgba(54, 95, 145, .35); color: var(--text); }
.sim-bild { background: linear-gradient(180deg, #FFFFFF 0%, var(--titel-verlauf) 100%); border-bottom: 1.5px solid var(--titel-rand); aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; }
.sim-bild img { width: 34%; height: auto; }
.sim-text { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sim-titel { font-weight: 700; font-size: 20px; line-height: 1.2; color: var(--text); }
.sim-kurz { font-size: 16px; color: var(--text-leise); }
.marken { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.marke-chip { font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 6px; background: var(--merke); color: var(--kopf); }
.marke-chip.typ { background: var(--rahmen); color: #FFFFFF; }

/* ---------- Datenbank-Filter ---------- */
.filter { display: grid; gap: 12px; grid-template-columns: 2fr 1fr 1fr 1fr; align-items: end; margin-bottom: 18px; }
@media (max-width: 880px) { .filter { grid-template-columns: 1fr 1fr; } }
label { display: block; font-weight: 700; font-size: 15px; color: var(--kopf); margin-bottom: 4px; }
input, select, textarea {
	width: 100%; font-family: var(--schrift); font-size: 17px; color: var(--text);
	background: #FFFFFF; border: 1.5px solid var(--titel-rand); border-radius: 8px; padding: 9px 11px;
}
textarea { min-height: 140px; resize: vertical; }
.treffer { font-size: 15px; color: var(--text-leise); margin-bottom: 12px; }
.leer { display: none; }
.leer.sichtbar { display: block; }

/* ---------- Detailseite ---------- */
.vorschau { background: linear-gradient(180deg, #FFFFFF 0%, var(--titel-verlauf) 100%); border: 1.5px solid var(--titel-rand); border-radius: 14px; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; }
.vorschau img { width: 26%; }
.steckbrief dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 16px; }
.steckbrief dt { font-weight: 700; color: var(--kopf); }
.steckbrief dd { margin: 0; }
.formular { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.formular .breit { grid-column: 1 / -1; }
@media (max-width: 700px) { .formular { grid-template-columns: 1fr; } }

/* ---------- Fuß ---------- */
.fuss { margin-top: 60px; padding: 18px 0 40px; border-top: 1px solid var(--titel-rand); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--text-leise); }
.fuss a { color: var(--kopf); text-decoration: none; margin-left: 14px; }
.fuss a:hover { text-decoration: underline; }

@media (max-width: 700px) {
	.seite { padding-left: 26px; }
	.innen { padding-right: 18px; }
	.titelzeile .symbol { width: 64px; height: 64px; }
	.titelkasten { padding-right: 90px; }
}
@media print { .menue, .knopfreihe { display: none; } }

/* Abstände zwischen gestapelten Kästen */
aside > * + *, .spalten > div > .kasten, .spalten > div > .merke { margin-top: 18px; }
.spalten > div > .vorschau + .knopfreihe { margin-top: 14px; }
.kasten ul, .kasten ol, .merke ul, .merke ol { margin: 4px 0 0; padding-left: 22px; }
.raster + .klein { margin-top: 12px; }
.fach-gruppe + .raster { margin-bottom: 4px; }
.merke .knopf { margin-top: 6px; }

/* ==========================================================================
   WordPress-Anpassungen: die Blöcke sehen aus wie die HTML-Vorschau
   ========================================================================== */
.wp-site-blocks { padding: 0; }
.seite > .ab-rahmen { margin: 0; }
.innen, .kk-main, .kk-kopf-teil, .kk-fuss-teil { max-width: none; }
.innen { max-width: 1180px; }
figure { margin: 0; }
.wp-block-group.innen > * { margin-block-start: 0; }

/* Kopf */
.marke-logo img { width: 78px; height: auto; }
.marke-text p { margin: 0; }
.marke-name a { color: var(--kino-dunkel); text-decoration: none; }
.menue { color: var(--kopf); }
.menue .wp-block-navigation__container { gap: 6px; }
.menue .knopf-menue { color: #FFFFFF; }
.menue .wp-block-navigation-item__content {
	display: block; padding: 8px 14px; border-radius: 8px;
	text-decoration: none; color: var(--kopf); font-weight: 700; font-size: 17px;
}
.menue .wp-block-navigation-item__content:hover,
.menue .ist-aktiv > .wp-block-navigation-item__content { background: var(--merke); color: var(--kopf); }
.menue .knopf-menue > .wp-block-navigation-item__content { background: var(--rahmen); color: #FFFFFF; }
.menue .knopf-menue > .wp-block-navigation-item__content:hover { background: var(--kopf); color: #FFFFFF; }
.wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close { color: var(--kopf); }
.wp-block-navigation__responsive-container.is-menu-open { padding: 30px; }

/* Kopfzeile auf Simulationsseiten (Fach · Stufe aus den Angaben) */
div.kopfzeile > * { display: inline; margin: 0; }
div.kopfzeile a { color: var(--kopf); text-decoration: none; }

/* Titelzeile */
.titelzeile figure.symbol img, .titelzeile .wp-block-post-featured-image.symbol img { width: 92px; height: 92px; object-fit: contain; }
.titelkasten .wp-block-post-title { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; color: var(--text); }
.titelkasten .wp-block-post-excerpt__excerpt, .titelkasten .unterzeile p { margin: 6px 0 0; color: var(--text-leise); font-size: 19px; }
.titelkasten .wp-block-term-description { margin: 0; }
.titelkasten .wp-block-post-excerpt__more-text { display: none; }

/* Knöpfe */
.wp-block-buttons.knopfreihe { gap: 10px; }
.wp-block-button .wp-block-button__link {
	background: var(--rahmen); color: #FFFFFF; font-weight: 700; font-family: var(--schrift); font-size: 17px;
	text-decoration: none; padding: 11px 20px; border-radius: 10px; border: 0;
	box-shadow: 1px 2px 3px rgba(54, 95, 145, .35); line-height: 1.5;
}
.wp-block-button .wp-block-button__link:hover { background: var(--kopf); color: #FFFFFF; }
.wp-block-button.knopf-hell .wp-block-button__link { background: #FFFFFF; color: var(--kopf); border: 1.5px solid var(--titel-rand); box-shadow: none; }
.wp-block-button.knopf-hell .wp-block-button__link:hover { background: var(--merke); color: var(--kopf); }
.merke .wp-block-buttons { margin-top: 10px; }

/* Kästen: Etikett als Absatz, Listen */
p.etikett { display: inline-block; margin: 0 0 8px; }
.kino-kachel p { margin: 0; }
.kino-kachel figure { align-self: center; width: 70%; }
.kino-kachel figure img { width: 100%; }
.abstand-oben { margin-top: 26px; }
h2.wp-block-heading { margin: 40px 0 16px; }
.stapel > * + * { margin-top: 18px; }
.stapel > h2.wp-block-heading { margin-top: 40px; }
.stapel > .wp-block-buttons.knopfreihe { margin-top: 14px; }
.stapel > p.klein { margin-top: 12px; }

/* Simulations-Karten aus der Abfrage */
.sim-liste ul.wp-block-post-template { list-style: none; margin: 0; padding: 0; }
.sim-liste .wp-block-post { margin: 0; }
.sim-liste .wp-block-post[hidden] { display: none; }
.sim { position: relative; height: 100%; }
.sim-titel { margin: 0; }
.sim-titel a { color: var(--text); text-decoration: none; }
.sim-titel a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.sim-kurz p { margin: 0; }
.sim-kurz .wp-block-post-excerpt__more-text { display: none; }
.sim-bild { margin: 0; overflow: hidden; }
.sim-bild a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.sim-bild img { width: 100%; height: 100%; object-fit: cover; }
.sim-bild.kk-symbol-ersatz img { width: 34%; height: auto; object-fit: contain; }
.marken .wp-block-post-terms { position: relative; z-index: 2; }
.marken .wp-block-post-terms a { color: inherit; text-decoration: none; }
.marken .wp-block-post-terms__separator { display: none; }
.marken .wp-block-post-terms a + .wp-block-post-terms__separator + a::before { content: "· "; }
.sim:hover .sim-titel a { color: var(--kopf); }
.sim-liste .wp-block-query-no-results p { color: var(--text-leise); }

/* Formular: Spam-Falle verstecken */
.kk-honig { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.formular button.knopf { width: auto; }

/* Editor: Rahmen nicht über die Bedienelemente legen */
.editor-styles-wrapper .ab-rahmen { z-index: 0; }

/* Simulations-Kacheln: feste Spalten, gleich groß – auch bei nur einer Kachel */
.sim-liste ul.wp-block-post-template.raster-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
@media (max-width: 1000px) { .sim-liste ul.wp-block-post-template.raster-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .sim-liste ul.wp-block-post-template.raster-3 { grid-template-columns: 1fr; } }
.sim-liste .wp-block-post { display: flex; }
.sim-liste .wp-block-post > .sim { flex: 1; }

/* Fachseite: Symbol bzw. Anfangsbuchstabe, Unterzeile */
.titelzeile img.symbol { width: 92px; height: 92px; flex-shrink: 0; }
.symbol-buchstabe { width: 92px; height: 92px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 18px; background: #FFFFFF; border: 2px solid var(--symbol-hell); color: var(--symbol); font-size: 46px; font-weight: 700; }
.titelkasten .wp-block-query-title { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; color: var(--text); }
.titelzeile + .sim-liste { margin-top: 0; }

/* Feinschliff */
.wp-block-button.knopf-hell { background: none; border: 0; padding: 0; box-shadow: none; }
.kopfzeile a { color: var(--kopf); text-decoration: none; }
.kopfzeile a:hover { text-decoration: underline; }
.raster { grid-auto-rows: 1fr; }
.fach-name { hyphens: auto; }
.stapel > .wp-block-heading:first-child, .stapel > .wp-block-shortcode:first-child + .wp-block-heading { margin-top: 18px; }
.stapel > h2.wp-block-heading:first-child { margin-top: 0; }
