/*
Theme Name: Zweiter Blick
Theme URI: https://thommy-mewes.de
Author: Thommy Mewes
Author URI: https://thommy-mewes.de
Description: Schlankes, blog-zentriertes WordPress-Theme für Thommy Mewes. Wenig Drumherum, der Fokus liegt auf den Beiträgen. Schrift lokal gehostet (DSGVO-konform).
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zweiter-blick
Tags: blog, one-column, custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   1. Lokale Schrift (Outfit) - DSGVO-konform, keine Google-Server
   ========================================================================== */
@font-face {
	font-family: "Outfit";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("assets/fonts/outfit-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Outfit";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("assets/fonts/outfit-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   2. Design-Tokens
   ========================================================================== */
:root {
	--zb-text:       #454f5e;
	--zb-heading:    #0f172a;
	--zb-muted:      #6b7280;
	--zb-bg:         #ffffff;
	--zb-bg-soft:    #f8fafc;
	--zb-border:     #e5e7eb;
	--zb-green:      #028939;
	--zb-green-dark: #026e2d;

	--zb-font:       "Outfit", Helvetica, Arial, sans-serif;

	--zb-content:    720px;   /* Lesebreite für Beiträge */
	--zb-wide:       1140px;  /* Maximale Layoutbreite */
	--zb-gap:        clamp(1.25rem, 4vw, 2rem);

	--zb-radius:     14px;
	--zb-shadow:     0 10px 30px rgba(15, 23, 42, .08);
}

/* ==========================================================================
   3. Reset / Grundlagen
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

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

body {
	margin: 0;
	font-family: var(--zb-font);
	font-size: 1.0625rem;      /* ~17px */
	line-height: 1.7;
	color: var(--zb-text);
	background: var(--zb-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

a { color: var(--zb-green); text-decoration: none; }
a:hover { color: var(--zb-green-dark); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
	color: var(--zb-heading);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin: 0 0 .6em;
}

p, ul, ol, blockquote, figure, pre, table { margin: 0 0 1.4em; }

blockquote {
	border-left: 3px solid var(--zb-green);
	padding: .2em 0 .2em 1.2em;
	color: var(--zb-heading);
	font-size: 1.1em;
}

hr { border: 0; border-top: 1px solid var(--zb-border); margin: 2.5rem 0; }

code, pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .9em;
}
pre {
	background: var(--zb-bg-soft);
	border: 1px solid var(--zb-border);
	border-radius: var(--zb-radius);
	padding: 1rem 1.25rem;
	overflow-x: auto;
}
:where(p, li) code {
	background: var(--zb-bg-soft);
	border: 1px solid var(--zb-border);
	border-radius: 6px;
	padding: .1em .4em;
}

/* Fokus-Sichtbarkeit (Barrierefreiheit) */
:focus-visible { outline: 3px solid var(--zb-green); outline-offset: 2px; }

/* Screenreader-Text */
.screen-reader-text {
	border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
	height: 1px; width: 1px; overflow: hidden; padding: 0;
	position: absolute !important; word-wrap: normal !important;
}
.skip-link {
	position: absolute; left: -9999px; top: 0; z-index: 1000;
	background: var(--zb-heading); color: #fff; padding: .75rem 1.25rem;
	border-radius: 0 0 var(--zb-radius) 0;
}
.skip-link:focus { left: 0; color: #fff; text-decoration: none; }

/* ==========================================================================
   4. Layout-Helfer
   ========================================================================== */
.zb-container {
	width: 100%;
	max-width: var(--zb-wide);
	margin-inline: auto;
	padding-inline: var(--zb-gap);
}
.zb-narrow { max-width: var(--zb-content); }

.zb-main { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

/* ==========================================================================
   5. Kopfzeile / Navigation
   ========================================================================== */
.site-header {
	position: relative; z-index: 100;
	background: var(--zb-bg);
}
.site-header__inner {
	display: flex; align-items: center; justify-content: flex-end;
	gap: 1.5rem;
	min-height: 72px;
}
.site-branding { display: flex; align-items: center; gap: .75rem; }
.site-title {
	font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em;
	margin: 0; line-height: 1;
}
.site-title a { color: var(--zb-heading); text-decoration: none; }
.site-title a:hover { color: var(--zb-green); }
.site-logo img { max-height: 44px; width: auto; }
.site-description { margin: 0; font-size: .8rem; color: var(--zb-muted); }

.main-nav { margin-left: auto; }  /* Menü zuverlässig nach rechts */
.main-nav ul { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.main-nav a {
	color: var(--zb-heading); font-weight: 500; font-size: .98rem;
	text-decoration: none; padding: .25rem 0; position: relative;
}
.main-nav a:hover { color: var(--zb-green); }
.main-nav .current-menu-item > a { color: var(--zb-green); }

/* Mobile Menü-Umschalter */
.menu-toggle {
	display: none; align-items: center; gap: .5rem;
	background: none; border: 1px solid var(--zb-border);
	border-radius: 10px; padding: .5rem .75rem; cursor: pointer;
	color: var(--zb-heading); font: inherit; font-size: .95rem;
}
.menu-toggle svg { width: 20px; height: 20px; }

@media (max-width: 782px) {
	.menu-toggle { display: inline-flex; }
	.main-nav {
		position: absolute; left: 0; right: 0; top: 100%;
		background: #fff; border-bottom: 1px solid var(--zb-border);
		box-shadow: var(--zb-shadow);
		display: none;
	}
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; gap: 0; padding: .5rem var(--zb-gap) 1rem; }
	.main-nav li { border-top: 1px solid var(--zb-border); }
	.main-nav a { display: block; padding: .85rem 0; }
	.main-nav li:first-child { border-top: 0; }
}

/* ==========================================================================
   6. Hero (Startseite)
   ========================================================================== */
.hero {
	padding-block: clamp(3rem, 8vw, 6rem);
	overflow: hidden;
}
.hero__grid {
	display: grid;
	grid-template-columns: 1.15fr .85fr;
	align-items: center;
	gap: clamp(2rem, 5vw, 4rem);
}
.hero__eyebrow {
	font-size: 1.05rem; color: var(--zb-text); margin: 0 0 1.25rem;
	max-width: 34ch;
}
.hero__eyebrow strong { color: var(--zb-heading); font-weight: 600; }
.hero__badge {
	display: inline-block; background: var(--zb-green); color: #fff;
	font-weight: 600; padding: .05em .45em; border-radius: 6px;
}
.hero__title {
	font-size: clamp(2.6rem, 6.5vw, 4.5rem);
	font-weight: 700; letter-spacing: -0.03em; line-height: 1.02;
	color: var(--zb-heading);
	margin: 0 0 1.4rem;
}
.hero__lead { font-size: 1.15rem; max-width: 46ch; margin: 0 0 1.75rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .85rem; }
.hero__media { position: relative; }
.hero__media img {
	width: 100%; border-radius: var(--zb-radius);
	box-shadow: var(--zb-shadow);
}
.hero__media--placeholder {
	aspect-ratio: 4 / 5;
	border-radius: var(--zb-radius);
	background:
		linear-gradient(135deg, #ff6b35, #f7c59f 30%, #028939 65%, #1e3a8a);
	display: grid; place-items: center; color: rgba(255,255,255,.85);
	font-size: .9rem; text-align: center; padding: 1rem;
	box-shadow: var(--zb-shadow);
}

@media (max-width: 860px) {
	.hero__grid { grid-template-columns: 1fr; }
	.hero__media { order: -1; max-width: 420px; }
}

/* ==========================================================================
   7. Buttons
   ========================================================================== */
.btn {
	display: inline-flex; align-items: center; gap: .5rem;
	font-weight: 600; font-size: .98rem; line-height: 1;
	padding: .85rem 1.4rem; border-radius: 999px;
	border: 1px solid transparent; cursor: pointer; text-decoration: none;
	transition: transform .12s ease, background .12s ease, color .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--zb-green); color: #fff; }
.btn--primary:hover { background: var(--zb-green-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--zb-heading); border-color: var(--zb-border); }
.btn--ghost:hover { border-color: var(--zb-green); color: var(--zb-green); }

/* ==========================================================================
   8. Beitragsliste (Blog / Archiv / Startseite)
   ========================================================================== */
.section-head { margin-bottom: 2.5rem; }
.section-head h2 {
	font-size: clamp(1.6rem, 3vw, 2.1rem);
	display: inline-flex; align-items: baseline; gap: .6rem;
}
.section-head .count { font-size: .95rem; color: var(--zb-muted); font-weight: 400; }
.section-head p { color: var(--zb-muted); margin: .4rem 0 0; }

.post-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 2rem;
}

.post-card {
	display: flex; flex-direction: column;
	background: #fff;
	border: 1px solid var(--zb-border);
	border-radius: var(--zb-radius);
	overflow: hidden;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--zb-shadow); border-color: transparent; }
.post-card__thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--zb-bg-soft); }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.post-card:hover .post-card__thumb img { transform: scale(1.04); }
.post-card__body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.post-card__meta { font-size: .82rem; color: var(--zb-muted); margin-bottom: .6rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.post-card__meta a { color: var(--zb-green); }
.post-card__title { font-size: 1.3rem; margin: 0 0 .55rem; line-height: 1.2; }
.post-card__title a { color: var(--zb-heading); }
.post-card__title a:hover { color: var(--zb-green); text-decoration: none; }
.post-card__excerpt { margin: 0 0 1.1rem; font-size: .98rem; }
.post-card__more { margin-top: auto; font-weight: 600; font-size: .92rem; }

/* Erster Beitrag als Aufmacher */
.post-list--featured .post-card:first-child { grid-column: 1 / -1; }
@media (min-width: 720px) {
	.post-list--featured .post-card:first-child { flex-direction: row; }
	.post-list--featured .post-card:first-child .post-card__thumb { flex: 0 0 48%; aspect-ratio: auto; }
	.post-list--featured .post-card:first-child .post-card__body { justify-content: center; }
	.post-list--featured .post-card:first-child .post-card__title { font-size: 1.9rem; }
}

/* Startseite: Aufmacher gross, darunter genau 3 nebeneinander */
.post-list--home { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) {
	.post-list--home { grid-template-columns: 1fr; }
}

/* ==========================================================================
   9. Einzelbeitrag / Seite
   ========================================================================== */
.entry-header { margin-bottom: 2.5rem; }
.entry-header .zb-eyebrow {
	color: var(--zb-green); font-weight: 600; font-size: .9rem;
	text-transform: uppercase; letter-spacing: .08em; margin-bottom: .75rem;
}
.entry-title { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.02em; }
.entry-meta { color: var(--zb-muted); font-size: .95rem; display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.entry-meta a { color: var(--zb-green); }
.entry-featured { margin: 0 0 2.5rem; }
.entry-featured img { width: 100%; border-radius: var(--zb-radius); box-shadow: var(--zb-shadow); }

.entry-content { font-size: 1.075rem; }
.entry-content > * { max-width: var(--zb-content); margin-inline: auto; }
.entry-content h2 { font-size: 1.7rem; margin-top: 2.2em; }
.entry-content h3 { font-size: 1.35rem; margin-top: 1.8em; }
.entry-content img,
.entry-content .wp-block-image,
.entry-content figure { border-radius: var(--zb-radius); }
.entry-content .alignwide { max-width: var(--zb-wide); }
.entry-content .alignfull { max-width: none; width: 100%; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: .4em; }

.entry-footer {
	max-width: var(--zb-content); margin: 3rem auto 0;
	padding-top: 1.5rem; border-top: 1px solid var(--zb-border);
	display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
	font-size: .92rem;
}
.tag-list a {
	display: inline-block; background: var(--zb-bg-soft); border: 1px solid var(--zb-border);
	color: var(--zb-text); padding: .2em .7em; border-radius: 999px; font-size: .85rem;
	margin: 0 .35rem .35rem 0;
}
.tag-list a:hover { border-color: var(--zb-green); color: var(--zb-green); text-decoration: none; }

/* Beitrags-Navigation (vor/zurück) */
.post-nav { max-width: var(--zb-content); margin: 3rem auto 0; display: flex; justify-content: space-between; gap: 1rem; }
.post-nav a { display: block; max-width: 48%; }
.post-nav .label { display: block; font-size: .8rem; color: var(--zb-muted); }
.post-nav .title { font-weight: 600; color: var(--zb-heading); }
.post-nav a:hover .title { color: var(--zb-green); }
.post-nav .next { text-align: right; margin-left: auto; }

/* ==========================================================================
   10. Kommentare (schlicht)
   ========================================================================== */
.comments-area { max-width: var(--zb-content); margin: 3.5rem auto 0; }
.comments-area .comment-list { list-style: none; padding: 0; margin: 0 0 2rem; }
.comments-area .comment-body { padding: 1.25rem 0; border-top: 1px solid var(--zb-border); }
.comments-area .comment-author { font-weight: 600; color: var(--zb-heading); }
.comments-area .comment-metadata { font-size: .82rem; color: var(--zb-muted); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%; padding: .75rem .9rem; border: 1px solid var(--zb-border);
	border-radius: 10px; font: inherit; margin-top: .3rem;
}
.comment-form p { margin-bottom: 1rem; }

/* ==========================================================================
   11. Paginierung
   ========================================================================== */
.pagination { margin-top: 3rem; display: flex; justify-content: center; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.pagination .page-numbers {
	display: inline-flex; min-width: 42px; height: 42px; align-items: center; justify-content: center;
	padding: 0 .6rem; border: 1px solid var(--zb-border); border-radius: 10px;
	color: var(--zb-heading); text-decoration: none; font-weight: 500;
}
.pagination .page-numbers:hover { border-color: var(--zb-green); color: var(--zb-green); }
.pagination .page-numbers.current { background: var(--zb-green); border-color: var(--zb-green); color: #fff; }
.pagination .dots { border: 0; }

/* Endless-Scroll (Beiträge-Seite) */
.zb-intro { color: var(--zb-muted); max-width: 60ch; }
.zb-intro p { margin: .4rem 0 0; }
.zb-scroll-sentinel {
	display: flex; justify-content: center; align-items: center;
	min-height: 60px; margin-top: 2.5rem;
}
.zb-scroll-spinner {
	width: 26px; height: 26px; border-radius: 50%;
	border: 3px solid var(--zb-border); border-top-color: var(--zb-green);
	opacity: 0; transition: opacity .2s ease;
}
.zb-scroll-sentinel.is-loading .zb-scroll-spinner { opacity: 1; animation: zb-spin .7s linear infinite; }
@keyframes zb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.zb-scroll-sentinel.is-loading .zb-scroll-spinner { animation: none; }
}

/* ==========================================================================
   12. Fußzeile
   ========================================================================== */
.site-footer {
	margin-top: clamp(4rem, 8vw, 6rem);
	background: var(--zb-bg-soft);
	border-top: 1px solid var(--zb-border);
	padding-block: 3rem;
	font-size: .95rem;
}
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: center; justify-content: space-between; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; }
.footer-nav a { color: var(--zb-text); font-weight: 500; }
.footer-nav a:hover { color: var(--zb-green); }
.site-footer .copyright { color: var(--zb-muted); margin: 0; }

/* ==========================================================================
   13. Suche / 404 / Leerzustand
   ========================================================================== */
.zb-empty { text-align: center; padding: 4rem 1rem; }
.zb-empty h1, .zb-empty h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.search-form { display: flex; gap: .5rem; max-width: 480px; margin: 1.5rem auto 0; }
.search-form input[type="search"] {
	flex: 1; padding: .75rem 1rem; border: 1px solid var(--zb-border);
	border-radius: 999px; font: inherit;
}
.search-form button { border: 0; }

/* ==========================================================================
   14. WordPress-Pflichtklassen
   ========================================================================== */
.alignleft { float: left; margin: .3rem 1.5rem 1rem 0; }
.alignright { float: right; margin: .3rem 0 1rem 1.5rem; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--zb-muted); text-align: center; margin-top: .5rem; }
.sticky, .gallery-caption, .bypostauthor { }
.wp-block-button__link { border-radius: 999px; }
