/*
Theme Name: Grünes Magazin
Theme URI: https://gruenesmagazin.de/
Author: Muse
Author URI: https://gruenesmagazin.de/
Description: Ein sauberes, schnelles Magazin-Theme für das Grüne Magazin — dunkelgrüner Header, Serifen-Überschriften, Top-Artikel und ein responsives Beitrags-Raster. Keine Plugin-Abhängigkeiten.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.7
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: gruenes-magazin
Tags: blog, news, magazine, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, two-columns, right-sidebar
*/

/* ============================================================
   Grünes Magazin 1.0.0 — base, layout, header, grid, single, footer
   Colours: forest green #14532D (primary), muted green #2E7D4F (accent),
   ink #1F2937, muted #6B7280, line #E7DFD2, paper #FAF7F0
   ============================================================ */

:root {
	--gm-green: #14532D;
	--gm-green-dark: #0A3A20;
	--gm-green-light: #1E6B38;
	--gm-accent: #2E7D4F;
	--gm-ink: #1F2937;
	--gm-muted: #6B7280;
	--gm-line: #E7DFD2;
	--gm-paper: #FAF7F0;
	--gm-soft: #F0EBDD;
	--gm-serif: "Playfair Display", Georgia, "Times New Roman", serif;
	--gm-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

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

body {
	margin: 0;
	background: var(--gm-paper);
	color: var(--gm-ink);
	font-family: var(--gm-sans);
	font-size: 17px;
	line-height: 1.75;
}

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

a { color: var(--gm-green); text-decoration: none; }
a:hover, a:focus { color: var(--gm-accent); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--gm-serif);
	line-height: 1.25;
	margin: 0 0 0.6em;
	color: var(--gm-ink);
}

p { margin: 0 0 1.1em; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.4em; }

blockquote {
	margin: 1.2em 0;
	padding: 0.6em 1.2em;
	border-left: 3px solid var(--gm-accent);
	background: var(--gm-soft);
	font-family: var(--gm-serif);
	font-size: 1.15em;
}

table { border-collapse: collapse; width: 100%; margin-bottom: 1.2em; }
th, td { border: 1px solid var(--gm-line); padding: 0.5em 0.7em; text-align: left; }

.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
	position: static;
	width: auto; height: auto;
	clip: auto; white-space: normal;
	background: var(--gm-accent);
	color: #fff;
	padding: 0.6em 1em;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--gm-accent);
	color: #fff;
	padding: 0.6em 1em;
	z-index: 100;
	font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------- */
.gm-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

.gm-site { min-height: 100vh; display: flex; flex-direction: column; }
.gm-main { flex: 1; padding: 2.75rem 0 3.5rem; }

/* ---------- Top bar ---------- */
.gm-topbar {
	background: var(--gm-green-dark);
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.82rem;
}
.gm-topbar .gm-container {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	padding-top: 0.4em;
	padding-bottom: 0.4em;
}
.gm-topbar .gm-tagline { color: rgba(255, 255, 255, 0.65); }

/* ---------- Header / masthead ---------- */
.gm-header {
	background: var(--gm-green);
	color: #fff;
	border-bottom: 3px solid var(--gm-accent);
}
.gm-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding-top: 1rem;
	padding-bottom: 1rem;
	flex-wrap: wrap;
}

.gm-brand a { display: inline-flex; align-items: center; gap: 0.7rem; color: #fff; text-decoration: none; }
.gm-brand a:hover, .gm-brand a:focus { color: #fff; text-decoration: none; }
.gm-brand .custom-logo { max-height: 64px; width: auto; display: block; }
.gm-site-title {
	font-family: var(--gm-serif);
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.1;
	margin: 0;
	letter-spacing: 0.01em;
}
.gm-site-title a { color: #fff; }
.gm-site-desc {
	font-size: 0.82rem;
	color: rgba(255, 255, 255, 0.7);
	margin: 0.15em 0 0;
	letter-spacing: 0.04em;
}

.gm-header-search { display: flex; align-items: center; }
.gm-header-search .search-form { display: flex; }
.gm-header-search input[type="search"] {
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	padding: 0.45em 0.7em;
	border-radius: 3px 0 0 3px;
	font-size: 0.9rem;
	width: 170px;
}
.gm-header-search input[type="search"]::placeholder { color: rgba(255, 255, 255, 0.6); }
.gm-header-search button {
	border: 1px solid var(--gm-accent);
	background: var(--gm-accent);
	color: #fff;
	padding: 0.45em 0.8em;
	border-radius: 0 3px 3px 0;
	cursor: pointer;
	font-weight: 600;
	font-size: 0.9rem;
}
.gm-header-search button:hover { background: #3E8F62; }

/* ---------- Primary navigation ---------- */
.gm-nav {
	background: var(--gm-green-dark);
}
.gm-nav .gm-container { display: flex; align-items: center; }
.gm-menu-toggle {
	display: none;
	background: none;
	border: 1px solid rgba(255, 255, 255, 0.4);
	color: #fff;
	padding: 0.55em 0.9em;
	margin: 0.5em 0;
	cursor: pointer;
	font-size: 0.95rem;
	border-radius: 3px;
}
.gm-menu-toggle .gm-burger { display: inline-block; margin-right: 0.4em; }

ul.gm-menu, .gm-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
}
.gm-nav ul li { position: relative; }
.gm-nav ul li a {
	display: block;
	color: #fff;
	padding: 0.75em 0.95em;
	font-size: 0.92rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	text-decoration: none;
}
.gm-nav ul li a:hover,
.gm-nav ul li a:focus,
.gm-nav ul li.current-menu-item > a,
.gm-nav ul li.current_page_item > a {
	background: var(--gm-green-light);
	color: var(--gm-accent);
	text-decoration: none;
}
/* Dropdown sub-menus */
.gm-nav ul ul {
	display: none;
	position: absolute;
	left: 0;
	top: 100%;
	min-width: 200px;
	background: var(--gm-green-dark);
	z-index: 50;
	flex-direction: column;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.gm-nav ul li:hover > ul,
.gm-nav ul li:focus-within > ul { display: flex; }
.gm-nav ul ul li a { text-transform: none; font-weight: 500; }

/* ---------- Section headings ---------- */
.gm-section-title {
	font-size: 1.5rem;
	border-bottom: 2px solid var(--gm-green);
	padding-bottom: 0.4em;
	margin: 0 0 1.2rem;
}
.gm-section-title::after {
	content: "";
	display: block;
	width: 48px;
	border-bottom: 2px solid var(--gm-accent);
	margin-top: 0.4em;
}

.gm-archive-title {
	font-size: 2rem;
	margin: 0 0 0.3em;
}
.gm-archive-desc { color: var(--gm-muted); margin-bottom: 1.5rem; }
.gm-archive-head { margin-bottom: 1.8rem; border-bottom: 2px solid var(--gm-green); padding-bottom: 1rem; }

/* ---------- Top-Artikel (hero) ---------- */
.gm-hero { margin-bottom: 2.75rem; }
.gm-hero-card {
	display: grid;
	grid-template-columns: 1.15fr 1fr;
	background: #fff;
	border: 1px solid var(--gm-line);
	overflow: hidden;
}
.gm-hero-card .gm-hero-media { min-height: 320px; }
.gm-hero-card .gm-hero-media img,
.gm-hero-card .gm-hero-media a { display: block; width: 100%; height: 100%; object-fit: cover; }
.gm-hero-card .gm-hero-body { padding: 2.2rem; display: flex; flex-direction: column; justify-content: center; }
.gm-hero-card h2 { font-size: 1.9rem; margin: 0.4em 0 0.5em; }
.gm-hero-card h2 a { color: var(--gm-ink); }
.gm-hero-card h2 a:hover { color: var(--gm-green); }
.gm-hero-card p { color: var(--gm-muted); }

.gm-cat-label {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gm-accent);
}
.gm-cat-label a { color: var(--gm-green); }
.gm-cat-label a:hover { color: var(--gm-accent); }

.gm-meta {
	font-size: 0.85rem;
	color: var(--gm-muted);
	margin: 0 0 0.6em;
}
.gm-meta a { color: var(--gm-muted); }

/* ---------- Post grid / cards ---------- */
.gm-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
}

.gm-card {
	background: #fff;
	border: 1px solid var(--gm-line);
	border-radius: 4px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.gm-card:hover { box-shadow: 0 4px 14px rgba(20, 83, 45, 0.08); border-color: var(--gm-accent); }
.gm-card-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--gm-soft); }
.gm-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gm-card-media a { display: block; width: 100%; height: 100%; }
.gm-card-body { padding: 1.35rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.gm-card-body h2, .gm-card-body h3 { font-size: 1.2rem; margin: 0.35em 0 0.45em; }
.gm-card-body h2 a, .gm-card-body h3 a { color: var(--gm-ink); }
.gm-card-body h2 a:hover, .gm-card-body h3 a:hover { color: var(--gm-green); text-decoration: none; }
.gm-card-body p { color: var(--gm-muted); font-size: 0.95rem; margin-bottom: 0.7em; flex: 1; }
.gm-card .gm-meta { margin-bottom: 0.4em; }

.gm-read-more {
	font-size: 0.88rem;
	font-weight: 700;
	color: var(--gm-green);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.gm-read-more:hover { color: var(--gm-accent); }

/* ---------- Pagination ---------- */
.gm-pagination { margin: 3rem 0 0; text-align: center; }
.gm-pagination .page-numbers {
	display: inline-block;
	padding: 0.45em 0.85em;
	margin: 0 0.15em;
	border: 1px solid var(--gm-line);
	border-radius: 3px;
	color: var(--gm-green);
	font-weight: 600;
}
.gm-pagination .page-numbers:hover { border-color: var(--gm-green); text-decoration: none; }
.gm-pagination .page-numbers.current { background: var(--gm-green); border-color: var(--gm-green); color: #fff; }

/* ---------- Single post ---------- */
.gm-single { max-width: 780px; margin: 0 auto; }
.gm-single-title { font-size: 2.4rem; margin: 0.3em 0 0.4em; }
.gm-single .gm-meta { font-size: 0.92rem; border-bottom: 1px solid var(--gm-line); padding-bottom: 1rem; margin-bottom: 1.4rem; }
.gm-featured { margin: 0 0 1.6rem; }
.gm-featured img { width: 100%; border-radius: 4px; }
.gm-featured figcaption { font-size: 0.85rem; color: var(--gm-muted); margin-top: 0.5em; }
.gm-content { font-size: 1.06rem; }
.gm-content img { border-radius: 4px; }
.gm-content a { text-decoration: underline; }
.gm-content h2 { font-size: 1.6rem; margin-top: 1.4em; }
.gm-content h3 { font-size: 1.3rem; margin-top: 1.2em; }

.gm-tags { margin: 1.8rem 0; font-size: 0.9rem; color: var(--gm-muted); }
.gm-tags a {
	display: inline-block;
	border: 1px solid var(--gm-line);
	border-radius: 20px;
	padding: 0.2em 0.8em;
	margin: 0 0.3em 0.3em 0;
	color: var(--gm-green);
	text-decoration: none;
}
.gm-tags a:hover { border-color: var(--gm-accent); color: var(--gm-accent); }

.gm-post-nav {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	border-top: 1px solid var(--gm-line);
	border-bottom: 1px solid var(--gm-line);
	padding: 1rem 0;
	margin: 1.5rem 0;
}
.gm-post-nav a { font-weight: 600; }
.gm-post-nav .gm-next { text-align: right; }

/* ---------- Related posts ---------- */
.gm-related { margin-top: 2.5rem; }
.gm-related .gm-grid { gap: 1.4rem; }

/* ---------- Pages ---------- */
.gm-page { max-width: 780px; margin: 0 auto; }
.gm-page-title { font-size: 2.2rem; margin-bottom: 0.6em; }

/* ---------- Seitenleiste & widgets ---------- */
.gm-layout {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 3rem;
	align-items: start;
}
.gm-sidebar .widget {
	margin-bottom: 2.25rem;
	border: 1px solid var(--gm-line);
	border-radius: 4px;
	padding: 1.4rem;
	background: var(--gm-soft);
}
.gm-sidebar .widget-title {
	font-size: 1.1rem;
	border-bottom: 2px solid var(--gm-accent);
	padding-bottom: 0.4em;
	margin-bottom: 0.8em;
}
.gm-sidebar ul { list-style: none; padding: 0; margin: 0; }
.gm-sidebar ul li { padding: 0.35em 0; border-bottom: 1px solid var(--gm-line); }
.gm-sidebar ul li:last-child { border-bottom: 0; }

/* ---------- Comments ---------- */
.gm-comments { margin-top: 2.5rem; border-top: 1px solid var(--gm-line); padding-top: 1.5rem; }
.gm-comments h2 { font-size: 1.4rem; }
.comment-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.comment-list .comment { border: 1px solid var(--gm-line); border-radius: 4px; padding: 1rem; margin-bottom: 1rem; }
.comment-list .children { list-style: none; padding-left: 1.5rem; margin-top: 1rem; }
.comment-meta { font-size: 0.85rem; color: var(--gm-muted); margin-bottom: 0.5em; }
.comment-form label { display: block; font-weight: 600; margin-bottom: 0.3em; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea,
.search-form input[type="search"],
.gm-sidebar input[type="text"] {
	width: 100%;
	border: 1px solid var(--gm-line);
	border-radius: 3px;
	padding: 0.55em 0.7em;
	font-size: 1rem;
	font-family: var(--gm-sans);
}
.comment-form input[type="submit"],
.search-form input[type="submit"],
.search-form button[type="submit"] {
	background: var(--gm-green);
	color: #fff;
	border: 0;
	border-radius: 3px;
	padding: 0.6em 1.2em;
	font-weight: 700;
	cursor: pointer;
}
.comment-form input[type="submit"]:hover { background: var(--gm-green-light); }

/* ---------- Search ---------- */
.gm-search-form { display: flex; gap: 0.5em; max-width: 480px; margin: 1rem 0 2rem; }
.gm-search-form input[type="search"] { flex: 1; border: 1px solid var(--gm-line); border-radius: 3px; padding: 0.55em 0.7em; font-size: 1rem; }

/* ---------- Footer ---------- */
.gm-footer {
	background: var(--gm-green);
	color: rgba(255, 255, 255, 0.85);
	margin-top: auto;
}
.gm-footer a { color: #fff; }
.gm-footer a:hover { color: var(--gm-accent); }
.gm-footer-widgets {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2.5rem;
	padding-top: 3rem;
	padding-bottom: 0.5rem;
}
.gm-footer-widgets .widget ul { list-style: none; margin: 0; padding: 0; }
.gm-footer-widgets .widget ul li { padding: 0.25em 0; }
.gm-footer-inner {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr;
	gap: 2rem;
	padding-top: 3rem;
	padding-bottom: 2.5rem;
}
.gm-footer h3, .gm-footer .gm-widget-title {
	color: #fff;
	font-size: 1.05rem;
	border-bottom: 2px solid var(--gm-accent);
	display: inline-block;
	padding-bottom: 0.35em;
	margin-bottom: 0.9em;
}
.gm-footer ul { list-style: none; margin: 0; padding: 0; }
.gm-footer ul li { padding: 0.25em 0; }
.gm-footer .gm-footer-brand .gm-site-title { font-size: 1.5rem; }
.gm-footer .gm-site-desc { color: rgba(255, 255, 255, 0.65); }
.gm-footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	padding: 1rem 0;
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.65);
	text-align: center;
}

/* ---------- Misc / WordPress core ---------- */
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.85rem; color: var(--gm-muted); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }

.gm-empty { text-align: center; padding: 3rem 1rem; color: var(--gm-muted); }
.gm-empty h2 { font-size: 1.6rem; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.gm-grid { grid-template-columns: repeat(2, 1fr); }
	.gm-hero-card { grid-template-columns: 1fr; }
	.gm-hero-card .gm-hero-media { min-height: 240px; }
	.gm-layout { grid-template-columns: 1fr; }
	.gm-footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
	body { font-size: 16px; }
	.gm-grid { grid-template-columns: 1fr; }
	.gm-header-inner { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
	.gm-header-search { width: 100%; }
	.gm-header-search .search-form { width: 100%; }
	.gm-header-search input[type="search"] { flex: 1; width: auto; }
	.gm-site-title { font-size: 1.7rem; }
	.gm-single-title { font-size: 1.9rem; }
	.gm-hero-card h2 { font-size: 1.5rem; }
	.gm-footer-inner { grid-template-columns: 1fr; }

	/* Mobile menu: toggle shows/hides the nav list */
	.gm-menu-toggle { display: inline-block; }
	.gm-nav .gm-container { flex-direction: column; align-items: stretch; }
	.gm-nav ul.gm-menu,
	.gm-nav ul.menu {
		display: none;
		flex-direction: column;
		width: 100%;
	}
	.gm-nav.toggled ul.gm-menu,
	.gm-nav.toggled ul.menu { display: flex; }
	.gm-nav ul li a { padding: 0.7em 0.2em; border-top: 1px solid rgba(255, 255, 255, 0.08); }
	.gm-nav ul ul { position: static; display: none; box-shadow: none; }
	.gm-nav ul li:hover > ul { display: none; }
	.gm-nav ul li.menu-item-has-children > a::after { content: " +"; color: var(--gm-accent); }
}

/* No-JS fallback: if JS is off, the checkbox-free toggle cannot open the menu,
   so keep the menu visible when the toggle is focused via keyboard. */
@media (max-width: 768px) {
	.gm-nav:focus-within ul.gm-menu { display: flex; }
}
