/*
Theme Name: Cserna
Theme URI: https://www.cserna.at
Author: Markus Cserna
Description: Persönliches Block-Theme für cserna.at. Schlank, ohne externe Ressourcen.
Version: 1.0.2
Requires at least: 6.6
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: cserna
*/

:root {
	--cs-paper: #f2f4f6;
	--cs-ink: #17202b;
	--cs-slate: #5b6776;
	--cs-rule: #cdd3da;
	--cs-deep: #1f2e44;
	--cs-gold: #a8781f;
	--cs-gold-light: #d9a846;
	--cs-gutter: clamp(1.25rem, 4vw, 3rem);
}

html { scroll-behavior: smooth; }
body { overflow-x: clip; font-stretch: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--cs-gold-light); color: var(--cs-ink); }

a { text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--cs-gold); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--cs-gold); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, .cs-condensed { font-stretch: 78%; letter-spacing: -0.01em; }

/* Kopfzeile */
.cs-header { padding-block: 1.25rem; padding-inline: var(--cs-gutter); border-bottom: 1px solid var(--cs-rule); }
.cs-header .cs-home { font-weight: 600; font-stretch: 78%; font-size: 1.15rem; text-decoration: none; color: var(--cs-ink); }
.cs-nav { display: flex; gap: 1.5rem; align-items: center; font-size: 0.95rem; }
.cs-nav a { color: var(--cs-ink); text-decoration: none; }
.cs-nav a:hover { text-decoration: underline; text-decoration-color: var(--cs-gold); }
.cs-lang { display: inline-flex; gap: 0.15rem; border: 1px solid var(--cs-rule); border-radius: 999px; padding: 2px; }
.cs-lang a, .cs-lang span { padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.85rem; }
.cs-lang span[aria-current] { background: var(--cs-ink); color: var(--cs-paper); }

/* Hero */
.cs-hero { padding-block: clamp(2.5rem, 7vw, 6rem) clamp(3rem, 8vw, 7rem); }
.cs-hero > .wp-block-columns { align-items: stretch; gap: clamp(2rem, 5vw, 5rem); }
.cs-name {
	font-size: clamp(4.5rem, 14vw, 11.5rem) !important;
	line-height: 0.86 !important;
	font-weight: 650 !important;
	font-stretch: 75% !important;
	letter-spacing: -0.025em !important;
	margin: 0 0 clamp(1.5rem, 3vw, 2.5rem) !important;
	margin-left: -0.04em !important;
	animation: cs-tighten 1100ms cubic-bezier(.2,.7,.1,1) both;
}
@keyframes cs-tighten {
	from { font-stretch: 100%; letter-spacing: 0.02em; opacity: 0.001; }
	30% { opacity: 1; }
	to { font-stretch: 75%; letter-spacing: -0.025em; opacity: 1; }
}
.cs-lede { font-size: clamp(1.35rem, 2.3vw, 1.75rem) !important; line-height: 1.35 !important; max-width: 30ch; font-weight: 500; margin-bottom: 1.25rem !important; }
.cs-sub { color: var(--cs-slate); max-width: 46ch; }
.cs-portrait { margin: 0 !important; height: 100%; position: relative; }
.cs-portrait img { width: 100%; height: 100%; min-height: 420px; max-height: 640px; object-fit: cover; object-position: 66% 30%; border-radius: 2px; display: block; }
.cs-portrait::before { content: ""; position: absolute; left: -14px; top: 12%; bottom: 12%; width: 3px; background: var(--cs-gold); }

/* Abschnitte */
.cs-section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.cs-section h2 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; margin: 0 0 clamp(2rem, 4vw, 3rem); font-weight: 600; }
.cs-topics { gap: clamp(1.5rem, 3vw, 3rem) !important; }
.cs-topic { border-top: 3px solid var(--cs-gold); padding-top: 1.25rem; }
.cs-topic h3 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); line-height: 1.08; margin: 0 0 0.9rem; font-weight: 600; }
.cs-topic p { color: #2c3846; }

/* Schmale Elemente links an der Inhaltskante ausrichten statt zentrieren */
.cs-section > .cs-big, .cs-section > .cs-timeline, .cs-section > .cs-media { margin-left: max(0px, calc((100% - 1240px) / 2)) !important; margin-right: auto !important; }

/* Werdegang */
.cs-hero, .cs-section { width: 100vw; max-width: none !important; margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important; padding-inline: var(--cs-gutter) !important; box-sizing: border-box; }
.cs-career { background: var(--cs-deep); color: #e8edf3; }
.cs-career h2 { color: #fff; }
.cs-timeline { list-style: none; margin: 0; padding: 0; max-width: 980px; }
.cs-timeline li { display: grid; grid-template-columns: minmax(6rem, 10rem) 1fr; gap: 1.5rem; padding: 1.4rem 0; border-top: 1px solid rgba(255,255,255,0.14); }
.cs-timeline li:last-child { border-bottom: 1px solid rgba(255,255,255,0.14); }
.cs-year { font-stretch: 75%; font-weight: 600; font-size: clamp(2rem, 4vw, 2.8rem); line-height: 0.95; color: var(--cs-gold-light); font-variant-numeric: tabular-nums; }
.cs-timeline strong { color: #fff; font-weight: 600; display: block; margin-bottom: 0.2rem; font-size: 1.1rem; }
.cs-timeline p { margin: 0; color: #c3ccd7; max-width: 62ch; }

/* Medien */
.cs-media { list-style: none; margin: 0; padding: 0; max-width: 980px; }
.cs-media li { display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem; padding: 1.1rem 0; border-top: 1px solid var(--cs-rule); align-items: baseline; }
.cs-media li:last-child { border-bottom: 1px solid var(--cs-rule); }
.cs-media .cs-src { color: var(--cs-slate); font-size: 0.92rem; }
.cs-media a { color: var(--cs-ink); font-weight: 500; font-size: 1.1rem; }
.cs-media small { display: block; color: var(--cs-slate); font-size: 0.92rem; margin-top: 0.15rem; }

/* Kontakt */
.cs-contact p.cs-big { font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-stretch: 80%; line-height: 1.15; font-weight: 500; max-width: 24ch; }
.cs-contact a { color: var(--cs-ink); }

/* Fußzeile */
.cs-footer { border-top: 1px solid var(--cs-rule); padding-block: 2rem; padding-inline: var(--cs-gutter); font-size: 0.9rem; color: var(--cs-slate); }
.cs-footer a { color: var(--cs-slate); }
.cs-footer .cs-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.cs-txt { font-family: var(--wp--preset--font-family--mono); font-size: 0.78rem; color: #8a94a1; overflow-wrap: anywhere; }

/* Textseiten */
.cs-prose { max-width: 68ch; }
.cs-prose h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1; font-weight: 600; margin-bottom: 2rem; }
.cs-prose h2 { font-size: 1.6rem; margin-top: 2.5rem; font-weight: 600; }
.cs-bio { border-left: 3px solid var(--cs-gold); padding-left: 1.25rem; margin-block: 1rem 2rem; }

@media (max-width: 781px) {
	.cs-hero > .wp-block-columns { flex-direction: column-reverse; }
	.cs-portrait img { min-height: 0; aspect-ratio: 4 / 3; max-height: 420px; }
	.cs-portrait::before { display: none; }
	.cs-timeline li, .cs-media li { grid-template-columns: 1fr; gap: 0.35rem; }
	.cs-nav { gap: 0.9rem; }
	.cs-nav .cs-hide-mobile { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.cs-name { animation: none; }
	html { scroll-behavior: auto; }
}
