/*
Theme Name: TVG 1883
Theme URI: https://www.tvgimmeldingen.de
Author: TV 1883 Gimmeldingen e.V.
Description: Modernes Block-Theme für den TV 1883 Gimmeldingen e.V. – vollständig im Website-Editor anpassbar, ohne externe Schriften oder Tracking.
Version: 1.0.1
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tvg1883
*/

/* ---------- Grundlagen ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(a) { text-underline-offset: .18em; text-decoration-thickness: 1px; }
:where(a:hover) { text-decoration-thickness: 2px; }
::selection { background: var(--wp--preset--color--accent); color: #fff; }
:focus-visible { outline: 3px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* ---------- Header ---------- */
.tvg-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--wp--preset--color--base) 92%, transparent);
	backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.admin-bar .tvg-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tvg-header { top: 46px; } }
.tvg-header .wp-block-site-title { line-height: 1.05; }
.tvg-header .tvg-claim { line-height: 1.1; }
.tvg-header .wp-block-navigation .wp-block-navigation-item__content { padding: .35em .1em; }
.tvg-header .wp-block-navigation .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: 12px; padding: .5rem; box-shadow: 0 18px 40px -18px rgba(16,40,28,.35);
	min-width: 240px !important;
}
.tvg-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: .45em .75em; border-radius: 8px;
}
.tvg-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--mist);
}

/* ---------- Hero ---------- */
.tvg-hero { position: relative; isolation: isolate; }
.tvg-hero .wp-block-cover__inner-container { max-width: 1240px; }
.tvg-hero h1 { text-wrap: balance; }
.tvg-eyebrow {
	display: block; letter-spacing: .14em; text-transform: uppercase;
	font-weight: 700; font-size: .8rem;
}

/* ---------- Kennzahlen ---------- */
.tvg-stats > .wp-block-column { border-left: 2px solid var(--wp--preset--color--accent); padding-left: 1rem; }
.tvg-stats .tvg-stat-num { font-family: var(--wp--preset--font-family--display); font-weight: 700; line-height: 1; }

/* ---------- Karten ---------- */
.tvg-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 18px; overflow: hidden; height: 100%;
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tvg-card:hover { transform: translateY(-3px); box-shadow: 0 22px 40px -24px rgba(16,40,28,.45); border-color: transparent; }
.tvg-card .wp-block-image { margin: 0; }
.tvg-card .wp-block-image img { aspect-ratio: 16/10; object-fit: cover; width: 100%; display: block; background: var(--wp--preset--color--mist); }
.tvg-card h3 a { text-decoration: none; }
.tvg-card h3 a::after { content: " →"; color: var(--wp--preset--color--accent); }
.tvg-sport-grid { align-items: stretch; }

/* ---------- Trainingszeiten-Tabelle ---------- */
.wp-block-table.tvg-times table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .98rem; }
.wp-block-table.tvg-times thead { border: 0; }
.wp-block-table.tvg-times th {
	background: var(--wp--preset--color--primary); color: #fff; text-align: left;
	font-weight: 600; padding: .7rem .9rem; border: 0;
}
.wp-block-table.tvg-times th:first-child { border-top-left-radius: 12px; }
.wp-block-table.tvg-times th:last-child { border-top-right-radius: 12px; }
.wp-block-table.tvg-times td { padding: .7rem .9rem; border: 0; border-bottom: 1px solid var(--wp--preset--color--line); vertical-align: top; }
.wp-block-table.tvg-times tbody tr:nth-child(even) td { background: var(--wp--preset--color--mist); }
@media (max-width: 700px) {
	.wp-block-table.tvg-times thead { display: none; }
	.wp-block-table.tvg-times tr { display: block; border: 1px solid var(--wp--preset--color--line); border-radius: 12px; margin-bottom: .75rem; overflow: hidden; }
	.wp-block-table.tvg-times td { display: block; border-bottom: 0; padding: .35rem .9rem; }
	.wp-block-table.tvg-times td:first-child { background: var(--wp--preset--color--primary) !important; color: #fff; font-weight: 600; padding: .6rem .9rem; }
	.wp-block-table.tvg-times tbody tr:nth-child(even) td { background: transparent; }
}

/* ---------- Kontaktkarten ---------- */
.tvg-contact {
	border-radius: 14px; border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--base); height: 100%;
}
.tvg-contact p { margin: .15rem 0; }
.tvg-contact a { word-break: break-word; }

/* ---------- Info-Box ---------- */
.tvg-note { border-left: 4px solid var(--wp--preset--color--accent); border-radius: 0 12px 12px 0; }

/* ---------- Seitenkopf ---------- */
.tvg-pagehead { position: relative; overflow: hidden; }
.tvg-pagehead::after {
	content: ""; position: absolute; right: -80px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
	background: radial-gradient(circle, rgba(255,255,255,.10), transparent 65%); pointer-events: none;
}
.tvg-pagehead .wp-block-post-title { text-wrap: balance; }

/* ---------- Footer ---------- */
.tvg-footer a { color: inherit; text-decoration: none; }
.tvg-footer a:hover { text-decoration: underline; }
.tvg-footer .wp-block-navigation { --navigation-layout-direction: column; }

/* ---------- Beitragsliste ---------- */
.tvg-postlist .wp-block-post { border-bottom: 1px solid var(--wp--preset--color--line); padding-bottom: 1.5rem; }
.tvg-postlist .wp-block-post-featured-image img { border-radius: 14px; aspect-ratio: 16/10; object-fit: cover; }

/* ---------- Details/FAQ ---------- */
.wp-block-details { border: 1px solid var(--wp--preset--color--line); border-radius: 12px; padding: .9rem 1.1rem; }
.wp-block-details summary { font-weight: 600; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}

/* Header-Button auf kleinen Bildschirmen ausblenden (Menü hat genug Platz) */
@media (max-width: 900px) { .tvg-header-cta { display: none; } .tvg-claim { display: none; } }

/* ---------- Abschnitte & Hilfsklassen ---------- */
.tvg-pad { padding: 1.3rem 1.4rem 1.4rem; }
.tvg-section { padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--60); }
.tvg-section-s { padding-top: var(--wp--preset--spacing--50); padding-bottom: var(--wp--preset--spacing--50); }
.tvg-section-top0 { padding-top: 0; }
:where(.wp-block-post-content) > .alignfull { margin-top: 0; margin-bottom: 0; }
.tvg-sectionhead { margin-bottom: var(--wp--preset--spacing--40); }
.tvg-sectionhead h2 { margin-top: .25rem; }
.tvg-split { justify-content: space-between; align-items: flex-end; }
.tvg-lead { color: var(--wp--preset--color--primary-dark); line-height: 1.5; }
.tvg-rounded img { border-radius: 18px; }
.wp-block-post-content > .tvg-rounded img { aspect-ratio: 1500/430; object-fit: cover; }

/* Kacheln mit Kurzinfos */
.tvg-facts { gap: .75rem !important; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)) !important; }
.tvg-fact { border-radius: 14px; padding: .9rem 1.1rem; }
.tvg-fact p { margin: 0; }
.tvg-fact-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }

/* Kontakt-Raster */
.tvg-contact-grid { gap: 1rem !important; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)) !important; }
.tvg-contact-name { font-size: 1.08rem; }

/* Sportkarten */
.tvg-sportcard { display: flex; flex-direction: column; }
.tvg-sportcard h3 { margin: .35rem 0 .5rem; }
.tvg-sportcard p { margin: 0 0 .6rem; }
.tvg-sportcard .tvg-when { margin-top: auto; padding-top: .7rem; border-top: 1px dashed var(--wp--preset--color--line); }
.tvg-sport-grid { gap: 1.1rem !important; grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)) !important; }

/* Hero */
.tvg-hero .wp-block-cover__inner-container > * { max-width: 760px; margin-left: 0 !important; }
.tvg-hero .tvg-eyebrow { color: #ffc2b0 !important; }

.tvg-hero .wp-block-cover__background { background: linear-gradient(100deg, rgba(14,47,33,.95) 0%, rgba(14,47,33,.78) 45%, rgba(14,47,33,.35) 100%) !important; opacity: 1 !important; }

/* Galerie-Raster */
.tvg-gallery { gap: .9rem !important; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)) !important; }
.tvg-gallery .wp-block-image { margin: 0; }
.tvg-gallery img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }

/* Spendenkonto-Karte */
.tvg-bank { background: var(--wp--preset--color--mist); border: 0; max-width: 560px; }

/* Noch-zu-ergänzen-Hinweise: nur für angemeldete Redakteure deutlich, für Besucher dezent */
.tvg-todo { border-left-color: #e0a100; }
body:not(.logged-in) .tvg-todo { display: none; }

/* Outline-Buttons allgemein */
.wp-block-button.is-style-outline > .wp-block-button__link { border: 2px solid currentColor; background: transparent; color: var(--wp--preset--color--primary); }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--primary); color: #fff; border-color: var(--wp--preset--color--primary); }

/* Tabellen in Seiteninhalten etwas breiter als der Text */
.wp-block-post-content > .wp-block-table.tvg-times { margin-top: 1rem; margin-bottom: 2rem; }

/* Outline-Button im Hero (weiß auf dunkel) */
.tvg-hero .wp-block-button.is-style-outline > .wp-block-button__link { color: #fff; border-color: rgba(255,255,255,.8); background: transparent; }
.tvg-hero .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: #fff; color: var(--wp--preset--color--primary-dark); border-color: #fff; }
.tvg-rounded img { width: 100%; height: auto; }
.wp-block-columns .tvg-rounded img { aspect-ratio: 4/3; object-fit: cover; }
/* Raster-Feinschliff */
.tvg-sport-grid { grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)) !important; }
.tvg-gallery { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)) !important; }
.tvg-section .is-layout-grid:not(.tvg-sport-grid):not(.tvg-gallery) { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
@media (max-width: 900px) { .wp-block-buttons.tvg-header-cta { display: none !important; } }
@media (max-width: 781px) {
	.tvg-stats.wp-block-columns { display: grid !important; grid-template-columns: 1fr 1fr; gap: 1.5rem 1rem; }
}
.tvg-contact a[href^="mailto"] { font-size: .95rem; }
.tvg-plainlist { list-style: none; }

/* Logo: Wappen in fester Höhe */
.tvg-header .wp-block-site-logo img, .tvg-footer .wp-block-site-logo img { height: 52px !important; width: auto !important; }
.tvg-footer .wp-block-site-logo img { height: 46px !important; }

/* Tablet/kleiner Laptop: Hamburger-Menü statt Umbruch */
@media (min-width: 600px) and (max-width: 1180px) {
	.tvg-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
	.tvg-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none !important; }
	.tvg-header .wp-block-navigation__responsive-container.is-menu-open { display: flex !important; }
}
