/*
Theme Name: Rouven Ruppert
Theme URI: https://r-rpprt.com
Author: Rouven Ruppert
Description: Minimalistisches Portfolio-Theme mit quadratischem Projekt-Grid, Duoton-Bildern, blauen transparenten Projektfenstern und Custom-Cursor. Projekte werden über den Projekt-Typ im Backend gepflegt (CMS).
Version: 1.4.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: rouven-ruppert
*/

/* =========================================================================
   0. FONT-PLATZHALTER – lizenzierte Mono-Schrift nach assets/fonts/ legen.
   ====================================================================== */
@font-face {
	font-family: "SiteMono";
	src: url("assets/fonts/SiteMono-Regular.woff2") format("woff2");
	font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
	font-family: "SiteMono";
	src: url("assets/fonts/SiteMono-Heavy.woff2") format("woff2");
	font-weight: 800; font-style: normal; font-display: swap;
}

:root {
	--rr-dark:  #8d948d;
	--rr-light: #e3ede1;
	--rr-blue:  #0066ff;
	/* Deckende Blaufläche hinter Slides mit transparentem Hintergrund (PNG/WebM mit Alpha).
	   Der Ton entspricht dem linken/oberen Ende des Fensterverlaufs. */
	--rr-blue-solid: #0f66ff;
	--rr-pink:  #ff1fb4;
	--rr-gap:   6px;
	--rr-cols:  5;
	--rr-pad:   22px;   /* Seitenabstand Grid                          */
	--rr-win-gap: 22px; /* Abstand der Fenster zum Rand (oben = seitlich) */
	--rr-win-bottom: 14vh; /* Abstand des Projektfensters nach unten        */
	--rr-top:   84px;   /* wird per JS aus Headerhöhe + Gap gesetzt     */
	--rr-font: "SiteMono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Roboto Mono", monospace;
	/* Projektfenster: Verlauf LINKS -> RECHTS, transparent            */
	--rr-blue-h: linear-gradient(90deg,
		rgba(0,92,255,.93) 0%,
		rgba(45,125,255,.86) 45%,
		rgba(160,200,255,.58) 100%);
	/* Info / E-Mail: diagonaler Verlauf                                */
	--rr-blue-d: linear-gradient(155deg,
		rgba(0,92,255,.92) 0%,
		rgba(45,125,255,.84) 45%,
		rgba(160,200,255,.56) 100%);
}

* { box-sizing: border-box; }

html, body {
	margin: 0; padding: 0;
	background: #fff;
	color: var(--rr-dark);
	font-family: var(--rr-font);
	font-weight: 400; font-size: 15px; line-height: 1.35;
	-webkit-font-smoothing: antialiased;
}

/* Custom-Cursor: pinkes Plus */
body, a, button, .rr-tile {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="34" height="34" viewBox="0 0 34 34"><line x1="17" y1="3" x2="17" y2="31" stroke="%23ff1fb4" stroke-width="4"/><line x1="3" y1="17" x2="31" y2="17" stroke="%23ff1fb4" stroke-width="4"/></svg>') 17 17, auto;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 800; margin: 0; letter-spacing: .01em; }
img { display: block; max-width: 100%; }

/* =========================================================================
   1. Sticky Header – bleibt IMMER vollständig sichtbar (auch bei Fenstern)
   ====================================================================== */
.rr-header {
	position: sticky; top: 0; z-index: 2000;
	display: flex; justify-content: space-between; align-items: flex-start;
	gap: 20px; padding: 16px var(--rr-pad); background: #fff;
}
.rr-header__title {
	display: inline-block;
	font-weight: 800; text-transform: uppercase;
	letter-spacing: .02em; white-space: nowrap; line-height: 1;
	font-size: clamp(20px, 2vw, 30px); color: var(--rr-dark);
	transition: color .12s ease;
}
.rr-header__title:hover { color: var(--rr-blue); }

.rr-nav { display: flex; gap: 22px; white-space: nowrap; line-height: 1; font-size: 15px; }
.rr-nav a { transition: color .12s ease; }
.rr-nav a:hover { color: var(--rr-blue); }
.rr-burger { display: none; }

/* =========================================================================
   2. Projekt-Grid  (quadratische Kacheln über Padding-Trick = überall stabil)
   ====================================================================== */
.rr-grid {
	display: grid; grid-template-columns: repeat(var(--rr-cols), 1fr);
	gap: var(--rr-gap); padding: 0 var(--rr-pad) var(--rr-pad); overflow: visible;
}
.rr-tile {
	position: relative; width: 100%; height: 0; padding-bottom: 100%;
	background: var(--rr-light); overflow: hidden;
	transition: transform .28s cubic-bezier(.2,.7,.2,1); z-index: 1;
}
.rr-tile.is-hidden { display: none; }
.rr-tile__media {
	position: absolute; inset: 0; width: 100%; height: 100%;
	object-fit: cover; filter: grayscale(1) url(#rr-duotone);
	transition: filter .2s ease;
}
.rr-tile__label {
	position: absolute; left: 10px; bottom: 8px; right: 10px; z-index: 2;
	color: var(--rr-blue);                         /* durchgehend blau */
	-webkit-text-stroke: 1px var(--rr-blue);
	font-weight: 800; font-size: 22px; line-height: 1.02; text-transform: uppercase;
	opacity: 0; transition: opacity .18s ease;
	pointer-events: none; overflow-wrap: anywhere;
}
/* Blauer Rahmen als überlagerndes Pseudo-Element: liegt ÜBER dem Bild und
   verändert den Kachelabstand nicht (ein echter border würde das Raster verschieben). */
.rr-tile--projekt::after {
	content: ""; position: absolute; inset: 0; z-index: 3;
	border: 2px solid var(--rr-blue);
	opacity: 0; transition: opacity .18s ease; pointer-events: none;
}
.rr-tile--projekt:hover::after { opacity: 1; }

/* Hover: moderat vergrößern, Originalfarben */
.rr-tile--projekt:hover { transform: scale(1.5); z-index: 50; }
.rr-tile--projekt:hover .rr-tile__media { filter: none; }
.rr-tile--projekt:hover .rr-tile__label { opacity: 1; }

.rr-tile--empty { pointer-events: none; }
.rr-tile--colophon { background: transparent; overflow: visible; pointer-events: none; }
.rr-colophon__inner { position: absolute; inset: 0; display: flex; flex-direction: column; }
.rr-colophon__title { font-weight: 800; text-transform: uppercase; font-size: clamp(18px,1.6vw,26px); white-space: nowrap; }
.rr-colophon__copy  { font-weight: 800; text-transform: uppercase; font-size: 12px; margin-top: 4px; white-space: nowrap; }

/* =========================================================================
   3. Fenster (Projekt / Information / E-Mail) – schweben über dem Grid
   ====================================================================== */
.rr-overlay { position: fixed; inset: 0; z-index: 1000; display: none; }
.rr-overlay.is-open { display: block; }
/* Klick außerhalb des blauen Bereichs schließt */
.rr-overlay__backdrop { position: absolute; inset: 0; background: transparent; }

/* Schließen-Kreuz sitzt IM Fenster, oben rechts */
.rr-close {
	position: absolute; top: 10px; right: 18px; z-index: 20;
	width: 60px; height: 60px; background: none; border: 0;
	color: #fff; font-size: 56px; line-height: 1; cursor: pointer;
}

/* ---- Projektfenster: Foto links, blauer Bereich rechts ---- */
/* Die Fensterhöhe richtet sich nach dem aktuellen Bild (per JS gesetzt),
   damit Bild und blauer Textbereich unten immer bündig abschließen. */
.rr-project-layout {
	position: absolute;
	/* Abstand zum Bildschirmrand UND zum Grid: Grid-Padding + gleicher Gap wie oben */
	top: var(--rr-top);
	left: calc(var(--rr-pad) + var(--rr-win-gap));
	right: calc(var(--rr-pad) + var(--rr-win-gap));
	bottom: auto;
	max-height: calc(100vh - var(--rr-top) - var(--rr-win-bottom));
	display: flex; align-items: stretch; gap: 0;
}
/* Die Bildfläche wird per JS exakt auf die Proportion des aktuellen Bildes
   gesetzt (Breite), die Höhe füllt das Fenster – dadurch ist alles bündig
   und nichts wird beschnitten oder verzerrt. */
.rr-project-photo {
	position: relative; align-self: stretch; flex: 0 0 auto;
	width: auto; line-height: 0;
	border: 2px solid var(--rr-blue); overflow: hidden;
	background: var(--rr-blue-solid);   /* volle Blaufläche hinter transparenten Slides */
}
/* Slides: Foto, animiertes GIF oder Video – nie beschnitten, nie verzerrt */
.rr-project-photo .rr-slide {
	display: none;
	width: 100%; height: 100%;
	object-fit: contain;
}
.rr-project-photo .rr-slide.is-active { display: block; }

/* Einzelansicht (/projekt/...) – dort läuft kein JS-Layout */
.rr-project-photo--static { align-self: auto; }
.rr-project-photo--static .rr-slide { width: 100%; height: auto; }
/* Slideshow-Cursor: Chevron, gleiche Strichstärke wie das Plus, eckige Kanten */
.rr-project-photo.dir-next {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="46" height="46" viewBox="0 0 46 46"><path d="M17 9 L31 23 L17 37" fill="none" stroke="%23ff1fb4" stroke-width="4" stroke-linecap="butt" stroke-linejoin="miter"/></svg>') 23 23, e-resize;
}
.rr-project-photo.dir-prev {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="46" height="46" viewBox="0 0 46 46"><path d="M29 9 L15 23 L29 37" fill="none" stroke="%23ff1fb4" stroke-width="4" stroke-linecap="butt" stroke-linejoin="miter"/></svg>') 23 23, w-resize;
}
.rr-panel--project {
	flex: 1; min-width: 0; overflow-y: auto;
	background: var(--rr-blue-h); color: #fff; padding: 24px 30px;
}
.rr-project__text-wrap { display: flex; flex-direction: column; height: 100%; max-width: 44ch; }
.rr-project__title { font-size: clamp(26px, 3vw, 46px); text-transform: uppercase; }
.rr-project__date  { font-weight: 800; margin: 6px 0 18px; }
.rr-project__text p { margin: 0 0 14px; }
.rr-project__team  { margin-top: auto; padding-top: 30px; font-weight: 800; text-transform: uppercase; }
.rr-project__team span { display: block; }

/* ---- Information- & E-Mail-Fenster ---- */
.rr-panel--info, .rr-panel--email {
	position: absolute; top: var(--rr-top);
	right: calc(var(--rr-pad) + var(--rr-win-gap)); bottom: 14vh;
	overflow-y: auto; background: var(--rr-blue-d); color: #fff; padding: 24px 30px;
}
/* Überschrift der Fenster (Information / Contact) */
.rr-win-title { font-size: clamp(24px, 3vw, 40px); text-transform: uppercase; margin-bottom: 18px; }
.rr-panel--info  { width: 52%; }
.rr-panel--email { width: 50%; }
.rr-info__text { max-width: 44ch; white-space: pre-line; }
.rr-info__br { position: absolute; right: 30px; bottom: 30px; width: 210px; }
.rr-info__kontakt { white-space: pre-line; margin-bottom: 14px; }
/* height:auto ist nötig, sonst erzwingen die height-Attribute von WordPress
   eine feste Höhe und das Foto wird verzerrt. */
.rr-info__foto img { width: 100%; height: auto; filter: grayscale(1); }

.rr-contact__title { font-size: clamp(24px, 3vw, 40px); text-transform: uppercase; margin-bottom: 18px; }
.rr-contact input, .rr-contact textarea {
	width: 100%; background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.7);
	color: #fff; font-family: var(--rr-font); font-size: 15px; padding: 8px 0; margin-bottom: 14px;
}
.rr-contact textarea { min-height: 200px; resize: vertical; }
.rr-contact input::placeholder, .rr-contact textarea::placeholder { color: rgba(255,255,255,.85); }
.rr-contact__actions { text-align: right; }
.rr-contact__actions button {
	background: none; border: 0; color: #fff; font-family: var(--rr-font);
	font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
}
.rr-contact__status { margin-top: 10px; font-weight: 800; }

/* =========================================================================
   4. Mobiles Projektfenster – INLINE im Grid (Seite wird nie verlassen)
   ====================================================================== */
.rr-mobile-project { display: none; }

@media (max-width: 900px) {
	:root { --rr-cols: 1; --rr-pad: 12px; --rr-win-gap: 12px; }

	.rr-nav { display: none; }
	.rr-burger { display: block; background: none; border: 0; font-size: 62px; line-height: .7; color: var(--rr-dark); padding: 0; }
	.rr-header__title { font-size: 32px; white-space: normal; width: min-content; line-height: 1.02; }

	.rr-tile--projekt:hover { transform: none; outline: 0; }
	.rr-tile--projekt:hover .rr-tile__media { filter: grayscale(1) url(#rr-duotone); }
	.rr-tile__label { opacity: 1; font-size: 15px; -webkit-text-stroke: .5px rgba(0,0,0,.3); }

	/* Colophon steht mobil ganz am Ende, als normale Textzeile */
	.rr-tile--colophon { height: auto; padding-bottom: 0; margin-top: 18px; }
	.rr-colophon__inner { position: static; }

	/* Desktop-Fenster mobil aus – Projekte öffnen inline */
	#rr-overlay-project { display: none !important; }

	/* Inline-Projektfenster: Verlauf vertikal, Rahmen NUR um die Slideshow */
	.rr-mobile-project.is-open {
		display: block; position: relative;
		margin: 0 0 var(--rr-gap);
		background: linear-gradient(180deg,
			rgba(0,92,255,.93) 0%,
			rgba(45,125,255,.86) 45%,
			rgba(160,200,255,.58) 100%);
		color: #fff;
	}
	.rr-mobile-project__gallery {
		position: relative; overflow: hidden;
		border: 2px solid var(--rr-blue);
		background: var(--rr-blue-solid);   /* volle Blaufläche hinter transparenten Slides */
	}
	.rr-mobile-project__gallery .rr-slide { width: 100%; height: auto; display: none; }
	.rr-mobile-project__gallery .rr-slide.is-active { display: block; }
	.rr-mobile-project__body { padding: 16px 16px 32px; }
	.rr-mobile-project .rr-project__team { margin-top: 26px; padding-top: 0; }
	.rr-mobile-project__close {
		position: absolute; top: 6px; right: 12px; z-index: 5;
		background: none; border: 0; color: var(--rr-pink);
		font-size: 58px; line-height: 1; padding: 0;
	}

	/* Info / E-Mail mobil: ohne Rahmen, X oben rechts, Seite scrollbar */
	/* Das Fenster selbst scrollt, nicht das Overlay */
	.rr-overlay.is-open { display: block; overflow: hidden; -webkit-overflow-scrolling: touch; }
	/* Absolut im Overlay verankert -> Position ist eindeutig, X hängt am Fenster */
	.rr-panel--info, .rr-panel--email {
		position: absolute; border: 0; margin: 0;
		top: var(--rr-top);
		left: var(--rr-win-gap);
		right: var(--rr-win-gap);
		bottom: var(--rr-win-gap);
		width: auto; min-height: 0;
		overflow-y: auto;
		padding: 18px 16px 40px;
	}
	.rr-panel--info .rr-close, .rr-panel--email .rr-close {
		color: var(--rr-pink); font-size: 58px; width: 60px; height: 60px; top: 4px; right: 8px;
	}
	/* Kontakt + kleineres Foto unten rechts */
	.rr-info__br { position: static; width: auto; margin-top: 30px; text-align: right; }
	.rr-info__kontakt { text-align: right; }
	.rr-info__foto { margin-left: auto; width: 45%; max-width: 170px; }

	/* Burger-Menü: im Vordergrund, gleicher Rand wie die Unterseiten, ohne Rahmen */
	.rr-mobile-menu {
		position: fixed; inset: 0; z-index: 3000; display: none;
		background: transparent; padding: 0;
	}
	.rr-mobile-menu.is-open { display: block; }
	.rr-mobile-menu__inner {
		position: absolute;
		top: var(--rr-top); left: var(--rr-win-gap); right: var(--rr-win-gap); bottom: var(--rr-win-gap);
		background: var(--rr-blue-d); color: #fff; padding: 18px 16px;
	}
	/* Kein X im Burger-Menü – Tippen irgendwo (außer auf einen Link) schließt. */
	.rr-mobile-menu nav { margin-top: 70px; text-align: right; font-size: 30px; line-height: 1.7; }
}

/* Sichtbarkeit */
.rr-only-mobile { display: none; }
.rr-mobile-menu { display: none; }
@media (max-width: 900px) {
	.rr-only-desktop { display: none !important; }
	.rr-only-mobile  { display: block; }
}
