/* =========================================================================
   gkf 2.0 – klebinger-fotografie.de
   Dunkel, ruhig, die Bilder sind der Star.
   ====================================================================== */

:root {
	--bg: #101015;
	--bg-raised: #19191f;
	--text: #ececec;
	--muted: #a3a3a3;          /* 7.6:1 auf #111 */
	--line: #2a2a31;
	--accent: #fff;
	--gap: 15px;               /* Galerie-Abstand wie bisher (Visual Portfolio) */
	--page: 1440px;
	--text-col: 42rem;
	--pad: clamp(1rem, 4vw, 2.5rem);
	--logo: 48px;
	--space-top: clamp(2rem, 1rem + 5vw, 6rem);         /* Luft über dem Header (Desktop ≈ 96 px) */
	--space-section: clamp(2.5rem, 1.5rem + 4.5vw, 6.5rem); /* Abstand Header → erster Inhalt */
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--ease-slow: cubic-bezier(.2, .6, .2, 1);
	color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 1.0625rem/1.6 var(--font);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 { line-height: 1.2; font-weight: 600; letter-spacing: -.01em; margin: 0 0 .5em; }

.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 {
	position: absolute; left: 1rem; top: -4rem; z-index: 100;
	background: var(--accent); color: #000; padding: .5rem 1rem; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---- Header ------------------------------------------------------------ */

.site-header {
	max-width: var(--page);
	margin: 0 auto;
	padding: var(--space-top) var(--pad) 1.25rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 2rem;
}

.site-brand { margin: 0; font-size: 1.25rem; font-weight: 600; line-height: 1.2; letter-spacing: 0; }
.site-brand a { text-decoration: none; display: inline-flex; gap: .5em; align-items: center; }
.site-brand a { position: relative; }
.site-brand__logo {
	width: var(--logo);
	height: var(--logo);
	border-radius: 50%;
	object-fit: cover;
	margin-right: .5rem;
	flex: none;
}

/* Desktop (ab 3 Galeriespalten): Logo hängt links außerhalb der Inhaltslinie wie in gkf 1.x.
   Der Seitenrand wächst dafür um Logo + Abstand, damit es nie abgeschnitten wird. */
@media (min-width: 48em) {
	:root {
		--logo: 64px;
		--logo-gap: 1.25rem;
		--pad: calc(var(--logo) + var(--logo-gap) + 1.5rem);
	}
	.site-brand__logo {
		position: absolute;
		right: calc(100% + var(--logo-gap));
		top: 50%;
		transform: translateY(-50%);
		margin: 0;
	}
}
.site-brand__tagline { font-weight: 400; color: var(--muted); }

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; }
.site-nav__list a { text-decoration: none; color: var(--muted); padding: .25rem 0; }
.site-nav__list a:hover,
.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a,
.site-nav__list .current-menu-parent > a { color: var(--accent); }
.site-nav__social { color: var(--muted); display: inline-flex; padding: .25rem; }
.site-nav__social:hover { color: var(--accent); }

/* Instagram: Kachel mit dem Farbverlauf aus gkf 1.x */
.site-nav__social--instagram {
	width: 2rem;
	height: 2rem;
	padding: 0;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: #d6249f;
	background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
	transition: filter .3s ease;
}
.site-nav__social--instagram:hover { color: #fff; filter: brightness(1.12); }
.site-nav__social--instagram .icon { width: 18px; height: 18px; }

.site-intro {
	max-width: var(--page);
	margin: 0 auto;
	padding: 0 var(--pad);
	color: var(--muted);
}
.site-intro p { max-width: var(--text-col); margin: 0 0 1rem; }

/* ---- Inhalt ------------------------------------------------------------ */

.site-main {
	max-width: var(--page);
	margin: 0 auto;
	padding: 0 var(--pad) 4rem;
}

.series { margin: var(--space-section) 0 5rem; }
.cat-nav + .series,
.site-main > .series:first-child { margin-top: var(--space-section); }
.series__title { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); }
.series__title a { text-decoration: none; }

.series__header { margin-bottom: 1.25rem; }
.series__meta {
	margin: -.15rem 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: .25rem 1rem;
	font-size: .875rem;
	color: var(--muted);
}
.series__meta a,
.series__tags a { color: var(--muted); text-decoration: none; }
.series__meta a:hover,
.series__tags a:hover { color: var(--accent); }
.series__intro { max-width: var(--text-col); margin: .75rem 0 0; color: var(--text); }
.series__footer { margin-top: 1rem; }
.series__tags { margin: 0; display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .875rem; }
.series__tags a::before { content: "#"; opacity: .6; }

/* Kategorie-Leiste */
.cat-nav { margin: 1.5rem 0 0; }
.cat-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-size: .9375rem; }
.cat-nav__list a { color: var(--muted); text-decoration: none; padding: .25rem 0; border-bottom: 1px solid transparent; }
.cat-nav__list a:hover { color: var(--accent); }
.cat-nav__list a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

.entry-content > *:not(.gkf-gallery):not(.alignwide):not(.alignfull) { max-width: var(--text-col); }
.entry-content p { margin: 0 0 1em; }
.entry-content a { text-decoration: underline; text-decoration-style: dotted; text-decoration-thickness: 2px; }
.entry-content .gkf-gallery + p { margin-top: 1rem; }
.entry-content p:has(+ .gkf-gallery) { margin-bottom: 1.25rem; }

.page-header { margin: var(--space-section) 0 1.5rem; }
.page-title { font-size: clamp(1.75rem, 1.3rem + 1.5vw, 2.5rem); }
.page-description { color: var(--muted); max-width: var(--text-col); }
.page-article .entry-content { line-height: 1.7; }
.page-article .entry-content h2 { font-size: 1.375rem; margin-top: 2.5rem; }
.page-article .entry-content h3 { font-size: 1.125rem; margin-top: 2rem; }

/* ---- Galerie (Masonry) ---------------------------------------------------- */

.gkf-gallery {
	display: flex;
	flex-direction: column;
	gap: var(--gap);
	margin: 0 0 1rem;
}

/* Mobil: Spalten auflösen, Original-Reihenfolge per order */
.gkf-gallery__col { display: contents; }
.gkf-gallery__item { order: var(--gkf-order, 0); }

@media (min-width: 48em) {
	.gkf-gallery { flex-direction: row; align-items: flex-start; }
	.gkf-gallery__col {
		display: flex;
		flex-direction: column;
		gap: var(--gap);
		flex: 1 1 0;
		min-width: 0;
	}
}

.gkf-gallery__item {
	margin: 0;
	overflow: hidden;
	background: var(--bg-raised);
}

.gkf-gallery__link { display: block; cursor: zoom-in; }

.gkf-gallery__img {
	width: 100%;
	height: auto;
	transform: scale(1);
	transition: transform 1.6s var(--ease-slow), opacity .4s ease;
	will-change: transform;
}

@media (hover: hover) {
	.gkf-gallery__link:hover .gkf-gallery__img,
	.gkf-gallery__link:focus-visible .gkf-gallery__img { transform: scale(1.045); }
}

.gkf-gallery__link:focus-visible { outline-offset: -2px; }

/* ---- Lightbox ------------------------------------------------------------ */

.gkf-lb {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100dvh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: #000;
	color: #fff;
	overflow: hidden;
}
.gkf-lb::backdrop { background: #000; }
.gkf-lb[open] { display: grid; grid-template-columns: 4rem 1fr 4rem; grid-template-rows: 3.5rem 1fr 3.5rem; }

.gkf-lb__stage {
	grid-column: 2;
	grid-row: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 0;
	touch-action: pan-y pinch-zoom;
}
.gkf-lb__img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	opacity: 0;
	transition: opacity .35s ease;
	user-select: none;
}
.gkf-lb__img.is-loaded { opacity: 1; }

.gkf-lb__btn {
	appearance: none;
	background: transparent;
	border: 0;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: .7;
	transition: opacity .2s ease;
	padding: 0;
}
.gkf-lb__btn:hover,
.gkf-lb__btn:focus-visible { opacity: 1; }
.gkf-lb__btn {
	width: 3rem;
	height: 3rem;
	align-self: center;
	justify-self: center;
	border-radius: 50%;
}
.gkf-lb__btn:focus-visible { outline: 1px solid rgba(255, 255, 255, .6); outline-offset: 0; }
.gkf-lb__btn svg { width: 2rem; height: 2rem; }

.gkf-lb__prev { grid-column: 1; grid-row: 2; }
.gkf-lb__next { grid-column: 3; grid-row: 2; }
.gkf-lb__close { grid-column: 3; grid-row: 1; z-index: 2; }
.gkf-lb__close svg { width: 1.5rem; height: 1.5rem; }
.gkf-lb__count {
	grid-column: 1 / 4;
	grid-row: 3;
	align-self: center;
	text-align: center;
	font-size: .8125rem;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
	margin: 0;
}

@media (max-width: 47.99em) {
	.gkf-lb[open] { grid-template-columns: 3rem 1fr 3rem; }
	.gkf-lb__stage { grid-column: 1 / 4; }
	.gkf-lb__prev,
	.gkf-lb__next { grid-row: 3; z-index: 2; }
}

html.gkf-lb-open { overflow: hidden; }

/* ---- Bücher -------------------------------------------------------------- */

.gkf-books__filter {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.25rem;
	margin: 0 0 2.5rem;
}
.gkf-books__btn {
	appearance: none;
	background: none;
	border: 0;
	padding: .25rem 0;
	color: var(--muted);
	font: inherit;
	font-size: .9375rem;
	cursor: pointer;
	border-bottom: 1px solid transparent;
}
.gkf-books__btn:hover { color: var(--accent); }
.gkf-books__btn[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.gkf-books__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 3rem 2rem;
	align-items: start;
}
.entry-content .gkf-books { max-width: none; }
.gkf-book__cover { width: 100%; margin-bottom: 1rem; }
.gkf-book__title { font-size: 1.125rem; margin: 0 0 .25rem; }
.gkf-book__author { margin: 0 0 .5rem; color: var(--muted); }
.gkf-book__text { font-size: .875rem; line-height: 1.5; color: var(--muted); margin: 0; }
.gkf-book[hidden] { display: none; }

/* ---- Navigation zwischen Serien / Pagination ------------------------------ */

.post-nav .nav-links,
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1rem;
	border-top: 1px solid var(--line);
	padding-top: 1.5rem;
}
.post-nav a { text-decoration: none; display: block; }
.post-nav__label { display: block; font-size: .8125rem; color: var(--muted); }
.post-nav__title { font-size: 1.125rem; }
.post-nav .nav-next { text-align: right; margin-left: auto; }

.pagination .nav-links { justify-content: center; gap: .5rem; }
.pagination .page-numbers {
	min-width: 2.5rem;
	padding: .4rem .6rem;
	text-align: center;
	text-decoration: none;
	color: var(--muted);
}
.pagination .page-numbers.current { color: var(--accent); border-bottom: 1px solid var(--accent); }
.pagination a.page-numbers:hover { color: var(--accent); }

/* ---- Footer -------------------------------------------------------------- */

.site-footer {
	max-width: var(--page);
	margin: 0 auto;
	padding: 2.5rem var(--pad) 3rem;
	border-top: 1px solid var(--line);
	font-size: .875rem;
	color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer__title { font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 1rem; }

.site-footer__tags .wp-tag-cloud {
	list-style: none;
	margin: 0 0 2.5rem;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: .35rem 1.1rem;
}
.site-footer__tags .wp-tag-cloud a { font-size: .9375rem !important; }

.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer__copy { margin: 0; }
.site-footer__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }

/* ---- Core-Blöcke, die in Seiten vorkommen ----------------------------------- */

.wp-block-image img { height: auto; }
.wp-block-button__link { background: var(--accent); color: #000; border-radius: 0; text-decoration: none !important; padding: .6em 1.2em; display: inline-block; }
.wp-block-separator { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
figcaption, .wp-element-caption { font-size: .8125rem; color: var(--muted); margin-top: .5rem; }

/* ---- Bewegung reduzieren ------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
	.gkf-gallery__link:hover .gkf-gallery__img { transform: none; }
}

/* ---- Druck ------------------------------------------------------------- */

@media print {
	body { background: #fff; color: #000; }
	.site-nav, .site-footer__tags, .post-nav, .pagination { display: none; }
}
