/*
Theme Name: Elternfonds
Author: Elternfonds der TMS
Description: Theme für den Elternfonds der Theodor-Mommsen-Schule mit Schaubild-Startseite und Seitenleiste „Aktuelle Beiträge“. Basiert auf einer Kopie von Twenty Twenty-Five 1.5 (WordPress-Team).
Requires at least: 6.7
Tested up to: 7.0
Requires PHP: 7.2
Version: 1.0.12
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: elternfonds
Tags: two-columns, right-sidebar, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, block-styles, wide-blocks
*/

/* ---------------------------------------------------------------
 * Basis (aus Twenty Twenty-Five übernommen)
 * ------------------------------------------------------------- */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: .15em;
}

:where(.wp-site-blocks *:focus) {
	outline-width: 2px;
	outline-style: solid;
}

.wp-block-navigation .wp-block-navigation-item .wp-block-navigation-item__content {
	outline-offset: 4px;
}

h1, h2, h3, h4, h5, h6, blockquote, caption, figcaption, p {
	text-wrap: pretty;
}

.more-link {
	display: block;
}

:where(pre) {
	overflow-x: auto;
}

/* Kopf, Inhalt und Fuß direkt aneinander. */
.wp-site-blocks > * {
	margin-block-start: 0;
}

/* ---------------------------------------------------------------
 * Kopfbereich
 * ------------------------------------------------------------- */
.ef-header {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.ef-header .wp-block-site-logo img {
	max-width: min(240px, 55vw);
	height: auto;
}

.ef-nav {
	font-weight: 600;
}

.ef-nav .wp-block-navigation-item__content {
	color: var(--wp--preset--color--dark);
}

.ef-nav .wp-block-navigation-item__content:hover,
.ef-nav .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	text-decoration-thickness: 2px !important;
	text-underline-offset: 6px;
}

/* ---------------------------------------------------------------
 * Layout: Inhalt + Seitenleiste
 * ------------------------------------------------------------- */
.ef-layout__main {
	min-width: 0;
}

.ef-layout__main > .wp-block-post-title {
	margin-top: 0;
}

.ef-featured img {
	border-radius: 22px;
}

.ef-meta {
	color: var(--wp--preset--color--muted);
}

/* ---------------------------------------------------------------
 * Schaubild (Startseite)
 * ------------------------------------------------------------- */
.ef-schaubild > * + * {
	margin-block-start: 40px;
}

.ef-hero {
	gap: 14px;
}

.ef-kicker {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--secondary);
}

.ef-kicker--small {
	font-size: 13px;
}

.ef-hero__title {
	margin: 0;
	font-size: clamp(2.25rem, 1.4rem + 2.6vw, 3.375rem);
	line-height: 1.05;
	font-weight: 800;
	color: var(--wp--preset--color--primary);
}

/* Karten */
.ef-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--wp--preset--color--surface);
	border-radius: 22px;
	box-shadow: 0 1px 2px rgba(11, 93, 102, .08);
}

.ef-card > * {
	margin-block-start: 0;
}

.ef-card .wp-block-image,
.ef-card .wp-block-post-featured-image {
	margin: 0;
}

.ef-card__image img {
	display: block;
	width: 100%;
	height: 230px;
	object-fit: cover;
}

.ef-card__body {
	padding: 28px;
}

.ef-card__body > * + * {
	margin-block-start: 18px;
}

/* Bildleiste */
.ef-gallery .wp-block-image {
	margin: 0;
}

.ef-gallery .wp-block-image img {
	display: block;
	width: 100%;
	height: 150px;
	object-fit: cover;
	border-radius: 14px;
}

/* Mitglieder-Aufruf */
.wp-block-columns.ef-cta {
	margin-bottom: 0;
	padding: 44px 48px;
	border-radius: 26px;
	background: var(--wp--preset--color--primary);
}

.ef-cta__title {
	margin: 0;
	font-size: clamp(1.5rem, 1.1rem + 1.2vw, 1.875rem);
	line-height: 1.25;
	font-weight: 800;
	color: var(--wp--preset--color--surface);
}

.ef-cta__text {
	margin: 0;
	font-size: 20px;
	line-height: 1.5;
	font-weight: 500;
	color: var(--wp--preset--color--on-primary);
}

.ef-cta__aside {
	border-left: 2px solid rgba(255, 255, 255, .35);
	padding-left: 40px;
}

.ef-cta .wp-block-button__link {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--dark);
}

.ef-cta .wp-block-button__link:hover {
	background: #FFCB5C;
	color: var(--wp--preset--color--dark);
}

@media (max-width: 781px) {
	.wp-block-columns.ef-cta {
		padding: 32px 24px;
	}

	.ef-cta__aside {
		border-left: 0;
		padding-left: 0;
		border-top: 2px solid rgba(255, 255, 255, .35);
		padding-top: 24px;
	}

	.ef-gallery .wp-block-image img {
		height: 120px;
	}
}

/* ---------------------------------------------------------------
 * Seitenleiste „Aktuelle Beiträge“
 * ------------------------------------------------------------- */
.ef-news__heading {
	margin: 0 0 18px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--wp--preset--color--soft);
	font-size: 18px;
	line-height: 1.3;
	font-weight: 800;
	color: var(--wp--preset--color--primary);
}

.ef-news .wp-block-post-template {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ef-news .wp-block-post-template > li {
	margin: 0;
}

.ef-news__item {
	overflow: hidden;
	background: var(--wp--preset--color--surface);
	border-radius: 14px;
	box-shadow: 0 1px 2px rgba(11, 93, 102, .08);
}

.ef-news__item > * {
	margin-block-start: 0;
}

.ef-news .wp-block-post-featured-image {
	margin: 0;
}

.ef-news .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	object-fit: cover;
}

.ef-news__body {
	padding: 14px 16px 16px;
}

.ef-news__body > * + * {
	margin-block-start: 8px;
}

.ef-news__title {
	margin: 0;
	font-size: 16px;
	line-height: 1.3;
	font-weight: 700;
}

.ef-news__title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.ef-news__title a:hover {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
}

.ef-news__empty {
	font-size: 15px;
	color: var(--wp--preset--color--muted);
}

/* „Weiter lesen“ – Seitenleiste und Beitragslisten */
.wp-block-read-more.ef-more {
	display: inline-block;
	font-size: 14px;
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.wp-block-read-more.ef-more::after {
	content: " \2192"; /* Pfeil nach rechts */
}

.wp-block-read-more.ef-more:hover {
	color: var(--wp--preset--color--dark);
	text-decoration: underline;
}

/* ---------------------------------------------------------------
 * Beitragslisten (Neuigkeiten, Archive, Suche)
 * ------------------------------------------------------------- */
.ef-post-card .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	object-fit: cover;
}

.ef-post-card__title {
	margin: 0;
	font-size: 22px;
	line-height: 1.25;
	font-weight: 800;
}

.ef-post-card__title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.ef-post-card__title a:hover {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
}

.ef-post-card__excerpt p {
	margin: 0;
}

/* ---------------------------------------------------------------
 * Fußbereich
 * ------------------------------------------------------------- */
.ef-footer a {
	color: var(--wp--preset--color--surface);
}

.ef-footer p {
	margin: 0;
}

/* ---------------------------------------------------------------
 * Inhaltsseiten (ohne Seitenleiste)
 * ------------------------------------------------------------- */
.ef-page-title {
	margin-top: 0;
	margin-bottom: 32px;
}

.ef-main .wp-block-post-content > * + * {
	margin-block-start: 1.2rem;
}

.ef-main .wp-block-post-content > .ef-box,
.ef-main .wp-block-post-content > .ef-grid,
.ef-main .wp-block-post-content > .ef-highlight,
.ef-main .wp-block-post-content > .ef-files,
.ef-main .wp-block-post-content > .wp-block-heading {
	margin-block-start: 40px;
}

.ef-lead {
	font-size: 20px;
	line-height: 1.5;
	font-weight: 500;
	color: var(--wp--preset--color--dark);
}

/* Infokarte */
.ef-box {
	padding: 28px;
	background: var(--wp--preset--color--surface);
	border-radius: 22px;
	box-shadow: 0 1px 2px rgba(11, 93, 102, .08);
}

.ef-box > * {
	margin-block: 0;
}

.ef-box > * + * {
	margin-block-start: 14px;
}

.ef-box h2,
.ef-box h3 {
	font-size: 22px;
	line-height: 1.25;
}

/* Hinweiskasten in Petrol */
.ef-highlight {
	padding: 32px 36px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--on-primary);
	border-radius: 22px;
}

.ef-highlight > * {
	margin-block: 0;
}

.ef-highlight > * + * {
	margin-block-start: 18px;
}

.ef-highlight strong,
.ef-highlight h2 {
	color: var(--wp--preset--color--surface);
}

.ef-highlight .wp-block-button__link {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--dark);
}

/* Personenkarten */
.ef-person {
	overflow: hidden;
	background: var(--wp--preset--color--surface);
	border-radius: 22px;
	box-shadow: 0 1px 2px rgba(11, 93, 102, .08);
}

.ef-person > * {
	margin-block: 0;
}

.ef-person .wp-block-image {
	margin: 0;
}

.ef-person .wp-block-image img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	object-position: center 20%;
}

.ef-person__body {
	padding: 20px 22px 24px;
}

.ef-person__body p {
	margin: 0;
}

.ef-person__body p + p {
	margin-top: 6px;
}

.ef-person__name {
	font-size: 20px;
	font-weight: 800;
	color: var(--wp--preset--color--contrast);
}

/* Downloads */
.ef-files {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ef-files > * {
	margin-block: 0;
}

.ef-files .wp-block-file {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 0;
	padding: 16px 20px;
	background: var(--wp--preset--color--surface);
	border-radius: 14px;
	box-shadow: 0 1px 2px rgba(11, 93, 102, .08);
	font-weight: 600;
}

.ef-files .wp-block-file > a:first-child {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.ef-files .wp-block-file > a:first-child::before {
	content: "PDF";
	display: inline-block;
	margin-right: 12px;
	padding: 3px 8px;
	border-radius: 6px;
	background: var(--wp--preset--color--soft);
	color: var(--wp--preset--color--primary);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .06em;
}

.ef-files .wp-block-file__button {
	flex: none;
	margin: 0;
	padding: 8px 18px;
	font-size: 15px;
}

@media (max-width: 600px) {
	.ef-files .wp-block-file {
		flex-direction: column;
		align-items: flex-start;
	}
}

.ef-highlight__title {
	font-size: clamp(1.375rem, 1.1rem + .8vw, 1.625rem);
	line-height: 1.25;
	font-weight: 800;
	color: var(--wp--preset--color--surface);
}

.ef-signature {
	font-weight: 700;
	color: var(--wp--preset--color--primary);
}

/* Download-Karten mit PDF-Vorschau */
.ef-file-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--wp--preset--color--surface);
	border-radius: 22px;
	box-shadow: 0 1px 2px rgba(11, 93, 102, .08);
}

.ef-file-card > * {
	margin-block: 0;
}

.ef-file-card__preview {
	margin: 0;
	padding: 20px 20px 0;
	background: var(--wp--preset--color--soft);
}

.ef-file-card__preview img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	object-position: top;
	border-radius: 8px 8px 0 0;
	box-shadow: 0 2px 10px rgba(11, 63, 70, .15);
	transition: transform .2s ease;
}

.ef-file-card__preview a:hover img,
.ef-file-card__preview a:focus-visible img {
	transform: translateY(-4px);
}

.ef-file-card .wp-block-file {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	flex: 1;
	margin: 0;
	padding: 18px 20px 22px;
	font-weight: 700;
	line-height: 1.35;
}

.ef-file-card .wp-block-file > a:first-child {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.ef-file-card .wp-block-file > a:first-child:hover {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
}

.ef-file-card .wp-block-file__button {
	margin: auto 0 0;
	padding: 8px 18px;
	font-size: 15px;
}

/* Platzhalter, wenn ein Beitrag kein Beitragsbild hat */
.wp-block-post-featured-image.ef-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin: 0;
	background: linear-gradient(135deg, var(--wp--preset--color--soft) 0%, #EEF7F7 55%, var(--wp--preset--color--base) 100%);
}

.wp-block-post-featured-image.ef-placeholder > a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.wp-block-post-featured-image.ef-placeholder img {
	width: auto !important;
	max-width: 62%;
	max-height: 62%;
	height: auto !important;
	object-fit: contain !important;
	padding: 10px 14px;
	background: #fff;
	border-radius: 12px !important;
	box-shadow: 0 1px 3px rgba(11, 93, 102, .12);
}

.ef-featured.ef-placeholder {
	border-radius: 22px;
	/* Gleicher Abstand nach oben wie bei einem echten Beitragsbild */
	margin-block-start: var(--wp--style--block-gap, 1.2rem);
}

/* Handy: Platzhalter im Format 4:3 wie die echten Beitragsbilder statt flachem 3:1-Streifen */
@media (max-width: 640px) {
	.ef-featured.ef-placeholder {
		aspect-ratio: 4 / 3 !important;
	}
}

/* „Weitere Beiträge“ */
.ef-load-more {
	display: flex;
	justify-content: center;
	margin-top: 40px;
}

.ef-load-more__button {
	cursor: pointer;
	border: 0;
}

.ef-load-more__button[disabled] {
	opacity: .7;
	cursor: progress;
}

.ef-posts .wp-block-query-pagination[hidden] {
	display: none !important;
}

/* Beitrittsformular (Seite „Mitglied werden“) */
.ef-form {
	margin-top: 32px;
}

.ef-form__privacy {
	margin: 0 0 24px;
	padding: 14px 18px;
	border-radius: 14px;
	background: var(--wp--preset--color--soft);
	font-size: 0.9375rem;
}

.ef-form__group {
	margin: 0 0 20px;
	padding: 22px 24px 8px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 18px;
	background: var(--wp--preset--color--surface);
	min-width: 0;
}

.ef-form__group legend {
	padding: 0 8px;
	margin-left: -8px;
	font-weight: 800;
	color: var(--wp--preset--color--primary);
}

.ef-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 20px;
}

.ef-form__grid--3 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ef-field--wide {
	grid-column: 1 / -1;
}

.ef-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 0 16px;
}

.ef-field label {
	font-size: 0.875rem;
	font-weight: 700;
}

.ef-req {
	color: #A4462B;
}

.ef-form input[type="text"],
.ef-form input[type="email"],
.ef-form input[type="date"],
.ef-form input[type="number"] {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid rgba(11, 93, 102, .35);
	border-radius: 10px;
	background: #fff;
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: 1rem;
}

.ef-form input:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--primary);
}

.ef-form.was-validated input:invalid {
	border-color: #A4462B;
	background: #FFF6F3;
}

.ef-field__msg {
	min-height: 0;
	color: #A4462B;
	font-size: 0.8125rem;
}

.ef-choice {
	margin: 0 0 14px;
}

.ef-choice label {
	cursor: pointer;
}

.ef-choice__main {
	display: block;
	padding-left: 26px;
	text-indent: -26px;
	font-weight: 700;
	line-height: 1.6;
}

.ef-choice__main > input[type="radio"] {
	margin-right: 8px !important;
	vertical-align: -3px;
}

.ef-choice__main .ef-amount__input {
	margin-left: 6px;
	text-indent: 0;
	vertical-align: middle;
}

.ef-choice__options {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 22px;
	margin: 10px 0 0 26px;
}

.ef-choice__options label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.ef-choice__options.is-disabled {
	opacity: .5;
}

.ef-form input[type="radio"] {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--wp--preset--color--primary);
}

.ef-amount__input {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 400;
}

.ef-form .ef-amount__input input {
	width: 6.5em;
	padding: 6px 10px;
}

.ef-form input:disabled {
	background: var(--wp--preset--color--base);
	cursor: not-allowed;
}

.ef-hint {
	color: var(--wp--preset--color--muted);
	font-size: 0.875rem;
}

.ef-form__group > .ef-hint {
	margin: 0 0 16px;
}

.ef-form__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 24px;
	margin-top: 28px;
}

.ef-form__actions button {
	cursor: pointer;
	border: 0;
}

.ef-form__actions button[disabled] {
	opacity: .7;
	cursor: progress;
}

.ef-form__status:not(:empty) {
	margin-top: 18px;
	padding: 14px 18px;
	border-radius: 14px;
	background: var(--wp--preset--color--soft);
}

.ef-form__status.is-error {
	background: #FFF1EC;
	color: #7A2E18;
}

.ef-form__steps {
	margin: 28px 0 0;
	padding-left: 1.4em;
	color: var(--wp--preset--color--muted);
}

@media (max-width: 640px) {
	.ef-form__grid,
	.ef-form__grid--3 {
		grid-template-columns: minmax(0, 1fr);
	}

	.ef-form__group {
		padding: 18px 16px 6px;
	}

	.ef-choice__options {
		margin-left: 0;
	}
}

.ef-amount__msg {
	margin: 6px 0 0 26px;
	font-weight: 600;
}

.ef-amount__msg:empty {
	display: none;
}

.ef-form .ef-amount__input input[aria-invalid="true"]:not(:disabled) {
	border-color: #A4462B;
	background: #FFF6F3;
}

/* Hinweis, solange das Skript den Button noch nicht freigeschaltet hat (erst nach 2 s sichtbar) */
.ef-form__wait {
	margin: 14px 0 0;
	color: var(--wp--preset--color--muted);
	font-size: 0.875rem;
	animation: ef-wait-in .3s ease 2s both;
}

@keyframes ef-wait-in {
	from { opacity: 0; }
	to { opacity: 1; }
}
