/*
Theme Name: Mythscriber
Theme URI: https://mythscriber.com
Author: Mythscriber
Description: Eigenes Block-Theme für mythscriber.com – Mythologie, modern erzählt und sauber belegt. Farben, Schriften und Abstände aus der CI (output/ci/design-system), Layouts nach den gewählten Mockups (output/design).
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Version: 0.1.7
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mythscriber
Update URI: false
*/

/* ---------- Dunkelmodus ----------
   Folgt beim ersten Besuch dem Gerät, danach dem Umschalter (data-theme am <html>).
   Gleiche Slugs wie theme.json, nur andere Werte (CI: dunkle Palette). */
:root { --ms-art-ground: var(--wp--custom--art-ground); color-scheme: light; }
:root[data-theme="dark"] {
	--wp--preset--color--ground: #15171B;
	--wp--preset--color--surface: #1E2126;
	--wp--preset--color--tint: #23284A;
	--wp--preset--color--ink: #ECEAE6;
	--wp--preset--color--ink-muted: #A8A49D;
	--wp--preset--color--line: #33363C;
	--wp--preset--color--nachthimmel: #9DA9F0;
	--wp--preset--color--nachthimmel-deep: #C3CBF6;
	--wp--preset--color--on-nachthimmel: #15171B;
	--wp--preset--color--ad-frame: #1B1D22;
	--ms-art-ground: #23262C;
	color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--wp--preset--color--ground: #15171B;
		--wp--preset--color--surface: #1E2126;
		--wp--preset--color--tint: #23284A;
		--wp--preset--color--ink: #ECEAE6;
		--wp--preset--color--ink-muted: #A8A49D;
		--wp--preset--color--line: #33363C;
		--wp--preset--color--nachthimmel: #9DA9F0;
		--wp--preset--color--nachthimmel-deep: #C3CBF6;
		--wp--preset--color--on-nachthimmel: #15171B;
		--wp--preset--color--ad-frame: #1B1D22;
		--ms-art-ground: #23262C;
		color-scheme: dark;
	}
}

/* ---------- Schriftgröße A− / A+ ---------- */
html { font-size: 16px; }
html[data-fs="-1"] { font-size: 14.5px; }
html[data-fs="1"] { font-size: 17.5px; }
html[data-fs="2"] { font-size: 19px; }

body { -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .wp-block-post-title { font-optical-sizing: auto; }
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

/* ---------- Kleine Bausteine ---------- */
.ms-label, .ms-label a {
	font-size: var(--wp--preset--font-size--label); line-height: 16px; font-weight: 600;
	text-transform: uppercase; letter-spacing: 0.08em; color: var(--wp--preset--color--nachthimmel);
}
.ms-label .ms-fmt, .ms-label.ms-fmt, .ms-label.ms-fmt a { color: var(--wp--preset--color--ink-muted); }
.ms-muted, .ms-muted a { color: var(--wp--preset--color--ink-muted); }
.ms-stern::before {
	content: ""; display: inline-block; width: 14px; height: 14px; flex: none; margin-right: 10px; vertical-align: 0.1em;
	background: var(--wp--preset--color--nachthimmel);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1 L12.2 7.8 L19 10 L12.2 12.2 L10 19 L7.8 12.2 L1 10 L7.8 7.8 Z'/%3E%3C/svg%3E") center / contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1 L12.2 7.8 L19 10 L12.2 12.2 L10 19 L7.8 12.2 L1 10 L7.8 7.8 Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Abschnittskopf: Überschrift links, „Alle …“ rechts */
.ms-sec-head { margin-top: var(--wp--preset--spacing--60) !important; margin-bottom: var(--wp--preset--spacing--40) !important; }
.ms-sec-head p { font-size: var(--wp--preset--font-size--body-small); font-weight: 600; margin: 0; white-space: nowrap; }

/* Knopf-Stile */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent; color: var(--wp--preset--color--nachthimmel);
	border: 0; box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--nachthimmel); padding: 10px 18px;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--tint); color: var(--wp--preset--color--nachthimmel-deep); }

/* Figuren-Knopf: rundes Bild + Name */
.wp-block-button.is-style-figur > .wp-block-button__link {
	display: inline-flex; align-items: center; gap: 8px; padding: 3px 14px 3px 3px;
	background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--line); font-size: 14px; font-weight: 600; line-height: 30px;
}
.wp-block-button.is-style-figur > .wp-block-button__link::before {
	content: ""; width: 30px; height: 30px; border-radius: 50%; flex: none;
	background: radial-gradient(circle at 50% 40%, var(--c, #D9A441) 0 40%, var(--ms-art-ground) 42%);
}
.wp-block-button.is-style-figur > .wp-block-button__link:hover { border-color: var(--wp--preset--color--nachthimmel); color: var(--wp--preset--color--nachthimmel); text-decoration: none; }
.ms-figuren-klein .wp-block-button.is-style-figur > .wp-block-button__link { background: var(--wp--preset--color--tint); border-color: transparent; font-size: 13px; line-height: 22px; padding: 2px 10px 2px 2px; }
.ms-figuren-klein .wp-block-button.is-style-figur > .wp-block-button__link::before { width: 22px; height: 22px; }

/* Filter-Chips (Formate) */
.ms-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--wp--preset--spacing--50) !important; margin-bottom: var(--wp--preset--spacing--40) !important; padding-bottom: var(--wp--preset--spacing--30); border-bottom: 1px solid var(--wp--preset--color--line); }
.ms-chips p { margin: 0 !important; }
.ms-chip, .ms-chips p > a {
	display: inline-block; border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--pill);
	padding: 8px 14px; font-size: 14px; font-weight: 500; color: var(--wp--preset--color--ink); background: var(--wp--preset--color--surface);
}
.ms-chips p > a:hover { text-decoration: none; border-color: var(--wp--preset--color--nachthimmel); }
.ms-chips em { font-style: normal; color: var(--wp--preset--color--ink-muted); margin-left: 4px; }
.ms-chips a.is-on { background: var(--wp--preset--color--nachthimmel); color: var(--wp--preset--color--on-nachthimmel); border-color: transparent; }
.ms-chips a.is-on em { color: inherit; opacity: .75; }

/* ---------- Kopf ---------- */
.ms-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--wp--preset--color--line); }
.admin-bar .ms-header { top: 32px; }
.ms-header > .wp-block-group { min-height: 72px; }
.ms-logo { display: flex; align-items: center; gap: 10px; color: var(--wp--preset--color--ink) !important; text-decoration: none !important; }
.ms-logo svg { width: 36px; height: 36px; }
.ms-logo b { font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; }
.ms-header .wp-block-navigation { margin-left: auto; }
.ms-header .wp-block-navigation-item.current-menu-item > a,
.ms-header .wp-block-navigation-item a[aria-current="page"] { color: var(--wp--preset--color--nachthimmel); box-shadow: inset 0 -2px 0 var(--wp--preset--color--nachthimmel); padding-bottom: 4px; }
.ms-tools { display: flex; gap: 6px; align-items: center; }
.ms-icon-btn {
	width: 34px; height: 34px; border-radius: var(--wp--custom--radius--pill); border: 1px solid var(--wp--preset--color--line);
	background: transparent; color: var(--wp--preset--color--ink); display: inline-grid; place-items: center; cursor: pointer;
	font: 600 12px/1 var(--wp--preset--font-family--sans); padding: 0;
}
.ms-icon-btn:hover { border-color: var(--wp--preset--color--nachthimmel); color: var(--wp--preset--color--nachthimmel); }
.ms-icon-btn svg { width: 17px; height: 17px; }
.ms-icon-btn .ms-sun { display: none; }
:root[data-theme="dark"] .ms-icon-btn .ms-sun { display: block; }
:root[data-theme="dark"] .ms-icon-btn .ms-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .ms-icon-btn .ms-sun { display: block; }
	:root:not([data-theme="light"]) .ms-icon-btn .ms-moon { display: none; }
}
.ms-header .wp-block-search__button { width: 34px; height: 34px; min-width: 0; padding: 0; border-radius: 999px; border: 1px solid var(--wp--preset--color--line); background: transparent; color: var(--wp--preset--color--ink); }
.ms-header .wp-block-search__button svg { width: 20px; height: 20px; fill: currentColor; }
/* Kopf-Suche: Feld legt sich links neben die Lupe über das Menü (kein Verrutschen). Kein display:none,
   sonst kann WordPress beim Öffnen den Cursor nicht ins Feld setzen. */
.ms-header .wp-block-search { position: relative; }
.ms-header .wp-block-search__inside-wrapper { border: 0 !important; padding: 0 !important; background: none !important; }
.ms-header .wp-block-search__button-only .wp-block-search__input {
	position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); z-index: 2;
	width: min(17rem, calc(100vw - 7.5rem)) !important; height: 38px; margin: 0; padding: 0 16px !important;
	border: 1px solid var(--wp--preset--color--nachthimmel) !important; border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); font: 15px var(--wp--preset--font-family--sans);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .08); outline: none; transition: opacity .15s;
}
.ms-header .wp-block-search__button-only .wp-block-search__input::placeholder { color: var(--wp--preset--color--ink-muted); }
.ms-header .wp-block-search__button-only.wp-block-search__searchfield-hidden .wp-block-search__input { opacity: 0; pointer-events: none; } /* nur durchsichtig: unsichtbare Felder nehmen keinen Fokus an; Tab überspringt es (tabindex -1 vom Suchblock) */
.ms-header .wp-block-search__button-only:not(.wp-block-search__searchfield-hidden) .wp-block-search__button { border-color: var(--wp--preset--color--nachthimmel); color: var(--wp--preset--color--nachthimmel); }

/* ---------- Karten 3:4 ---------- */
.ms-cards { gap: var(--wp--preset--spacing--40) !important; }
.ms-card { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.ms-card > * { margin: 0 !important; }
.ms-card .wp-block-post-featured-image { margin-bottom: 4px !important; }
.ms-card .wp-block-post-featured-image img { aspect-ratio: 3/4; object-fit: cover; border-radius: var(--wp--custom--radius--md); width: 100%; background: var(--ms-art-ground); }
.ms-card .wp-block-post-title { font-size: 1.125rem; line-height: 1.3; }
.ms-card .wp-block-post-title a { color: var(--wp--preset--color--ink); }
.ms-card:hover .wp-block-post-title a { color: var(--wp--preset--color--nachthimmel); text-decoration: none; }
.ms-meta { font-size: 13px; color: var(--wp--preset--color--ink-muted); display: flex; gap: 6px; }
.ms-meta > * { margin: 0 !important; font-size: inherit !important; }
.ms-meta > * + *::before { content: "·"; margin-right: 6px; }
.ms-card .ms-label { display: flex; gap: 6px; flex-wrap: wrap; }
.ms-card .ms-label .wp-block-post-terms__separator { display: none; }
.ms-card .ms-label .ms-fmt::before { content: "· "; }

/* Kultur-Seite: erste 4 als Karten, danach kompakte Liste (eine Abfrage, nur CSS) */
.ms-kartenliste > .wp-block-post-template { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--wp--preset--spacing--40); list-style: none; padding: 0; margin: 0; }
.ms-kartenliste .wp-block-post:nth-child(n+5) { grid-column: 1 / -1; }
.ms-kartenliste .wp-block-post:nth-child(n+5) .ms-card {
	display: grid; grid-template-columns: 1fr 160px 110px; gap: 16px; align-items: center;
	padding: 13px 4px; border-bottom: 1px solid var(--wp--preset--color--line); font-size: var(--wp--preset--font-size--body-small);
}
.ms-kartenliste .wp-block-post:nth-child(5) .ms-card { border-top: 1px solid var(--wp--preset--color--line); }
.ms-kartenliste .wp-block-post:nth-child(5) { margin-top: var(--wp--preset--spacing--50); }
.ms-kartenliste .wp-block-post:nth-child(n+5) .wp-block-post-featured-image,
.ms-kartenliste .wp-block-post:nth-child(n+5) .ms-kultur-term,
.ms-kartenliste .wp-block-post:nth-child(n+5) .wp-block-post-time-to-read { display: none; }
.ms-kartenliste .wp-block-post:nth-child(n+5) .wp-block-post-title { order: 1; font-size: 1.0625rem; }
.ms-kartenliste .wp-block-post:nth-child(n+5) .ms-label { order: 2; }
.ms-kartenliste .wp-block-post:nth-child(n+5) .ms-label .ms-fmt::before { content: none; }
.ms-kartenliste .wp-block-post:nth-child(n+5) .ms-meta { order: 3; justify-content: flex-end; }

/* ---------- Flächen ---------- */
.ms-box { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--lg); }
a.ms-box:hover, .ms-box:has(> a:hover) { border-color: var(--wp--preset--color--nachthimmel); }
.ms-art { background: var(--ms-art-ground); border-radius: var(--wp--custom--radius--md); overflow: hidden; }
.ms-art img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Newsletter-Band */
.ms-nl-band { border-radius: var(--wp--custom--radius--lg); position: relative; overflow: hidden; margin-top: var(--wp--preset--spacing--60) !important; margin-bottom: var(--wp--preset--spacing--60) !important; }
.ms-nl-band h2 { color: inherit; }
.ms-nl-band p { opacity: .9; }
.ms-nl-band .ms-label { color: inherit; opacity: .8; }
.ms-nl-band::after {
	content: ""; position: absolute; right: 18px; top: 14px; width: 120px; height: 60px; opacity: .35; pointer-events: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60' fill='white' stroke='white'%3E%3Ccircle cx='10' cy='40' r='2'/%3E%3Ccircle cx='40' cy='12' r='2.5'/%3E%3Ccircle cx='75' cy='30' r='2'/%3E%3Ccircle cx='110' cy='8' r='3'/%3E%3Cpath d='M10 40 L40 12 L75 30 L110 8' stroke-width='.8' fill='none'/%3E%3C/svg%3E") no-repeat;
}
:root[data-theme="dark"] .ms-nl-band { background: var(--wp--preset--color--tint) !important; color: var(--wp--preset--color--ink) !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ms-nl-band { background: var(--wp--preset--color--tint) !important; color: var(--wp--preset--color--ink) !important; } }
.ms-nl-form { display: flex; gap: 8px; }
.ms-nl-form input[type="email"] { flex: 1; min-width: 0; border: 0; border-radius: var(--wp--custom--radius--pill); padding: 12px 18px; font: 15px var(--wp--preset--font-family--sans); background: #fff; color: #1D1D1F; }
.ms-nl-form button { border: 0; cursor: pointer; border-radius: var(--wp--custom--radius--pill); padding: 10px 18px; font: 600 var(--wp--preset--font-size--button)/20px var(--wp--preset--font-family--sans); background: var(--wp--preset--color--surface); color: var(--wp--preset--color--nachthimmel); }
:root[data-theme="dark"] .ms-nl-band .ms-nl-form button { background: var(--wp--preset--color--nachthimmel); color: var(--wp--preset--color--on-nachthimmel); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ms-nl-band .ms-nl-form button { background: var(--wp--preset--color--nachthimmel); color: var(--wp--preset--color--on-nachthimmel); } }
.ms-nl-box .ms-nl-form input[type="email"] { border: 1px solid var(--wp--preset--color--line); background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); padding: 10px 16px; }
.ms-nl-box .ms-nl-form button { background: var(--wp--preset--color--nachthimmel); color: var(--wp--preset--color--on-nachthimmel); }

/* Lexikon-Kacheln */
.ms-lex-tile { display: grid !important; grid-template-columns: 110px 1fr; overflow: hidden; gap: 0 !important; }
.ms-lex-tile > figure { margin: 0 !important; height: 100%; }
.ms-lex-tile > figure img { height: 100%; width: 100%; object-fit: cover; }
.ms-lex-tile h3 { font-size: 1.125rem; }
.ms-lex-tile h3 a { color: var(--wp--preset--color--ink); }
.ms-lex-tile h3 a::after { content: ""; position: absolute; inset: 0; }
.ms-lex-tile { position: relative; }
.ms-az-mini { font-size: 12px; letter-spacing: .12em; color: var(--wp--preset--color--ink-muted); }

/* A–Z-Leiste */
.ms-az { display: flex; flex-wrap: wrap; gap: 4px; }
.ms-az a, .ms-az span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--wp--custom--radius--sm); background: var(--wp--preset--color--tint); font-weight: 600; font-size: 14px; }

/* Anzeige- und Affiliate-Platzhalter */
.ms-ad { background: var(--wp--preset--color--ad-frame); border-radius: var(--wp--custom--radius--sm); display: grid; place-items: center; color: var(--wp--preset--color--ink-muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; min-height: 250px; position: relative; margin-block: var(--wp--preset--spacing--40) !important; }
.ms-ad::before { content: "Anzeige"; position: absolute; top: 6px; left: 10px; font-size: 10px; }
.ms-ad p { margin: 0; }
.ms-aff { background: var(--wp--preset--color--ad-frame); border-radius: var(--wp--custom--radius--md); padding: 14px !important; position: relative; font-size: 14px; margin-top: var(--wp--preset--spacing--40) !important; }
.ms-aff::before { content: "Werbung · Affiliate-Link"; position: absolute; top: -9px; left: 12px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; background: var(--wp--preset--color--ground); padding: 0 6px; color: var(--wp--preset--color--ink-muted); }
.ms-aff .ms-buch { width: 56px; height: 76px; border-radius: 3px; background: linear-gradient(135deg, #7A4A22, #D9A441); flex: none; }
.ms-aff p { margin: 0; }

/* ---------- Startseite (Hub) ---------- */
.ms-hero { text-align: center; max-width: 52rem; margin-inline: auto !important; }
.ms-hero h1 { font-size: var(--wp--preset--font-size--display); line-height: 1.08; }
.ms-hero .ms-intro { font-size: 1.25rem; color: var(--wp--preset--color--ink-muted); max-width: 40rem; margin-inline: auto !important; }
.ms-hero .wp-block-search { max-width: 34rem; margin-inline: auto !important; }
.ms-hero .wp-block-search__inside-wrapper { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line) !important; border-radius: var(--wp--custom--radius--pill); padding: 6px 6px 6px 20px !important; }
.ms-hero .wp-block-search__input { border: 0; background: transparent; font: 16px var(--wp--preset--font-family--sans); color: var(--wp--preset--color--ink); outline: none; }
.ms-hero .wp-block-search__button { margin-left: 8px; }
.ms-examples { font-size: 13px; color: var(--wp--preset--color--ink-muted); }

.ms-cult { overflow: hidden; display: flex; flex-direction: column; }
.ms-cult > figure { margin: 0 !important; }
.ms-cult > figure img { aspect-ratio: 16/9; object-fit: cover; width: 100%; display: block; }
.ms-cult .ms-cult-in { padding: 18px 20px 20px; }
.ms-cult .ms-cult-in > * { margin: 0; }
.ms-cult p.ms-sub { font-size: var(--wp--preset--font-size--body-small); color: var(--wp--preset--color--ink-muted); margin-top: 6px; }
.ms-cult .ms-zeilen { margin-top: 12px !important; display: grid; gap: 0; }
.ms-zeilen p { margin: 0 !important; font-size: var(--wp--preset--font-size--body-small); }
.ms-zeilen p a { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--wp--preset--color--line); font-weight: 500; }
.ms-zeilen em { font-style: normal; color: var(--wp--preset--color--ink-muted); font-weight: 400; }

.ms-who-row { display: grid !important; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--wp--preset--color--line); }
.ms-who-row > h3 { font-size: 1.125rem; margin: 0; }
.ms-who-row .wp-block-buttons { gap: 8px; }

.ms-fmt-tile { padding: 20px !important; position: relative; }
.ms-fmt-tile > * { margin: 0 !important; }
.ms-fmt-tile h3 { margin: 10px 0 6px !important; }
.ms-fmt-tile h3 a { color: var(--wp--preset--color--ink); }
.ms-fmt-tile h3 a::after { content: ""; position: absolute; inset: 0; }
.ms-fmt-tile p { font-size: 14px; color: var(--wp--preset--color--ink-muted); margin-bottom: 10px !important; }
.ms-fmt-tile .ms-mehr { font-size: 13px; font-weight: 600; color: var(--wp--preset--color--nachthimmel); margin-top: 10px !important; }
.ms-fmt-tile svg { width: 26px; height: 26px; color: var(--wp--preset--color--nachthimmel); }

.ms-about { border-radius: var(--wp--custom--radius--lg); }
.ms-about h3 { display: flex; align-items: center; }
.ms-about p { font-size: var(--wp--preset--font-size--body-small); margin: 6px 0 0; }

/* ---------- Kultur-Seite ---------- */
.ms-kultur-hero h1 { font-size: var(--wp--preset--font-size--display); }
.ms-kultur-hero .wp-block-term-description p { font-size: 1.125rem; color: var(--wp--preset--color--ink-muted); }
.ms-facts-row { gap: 28px !important; font-size: 14px; color: var(--wp--preset--color--ink-muted); }
.ms-facts-row p { margin: 0; }
.ms-facts-row b { display: block; font-family: var(--wp--preset--font-family--display); font-size: 1.5rem; color: var(--wp--preset--color--ink); font-weight: 600; }
.ms-kulturbild img { aspect-ratio: 4/3; object-fit: cover; border-radius: var(--wp--custom--radius--lg); width: 100%; }

/* ---------- Artikel (Steckbrief, Mythos, Moderne Sicht) ---------- */
.ms-crumb { font-size: 13px; color: var(--wp--preset--color--ink-muted); }
.ms-crumb a { color: var(--wp--preset--color--ink-muted); }
.ms-crumb > * { margin: 0 !important; }
.ms-crumb .wp-block-post-terms::after, .ms-crumb .ms-crumb-sep { content: ""; }

.ms-kopf { align-items: flex-start !important; }
.ms-kopf .wp-block-post-featured-image img, .ms-kopf .ms-figur-bild img { aspect-ratio: 3/4; object-fit: cover; border-radius: var(--wp--custom--radius--lg); background: var(--ms-art-ground); }
.ms-kopf h1, .ms-kopf .wp-block-post-title { font-size: var(--wp--preset--font-size--display); line-height: 1.08; }
.ms-sub, .ms-kopf .wp-block-post-excerpt__excerpt { font-size: 1.25rem; line-height: 1.45; color: var(--wp--preset--color--ink-muted); }
.ms-player { display: flex; align-items: center; gap: 14px; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--pill); padding: 8px 18px 8px 8px; }
.ms-player .ms-play { width: 42px; height: 42px; border-radius: 50%; background: var(--wp--preset--color--nachthimmel); color: var(--wp--preset--color--on-nachthimmel); display: grid; place-items: center; flex: none; border: 0; }
.ms-player .ms-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--wp--preset--color--line); position: relative; }
.ms-player .ms-bar::after { content: ""; position: absolute; inset: 0 70% 0 0; background: var(--wp--preset--color--nachthimmel); border-radius: 2px; }
.ms-player small { font-size: 12px; color: var(--wp--preset--color--ink-muted); white-space: nowrap; }
.ms-say { font-size: 14px; color: var(--wp--preset--color--ink-muted); }

/* Faktenbox „Klar“: weiße Karte, kleine graue Überschrift */
.ms-fakten { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--lg); overflow: hidden; font-size: var(--wp--preset--font-size--body-small); }
.ms-fakten h3 { font-family: var(--wp--preset--font-family--sans); font-size: var(--wp--preset--font-size--label); text-transform: uppercase; letter-spacing: .08em; color: var(--wp--preset--color--ink-muted); padding: 12px 18px; margin: 0; display: flex; align-items: center; }
.ms-fakten table { border-collapse: collapse; width: 100%; margin: 0; }
.ms-fakten .wp-block-table { margin: 0; }
.ms-fakten td { padding: 9px 18px; border: 0; border-top: 1px solid var(--wp--preset--color--line); vertical-align: top; }
.ms-fakten td:first-child { color: var(--wp--preset--color--ink-muted); font-weight: 500; width: 130px; }
.ms-fakten .ms-fig { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 2px; border-radius: var(--wp--custom--radius--pill); background: var(--wp--preset--color--tint); font-size: 13px; font-weight: 600; margin: 2px 4px 2px 0; }
.ms-fakten .ms-fig::before { content: ""; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #D9A441 0 40%, var(--ms-art-ground) 42%); }

/* Lesebereich mit Inhaltsverzeichnis links */
/* Kopf (.ms-kopf) über die volle Breite, darunter links das Verzeichnis, rechts der Text.
   Die Kinder von post-content werden per display:contents zu Rasterzellen. */
.ms-lesen > .ms-toc-spalte { display: none; }
.ms-lesen.has-toc { display: grid; grid-template-columns: 220px minmax(0, var(--wp--style--global--content-size)) 1fr; column-gap: var(--wp--preset--spacing--60); row-gap: 0; align-items: start; }
.ms-lesen.has-toc > .wp-block-post-content { display: contents; }
.ms-lesen.has-toc > *, .ms-lesen.has-toc > .wp-block-post-content > * { grid-column: 2; min-width: 0; margin-left: 0 !important; margin-right: 0 !important; }
.ms-lesen.has-toc > .wp-block-post-content > .ms-kopf { grid-column: 1 / -1; margin-bottom: var(--wp--preset--spacing--60) !important; max-width: none; }
.ms-lesen.has-toc > .ms-toc-spalte { display: block; grid-column: 1; grid-row: 2 / span 400; position: sticky; top: 96px; margin: 0 !important; }
.ms-lesen > .wp-block-post-content > .ms-kopf { margin-bottom: var(--wp--preset--spacing--50); }
.ms-toc { font-size: 14px; }
.ms-toc .ms-label { color: var(--wp--preset--color--ink-muted); display: block; margin-bottom: 10px; }
.ms-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--wp--preset--color--line); }
.ms-toc li a { display: flex; gap: 8px; padding: 6px 12px; color: var(--wp--preset--color--ink-muted); margin-left: -2px; border-left: 2px solid transparent; }
.ms-toc li a:hover { text-decoration: none; color: var(--wp--preset--color--ink); }
.ms-toc li a.is-on { color: var(--wp--preset--color--nachthimmel); border-left-color: var(--wp--preset--color--nachthimmel); font-weight: 600; }
.ms-toc li a span { color: var(--wp--preset--color--nachthimmel); opacity: .7; }

.ms-text h2 { margin: var(--wp--preset--spacing--50) 0 var(--wp--preset--spacing--30); scroll-margin-top: 96px; }
.ms-text h2[data-num]::before { content: attr(data-num); font: 600 0.8rem/1 var(--wp--preset--font-family--sans); color: var(--wp--preset--color--nachthimmel); letter-spacing: .06em; margin-right: 12px; vertical-align: 0.35em; }
.ms-text p { line-height: 1.62; }
.ms-text sup a { font-size: 11px; font-weight: 600; padding: 0 2px; }
.ms-updated { font-size: 13px; color: var(--wp--preset--color--ink-muted); }
.ms-updated > * { margin: 0 !important; font-size: inherit !important; }
.ms-text .wp-block-details summary { cursor: pointer; font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: var(--wp--preset--font-size--h-3); }
.ms-text .wp-block-details ol { font-size: var(--wp--preset--font-size--body-small); }
.ms-nl-box { border-radius: var(--wp--custom--radius--lg); }
.ms-hint { font-size: 14px; color: var(--wp--preset--color--ink-muted); }
.ms-autor { border-top: 1px solid var(--wp--preset--color--line); padding-top: var(--wp--preset--spacing--40); font-size: 14px; }
.ms-autor svg { width: 64px; height: 64px; flex: none; }
.ms-autor p { margin: 0; }

.ms-ausmal-link { padding: 12px !important; }
.ms-ausmal-link .ms-pv { width: 80px; aspect-ratio: 3/4; background: #fff; border: 1px solid #ddd; border-radius: 4px; display: grid; place-items: center; flex: none; }
.ms-ausmal-link .ms-pv svg { width: 70%; color: #222; }
.ms-ausmal-link p { margin: 0; }

/* Mythos erzählt: großer Anfangsbuchstabe, Szenenbild 16:9 */
.ms-mythos .ms-text > p:first-of-type::first-letter { font-family: var(--wp--preset--font-family--display); font-weight: 600; float: left; font-size: 3.6rem; line-height: .9; margin: 6px 10px 0 0; color: var(--wp--preset--color--nachthimmel); }
.ms-szene img { aspect-ratio: 16/9; object-fit: cover; border-radius: var(--wp--custom--radius--lg); width: 100%; }
.ms-hinweis { background: var(--wp--preset--color--tint); border-radius: var(--wp--custom--radius--lg); font-size: var(--wp--preset--font-size--body-small); }
.ms-hinweis > * { margin: 0; }
.ms-vergleich > .wp-block-column { border-radius: var(--wp--custom--radius--lg); }

/* Ausmalbild-Seite */
.ms-malvorlage img { background: #fff !important; border: 1px solid #ddd; border-radius: var(--wp--custom--radius--md); aspect-ratio: 3/4; object-fit: contain; }

/* Lexikon-Platzhalter */
.ms-platzhalter { border: 2px dashed var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--lg); color: var(--wp--preset--color--ink-muted); }

/* ---------- Fuß ---------- */
.ms-footer { border-top: 1px solid var(--wp--preset--color--line); font-size: var(--wp--preset--font-size--body-small); }
.ms-footer h4 { font: 600 var(--wp--preset--font-size--label)/16px var(--wp--preset--font-family--sans); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; color: var(--wp--preset--color--ink-muted); }
.ms-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ms-footer ul a { color: var(--wp--preset--color--ink); }

/* ---------- Handy ---------- */
@media (max-width: 900px) {
	.ms-lesen.has-toc { grid-template-columns: minmax(0, 1fr); }
	.ms-lesen.has-toc > *, .ms-lesen.has-toc > .wp-block-post-content > * { grid-column: 1; }
	.ms-lesen.has-toc > .ms-toc-spalte { position: static; grid-row: 2; margin-bottom: var(--wp--preset--spacing--40) !important; }
}
@media (max-width: 781px) {
	.ms-tools .ms-fs { display: none; }
	.ms-header .wp-block-buttons { display: none; }
	.ms-kartenliste > .wp-block-post-template { grid-template-columns: repeat(2, 1fr); }
	.ms-kartenliste .wp-block-post:nth-child(n+5) .ms-card { grid-template-columns: 1fr auto; }
	.ms-kartenliste .wp-block-post:nth-child(n+5) .ms-label { display: none; }
	.ms-who-row { grid-template-columns: 1fr; }
	.ms-hero h1, .ms-kultur-hero h1, .ms-kopf h1, .ms-kopf .wp-block-post-title { font-size: var(--wp--preset--font-size--h-1); }
	.ms-nl-form { flex-direction: column; }
}

/* Farben der Figuren-Knöpfe (Platzhalter, bis echte Figurenbilder da sind) */
.ms-c1 { --c: #E2B04A; } .ms-c2 { --c: #E8B3C5; } .ms-c3 { --c: #C9B37E; }
.ms-c4 { --c: #D98BA7; } .ms-c5 { --c: #F0A040; } .ms-c6 { --c: #88C08A; }
.wp-block-button.is-style-figur.ms-alle > .wp-block-button__link { padding-left: 14px; }
.wp-block-button.is-style-figur.ms-alle > .wp-block-button__link::before { content: none; }
.ms-label .ms-fmt a { color: var(--wp--preset--color--ink-muted); }

/* Raster: feste Spaltenzahl (Abstände per CSS, daher nicht das auto-fill von WordPress) */
.wp-block-post-template.ms-cards { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.wp-block-post-template.ms-cards.columns-3, .ms-cards-3 .wp-block-post-template.ms-cards { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.ms-cult figure, .ms-cult figure a { display: block; width: 100%; }
.ms-cult > figure img { height: auto; }
@media (max-width: 781px) {
	.wp-block-post-template.ms-cards, .ms-cards-3 .wp-block-post-template.ms-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

.ms-kartenliste .wp-block-post { margin: 0; }
.wp-element-button, .wp-block-button__link { white-space: nowrap; }

.ms-chips p { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ms-chips p.ms-muted a, .ms-chips p.ms-label a { border: 0; background: none; padding: 0; font-size: inherit; }
.ms-chips p.ms-muted { font-size: 14px; }
.ms-malkarten .wp-block-post-featured-image img { background: #fff; object-fit: contain; border: 1px solid var(--wp--preset--color--line); }

/* Großer Anfangsbuchstabe (nur „Mythos erzählt“) */
.has-drop-cap:not(:focus)::first-letter {
	font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: 3.6em; line-height: .9;
	float: left; margin: 6px 10px 0 0; color: var(--wp--preset--color--nachthimmel); text-transform: none;
}

details.ms-toc > summary { list-style: none; cursor: default; }
details.ms-toc > summary::-webkit-details-marker { display: none; }
@media (max-width: 900px) {
	details.ms-toc { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--md); padding: 12px 16px; }
	details.ms-toc > summary { cursor: pointer; margin: 0 !important; }
	details.ms-toc > summary::after { content: " ▾"; }
	details.ms-toc[open] > summary { margin-bottom: 10px !important; }
}
/* Handy: Label, Titel und Untertitel vor dem Bild */
@media (max-width: 781px) {
	.ms-kopf.wp-block-columns { display: flex; flex-direction: column; }
	.ms-kopf > .wp-block-column:last-child { display: contents; }
	.ms-kopf > .wp-block-column:last-child > .ms-label,
	.ms-kopf > .wp-block-column:last-child > .wp-block-post-title,
	.ms-kopf > .wp-block-column:last-child > .ms-sub { order: -1; margin: 0 !important; }
	.ms-kopf > .wp-block-column:last-child > * { margin: 0 !important; }
}

/* Suchfeld allgemein (Lexikon, Suche, 404) */
.wp-block-search:not(.wp-block-search__button-only) .wp-block-search__input { border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--pill); background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); padding: 10px 18px; font: 16px var(--wp--preset--font-family--sans); }
.ms-hero .wp-block-search__input { border: 0 !important; padding: 0 !important; }
.ms-cult h2 a { color: var(--wp--preset--color--ink); } .ms-cult h2 a:hover { color: var(--wp--preset--color--nachthimmel); text-decoration: none; }

/* ---------- Lexikon (Mythscriber Core) ---------- */
.ms-chips p.ms-muted a.is-on { background: none; color: var(--wp--preset--color--nachthimmel); font-weight: 600; }
.ms-az a { color: var(--wp--preset--color--ink); }
.ms-az a:hover { background: var(--wp--preset--color--nachthimmel); color: var(--wp--preset--color--on-nachthimmel); text-decoration: none; }
.ms-az a.is-on { background: var(--wp--preset--color--nachthimmel); color: var(--wp--preset--color--on-nachthimmel); }
.ms-az .is-leer { background: transparent; color: var(--wp--preset--color--ink-muted); opacity: .45; font-weight: 500; }
.ms-lex-liste { margin-top: var(--wp--preset--spacing--40) !important; }
.ms-lex-buchstabe { font-size: 1.5rem; padding-bottom: 6px; border-bottom: 2px solid var(--wp--preset--color--ink); margin: var(--wp--preset--spacing--50) 0 14px !important; scroll-margin-top: 90px; }
.ms-lex-liste .wp-block-buttons { gap: 8px; }
.ms-hinweis { font-weight: 400; font-size: 12px; color: var(--wp--preset--color--ink-muted); }
.ms-box .ms-figuren-klein { margin-top: 12px !important; }
.ms-lex-eintrag .wp-block-post-title { margin-bottom: 6px; }
.ms-aussprache { color: var(--wp--preset--color--ink-muted); margin: 0 0 14px !important; }
.ms-zeile { gap: 8px 10px !important; align-items: center; margin-block: 10px !important; }
.ms-zeile > p { margin: 0 !important; font-size: 14px; font-weight: 600; }
.ms-zeile .wp-block-buttons { margin: 0 !important; gap: 8px; }
.ms-lex-text { font-size: 1.0625rem; }
.ms-ad-klein .ms-ad { min-height: 120px; }
.ms-lex-bild:empty { display: none; }
@media (max-width: 781px) { .ms-lex-bild { order: -1; max-width: 12rem; } }
/* Figuren-Knopf: Farbe nach Figurentyp, Bild der Figur hat Vorrang (2026-11-01) */
.ms-typ-goetter { --c: #E2B04A; } .ms-typ-helden { --c: #88C08A; } .ms-typ-wesen { --c: #D98BA7; } .ms-typ-sonstige, .ms-typ-orte { --c: #B4B2A9; }
.wp-block-button.is-style-figur.ms-hat-bild > .wp-block-button__link::before { background: var(--ms-art-ground) var(--bild) 50% 12% / cover no-repeat; }
/* Ältere Artikel: Ersatz-Kopf; Rank-Math-Inhaltsverzeichnis ausblenden, wenn das Theme-Verzeichnis sichtbar ist (2026-11-01) */
.ms-kopf-ersatz .wp-block-post-featured-image img { border-radius: var(--wp--custom--radius--md); }
.ms-lesen.has-toc .wp-block-rank-math-toc-block { display: none; }
