/*
Theme Name: PFC – privater Freizeitclub
Theme URI: https://www.pfclub.de
Author: privater Freizeitclub e.V.
Description: Responsives Vereins-Theme für pfclub.de. Funktioniert auf Handy, Tablet und Laptop, ohne externe Schriften und ohne Tracking. Legt beim Aktivieren alle Seiten als Entwurf an.
Version: 1.2.0
Requires at least: 6.3
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pfclub
*/

/* ---------- Farben und Grundwerte ---------- */
:root {
	--pfc-petrol: #5a1d3c; /* Pflaume dunkel (Briefbogen) */
	--pfc-petrol-2: #993366; /* Schriftzug Briefbogen */
	--pfc-amber: #f4a020; /* Logo-Orange */
	--pfc-amber-dark: #b0650a;
	--pfc-green: #90d040;
	--pfc-blue: #08a0e8;
	--pfc-magenta: #f00890;
	--pfc-bg: #fbfaf7;
	--pfc-surface: #ffffff;
	--pfc-soft: #f6eef2;
	--pfc-text: #1c2526;
	--pfc-muted: #55605f;
	--pfc-line: #e8dbe2;
	--pfc-ok: #1f7a4d;
	--pfc-warn: #9a5b00;
	--pfc-open: #8a2c2c;
	--pfc-radius: 14px;
	--pfc-shadow: 0 6px 24px rgba(90, 29, 60, .08);
	--pfc-max: 1140px;
	--pfc-gutter: clamp(16px, 4vw, 32px);
	--pfc-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--pfc-serif: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--pfc-bg);
	color: var(--pfc-text);
	font-family: var(--pfc-font);
	font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
	line-height: 1.65;
	overflow-x: hidden;
}
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--pfc-petrol-2); text-underline-offset: 3px; }
a:hover, a:focus { color: var(--pfc-amber-dark); }
:focus-visible { outline: 3px solid var(--pfc-amber); outline-offset: 2px; }

h1, h2, h3, h4 { font-family: var(--pfc-serif); color: var(--pfc-petrol); line-height: 1.2; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + .5vw, 1.4rem); }
p { margin: 0 0 1em; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto;
	background: #fff; padding: 10px 16px; border-radius: 8px;
}

.pfc-wrap { max-width: var(--pfc-max); margin: 0 auto; padding: 0 var(--pfc-gutter); }

/* ---------- Kopfzeile ---------- */
.site-header {
	position: sticky; top: 0; z-index: 100;
	background: rgba(255, 255, 255, .96);
	backdrop-filter: saturate(160%) blur(6px);
	border-bottom: 1px solid var(--pfc-line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }

.site-header .pfc-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.site-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--pfc-petrol); }
.site-brand:hover { color: var(--pfc-petrol); }
.site-brand .custom-logo { max-height: 48px; width: auto; }
.brand-mark {
	display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
	background: var(--pfc-petrol); color: #fff; font-weight: 800; letter-spacing: .5px; font-size: .95rem;
	flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--pfc-serif); font-size: 1.12rem; font-weight: 700; }
.brand-claim { font-size: .78rem; color: var(--pfc-muted); }

.menu-toggle {
	display: none; align-items: center; gap: 8px;
	min-height: 44px; padding: 0 14px; border-radius: 10px;
	border: 1px solid var(--pfc-line); background: #fff; color: var(--pfc-petrol);
	font: inherit; font-weight: 600; cursor: pointer;
}
.menu-toggle .bars, .menu-toggle .bars::before, .menu-toggle .bars::after {
	display: block; width: 20px; height: 2px; background: currentColor; position: relative; transition: transform .2s;
}
.menu-toggle .bars::before, .menu-toggle .bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle .bars::before { top: -6px; }
.menu-toggle .bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.main-navigation a {
	display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none;
	color: var(--pfc-text); font-weight: 600; font-size: .95rem;
}
.main-navigation a:hover, .main-navigation .current-menu-item > a, .main-navigation .current_page_item > a {
	background: var(--pfc-soft); color: var(--pfc-petrol);
}
.main-navigation .menu-item-members > a, .main-navigation a[href*="/mitglieder"] {
	background: var(--pfc-petrol); color: #fff; margin-left: 6px;
}
.main-navigation .menu-item-members > a:hover, .main-navigation a[href*="/mitglieder"]:hover { background: var(--pfc-petrol-2); color: #fff; }
.main-navigation .sub-menu { display: none; }

@media (max-width: 1024px) {
	.menu-toggle { display: inline-flex; }
	.main-navigation { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--pfc-line); box-shadow: var(--pfc-shadow); display: none; max-height: calc(100vh - 68px); overflow-y: auto; }
	.main-navigation.is-open { display: block; }
	.main-navigation ul { flex-direction: column; align-items: stretch; padding: 8px var(--pfc-gutter) 16px; }
	.main-navigation a { padding: 14px 12px; font-size: 1.05rem; border-bottom: 1px solid var(--pfc-soft); border-radius: 0; }
	.main-navigation .menu-item-members > a, .main-navigation a[href*="/mitglieder"] { margin: 10px 0 0; border-radius: 10px; text-align: center; }
	.brand-claim { display: none; }
}

/* ---------- Inhalt ---------- */
.site-main { padding-bottom: 48px; }
.page-header { background: linear-gradient(135deg, var(--pfc-petrol) 0%, var(--pfc-petrol-2) 100%); color: #fff; padding: clamp(36px, 7vw, 72px) 0 clamp(28px, 5vw, 48px); margin-bottom: 32px; }
.page-header h1 { color: #fff; margin: 0; }
.page-header .page-lead { color: #f3e3eb; max-width: 760px; margin-top: 10px; font-size: 1.1rem; }

.entry-content > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.entry-content > .alignwide { max-width: var(--pfc-max); }
.entry-content > .alignfull { max-width: none; }
.entry-content { padding: 0 var(--pfc-gutter); }
.entry-content > .alignfull { margin-left: calc(-1 * var(--pfc-gutter)); margin-right: calc(-1 * var(--pfc-gutter)); }

/* Startseiten-Bühne */
.pfc-hero {
	background:
		radial-gradient(1200px 400px at 85% -10%, rgba(244, 160, 32, .30), transparent 60%),
		linear-gradient(135deg, #7a2952 0%, #3d1229 100%);
	color: #fff; padding: clamp(48px, 9vw, 110px) var(--pfc-gutter) clamp(40px, 7vw, 90px) !important;
	margin-top: 0 !important;
}
.pfc-hero > * { max-width: var(--pfc-max); margin-left: auto !important; margin-right: auto !important; }
.pfc-hero h1, .pfc-hero h2 { color: #fff; margin-top: 0; max-width: 780px; }
.pfc-hero .pfc-hero-title { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); }
.pfc-hero p { color: #f3e3eb; font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem); max-width: 720px; }
.pfc-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem !important; font-weight: 700; color: var(--pfc-amber) !important; margin-bottom: .6em !important; }

/* Knöpfe */
.wp-block-button__link, .pfc-btn {
	display: inline-block; min-height: 48px; padding: 12px 22px; border-radius: 999px;
	background: var(--pfc-amber); color: #1b1404; font-weight: 700; text-decoration: none; border: 2px solid var(--pfc-amber);
	line-height: 1.4;
}
.wp-block-button__link:hover, .pfc-btn:hover { background: #e9a540; color: #1b1404; }
.is-style-outline .wp-block-button__link { background: transparent; color: inherit; border-color: currentColor; }
.pfc-hero .is-style-outline .wp-block-button__link { color: #fff; }
.wp-block-buttons { gap: 12px; }

/* Abschnitte und Karten */
.pfc-section { padding: clamp(36px, 6vw, 72px) 0; }
.pfc-band { background: var(--pfc-soft); padding: clamp(36px, 6vw, 72px) var(--pfc-gutter) !important; }
.pfc-band > * { max-width: var(--pfc-max); margin-left: auto !important; margin-right: auto !important; }

.pfc-cards { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.pfc-cards > .wp-block-group, .pfc-card {
	background: var(--pfc-surface); border: 1px solid var(--pfc-line); border-radius: var(--pfc-radius);
	padding: 22px 22px 10px; box-shadow: var(--pfc-shadow); margin: 0 !important;
}
.pfc-cards h3 { margin-top: 0; }
.pfc-icon { font-size: 1.8rem; line-height: 1; margin-bottom: 10px !important; }

.pfc-stats { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; text-align: center; }
.pfc-stats > * { background: #fff; border-radius: var(--pfc-radius); padding: 18px 12px; border: 1px solid var(--pfc-line); margin: 0 !important; }
.pfc-stat-num { font-family: var(--pfc-serif); font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.3rem) !important; color: var(--pfc-petrol); font-weight: 700; margin: 0 !important; }
.pfc-stat-label { color: var(--pfc-muted); font-size: .92rem; margin: 0 !important; }

/* Hinweiskasten */
.pfc-note {
	border-left: 5px solid var(--pfc-amber); background: #fff7ea; padding: 16px 20px !important;
	border-radius: 0 var(--pfc-radius) var(--pfc-radius) 0;
}
.pfc-note p:last-child { margin-bottom: 0; }

/* Chronik */
.pfc-timeline { position: relative; padding-left: 28px !important; }
.pfc-timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 3px; background: var(--pfc-line); border-radius: 2px; }
.pfc-event { position: relative; background: #fff; border: 1px solid var(--pfc-line); border-radius: var(--pfc-radius); padding: 16px 18px 6px !important; margin: 0 0 16px !important; box-shadow: var(--pfc-shadow); }
.pfc-event::before { content: ""; position: absolute; left: -26px; top: 20px; width: 15px; height: 15px; border-radius: 50%; background: var(--pfc-amber); border: 3px solid var(--pfc-bg); }
.pfc-event.is-negative::before { background: var(--pfc-open); }
.pfc-event.is-positive::before { background: var(--pfc-ok); }
.pfc-date { font-weight: 800; color: var(--pfc-petrol-2); font-size: .9rem; letter-spacing: .02em; margin-bottom: 2px !important; }
.pfc-event h3 { margin: 0 0 6px; font-size: 1.12rem; }
.pfc-source { font-size: .88rem; color: var(--pfc-muted); border-top: 1px dashed var(--pfc-line); padding-top: 8px; }
.pfc-badge {
	display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 10px; border-radius: 999px;
	background: var(--pfc-soft); color: var(--pfc-petrol); vertical-align: middle; white-space: nowrap;
}
.pfc-badge.is-open { background: #fbe9e9; color: var(--pfc-open); }
.pfc-badge.is-ok { background: #e3f3ea; color: var(--pfc-ok); }
.pfc-badge.is-warn { background: #fff1d6; color: var(--pfc-warn); }

/* Tabellen: auf dem Handy als Karten */
.wp-block-table { overflow-x: auto; }
.wp-block-table table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--pfc-radius); overflow: hidden; }
.wp-block-table th, .wp-block-table td { padding: 12px 14px; border-bottom: 1px solid var(--pfc-line); text-align: left; vertical-align: top; }
.wp-block-table thead th { background: var(--pfc-petrol); color: #fff; font-weight: 700; border: 0; }
@media (max-width: 680px) {
	.pfc-stack table, .pfc-stack thead, .pfc-stack tbody, .pfc-stack tr, .pfc-stack td { display: block; width: 100%; }
	.pfc-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
	.pfc-stack tr { border: 1px solid var(--pfc-line); border-radius: var(--pfc-radius); margin-bottom: 12px; background: #fff; }
	.pfc-stack td { border: 0; padding: 6px 14px; }
	.pfc-stack td:first-child { padding-top: 12px; font-weight: 800; color: var(--pfc-petrol-2); }
	.pfc-stack td:last-child { padding-bottom: 12px; }
	.pfc-stack table { background: transparent; }
}

/* Spalten-Block auf kleinen Geräten */
@media (max-width: 781px) {
	.wp-block-columns { flex-wrap: wrap !important; }
	.wp-block-columns > .wp-block-column { flex-basis: 100% !important; }
}

/* Mitgliederbereich */
.pfc-login-box { max-width: 460px !important; background: #fff; border: 1px solid var(--pfc-line); border-radius: var(--pfc-radius); padding: 26px; box-shadow: var(--pfc-shadow); }
.pfc-login-box label { display: block; font-weight: 600; margin-bottom: 4px; }
.pfc-login-box input[type="text"], .pfc-login-box input[type="password"] {
	width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #b9c6c5; border-radius: 10px; font: inherit; font-size: 16px;
}
.pfc-login-box input[type="submit"] {
	width: 100%; min-height: 48px; border: 0; border-radius: 999px; background: var(--pfc-petrol); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.pfc-login-box .login-remember label { font-weight: 400; display: inline; }
.pfc-member-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; background: var(--pfc-soft); border-radius: var(--pfc-radius); padding: 12px 16px; margin-bottom: 24px !important; }

/* ---------- Fußzeile ---------- */
.site-footer { background: #3d1229; color: #e6d3dd; padding: 44px 0 24px; font-size: .95rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.site-footer h2 { color: #fff; font-size: 1.05rem; margin: 0 0 10px; font-family: var(--pfc-font); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0 0 8px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 28px; padding-top: 16px; font-size: .85rem; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

/* Beiträge / Archiv */
.pfc-posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.pfc-post-card { background: #fff; border: 1px solid var(--pfc-line); border-radius: var(--pfc-radius); padding: 20px; }
.pfc-post-card h2 { font-size: 1.25rem; margin-top: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

@media print {
	.site-header, .site-footer, .menu-toggle { display: none; }
	.page-header { background: none; color: #000; }
	.page-header h1 { color: #000; }
}

/* ---------- Klassische Themes: Gruppen-Block hat einen inneren Container ---------- */
.wp-block-group > .wp-block-group__inner-container > :first-child { margin-top: 0; }
.pfc-section > :first-child, .pfc-band > :first-child, .pfc-hero > :first-child { margin-top: 0 !important; }
.pfc-cards:has(> .wp-block-group__inner-container), .pfc-stats:has(> .wp-block-group__inner-container) { display: block !important; }
.pfc-cards > .wp-block-group__inner-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.pfc-stats > .wp-block-group__inner-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; text-align: center; }
.pfc-cards > .wp-block-group__inner-container > .wp-block-group {
	background: var(--pfc-surface); border: 1px solid var(--pfc-line); border-radius: var(--pfc-radius);
	padding: 22px 22px 10px; box-shadow: var(--pfc-shadow); margin: 0 !important;
}
.pfc-stats > .wp-block-group__inner-container > * { background: #fff; border-radius: var(--pfc-radius); padding: 18px 12px; border: 1px solid var(--pfc-line); margin: 0 !important; }
.pfc-cards:has(> .wp-block-group__inner-container), .pfc-stats:has(> .wp-block-group__inner-container) { background: none; border: 0; box-shadow: none; padding: 0; }
.pfc-stats > .wp-block-group__inner-container > * > .wp-block-group__inner-container > *,
.pfc-cards .pfc-card > .wp-block-group__inner-container > :first-child { margin-top: 0; }
.pfc-hero > .wp-block-group__inner-container, .pfc-band > .wp-block-group__inner-container { max-width: var(--pfc-max); margin: 0 auto; }
.pfc-section { padding: clamp(32px, 5vw, 56px) 0; }
.pfc-band { padding-top: clamp(32px, 5vw, 56px) !important; padding-bottom: clamp(32px, 5vw, 56px) !important; }

/* ---------- Markenauftritt laut Briefbogen ---------- */
.site-header { border-bottom: 0; }
.site-header::after {
	content: ""; display: block; height: 4px;
	background: linear-gradient(90deg, var(--pfc-green) 0 25%, var(--pfc-magenta) 25% 50%, var(--pfc-blue) 50% 75%, var(--pfc-amber) 75% 100%);
}
.site-brand .brand-logo { width: 48px; height: 48px; flex: none; }
.brand-name { font-style: italic; color: var(--pfc-petrol-2); font-size: 1.25rem; font-weight: 400; }
.brand-name .ev { font-size: .8em; }
.page-header { background: linear-gradient(135deg, #7a2952 0%, #3d1229 100%); }
.pfc-kicker { color: #ffc35a !important; }
.pfc-stat-num { color: var(--pfc-petrol-2); }
.pfc-cards > .wp-block-group__inner-container > .wp-block-group:nth-child(4n+1) { border-top: 4px solid var(--pfc-green); }
.pfc-cards > .wp-block-group__inner-container > .wp-block-group:nth-child(4n+2) { border-top: 4px solid var(--pfc-magenta); }
.pfc-cards > .wp-block-group__inner-container > .wp-block-group:nth-child(4n+3) { border-top: 4px solid var(--pfc-blue); }
.pfc-cards > .wp-block-group__inner-container > .wp-block-group:nth-child(4n+4) { border-top: 4px solid var(--pfc-amber); }
.footer-logo { width: 56px; height: 56px; background: #fff; border-radius: 12px; padding: 4px; margin-bottom: 10px; }

/* ---------- Logo aus dem Briefbogen (V03) ---------- */
.brand-briefkopf { display: block; line-height: 0; }
.brand-briefkopf img { display: block; height: 62px; width: auto; max-width: 100%; }
.site-brand { min-width: 0; flex: 0 1 auto; }
@media (min-width: 1025px) {
	/* wie im Briefbogen: Briefkopf oben, Menue darunter */
	.site-header { position: static; }
	.site-header .pfc-wrap { flex-wrap: wrap; padding-top: 14px; }
	.site-brand { flex: 1 0 100%; }
	.brand-briefkopf img { height: 78px; }
	.main-navigation { flex: 1 0 100%; padding: 6px 0 8px; border-top: 1px solid var(--pfc-line); }
}
@media (max-width: 1024px) {
	.brand-briefkopf img { height: 40px; }
	.site-header .pfc-wrap { min-height: 64px; }
}
@media (max-width: 420px) {
	.brand-briefkopf img { height: auto; width: 100%; max-height: 36px; }
	.menu-toggle span:not(.bars) { display: none; }
}
