/* TS Toolkit – Design „Notizbuch“ */

/* ---------- Grundlage ---------- */
body {
	background-color: var(--wp--preset--color--base);
	background-image: radial-gradient(rgba(31, 45, 77, 0.16) 1.2px, transparent 1.3px);
	background-size: 24px 24px;
	-webkit-font-smoothing: antialiased;
}
::selection { background: var(--wp--preset--color--marker); color: var(--wp--preset--color--contrast); }
a { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:where(.wp-site-blocks) :focus-visible { outline: 3px solid var(--wp--preset--color--secondary); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 12 5 5; overflow-wrap: break-word; }
.wp-site-blocks > main, .wp-site-blocks > .wp-block-group { margin-block-start: 0; }

/* Buttons: Tinte mit Textmarker-Schatten */
.wp-element-button, .wp-block-button__link {
	box-shadow: 4px 4px 0 var(--wp--preset--color--marker);
	transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
	text-decoration: none;
}
.wp-element-button:hover, .wp-block-button__link:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--wp--preset--color--marker); }
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent; color: var(--wp--preset--color--contrast);
	border: 2px solid currentColor; box-shadow: none;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }

/* Textmarker im Fließtext (z. B. in der Startseiten-Überschrift) */
mark.ts-marker { background: var(--wp--preset--color--marker); color: inherit; padding: 0 .15em; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---------- Kopfbereich ---------- */
.ts-kopf { position: relative; z-index: 20; }
.ts-kopf .wp-block-site-title { margin: 0; line-height: 1.1; }
.ts-kopf .wp-block-site-title a { text-decoration: none; }
.ts-kopf .wp-block-site-tagline { margin: 0; line-height: 1.1; }
.ts-kopf .wp-block-navigation a { text-decoration: none; font-weight: 700; }
.ts-kopf .wp-block-navigation a:hover { text-decoration: underline; text-decoration-color: var(--wp--preset--color--marker); text-decoration-thickness: 4px; }
.ts-kopf .wp-block-navigation__submenu-container {
	background: #fff !important; border: 2px solid var(--wp--preset--color--contrast) !important;
	border-radius: 12px; padding: .5rem 0 !important; box-shadow: 4px 4px 0 var(--wp--preset--color--marker);
	min-width: 270px !important;
}
.ts-kopf .wp-block-navigation__submenu-container a { font-weight: 600; padding: .45rem 1.1rem !important; }
.ts-kopf .wp-block-navigation__responsive-container.is-menu-open { background-color: var(--wp--preset--color--base) !important; }
.ts-kopf .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container { border: 0 !important; box-shadow: none; background: transparent !important; }
.ts-kopf .is-menu-open .wp-block-navigation__responsive-container-content, .ts-kopf .is-menu-open .wp-block-navigation__container, .ts-kopf .is-menu-open .wp-block-navigation__submenu-container, .ts-kopf .is-menu-open .wp-block-navigation-item { align-items: flex-start !important; text-align: left; }
.ts-kopf .is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 2.5rem; }
.ts-kopf .is-menu-open .wp-block-navigation-item { font-size: 1.45rem; }
.ts-kopf .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item { font-size: 1.15rem; }
.ts-kopf .is-menu-open .wp-block-navigation__submenu-container { padding-left: 1rem !important; }

/* ---------- Kopf: Einband (0.8.0) ---------- */
header.wp-block-template-part { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 50; }
@media (max-width: 600px) { header.wp-block-template-part { top: 0; } }
.ts-kopf { border-top: 6px solid var(--wp--preset--color--secondary); border-bottom: 2px dashed var(--wp--preset--color--linie); box-shadow: 0 6px 18px rgba(31, 45, 77, .07); transition: padding .2s ease; }
.ts-kopf .wp-block-site-logo { position: relative; }
.ts-kopf .wp-block-site-logo::before { content: ""; position: absolute; left: 50%; top: -9px; width: 42px; height: 15px; translate: -50% 0; rotate: -6deg; background: var(--wp--preset--color--klebeband); opacity: .9; z-index: 1; }
.ts-kopf .wp-block-site-logo img { transition: width .2s ease, height .2s ease; }
.ts-kopf.ist-kompakt { padding-top: .45rem !important; padding-bottom: .45rem !important; }
.ts-kopf.ist-kompakt .wp-block-site-logo img { width: 40px !important; height: auto !important; }
.ts-kopf.ist-kompakt .wp-block-site-tagline { display: none; }
.ts-kopf.ist-kompakt .wp-block-site-logo::before { top: -3px; width: 32px; height: 11px; }
@media (max-width: 600px) {
	.ts-kopf .wp-block-site-title { font-size: 1.35rem !important; }
	.ts-kopf .wp-block-site-tagline { font-size: 1.15rem !important; }
	.ts-kopf .wp-block-site-logo img { width: 44px !important; height: auto !important; }
}

/* ---------- Fuß: Buchrücken (0.8.0) ---------- */
.wp-site-blocks > footer.wp-block-template-part { margin-top: var(--wp--preset--spacing--60); }
.ts-fuss { position: relative; border-top: 6px solid var(--wp--preset--color--secondary); background-image: none !important; }
.ts-fuss .wp-block-site-title { margin: 0; line-height: 1.1; }
.ts-fuss .wp-block-site-title a { text-decoration: none; color: var(--wp--preset--color--base); }
.ts-fuss-text { opacity: .85; max-width: 34ch; }
.ts-fuss-titel { font-family: var(--wp--preset--font-family--caveat); font-size: 1.6rem; line-height: 1.1; color: var(--wp--preset--color--marker); margin-bottom: .6rem !important; }
.ts-fuss-liste { list-style: none; padding: 0; margin: 0; }
.ts-fuss-liste li { margin: 0 0 .55rem; }
.ts-fuss a, .ts-fuss .wp-block-navigation a { color: var(--wp--preset--color--base) !important; text-decoration: none; }
.ts-fuss a:hover, .ts-fuss a:focus-visible { text-decoration: underline; text-decoration-color: var(--wp--preset--color--marker); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.ts-fuss .wp-block-navigation, .ts-fuss .wp-block-navigation__container { align-items: flex-start; }
.ts-fuss-unten { border-top: 1px dashed rgba(251, 247, 238, .3); opacity: .8; }
.ts-fuss-unten p { margin: 0; }

/* Kopf und Fuß bündig an den Rand */
.wp-site-blocks { padding-top: 0 !important; padding-bottom: 0 !important; }
.ts-fuss .wp-block-navigation { font-size: inherit !important; }
.ts-fuss .wp-block-site-logo img { background: var(--wp--preset--color--base); border-radius: 10px; padding: 4px; box-sizing: content-box; }

/* Karten: fehlende oder noch nicht geladene Bilder dürfen die Karte nicht sprengen */
.ts-polaroid-karte > * { max-width: 100%; min-width: 0; }
.ts-polaroid-karte .wp-block-post-featured-image { width: 100%; background: var(--wp--preset--color--klebeband); }
.ts-polaroid-karte .wp-block-post-featured-image img { max-width: 100%; contain-intrinsic-size: auto 240px; }

/* Große Karteikarte (Startseite, „Für den Anfang“) */
.ts-karte-gross { border: 2px solid var(--wp--preset--color--contrast); box-shadow: 7px 7px 0 var(--wp--preset--color--marker); }
.ts-karte-gross img { box-shadow: 0 8px 20px rgba(31, 45, 77, .14); }

/* ---------- Polaroid ---------- */
.is-style-polaroid { background: #fff; padding: 12px 12px 16px; box-shadow: 0 10px 28px rgba(31, 45, 77, .16); rotate: -1deg; }
.is-style-polaroid img { display: block; border-radius: 0 !important; }
.wp-block-post-featured-image.is-style-polaroid { margin-block: 0; }
.wp-block-image.is-style-polaroid figcaption { font-family: var(--wp--preset--font-family--caveat); font-size: 1.6rem; text-align: center; margin: .6rem 0 0; color: var(--wp--preset--color--contrast); }
.ts-schief-rechts { rotate: 2deg; }
.ts-kritzel { rotate: -2deg; transform-origin: left center; }

/* Beitragskarten im Polaroid-Stil (Query-Loop) */
.ts-polaroid-karte { background: #fff; padding: 12px 12px 18px; box-shadow: 0 6px 18px rgba(31, 45, 77, .12); height: 100%; box-sizing: border-box; transition: rotate .2s ease, translate .2s ease; }
.wp-block-post-template > li:nth-child(3n+1) .ts-polaroid-karte { rotate: -1deg; }
.wp-block-post-template > li:nth-child(3n+2) .ts-polaroid-karte { rotate: .8deg; }
.wp-block-post-template > li:nth-child(3n) .ts-polaroid-karte { rotate: -.5deg; }
.ts-polaroid-karte:hover { rotate: 0deg !important; translate: 0 -3px; }
.ts-polaroid-karte .wp-block-post-featured-image { margin: 0; }
.ts-polaroid-karte .wp-block-post-featured-image img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.ts-polaroid-karte .wp-block-post-title { padding-inline: 6px; font-size: clamp(1.25rem, 1.15rem + 0.4vw, 1.45rem) !important; }
.ts-polaroid-karte .wp-block-post-terms { font-size: clamp(1.25rem, 1.2rem + 0.2vw, 1.4rem) !important; }
.ts-polaroid-karte .wp-block-post-title a { text-decoration: none; }
.ts-polaroid-karte .wp-block-post-title a:hover { text-decoration: underline; text-decoration-color: var(--wp--preset--color--marker); text-decoration-thickness: 4px; }
.ts-polaroid-karte .wp-block-post-terms, .ts-polaroid-karte .wp-block-post-excerpt { padding-inline: 6px; }
.ts-polaroid-karte .wp-block-post-terms a { text-decoration: none; color: var(--wp--preset--color--secondary); }
.ts-polaroid-karte .wp-block-post-excerpt__excerpt { margin: 0; }

/* ---------- Klebeband ---------- */
.is-style-klebeband { position: relative; }
.is-style-klebeband::before, .is-style-klebeband::after {
	content: ""; position: absolute; z-index: 2; top: -12px; width: 120px; height: 32px;
	background: var(--wp--preset--color--klebeband); opacity: .92; pointer-events: none;
}
.is-style-klebeband::before { left: 8%; rotate: -6deg; }
.is-style-klebeband::after { right: 8%; rotate: 5deg; }

/* ---------- Karteikarte ---------- */
.is-style-karteikarte { background: #fff; border: 2px solid var(--wp--preset--color--contrast); border-radius: 14px; padding: 1.4rem 1.5rem; }

/* ---------- Notizzettel (liniert) ---------- */
.is-style-notizzettel {
	--ts-zeile: 2.5rem;
	background-color: #FFFEFA;
	background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--ts-zeile) - 1px), #CFDCEB calc(var(--ts-zeile) - 1px), #CFDCEB var(--ts-zeile));
	border-left: 2px solid #E9A3A3; border-radius: 6px;
	box-shadow: 0 6px 18px rgba(31, 45, 77, .10);
	padding: .5rem 1.75rem 1rem 3.5rem !important; rotate: .4deg;
	font-family: var(--wp--preset--font-family--caveat); font-size: 1.75rem; line-height: var(--ts-zeile);
}
.is-style-notizzettel > *, .is-style-notizzettel li { line-height: var(--ts-zeile); margin-block: 0 !important; }
ul.is-style-notizzettel, ol.is-style-notizzettel { padding-left: 3.5rem !important; }
.is-style-notizzettel :is(h2, h3, h4) { font-family: var(--wp--preset--font-family--caveat); font-size: 1.9rem; color: var(--wp--preset--color--secondary); text-decoration: none !important; }

/* ---------- Textmarker-Überschrift & Handschrift ---------- */
.is-style-markiert, .wp-block-post-content h2 {
	text-decoration-line: underline; text-decoration-color: var(--wp--preset--color--marker);
	text-decoration-thickness: .42em; text-underline-offset: -.22em; text-decoration-skip-ink: none;
}
.is-style-handschrift { font-family: var(--wp--preset--font-family--caveat); font-size: 1.7rem; line-height: 1.3; color: var(--wp--preset--color--secondary); }

/* ---------- Beitrag ---------- */
.wp-block-post-content > p:first-child { font-size: 1.2em; line-height: 1.6; }
.wp-block-post-content h2 { margin-top: 2.5rem; }
.wp-block-post-content a { text-decoration-color: var(--wp--preset--color--secondary); text-decoration-thickness: 2px; }
.ts-meta { color: var(--wp--preset--color--grau); }
.ts-meta > * { margin: 0; }
.ts-brotkrumen, .ts-brotkrumen a { color: var(--wp--preset--color--grau); }

/* Teilen-Leiste (Modul „Teilen-Leiste“; alte Klassen des Social Sharing Block bleiben zur Sicherheit) */
.ts-teilen { border-top: 2px dashed var(--wp--preset--color--linie); border-bottom: 2px dashed var(--wp--preset--color--linie); }
.ts-teilen-liste, .ts-teilen .wp-block-outermost-social-sharing { display: flex; flex-wrap: wrap; gap: 10px !important; list-style: none; margin: 0; padding: 0; }
.ts-teilen-liste li { margin: 0; }
.ts-teilen-liste a, .ts-teilen .wp-block-outermost-social-sharing-link a {
	display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 0 !important; box-sizing: border-box;
	background: #fff; border: 2px solid var(--wp--preset--color--contrast); border-radius: 10px; color: var(--wp--preset--color--contrast);
}
.ts-teilen-liste a:hover, .ts-teilen-liste a:focus-visible, .ts-teilen .wp-block-outermost-social-sharing-link a:hover { background: var(--wp--preset--color--marker); }
.ts-teilen-liste svg, .ts-teilen .wp-block-outermost-social-sharing-link svg { width: 22px; height: 22px; fill: currentColor; }

/* ---------- Startseite: Auswahl-Karten ---------- */
.ts-check { position: relative; background: #fff; border: 2px solid var(--wp--preset--color--contrast); border-radius: 12px; padding: 1.1rem 1.3rem 1.1rem 3.7rem !important; height: 100%; box-sizing: border-box; transition: box-shadow .15s ease, translate .15s ease; }
.ts-check::before { content: ""; position: absolute; left: 1.25rem; top: 1.45rem; width: 24px; height: 24px; box-sizing: border-box; border: 2px solid var(--wp--preset--color--contrast); border-radius: 6px; background: #fff; }
.ts-check:hover { box-shadow: 4px 4px 0 var(--wp--preset--color--marker); translate: -1px -1px; }
.ts-check:hover::before { background: var(--wp--preset--color--marker); }
.ts-check p { margin: 0; }
.ts-check a { text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.ts-check a::after { content: ""; position: absolute; inset: 0; }
.ts-check .ts-check__text { font-size: .95rem; color: var(--wp--preset--color--grau); }

/* Dunkle Fläche (Leitfaden-Kasten) */
.ts-tinte a:not(.wp-element-button) { color: inherit; }
.ts-tinte .wp-element-button { background: var(--wp--preset--color--marker); color: var(--wp--preset--color--contrast); box-shadow: 4px 4px 0 rgba(255, 255, 255, .25); }
.ts-tinte .wp-element-button:hover { background: #fff; color: var(--wp--preset--color--contrast); }

/* Seitennummerierung */
.wp-block-query-pagination a, .wp-block-query-pagination .current { text-decoration: none; font-weight: 700; }
.wp-block-query-pagination .page-numbers { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; border-radius: 10px; }
.wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }

/* Suche */
.wp-block-search__input { border: 2px solid var(--wp--preset--color--contrast) !important; border-radius: 10px; background: #fff; min-height: 48px; padding-inline: 1rem; font: inherit; }
.wp-block-search__button { margin-left: .5rem; }

/* ---------- Produktbox (Modul Produkte) ---------- */
body .ts-produkt {
	background: #fff; border: 2px dashed var(--wp--preset--color--contrast); border-radius: 14px;
	padding: 1.75rem 1.6rem 1.4rem; margin: 2.5rem 0;
}
body .ts-produkt__kennzeichen {
	top: -.9em; left: 1.25rem; padding: .1em .7em; background: var(--wp--preset--color--marker);
	color: var(--wp--preset--color--contrast); font-weight: 700; font-size: .8rem; letter-spacing: .08em; rotate: -2deg;
}
body .ts-produkt__name { font-family: var(--wp--preset--font-family--dm-serif-display); font-weight: 400; font-size: 1.6rem; line-height: 1.2; margin-bottom: .8rem; }
body .ts-produkt__name::before { content: "Meine Empfehlung"; display: block; font-family: var(--wp--preset--font-family--caveat); font-size: 1.5rem; color: var(--wp--preset--color--secondary); margin-bottom: .1rem; }
body .ts-produkt-hinweis { font-size: .85rem; color: var(--wp--preset--color--grau); opacity: 1; }


/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 781px) {
	.is-style-polaroid, .ts-polaroid-karte { rotate: 0deg !important; }
	.is-style-klebeband::before, .is-style-klebeband::after { width: 84px; height: 26px; }
	.is-style-notizzettel { padding-left: 2.4rem !important; font-size: 1.55rem; }
}
@media (prefers-reduced-motion: reduce) {
	.wp-element-button, .ts-polaroid-karte, .ts-check { transition: none; }
}

/* Bildnachweise ([ts_bildnachweise]) */
.ts-bildnachweise { list-style: none; padding: 0; display: grid; gap: 1rem; }
.ts-bildnachweise li { display: flex; gap: 1rem; align-items: center; background: #fff; border: 1px solid var(--wp--preset--color--linie); border-radius: 10px; padding: .75rem; font-size: .95rem; }
.ts-bildnachweise img { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
