/*
Theme Name: SG Nörvenich-Hochkirchen
Theme URI:
Author: Endless One
Author URI: https://endless-one.de
Description: Schlankes Basis-Theme für die Website der SG Nörvenich-Hochkirchen. Enthält nur die nötigsten WordPress-Grundfunktionen als Ausgangspunkt für weiteren Ausbau.
Version: 0.1.26
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sgnh
*/

/* -------------------------------------------------- */
/* Schriften (selbst gehostet, Latin-Subset)            */
/* -------------------------------------------------- */
/* Inter: variabler Font, deckt Schnitte 100–900 in einer Datei ab.
   Genutzt werden aktuell die Schnitte 400/600/700 (Fließtext, Buttons). */
@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('assets/fonts/inter-latin-variable.woff2') format('woff2-variations');
}

/* Big Shoulders: variabler Font, deckt Schnitte 100–900 in einer Datei ab.
   Genutzt werden aktuell die Schnitte 700/800 (Überschriften). */
@font-face {
	font-family: 'Big Shoulders';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('assets/fonts/big-shoulders-latin-variable.woff2') format('woff2-variations');
}

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

body {
	margin: 0;
	font-family: var(--sgnh-font-body);
	font-weight: 400;
	line-height: 1.5;
	color: #1a1a1a;
	background: #ffffff;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--sgnh-font-heading);
	font-weight: 700;
	line-height: 1.15;
}

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

a {
	color: inherit;
}

ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* -------------------------------------------------- */
/* Variablen                                           */
/* -------------------------------------------------- */
:root {
	--sgnh-container: 1280px;
	/* Vorläufiger Platzhalter-Akzent, an das Vereinslogo angelehnt. */
	--sgnh-accent: #b3e636;
	--sgnh-dark: #14231b;
	/* Seitenhintergrund (siehe body-Regel oben). Wird vom Hero-Block der
	   kompakten Variante genutzt, um die Vereinswappen-Kerbe farblich
	   passend "auszustanzen" (siehe sgnh-wp-blocks). Anders als
	   --sgnh-hero-mask ein reiner Farbwert ohne url() - deshalb hier direkt
	   und nicht per PHP-Inline-Style setzbar. */
	--sgnh-page-bg: #ffffff;
	--sgnh-font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--sgnh-font-heading: 'Big Shoulders', 'Arial Narrow', Arial, sans-serif;
	/* Zieht den Hero-Block (sgnh-wp-blocks) unter den Header, um den durch
	   die Logo-Höhe (120px + 15px oberes Margin) breiteren Header optisch
	   auszugleichen. Wird vom Hero-Block als --sgnh-header-overlap konsumiert. */
	--sgnh-header-overlap: -60px;
	/* --sgnh-hero-mask wird NICHT hier gesetzt: ein relativer url()-Wert in
	   einer Custom Property wird browserabhängig relativ zur Dokument-Basis-
	   URL statt zur Stylesheet-URL aufgelöst, sobald die Variable in einem
	   anderen Stylesheet (z. B. dem Hero-Block-Plugin) konsumiert wird –
	   das führt zu 404s. Stattdessen wird die Variable in functions.php mit
	   einer absoluten URL (get_theme_file_uri()) per Inline-Style gesetzt. */
}

/* -------------------------------------------------- */
/* Layout                                              */
/* -------------------------------------------------- */
.content-area,
.site-footer {
	max-width: var(--sgnh-container);
	margin: 0 auto;
	padding: 1rem 1.25rem;
}

.content-area {
	padding-top: 2rem;
	padding-bottom: 2rem;
}

/* -------------------------------------------------- */
/* Header                                              */
/* -------------------------------------------------- */
.site-header {
	background: transparent;
	position: relative;
	z-index: 10;
}

.site-header-inner {
	max-width: var(--sgnh-container);
	margin: 0 auto;
	padding: 0 1.25rem;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 1rem;
}

.site-branding {
	justify-self: center;
	text-align: center;
}

.custom-logo-link {
	display: block;
}

.custom-logo {
	display: block;
	width: 120px;
	height: 120px;
	margin: 15px auto 0;
	object-fit: contain;
}

.site-title {
	margin: 0;
	font-family: var(--sgnh-font-heading);
	font-size: 1.5rem;
	text-transform: uppercase;
}

.site-title a {
	text-decoration: none;
}

.site-description {
	margin: 0;
	font-size: 0.9rem;
	color: #555;
}

.main-navigation {
	height: 79px;
	display: flex;
	align-items: center;
}

.main-navigation--left {
	justify-self: start;
}

.main-navigation--right {
	justify-self: end;
}

.main-navigation ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	height: 100%;
	gap: 36px;
}

.main-navigation li {
	display: flex;
	align-items: center;
	height: 100%;
}

.main-navigation a {
	position: relative;
	display: flex;
	align-items: center;
	height: 100%;
	padding: 0 18px;
	font-family: var(--sgnh-font-heading);
	font-weight: 500;
	font-size: 18px;
	/* 2 % in Figma = 2 % der Schriftgröße */
	letter-spacing: 0.02em;
	color: #070707;
	text-decoration: none;
}

/* Aktiver Menüpunkt: Unterstrich hängt unten am Container (.main-navigation). */
.main-navigation .current-menu-item > a::after,
.main-navigation .current_page_item > a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 4px;
	background: #baff72;
	border-radius: 0 0 3px 3px;
}

/* -------------------------------------------------- */
/* Dropdown-Menü (Untermenüs, 2. Ebene und tiefer)     */
/* -------------------------------------------------- */
.main-navigation .menu-item-has-children {
	position: relative;
}

.main-navigation .menu-item-has-children > a {
	padding-right: 34px;
}

/* Pfeil-Indikator; a ist bereits position: relative (siehe oben). */
.main-navigation .menu-item-has-children > a::before {
	content: "";
	position: absolute;
	right: 14px;
	top: 50%;
	width: 6px;
	height: 6px;
	margin-top: -5px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.15s ease;
}

.main-navigation .menu-item-has-children:hover > a::before,
.main-navigation .menu-item-has-children:focus-within > a::before,
.main-navigation .menu-item-has-children.sgnh-submenu-open > a::before {
	transform: rotate(225deg);
	margin-top: -2px;
}

.main-navigation ul.sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	flex-direction: column;
	align-items: stretch;
	height: auto;
	gap: 0;
	min-width: 220px;
	padding: 8px 0;
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
	z-index: 50;
}

/* Rechtes Menü: Untermenüs rechtsbündig öffnen, damit sie nicht über den
   Viewport-Rand hinausragen. */
.main-navigation--right ul.sub-menu {
	left: auto;
	right: 0;
}

/* Untermenü 3. Ebene (und tiefer): klappt seitlich statt darunter auf. */
.main-navigation ul.sub-menu ul.sub-menu {
	top: -8px;
	left: 100%;
}

.main-navigation--right ul.sub-menu ul.sub-menu {
	left: auto;
	right: 100%;
}

.main-navigation .menu-item-has-children:hover > .sub-menu,
.main-navigation .menu-item-has-children:focus-within > .sub-menu,
.main-navigation .menu-item-has-children.sgnh-submenu-open > .sub-menu {
	display: flex;
}

.main-navigation .sub-menu li {
	height: auto;
	width: 100%;
}

.main-navigation .sub-menu a {
	height: auto;
	width: 100%;
	padding: 10px 20px;
	white-space: nowrap;
	font-size: 16px;
}

.main-navigation .sub-menu .current-menu-item > a::after,
.main-navigation .sub-menu .current_page_item > a::after {
	display: none;
}

/* -------------------------------------------------- */
/* Footer                                              */
/* -------------------------------------------------- */
.site-footer {
	border-top: 1px solid #e2e2e2;
	margin-top: 2rem;
	font-size: 0.9rem;
	color: #555;
}

article + article {
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 1px solid #e2e2e2;
}
