/*
Theme Name: Cody
Theme URI: https://example.com/cody
Author: Henning
Author URI: https://example.com
Description: Ein leeres WordPress-Starter-Theme.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
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: cody
*/

/* =========================================================
   1. Custom Properties (Design-Tokens)
   ========================================================= */
:root {
	--cody-color-text: #1a1a1a;
	--cody-color-bg: #ffffff;
	--cody-color-accent: #2563eb;
	--cody-color-muted: #6b7280;
	--cody-color-border: #e5e7eb;
	--cody-color-bg2: #e4e4e4;

	--cody-font-base: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--cody-font-size: 1rem;
	--cody-font-weight: 400;
	--cody-line-height: 1.6;

	--cody-content-width: 70rem;
	--cody-space: 1rem;
}

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

body {
	margin: 0;
	font-family: var(--cody-font-base);
	font-size: var(--cody-font-size);
	font-weight: var(--cody-font-weight);
	line-height: var(--cody-line-height);
	color: var(--cody-color-text);
	background: var(--cody-color-bg);
}

img,
picture,
video,
svg {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--cody-color-accent);
	text-decoration: none;
}

a:hover,
a:focus {
	text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
	line-height: 1.2;
	margin: 0 0 0.5em;
}

p {
	margin: 0 0 1em;
}

/* =========================================================
   3. Barrierefreiheit (Helfer)
   ========================================================= */

/* Sichtbarer Fokus für alle interaktiven Elemente. */
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--cody-color-accent);
	outline-offset: 2px;
}

/* Inhalt nur für Screenreader (visuell versteckt). */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Skip-Link: bei Tastaturfokus sichtbar einblenden. */
.skip-link {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1000;
	padding: var(--cody-space);
	background: var(--cody-color-bg);
	color: var(--cody-color-accent);
}

.skip-link:focus {
	clip: auto;
	width: auto;
	height: auto;
	margin: 0;
}

/* =========================================================
   4. Layout
   ========================================================= */
.site-header__inner,
.site-content,
.site-footer {
	max-width: var(--cody-content-width);
	margin-inline: auto;
	padding-inline: var(--cody-space);
}

.site-header {
	background: var(--cody-color-bg2);
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--cody-space);
	padding-block: var(--cody-space);
}

.site-title {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--cody-color-text);
}

.site-content {
	padding-block: calc(var(--cody-space) * 2);
}

.site-footer {
	padding-block: calc(var(--cody-space) * 2);
	border-top: 1px solid var(--cody-color-border);
	color: var(--cody-color-muted);
}

/* =========================================================
   5. Navigation (mobile-first)
   ========================================================= */

/* Hamburger-Icon (drei Striche über ::before/::after). */
.nav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	background: transparent;
	border: 1px solid var(--cody-color-border);
	border-radius: 0.25rem;
	cursor: pointer;
}

.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
	display: block;
	width: 1.25rem;
	height: 2px;
	background: var(--cody-color-text);
}

.nav-toggle__icon {
	position: relative;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
	content: "";
	position: absolute;
	left: 0;
}

.nav-toggle__icon::before {
	top: -6px;
}

.nav-toggle__icon::after {
	top: 6px;
}

/* Menü auf Mobile standardmäßig ausgeblendet. */
.nav-menu {
	display: none;
	flex-direction: column;
	gap: 0.25rem;
	width: 100%;
	margin: var(--cody-space) 0 0;
	padding: 0;
	list-style: none;
}

/* Von JS gesetzt, wenn der Toggle aktiv ist. */
.site-navigation.is-open .nav-menu {
	display: flex;
}

.nav-menu a {
	display: block;
	padding: 0.5rem 0;
	color: var(--cody-color-text);
}

.nav-menu a:hover,
.nav-menu a:focus {
	color: var(--cody-color-accent);
}

/* Ab Tablet/Desktop: horizontale Leiste, Toggle ausblenden. */
@media (min-width: 48em) {
	.nav-toggle {
		display: none;
	}

	.nav-menu {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		gap: var(--cody-space);
		width: auto;
		margin: 0;
	}

	.nav-menu a {
		padding: 0;
	}
}

/* =========================================================
   6. Beiträge
   ========================================================= */
article {
	margin-bottom: calc(var(--cody-space) * 2);
	padding-bottom: calc(var(--cody-space) * 2);
	border-bottom: 1px solid var(--cody-color-border);
}

article:last-child {
	border-bottom: 0;
}

.entry-title {
	font-size: 1.75rem;
}

/* Hier kommen deine eigenen Styles hin. */
