/*
Theme Name: IAMKLAUS
Theme URI: https://iamklaus.org/
Author: Klaus Gollwitzer
Author URI: https://iamklaus.org/
Description: Schlankes Block-Theme für iamklaus.org – ohne Page-Builder. SEO-Meta, Open Graph, JSON-LD und Sitemap-Steuerung sind eingebaut.
Version: 1.0.5
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: iamklaus
*/

/* ---------- Basis ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, video { max-width: 100%; height: auto; }
:where(.wp-site-blocks) > main { min-height: 60vh; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus { clip: auto; width: auto; height: auto; z-index: 1000; background: #fff; padding: .5rem 1rem; }

:focus-visible { outline: 2px solid var(--wp--preset--color--primary); outline-offset: 2px; }

/* ---------- Header ---------- */
header.wp-block-template-part {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255,255,255,.92);
	backdrop-filter: saturate(180%) blur(10px);
	-webkit-backdrop-filter: saturate(180%) blur(10px);
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.admin-bar header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { .admin-bar header.wp-block-template-part { top: 0; position: relative; } }
header.wp-block-template-part .wp-block-site-logo img { width: auto; max-height: 40px; }
header.wp-block-template-part .wp-block-navigation a { text-decoration: none; }
header.wp-block-template-part .wp-block-navigation a:hover { color: var(--wp--preset--color--primary); }
header.wp-block-template-part .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--primary); }

/* ---------- Karten ---------- */
.iamk-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px; overflow: hidden; height: 100%;
	transition: transform .18s ease, box-shadow .18s ease;
}
.iamk-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(18,20,29,.08); }
.iamk-card .wp-block-post-featured-image { margin: 0; }
.iamk-card .wp-block-post-featured-image img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.iamk-card .wp-block-post-title a { text-decoration: none; color: inherit; }
.iamk-card .wp-block-post-title a:hover { color: var(--wp--preset--color--primary); }
.wp-block-post-template.is-layout-grid > li { height: 100%; }

.iamk-eyebrow a, .iamk-eyebrow { text-decoration: none; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }

/* Hero-Beitrag */
.iamk-hero {
	background:
		radial-gradient(ellipse at 85% 0%, rgba(43,89,255,.18), transparent 55%),
		radial-gradient(ellipse at 0% 100%, rgba(20,24,87,.10), transparent 50%),
		var(--wp--preset--color--surface);
}
.iamk-feature .wp-block-post-featured-image img { aspect-ratio: 16/9; object-fit: cover; border-radius: 14px; }
.iamk-feature .wp-block-post-title a { text-decoration: none; color: inherit; }
.iamk-feature .wp-block-post-title a:hover { color: var(--wp--preset--color--primary); }

/* Kompakte Liste */
.iamk-list .wp-block-post-template > li { border-bottom: 1px solid var(--wp--preset--color--border); padding-bottom: var(--wp--preset--spacing--30); }
.iamk-list .wp-block-post-template > li:last-child { border-bottom: 0; }
.iamk-list .wp-block-post-featured-image img { aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.iamk-list .wp-block-post-title a { text-decoration: none; color: inherit; }
.iamk-list .wp-block-post-title a:hover { color: var(--wp--preset--color--primary); }

/* ---------- Beitrag ---------- */
.iamk-single-hero .wp-block-post-featured-image img { border-radius: 16px; aspect-ratio: 16/9; object-fit: cover; }
.wp-block-post-content > * + h2 { margin-top: var(--wp--preset--spacing--60); }
.wp-block-post-content > * + h3 { margin-top: var(--wp--preset--spacing--50); }
.wp-block-post-content a { text-underline-offset: .18em; text-decoration-thickness: 1px; }
.wp-block-post-content table { border-collapse: collapse; width: 100%; font-size: .95em; }
.wp-block-post-content :where(th, td) { border: 1px solid var(--wp--preset--color--border); padding: .5em .75em; }
.wp-block-post-content figure.wp-block-image img { border-radius: 10px; }
.wp-block-post-content .wp-block-embed iframe { width: 100%; }
.wp-block-post-content :not(pre) > code {
	background: var(--wp--preset--color--surface); padding: .12em .38em; border-radius: 4px; font-size: .9em;
}
.wp-block-post-terms a { text-decoration: none; }
.iamk-tags a {
	display: inline-block; padding: .2em .7em; margin: 0 .25em .4em 0; border-radius: 999px;
	background: var(--wp--preset--color--surface); color: var(--wp--preset--color--contrast-2);
}
.iamk-tags .wp-block-post-terms__separator { display: none; }

/* Info-/CTA-Box (Ersatz für Spectra Call-to-Action & Info-Box) */
.is-style-iamk-box {
	border-radius: 16px; border: 1px solid var(--wp--preset--color--border);
	background: linear-gradient(135deg, rgba(43,89,255,.08), rgba(20,24,87,.04)), var(--wp--preset--color--base);
}

/* Related Posts (Contextual Related Posts) an Theme angleichen */
.crp_related { margin-top: var(--wp--preset--spacing--60); }
.crp_related h3 { font-size: var(--wp--preset--font-size--large); }
.crp_related .crp_thumb { border-radius: 10px; }
.crp_title { background: transparent !important; color: var(--wp--preset--color--contrast) !important; font-weight: 700; }

/* Kommentare */
.wp-block-comments { border-top: 1px solid var(--wp--preset--color--border); }
.wp-block-comment-template .comment { border-bottom: 1px solid var(--wp--preset--color--border); padding-bottom: 1rem; }
.comment-form input:not([type=submit]):not([type=checkbox]), .comment-form textarea,
.wp-block-search__input {
	border: 1px solid var(--wp--preset--color--border); border-radius: 8px; padding: .65em .8em; font: inherit; width: 100%;
}

/* Pagination */
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers { text-decoration: none; padding: .3em .7em; border-radius: 6px; }
.wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--primary); color: #fff; }

/* Footer */
footer.wp-block-template-part { margin-top: var(--wp--preset--spacing--70); }
.site-footer { margin-top: 0 !important; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Altinhalte (Farben aus früheren Themes) ---------- */
.has-white-color { color: #fff !important; }
.has-white-background-color { background-color: #fff !important; }
.has-black-color { color: #000 !important; }
.has-black-background-color { background-color: #000 !important; }
.has-accent-5-background-color { background-color: #F6F6F6 !important; }
.has-ast-global-color-5-color { color: #fff !important; }
.has-very-light-gray-to-cyan-bluish-gray-gradient-background {
	background: linear-gradient(135deg, #EEEEEE 0%, #A9B8C3 100%) !important;
}
.wp-block-post-content .has-background { padding: 1.25em 1.5em; border-radius: 10px; }
.wp-block-post-content .wp-block-columns.has-background { padding: 1.5em; }
.wp-block-post-content iframe[src*="youtube"] { aspect-ratio: 16/9; height: auto; }

/* Werbe-Platzhalter (AdSense ist deaktiviert) nicht als Lücke stehen lassen */
.wp-block-post-content div:has(> [data-borlabs-cookie-service-id="google-ad-sense"]) { display: none; }

/* Beitrags-Meta */
.wp-block-template-part .is-layout-flex > p { margin: 0; }

/* Downloads (Ersatz für Download Monitor) */
.iamk-download { align-items: center; gap: .5rem 1rem; margin-block: 1.25rem; }
.iamk-download__meta { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.iamk-download-list .iamk-download { padding-bottom: 1rem; border-bottom: 1px solid var(--wp--preset--color--border); }

/* ---------- Suche im Header: runder Icon-Button ---------- */
header.wp-block-template-part .wp-block-search { margin: 0; }
header.wp-block-template-part .wp-block-search__inside-wrapper { border: 0; padding: 0; gap: .4rem; align-items: center; }
header.wp-block-template-part .wp-block-search__button {
	width: 40px; height: 40px; min-width: 40px; padding: 0; margin: 0;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 50%; border: 1px solid var(--wp--preset--color--border);
	background: transparent; color: var(--wp--preset--color--contrast);
	box-shadow: none; transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
header.wp-block-template-part .wp-block-search__button:hover,
header.wp-block-template-part .wp-block-search__button:focus-visible {
	background: var(--wp--preset--color--surface); color: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary);
}
header.wp-block-template-part .wp-block-search__button svg { width: 20px; height: 20px; min-width: 20px; fill: currentColor; }
header.wp-block-template-part .wp-block-search__input {
	height: 40px; border-radius: 999px; padding: 0 1rem; border: 1px solid var(--wp--preset--color--border); font-size: .95rem;
}
header.wp-block-template-part .wp-block-search__input:focus { outline: none; border-color: var(--wp--preset--color--primary); }

/* Affiliate-Buttons: Outline-Stil */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent; color: var(--wp--preset--color--primary); border: 2px solid currentColor;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--surface); }
