/*
Theme Name: Nils Hagelstein
Theme URI: https://nilshagelstein.de
Author: Nils Hagelstein
Description: Persönliche Startseite mit Foto, Steckbrief, Ausschnitt von itcrafter.de und App-Übersicht.
Version: 1.2.4
Requires at least: 6.5
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: nilshagelstein
*/

:root {
	--nh-accent: #4f46e5;
	--nh-accent-2: #06b6d4;
	--nh-ink: #0f172a;
	--nh-muted: #64748b;
	--nh-card: rgba(255, 255, 255, 0.82);
	--nh-line: rgba(15, 23, 42, 0.08);
	--nh-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -12px rgba(15, 23, 42, 0.18);
	--nh-radius: 20px;
}

body {
	background:
		radial-gradient(900px 500px at 10% -10%, rgba(79, 70, 229, 0.14), transparent 60%),
		radial-gradient(800px 500px at 100% 0%, rgba(6, 182, 212, 0.14), transparent 60%),
		#f8fafc;
	background-attachment: fixed;
}

/* Header */
.nh-header { backdrop-filter: blur(10px); background: rgba(248, 250, 252, 0.7); border-bottom: 1px solid var(--nh-line); position: sticky; top: 0; z-index: 50; }
.nh-brand a { text-decoration: none; color: var(--nh-ink); }
.nh-brand .nh-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--nh-accent), var(--nh-accent-2)); margin-right: 8px; }
.nh-nav a { text-decoration: none; color: var(--nh-muted); }
.nh-nav a:hover { color: var(--nh-accent); }

/* Cards */
.nh-card {
	background: var(--nh-card);
	border: 1px solid var(--nh-line);
	border-radius: var(--nh-radius);
	box-shadow: var(--nh-shadow);
	backdrop-filter: blur(8px);
	height: 100%;
	box-sizing: border-box;
}
.nh-eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; color: var(--nh-accent); }

/* Hero */
.nh-hero { align-items: stretch !important; }
.nh-hero > .wp-block-column { display: flex; flex-direction: column; }
.nh-hero > .wp-block-column > .nh-card { flex: 1; }
.nh-center { text-align: center; justify-content: center; }
.nh-foto { margin: 0 auto !important; }
.nh-foto img {
	width: 240px; height: 240px; object-fit: cover; border-radius: 50%;
	padding: 6px; background: linear-gradient(135deg, var(--nh-accent), var(--nh-accent-2));
	box-shadow: 0 20px 40px -18px rgba(79, 70, 229, 0.6);
}
.nh-gradient-text {
	background: linear-gradient(135deg, var(--nh-accent), var(--nh-accent-2));
	-webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Steckbrief */
.nh-steckbrief { list-style: none; padding: 0 !important; margin: 0; }
.nh-steckbrief li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--nh-line); }
.nh-steckbrief li:last-child { border-bottom: 0; }
.nh-steckbrief strong { color: var(--nh-muted); font-weight: 500; }

/* Website-Vorschau */
.nh-preview {
	position: relative; aspect-ratio: 16 / 10; overflow: hidden;
	border-radius: 12px; border: 1px solid var(--nh-line); background: #fff;
}
.nh-preview::before {
	content: ""; position: absolute; inset: 0 0 auto 0; height: 22px; z-index: 2;
	background: radial-gradient(circle at 12px 11px, #f87171 4px, transparent 5px),
		radial-gradient(circle at 26px 11px, #fbbf24 4px, transparent 5px),
		radial-gradient(circle at 40px 11px, #34d399 4px, transparent 5px) #f1f5f9;
	border-bottom: 1px solid var(--nh-line);
}
.nh-preview iframe {
	position: absolute; top: 22px; left: 0; border: 0;
	width: 300%; height: calc((100% - 22px) * 3);
	transform: scale(0.3333); transform-origin: 0 0; pointer-events: none;
}
.nh-preview a.nh-preview-link { position: absolute; inset: 0; z-index: 3; }

/* Apps */
.nh-app { transition: transform .2s ease, box-shadow .2s ease; }
.nh-app:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 22px 40px -16px rgba(79,70,229,.35); }
.nh-icon {
	width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
	background: linear-gradient(135deg, var(--nh-accent), var(--nh-accent-2)); color: #fff; font-size: 22px; margin: 0;
}
.nh-logo {
	width: 48px !important; height: 48px !important; box-sizing: border-box; padding: 5px;
	border-radius: 14px; background: #fff; border: 1px solid var(--nh-line); display: block;
}
.nh-badge { display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; margin: 0; }
.nh-badge-live { background: #dcfce7; color: #166534; }
.nh-badge-dev { background: #fef3c7; color: #92400e; }
.nh-badge-soon { background: #e2e8f0; color: #475569; }
.nh-app-soon { border-style: dashed; background: rgba(255,255,255,.5); }
.nh-url a { color: var(--nh-accent); text-decoration: none; font-weight: 600; }
.nh-url a:hover { text-decoration: underline; }

/* App-Karten: Link "Mehr erfahren" und Adresse ganz unten */
.nh-app { display: flex; flex-direction: column; }
.nh-app > * { margin-block-start: 0 !important; margin-block-end: 0 !important; }
.nh-app > * + * { margin-top: 0.9rem !important; }
.nh-more a { font-weight: 600; text-decoration: none; color: var(--nh-ink); }
.nh-more a:hover { color: var(--nh-accent); }
.nh-app > .nh-url { margin-top: auto !important; padding-top: 1.1rem; border-top: 1px solid var(--nh-line); }
.nh-app > .nh-more { margin-bottom: 1.4rem !important; }

/* Screenshots (Beitragsbild der Unterseite) */
.nh-shot-link { display: block; text-decoration: none; }
.nh-shot {
	aspect-ratio: 16 / 10; overflow: hidden; border-radius: 12px;
	border: 1px solid var(--nh-line); background: #fff;
}
.nh-shot:not(.nh-shot-gross) { position: relative; }
.nh-shot:not(.nh-shot-gross) img { position: absolute; inset: 0; }
.nh-shot img { width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; object-position: top left; display: block; transition: transform .3s ease; }
.nh-shot-link:hover .nh-shot img { transform: scale(1.03); }
.nh-shot-leer {
	display: grid; place-items: center;
	background: linear-gradient(135deg, #eef2ff, #ecfeff);
	color: var(--nh-accent); font-weight: 600; font-size: 0.9rem;
}
.nh-shot-gross { aspect-ratio: auto; box-shadow: var(--nh-shadow); border-radius: var(--nh-radius); }
.nh-shot-gross img { height: auto !important; object-fit: contain; }
.nh-shot-gross.nh-shot-leer { aspect-ratio: 16 / 9; font-size: 1.1rem; }

/* Browserfenster-Rahmen für große Screenshots */
.nh-shot-gross:not(.nh-shot-leer), .nh-frame img {
	border: 1px solid var(--nh-line);
}
.nh-shot-gross:not(.nh-shot-leer) { position: relative; padding-top: 26px; background: #1f2937; }
.nh-shot-gross:not(.nh-shot-leer)::before, .nh-frame figure::before {
	content: ""; position: absolute; inset: 0 0 auto 0; height: 26px;
	background: radial-gradient(circle at 14px 13px, #f87171 4.5px, transparent 5.5px),
		radial-gradient(circle at 30px 13px, #fbbf24 4.5px, transparent 5.5px),
		radial-gradient(circle at 46px 13px, #34d399 4.5px, transparent 5.5px) #e2e8f0;
}
.nh-frame figure { position: relative; padding-top: 26px; border-radius: 14px; overflow: hidden; box-shadow: var(--nh-shadow); background: #1f2937; }
.nh-frame figure img { display: block; width: 100%; height: auto; border: 0; }
.nh-frame { margin: 3rem 0 !important; gap: 0; }
.nh-frame .wp-block-media-text__content { padding: 0 0 0 2rem !important; }
.nh-frame .wp-block-media-text__content h2 { margin-top: 0; }
@media (max-width: 781px) {
	.nh-frame .wp-block-media-text__content { padding: 1.5rem 0 0 0 !important; }
}

/* Etwas breiter für Bilder auf der Detailseite */
.nh-detail-text .nh-frame { max-width: 1060px !important; }

/* App-Detailseite */
.nh-back a { color: var(--nh-muted); text-decoration: none; font-size: 0.95rem; }
.nh-back a:hover { color: var(--nh-accent); }
.nh-detail-text h2 { margin-top: 2.5rem; font-size: var(--wp--preset--font-size--large); }
.nh-detail-text ul { padding-left: 1.2rem; }
.nh-detail-text li { margin: 0.35rem 0; }

/* Footer */
.nh-footer { border-top: 1px solid var(--nh-line); color: var(--nh-muted); }
.nh-footer a { color: var(--nh-muted); text-decoration: none; }
.nh-footer a:hover { color: var(--nh-accent); }

@media (max-width: 781px) {
	.nh-hero > .wp-block-column:nth-child(2) { order: -1; }
	.nh-foto img { width: 180px; height: 180px; }
	.nh-nav { display: none !important; }
}
