/*
Theme Name: Berderhof Spargel
Theme URI: https://berderhof-spargel.de
Author: DIE DESIGNER
Description: Schlankes, schnelles Custom-Theme für den Spargelhof Berderhof. Bootstrap 5.3 + Gutenberg, kein Page-Builder. CI-Farben Blau (#0083d6) und Rot (#e30917), Schriften lokal. Inhalte werden im Block-Editor gepflegt.
Version: 1.5.3
Requires at least: 6.0
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: berderhof
*/

/* =========================================================
   0. RASTER – eine gemeinsame Schiene für Header, Inhalt und Footer
   Bootstraps .container (1140/1320px) und das Gutenberg-Raster (1180px)
   liefen vorher auseinander. Hier auf einen Wert gezogen.
   ========================================================= */
.navbar > .container,
footer.site-footer > .container {
  max-width: 1180px;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* =========================================================
   1. CI-FARBEN & GRUNDLAGEN
   CI: #0083d6 (Blau) · #e30917 (Rot)
   ========================================================= */
:root {
  --hof-blue:      #0083d6;   /* Primär: Buttons, Links */
  --hof-blue-band: #005B96;   /* Band-Hintergrund (Kontrast für Fließtext) */
  --hof-blue-deep: #004a7c;   /* Footer, Hover */
  --hof-red:       #e30917;   /* Akzent */

  --hof-line:      #e3e7ea;   /* Linien, Rahmen */
  --hof-soft:      #f1f5f8;   /* helles Band */
  --hof-bg:        #fbfcfd;   /* Grundfläche */
  --hof-ink:       #1c2229;   /* Text */

  --bs-body-font-family: 'Mulish', system-ui, sans-serif;
  --bs-body-color: var(--hof-ink);
  --bs-body-bg: var(--hof-bg);
  --bs-primary: #0083d6;
  --bs-primary-rgb: 0,131,214;
}

body { font-family: var(--bs-body-font-family); color: var(--hof-ink); background: var(--hof-bg); }

/* Display-Schrift: Leckerli One – nur H1/H2 */
h1, h2, .display-font {
  font-family: 'Leckerli One', 'Brush Script MT', cursive;
  font-weight: 400; letter-spacing: 0; line-height: 1.2;
}
/* H3 und tiefer in der ruhigen Sans */
h3, h4, h5, h6 {
  font-family: 'Mulish', system-ui, sans-serif;
  font-weight: 700; letter-spacing: -0.01em;
}

a { color: var(--hof-blue); }
a:hover { color: var(--hof-blue-deep); }
:focus-visible { outline: 3px solid var(--hof-red); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* =========================================================
   2. HEADER / NAVIGATION
   ========================================================= */
.navbar {
  background: rgba(251,252,253,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hof-line);
}

/* Logo (über Customizer → Website-Identität) */
.navbar .custom-logo-link { display: inline-block; }
.navbar .custom-logo { max-height: 60px; width: auto; height: auto; }
@media (max-width: 575.98px) { .navbar .custom-logo { max-height: 46px; } }

/* Fallback-Schriftzug, wenn kein Logo gesetzt ist */
.navbar .navbar-brand.brand-text {
  font-family: 'Leckerli One', cursive; font-weight: 400;
  font-size: 1.6rem; color: var(--hof-blue);
}
.navbar .navbar-brand.brand-text span { color: var(--hof-red); }

.navbar .navbar-nav li { list-style: none; }
.navbar .navbar-nav li a {
  display: block; padding: .5rem .9rem; font-weight: 600;
  color: var(--hof-ink); text-decoration: none; white-space: nowrap;
}
.navbar .navbar-nav li a:hover,
.navbar .navbar-nav li a:focus,
.navbar .navbar-nav li.current-menu-item > a { color: var(--hof-blue); }

/* Untermenüs als Dropdown */
.navbar .navbar-nav > li { position: relative; }
.navbar .navbar-nav .sub-menu {
  display: none; position: absolute; top: 100%; left: 0;
  min-width: 230px; margin: 0; padding: .5rem 0;
  background: #fff; border: 1px solid var(--hof-line); border-radius: 4px;
  box-shadow: 0 14px 34px -16px rgba(0,74,124,.4); z-index: 1000;
}
.navbar .navbar-nav > li:hover > .sub-menu,
.navbar .navbar-nav > li:focus-within > .sub-menu { display: block; }
.navbar .navbar-nav .sub-menu li a { padding: .5rem 1rem; }
@media (max-width: 991.98px) {
  .navbar .navbar-nav .sub-menu {
    display: block; position: static; border: none; box-shadow: none;
    padding-left: 1rem; background: transparent;
  }
}

/* =========================================================
   3. BUTTONS
   ========================================================= */
.btn-hof {
  background: var(--hof-blue); color: #fff; border: none;
  font-weight: 600; border-radius: 2px; padding: .6rem 1.4rem;
}
.btn-hof:hover, .btn-hof:focus { background: var(--hof-blue-deep); color: #fff; }

/* =========================================================
   4. SAISON-BAND (CI-Rot)
   ========================================================= */
.season-ribbon {
  background: var(--hof-red); color: #fff;
  font-weight: 600; letter-spacing: .02em;
}

/* =========================================================
   5. GUTENBERG-INHALT
   ========================================================= */

/* Inhaltsbreite (Gutenberg liefert keinen Container mit) */
.site-main > * {
  max-width: 820px; margin-left: auto; margin-right: auto;
  padding-left: 1.25rem; padding-right: 1.25rem;
}
.site-main > .alignwide { max-width: 1180px; }

/* Farbige Bänder laufen voll durch, ihr Inhalt sitzt auf derselben Schiene.
   Wichtig: Padding gehört an die KINDER, nicht an die Gruppe – sonst sind die
   Band-Inhalte 40px breiter als die Blöcke auf oberster Ebene. */
.site-main > .wp-block-group {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}
.site-main > .wp-block-group > * {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
.site-main > .wp-block-group > .alignwide { max-width: 1180px; }

/* Bänder */
.wp-block-group.has-hof-sand-soft-background-color { background: var(--hof-soft); }
.wp-block-group.has-hof-green-background-color { background: var(--hof-blue-band); color: #fff; }
.wp-block-group.has-hof-green-background-color h1,
.wp-block-group.has-hof-green-background-color h2,
.wp-block-group.has-hof-green-background-color h3,
.wp-block-group.has-hof-green-background-color a { color: #fff; }

/* Roter Akzentstrich unter H2 – CI-Signatur */
.site-main h2::after {
  content: ""; display: block; width: 48px; height: 3px;
  background: var(--hof-red); margin-top: .6rem;
}
.site-main h2.has-text-align-center::after { margin-left: auto; margin-right: auto; }
.has-hof-green-background-color h2::after { background: #fff; }

/* Spalten */
.site-main .wp-block-columns { align-items: center; gap: 3rem; }
.site-main h2 { margin-bottom: 1.25rem; }
.site-main h3 { margin-bottom: .5rem; }
.site-main p { line-height: 1.75; }

/* Bilder – einheitliches Format 3:2 für alle Inhaltsbilder.
   Egal welches Ausgangsformat (Panorama, Hochformat, quadratisch): Das Theme
   schneidet mittig auf 3:2 zu. So sitzt jedes neue Bild automatisch richtig. */
.site-main .wp-block-image img { border-radius: 4px; }

.site-main .wp-block-columns .wp-block-image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  height: auto;
}

/* Bild in den Sortiment-Kacheln: oben bündig, gleiche Höhe */
.site-main .card-image { margin: 0; }
.site-main .card-image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 4px 4px 0 0;
  margin-bottom: 1.25rem;
}

/* Kacheln gleich hoch */
.site-main .wp-block-columns:has(.card-image) .wp-block-column { display: flex; }
.site-main .wp-block-column > .wp-block-group.has-background { width: 100%; height: 100%; border-radius: 4px; overflow: hidden; }

/* Hero-Bild mit Tiefe */
.site-main > .wp-block-columns:first-of-type .wp-block-image img {
  box-shadow: 0 24px 50px -24px rgba(0,74,124,.45);
}

/* Ausnahme: Restaurant-Logo nicht zuschneiden */
.site-main .wp-block-columns .wp-block-image img[src*="landwirtschaft"] {
  aspect-ratio: auto;
  object-fit: contain;
  max-height: 200px;
  width: auto;
  border-radius: 0;
  box-shadow: none;
}

/* Ausnahme: volle Breite (z. B. Saison-Bild) darf flacher sein */
.site-main .wp-block-image.alignwide img {
  aspect-ratio: 21 / 9;
  object-fit: cover;
  width: 100%;
}

/* Ausnahme: Karten / Anfahrtsskizzen / Deko-Grafiken NIE zuschneiden – jedes
   Detail muss sichtbar bleiben. Greift per Klasse oder Dateiname. Höhere
   Spezifität (.wp-block-columns) und !important, damit es die 3:2-Spaltenregel
   sicher schlägt. */
.site-main .wp-block-image img.is-map,
.site-main .wp-block-columns .wp-block-image img.is-map,
.site-main .wp-block-image img[src*="anfahrt"],
.site-main .wp-block-columns .wp-block-image img[src*="anfahrt"],
.site-main .wp-block-image img[src*="skizze"],
.site-main .wp-block-columns .wp-block-image img[src*="skizze"],
.site-main .wp-block-image img[src*="natur"],
.site-main .wp-block-columns .wp-block-image img[src*="natur"],
.site-main .wp-block-image img[src*="lageplan"] {
  aspect-ratio: auto !important;
  object-fit: contain !important;
  height: auto !important;
  width: 100% !important;
  max-width: 100%;
}

/* Anfahrtsskizze (rechteckig): mit Rahmen-Optik */
.site-main .wp-block-image img[src*="anfahrt"],
.site-main .wp-block-image img[src*="skizze"],
.site-main .wp-block-image img[src*="lageplan"] {
  border-radius: 6px;
  box-shadow: 0 20px 45px -25px rgba(0,74,124,.4);
}

/* Transparente Deko-Grafik (Natur): kein Rahmen, kein Schatten */
.site-main .wp-block-image img.is-map,
.site-main .wp-block-image img[src*="natur"] {
  border-radius: 0;
  box-shadow: none;
}

/* Kacheln (Sortiment) */
.site-main .wp-block-column > .wp-block-group.has-background { height: 100%; border-radius: 4px; }

/* Buttons im Content – gleiche Maße für gefüllt und Outline.
   WordPress-Core gibt Outline-Buttons eigenes Padding + 2px Rahmen (calc(.667em + 2px)),
   dieser Selektor ist spezifischer. Deshalb hier explizit gleichsetzen. */
.wp-block-button__link {
  border-radius: 2px; font-weight: 600;
  padding: .6rem 1.4rem;
  border: 1.5px solid transparent;   /* gleiche Gesamthöhe wie Outline */
  line-height: 1.5;
}
.wp-block-button.is-style-outline > .wp-block-button__link,
.wp-block-button.is-style-outline .wp-block-button__link {
  padding: .6rem 1.4rem;
  border: 1.5px solid var(--hof-blue);
  color: var(--hof-blue);
  background: transparent;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--hof-blue); color: #fff; }
.has-hof-green-background-color .wp-block-button.is-style-outline .wp-block-button__link {
  border-color: #fff; color: #fff;
}
.has-hof-green-background-color .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: #fff; color: var(--hof-blue-band);
}
/* Buttons in einer Reihe gleich hoch */
.wp-block-buttons { align-items: stretch; }
.wp-block-buttons > .wp-block-button { display: flex; }
.wp-block-buttons > .wp-block-button > .wp-block-button__link { display: inline-flex; align-items: center; }

/* Öffnungszeiten-Tabelle auf dem Farbband */
.has-hof-green-background-color .wp-block-table table { color: #fff; border-collapse: collapse; width: 100%; }
/* WordPress setzt die Streifen auf die ZEILE – hier überschreiben, sonst hell auf hell */
.has-hof-green-background-color .wp-block-table.is-style-stripes tbody tr,
.has-hof-green-background-color .wp-block-table tbody tr { background-color: transparent !important; }
.has-hof-green-background-color .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
  background-color: rgba(255,255,255,.12) !important;
}
.has-hof-green-background-color .wp-block-table td {
  border: none; border-bottom: 1px dashed rgba(255,255,255,.28);
  padding: .75rem .9rem; background: transparent !important; color: #fff;
}
.has-hof-green-background-color .wp-block-table td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }

/* Hinweis „Geöffnet nur während der Spargelsaison" mit Info-Icon hervorheben */
.has-hof-green-background-color .wp-element-caption {
  color: #fff;
  text-align: left;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 600;
  font-size: .95rem;
  background: rgba(255,255,255,.10);
  border-left: 3px solid var(--hof-red);
  border-radius: 0 3px 3px 0;
  padding: .65rem .9rem;
}
.has-hof-green-background-color .wp-element-caption::before {
  content: "";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 4.75a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5zM13.25 17h-2.5v-6h2.5v6z'/%3E%3C/svg%3E") no-repeat center/contain;
}

/* FAQ – core/details als Akkordeon */
.wp-block-details {
  background: #fff; border: 1px solid var(--hof-line); border-radius: 4px;
  padding: 1rem 1.25rem; margin-bottom: .75rem; max-width: 820px;
}
.wp-block-details summary {
  font-weight: 700; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: "+"; color: var(--hof-red); font-size: 1.4rem; line-height: 1; }
.wp-block-details[open] summary::after { content: "–"; }
.wp-block-details[open] summary { margin-bottom: .75rem; }

@media (max-width: 781px) {
  .site-main .wp-block-columns { gap: 2rem; }
  .site-main > .wp-block-group { padding-top: 3rem; padding-bottom: 3rem; }
}

/* =========================================================
   6. FOOTER
   ========================================================= */
footer.site-footer { background: var(--hof-blue-deep); color: #d6e4ef; padding: 3rem 0 1.5rem; }
footer.site-footer a { color: #fff; text-decoration: none; }
footer.site-footer a:hover { text-decoration: underline; }

/* Logo in Weiß */
footer.site-footer .footer-logo { max-width: 210px; width: 100%; height: auto; }
@media (max-width: 767.98px) { footer.site-footer .footer-logo { max-width: 170px; } }

/* Unterüberschriften: kein Uppercase, ruhige Sans */
footer.site-footer .footer-heading {
  font-family: 'Mulish', system-ui, sans-serif;
  font-size: 1rem; font-weight: 700; letter-spacing: 0;
  text-transform: none; color: #fff; margin-bottom: .75rem;
}

/* Seiteninhalt (page.php) */
.entry-content { max-width: 820px; }
.entry-content h2 { margin-top: 2rem; }


/* =========================================================
   7. SAISON-POPUP  (eigenständig, ohne Bootstrap-JS)
   ========================================================= */
/* Overlay – abgedunkelter Hintergrund über der ganzen Seite */
.season-modal {
  position: fixed; inset: 0; z-index: 1080;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: rgba(0, 30, 55, .55);
  backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .3s ease;
}
.season-modal.is-visible { opacity: 1; }
.season-modal[hidden] { display: none; }
body.season-modal-open { overflow: hidden; }

/* Dialog-Karte */
.season-modal__dialog {
  position: relative;
  width: 100%; max-width: 560px;
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,74,124,.5);
  transform: translateY(16px) scale(.96);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.season-modal.is-visible .season-modal__dialog { transform: translateY(0) scale(1); }

/* Kopfzone in ruhigem Sand – hebt Status + Überschrift ab */
.season-modal__header {
  background: linear-gradient(180deg, #f3ead9 0%, #f7f0e3 100%);
  padding: 2.25rem 2.25rem 1.75rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

/* Status als kompakte Plakette statt lautem Vollband */
.season-modal__pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  font-size: .8rem; font-weight: 700; letter-spacing: .01em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 1rem;
}
.season-modal__pill.is-open   { background: #1f7a3d; }
.season-modal__pill.is-closed { background: var(--hof-red); }
.season-modal__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #fff; flex: 0 0 auto;
}
.season-modal__pill.is-open .season-modal__dot { animation: hof-pulse 1.8s ease-in-out infinite; }
@keyframes hof-pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
  .season-modal, .season-modal__dialog { transition: none; }
  .season-modal__pill.is-open .season-modal__dot { animation: none; }
}

.season-modal__close {
  position: absolute; top: 1.1rem; right: 1.1rem;
  width: 2.1rem; height: 2.1rem; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: rgba(0,0,0,.06);
  color: var(--hof-ink); font-size: 1.4rem; line-height: 1;
  cursor: pointer; transition: background .15s ease, color .15s ease;
}
.season-modal__close:hover { background: var(--hof-red); color: #fff; }

.season-modal__headline {
  font-family: 'Leckerli One', cursive; font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 1.9rem); line-height: 1.2;
  color: var(--hof-blue-deep); margin: 0;
}
.season-modal__headline::after { content: none; }

.season-modal__body { padding: 1.75rem 2.25rem 2.25rem; }

.season-modal__text p { margin-bottom: .6rem; line-height: 1.7; color: var(--hof-ink); }
.season-modal__text p:last-child { margin-bottom: 0; }

.season-modal__contact {
  margin-top: 1.5rem; padding: 1.1rem 1.35rem;
  background: var(--hof-soft); border-radius: 10px;
  font-size: .95rem;
}
.season-modal__contact p { display: flex; flex-direction: column; }
.season-modal__contact-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; color: var(--hof-blue-deep); opacity: .7;
}
.season-modal__contact a { font-weight: 600; font-size: 1.05rem; }

.season-modal__actions {
  display: flex; flex-wrap: wrap; gap: .75rem;
  margin-top: 1.75rem;
}
.season-modal__actions .btn-hof-outline {
  background: transparent; color: var(--hof-blue);
  border: 1.5px solid var(--hof-blue); font-weight: 600;
  border-radius: 8px; padding: .6rem 1.4rem;
}
.season-modal__actions .btn-hof-outline:hover { background: var(--hof-blue); color: #fff; }
.season-modal__actions .btn-hof { border-radius: 8px; }
