/*
Theme Name: Ar e Mar
Description: Block-Theme für Ar e Mar, Aljezur. Testaufbau: HTML-Mockup nach Gutenberg.
Version: 17.0
Requires at least: 6.6
Requires PHP: 7.4
Author: Capricorn Conversion
Text Domain: ar-e-mar
*/

:root {
  --aem-rule: var(--wp--preset--color--rule);
  --aem-rule-soft: var(--wp--preset--color--rule-soft);
  --aem-muted: var(--wp--preset--color--muted);
  --aem-clay: var(--wp--preset--color--clay);
  --aem-action: var(--wp--preset--color--action);
  --aem-accent: var(--wp--preset--color--accent);
  --aem-max: 1116px;
  --aem-pad: clamp(20px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
body { -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }
img { display: block; max-width: 100%; height: auto; } /* global: Plugin-Ausgaben (z. B. Wohnungsbilder) laufen sonst über */

/* Top-level-Abstände kontrollieren wir selbst, nicht über blockGap */
.wp-site-blocks > *,
.aem-main > *,
.wp-block-post-content > * { margin-block-start: 0; margin-block-end: 0; }
.editor-styles-wrapper .is-root-container > *,
.editor-styles-wrapper .wp-block-post-content > * { margin-block-start: 0; margin-block-end: 0; }

h1.wp-block-heading { max-width: 19ch; }

/* Elemente mit eigener Maximalbreite in einem constrained-Layout links an der
   Inhaltskante ausrichten, statt sie zu zentrieren */
.is-layout-constrained > h1.wp-block-heading,
.is-layout-constrained > .is-style-intro,
.is-layout-constrained > .is-style-quote,
.is-layout-constrained > .aem-col {
  margin-left: max(0px, calc((100% - var(--wp--style--global--content-size)) / 2)) !important;
  margin-right: auto !important;
}

/* ============ Absatz-Stile ============ */
.is-style-label {
  font-family: var(--wp--preset--font-family--sans);
  font-weight: 200; font-size: 10.5px; line-height: 1.8;
  text-transform: uppercase; letter-spacing: .28em;
  color: var(--aem-clay);
  margin-bottom: 0;
}
* + .is-style-label { margin-block-start: 0; }
.is-style-label + * { margin-block-start: 20px; }

.is-style-intro { color: var(--aem-muted); max-width: 640px; }
h2 + .is-style-intro { margin-block-start: 18px; }

.is-style-quote {
  font-family: var(--wp--preset--font-family--serif);
  font-weight: 300; font-size: 29px; line-height: 1.4;
  color: var(--aem-clay); max-width: 22ch;
}
.is-style-quote + p { margin-block-start: 34px; }

.is-style-small-muted { font-size: 14.5px; line-height: 1.7; color: var(--aem-muted); }

/* Link mit gezeichneter Linie (über background, damit der Link nicht position:relative braucht) */
.is-style-more a {
  display: inline-block; padding-bottom: 2px;
  color: var(--aem-action); text-decoration: none; font-size: 14.5px;
  background: linear-gradient(var(--aem-accent), var(--aem-accent)) left bottom / 0 1px no-repeat;
  transition: background-size .3s ease;
}
.is-style-more a:hover,
.aem-card:hover .is-style-more a { background-size: 100% 1px; }

/* Ganze Karte klickbar: der Link im "more"-Absatz spannt sich über die Karte */
.aem-card { position: relative; transition: opacity .2s ease; }
.aem-card:hover { opacity: .8; }
.aem-card .is-style-more a::after { content: ""; position: absolute; inset: 0; z-index: 1; }

/* Logo-Schrift */
.aem-logo, .is-style-logo-small {
  font-family: var(--wp--preset--font-family--hand);
  word-spacing: -.2em; letter-spacing: .01em; line-height: 1;
}
.aem-logo { font-size: 27px; margin: 0; }
.aem-logo a { text-decoration: none; color: inherit; }
.is-style-logo-small { font-size: 19px; color: var(--aem-muted); margin: 0; }
.aem-unit__meta .is-style-logo-small { line-height: 30.6px; }

/* ============ Sektionen ============ */
.is-style-sec,
.is-style-sec-surface { padding-top: 112px; padding-bottom: 112px; }
.is-style-sec-tight { padding-top: 72px; padding-bottom: 72px; }
.is-style-sec-tight-clay { padding-top: 56px; padding-bottom: 56px; }
.is-style-sec-surface { background: var(--wp--preset--color--surface); }
.is-style-sec-tight-clay { background: var(--wp--preset--color--clay-band); border-top: 1px solid var(--aem-rule); }
/* Kontrast (WCAG AA 4,5:1) auf dem dunkleren Clay-Band: Textfarben dort je um so viel dunkler, wie nötig (P59). */
.is-style-sec-tight-clay, .is-style-sec-clay {
  --wp--preset--color--muted: #645C53; --aem-muted: #645C53;
  --wp--preset--color--clay: #84521B; --aem-clay: #84521B;
  --wp--preset--color--clay-deep: #835228;
}

[class*="is-style-sec"] + [class*="is-style-sec"] { border-top: 1px solid var(--aem-rule); }

.aem-sec-head { margin-bottom: 52px; }
.aem-sec-head > * { margin-block-end: 0; }
.aem-sec-head > :first-child { margin-block-start: 0; }

/* Bildformate */
.aem-ratio-32 img { aspect-ratio: 3 / 2; width: 100%; height: auto; object-fit: cover; }
.aem-ratio-23 img { aspect-ratio: 2 / 3; width: 100%; height: auto; object-fit: cover; }
.wp-block-image { margin: 0; }

/* Platzhalterfläche */
.aem-ph {
  background: var(--wp--preset--color--placeholder); aspect-ratio: 3 / 2; display: flex; align-items: flex-end;
}
.aem-ph > p {
  margin: 0; padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; color: #9B8B72;
}

/* ============ Header ============ */
.aem-hdr { border-bottom: 1px solid var(--aem-rule); background: var(--wp--preset--color--page); }
.aem-hdr__in { padding-top: 22px; padding-bottom: 22px; gap: 24px; }
.aem-hdr__nav { gap: 34px; }
.aem-hdr .wp-block-navigation { gap: 34px; font-size: 14.5px; }
.aem-hdr .wp-block-navigation-item__content {
  text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.aem-hdr .wp-block-navigation-item__content:hover { border-color: var(--aem-accent); }
.aem-hdr .current-menu-item > .wp-block-navigation-item__content { border-color: var(--aem-action); }
/* Burger statt „MENU“ (bewusste Abweichung vom Mockup, P43): drei Linien 22 × 2 px im Abstand von 7 px, Farbe = Text,
   Tippfläche 44 × 44 px; rechts um 11 px in den Rand gezogen, damit die Linien mit dem Seitenrand abschließen.
   Offen (Navigation enthält .is-menu-open) werden die Linien zum Kreuz. */
.aem-hdr .wp-block-navigation__responsive-container-open.aem-burger {
  position: relative; width: 44px; height: 44px; margin: -11px -11px -11px 0; padding: 0;
  font-size: 0; color: var(--wp--preset--color--text); background: transparent; border: 0; cursor: pointer;
}
.aem-burger::before, .aem-burger::after {
  content: ""; position: absolute; left: 11px; width: 22px; height: 2px; top: 21px;
  background: currentColor; transition: transform .2s ease, box-shadow .2s ease;
}
.aem-burger::before { box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor; }
.aem-burger::after { opacity: 0; }
.aem-hdr .wp-block-navigation:has(.is-menu-open) .aem-burger::before { box-shadow: none; transform: rotate(45deg); }
.aem-hdr .wp-block-navigation:has(.is-menu-open) .aem-burger::after { opacity: 1; transform: rotate(-45deg); }
.aem-burger:focus-visible { outline: 2px solid var(--aem-action); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .aem-burger::before, .aem-burger::after { transition: none; } }
.aem-hdr .wp-block-navigation .aem-nav-cta { display: none; }
.aem-hdr .is-menu-open .aem-nav-cta { display: block; width: 100%; margin-top: 6px; }
.aem-hdr .is-menu-open .aem-nav-cta > .wp-block-navigation-item__content {
  display: block; text-align: center; padding: 13px 26px; border-radius: 2px; line-height: 1.8; letter-spacing: .06em;
  background: var(--aem-action); color: var(--wp--preset--color--surface); border: 0;
}
.aem-hdr .wp-block-navigation__responsive-container.is-menu-open {
  background: var(--wp--preset--color--page); color: var(--wp--preset--color--text);
}

/* ============ Hero ============ */
.wp-block-columns.aem-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
  gap: 0 clamp(48px, 5vw, 80px); margin-block: 0; align-items: center;
}
.wp-block-columns.aem-hero > .wp-block-column { flex: none; width: auto; min-width: 0; }
.aem-hero > .aem-hero__text {
  flex-basis: 0; flex-grow: 1;
  padding: clamp(80px, 9vw, 124px) 0 clamp(80px, 9vw, 124px)
           max(32px, calc((100vw - var(--aem-max)) / 2)); /* Mockup .hero__text: fest 32px, nicht der Seitenrand */
}
.aem-hero > .aem-hero__img { flex-basis: 0; flex-grow: 1.04; align-self: stretch; display: flex; }
.aem-hero__img .wp-block-image { flex: 1; display: flex; }
.aem-hero__img img {
  width: 100%; height: 100%; min-height: clamp(460px, 62vh, 640px); object-fit: cover;
}
h1.wp-block-heading.aem-hero__h1 { max-width: 13ch; }
.aem-hero__text > .is-style-label + .aem-hero__h1 { margin-block-start: 26px; }
.aem-hero__copy { margin-block-start: 30px !important; max-width: 46ch; }
.aem-hero__copy + p { margin-block-start: 6px; max-width: 46ch; }
.aem-hero__actions { margin-block-start: 38px !important; gap: 22px; }
.aem-hero__price { font-size: 14.5px; line-height: 1.7; color: var(--aem-muted); max-width: 34ch; margin: 0; }

/* ============ Fahrzeiten-Leiste ============ */
.aem-today { padding-top: clamp(72px, 7vw, 104px); padding-bottom: clamp(72px, 7vw, 104px); }
.aem-today__in { max-width: 1100px; gap: 22px clamp(22px, 2.6vw, 40px) !important; }
.aem-today__cell { position: relative; gap: 10px !important; align-items: baseline !important; }
.aem-today__cell > * { margin: 0; }
.aem-today__cell .is-style-label { color: var(--aem-muted); letter-spacing: .24em; font-size: 11px; }
.aem-today__v {
  font-family: var(--wp--preset--font-family--serif); font-weight: 300;
  font-size: clamp(26px, 2.2vw, 32px); line-height: 1;
}
.aem-today__v a { color: var(--aem-action); text-decoration: none; }
.aem-today__v a::after { content: ""; position: absolute; inset: 0; }
/* Einheit erbt die Serifenschrift des Werts wie im Mockup (.today__u); vorher Mulish → Zellen 1,6 px breiter (P26) */
.aem-today__v em { font-style: normal; font-size: 13px; color: var(--aem-accent); margin-left: 4px; }
.aem-today__cell:hover .aem-today__v a { color: var(--wp--preset--color--action-hover); }
.aem-today__note {
  max-width: 576px; margin: 28px auto 0 !important;
  font-size: 12.5px; color: var(--aem-muted); text-align: center;
}
.aem-today + .is-style-sec { padding-top: 0; }

/* ============ Slider ============ */
.aem-slider {
  display: flex; gap: 32px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; padding-bottom: 4px;
}
.aem-slider::-webkit-scrollbar { display: none; }
.aem-slider > * { margin: 0 !important; }
.aem-unit { flex: 0 0 calc(50% - 16px); scroll-snap-align: start; }
.aem-slider > .aem-unit:last-child { scroll-snap-align: end; }
.aem-unit > * { margin-block: 0; }
.aem-unit__meta {
  position: relative; padding: 36px 0 14px; /* Mockup 37px; −1 px gleicht den Grundlinien-Versatz des Logos aus (P28) */ border-bottom: 1px solid var(--aem-rule);
  gap: 16px; align-items: baseline !important;
}
.aem-unit__meta::before {
  content: ""; position: absolute; left: 0; top: 0; width: 26px; height: 3px;
  background: var(--aem-swatch, var(--aem-clay));
}
.aem-unit__meta h3 { margin: 3px 0 0; } /* Mockup 2px, +1 px Ausgleich zu padding-top (P28) */
.aem-unit__meta > * { margin: 0; }
.aem-unit__price { font-size: 14.5px; color: var(--aem-muted); white-space: nowrap; }
.aem-unit__facts { margin-block: 1em !important; padding-top: 14px; font-size: 14.5px; line-height: 1.7; color: var(--aem-muted); }
/* 25.5 statt 28.5 px: Der 14,5-px-Link sitzt in einer 30,6-px-Zeile (17 px × 1.8) rund 3 px tiefer
   als im Mockup, wo die Zeile 26,1 px hoch ist. Gemessen: Grundlinie Beschreibung → Link 54,14 px wie im Mockup (P25). */
.aem-unit .is-style-more { margin-top: 25.5px !important; }
.aem-swatch-pine { --aem-swatch: var(--wp--preset--color--pine); }
.aem-swatch-sage { --aem-swatch: var(--wp--preset--color--sage); }
.aem-swatch-clay { --aem-swatch: var(--wp--preset--color--clay); }
.aem-unit.is-soon { opacity: .62; }

.aem-slider__nav { display: flex; gap: 10px; margin-top: 32px; }
.aem-sldbtn {
  width: 38px; height: 38px; border: 1px solid var(--wp--preset--color--muted);
  border-color: var(--wp--preset--color--outline); background: transparent; border-radius: 2px; cursor: pointer;
  color: var(--wp--preset--color--text); font-size: 14px; line-height: 1;
  font-family: "Mulish", sans-serif; font-weight: 400; padding: 0; transition: border-color .2s ease;
}
.aem-sldbtn:hover { border-color: var(--wp--preset--color--text); }
.aem-sldbtn:disabled { opacity: .35; cursor: default; }
.aem-sldbtn:disabled:hover { border-color: var(--wp--preset--color--outline); }

/* ============ Themenkarten ============ */
.wp-block-columns.aem-spokes { gap: 32px; margin-block: 8px 0; } /* Mockup .spokes margin-top 8px (kollabiert auf der Startseite mit dem Sektionskopf) */
.aem-spokes h3 { margin: 18px 0 0; }
.aem-spokes h3 + p { margin-top: 8px; }
.aem-spokes .is-style-more { margin-top: 9px; }

/* ============ Über uns ============ */
.wp-block-columns.aem-about { gap: 64px; margin-block: 0; align-items: flex-start; }
.aem-about .wp-block-column > * { margin-block-start: 0 !important; }
.aem-about p { max-width: 56ch; margin-bottom: 20px; }
.aem-about .is-style-label { margin-bottom: 20px; }
.aem-about .is-style-quote { max-width: 56ch; margin-bottom: 20px; }
.aem-about .wp-block-column > .aem-sig { margin-top: 34px !important; }
.aem-about .aem-sig > p { margin: 0; }
.aem-sig__names { font-family: var(--wp--preset--font-family--hand); font-size: 25px; line-height: 1.8; }
.aem-about .aem-sig > p.aem-sig__role { font-size: 12.5px; color: var(--aem-muted); margin-top: 4px; }

/* ============ Buchungsband ============ */
.aem-avail { gap: 48px; }
.aem-avail > .wp-block-group > * { margin-block: 0; }
/* Mockup .avail: grid 1fr auto – Textspalte nimmt die freie Breite (wichtig, wenn darin eine Nummernliste steht) */
.aem-avail > .wp-block-group:first-child { flex: 1 1 0; min-width: 0; }
/* Ohne Button bleibt im Mockup-Grid die leere zweite Spalte samt 48px Lücke stehen – Textspalte entsprechend schmaler */
@media (min-width: 901px) { .aem-avail > .wp-block-group:only-child { flex: 0 1 calc(100% - 48px); } }
.aem-avail h2 { margin-top: 20px !important; }
.aem-avail h2 + p { margin-top: 14px !important; max-width: 46ch; font-size: 16px; }

/* ============ Unterseiten: Bausteine aus dem Mockup ============
   Mockup-Klasse → Theme-Klasse: .wrap → .aem-wrap/.aem-band, .answer → .aem-answer, .entry → .aem-entry,
   .prep → .aem-prep (Liste), .triptych → .aem-triptych, .dir → .aem-dir, .urgent → .aem-urgent, figure.por → .aem-por */

/* Mehrere .wrap in einer Sektion stapeln sich ohne Abstand; ein .wrap direkt in main (Band) hat keinen Innenabstand oben/unten */
.aem-wrap > * , .aem-band > * { margin-block-start: 0; }
.is-layout-constrained > .aem-wrap { margin-block-start: 0; }
.aem-wrap > * + * , .aem-band > * + * { margin-block-start: 0; }
.wp-block-post-content > .aem-band { margin-block: 0; }

/* Erste Elemente im Seitenkopf (Label → H1) wie im Mockup */
.is-style-label + h1.wp-block-heading { margin-block-start: 20px; }
h1.wp-block-heading + .is-style-intro,
h1.wp-block-heading + p { margin-block-start: 26px; }
.is-style-intro { margin-block-start: 26px; }
.is-style-intro.aem-intro--tight { margin-block-start: 18px; }

/* Bilder mit festem Format (wie .ph--11 / .ph--23 / .ph--32) */
.aem-ratio-11 img { aspect-ratio: 1 / 1; width: 100%; height: auto; object-fit: cover; }
.aem-ph.aem-ph--11 { aspect-ratio: 1 / 1; }
.aem-ph.aem-ph--23 { aspect-ratio: 2 / 3; }

/* Textspalte (Mockup .col: max-width var(--col) = 640px) */
.aem-col { max-width: 640px; }
.aem-col > p { margin-block: 1em; } /* Mockup: Absätze ohne Reset (Browser-Standard 1em), kollabieren wie dort (P11) */
.aem-col > p:last-child { margin-block-end: 1em; } /* Flow-Layout setzt letztes Kind auf 0; im Mockup wirkt der Abstand bis zum nächsten Baustein */

/* Kurzantwort */
.aem-answer {
  background: var(--wp--preset--color--surface);
  border-top: 1px solid var(--aem-rule); border-bottom: 1px solid var(--aem-rule);
  padding: 32px; margin-block: 32px 8px !important;
}
.aem-answer > * { margin: 0; max-width: 70ch; font-size: 16px; }

/* Einträge (Strände, Restaurants, Ausflüge) */
.aem-entry {
  display: grid; grid-template-columns: 1fr 320px; gap: 44px; align-items: start;
  padding: 36px 0; border-bottom: 1px solid var(--wp--preset--color--rule-soft);
  margin-block: 0 !important;
}
/* Rand oben am ersten Eintrag, wo das Mockup ihn rendert (.entry:first-of-type hängt dort an der Element-Reihenfolge; der Konverter setzt die Klasse nach dem gerenderten Wert) */
.aem-entry.aem-entry--rule-top { border-top: 1px solid var(--aem-rule); }
.aem-entry.aem-entry--wide { grid-template-columns: 1fr; }
.aem-entry > * { margin: 0 !important; min-width: 0; }
.aem-entry__head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 18px; margin-bottom: 6px;
}
.aem-entry__head > * { margin: 0; }
.aem-entry__body > * { margin-block: 0; }
.aem-entry__body > p { margin: 0 0 12px; max-width: 64ch; font-size: 16px; }
.aem-entry__body > p:last-child { margin-bottom: 0; }
.aem-entry--wide .aem-entry__body > p { max-width: none; }
.aem-entry em { font-style: normal; color: var(--wp--preset--color--clay-deep); }
ul.wp-block-list.aem-entry__facts {
  display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 12px 0 16px; padding: 0; list-style: none;
  font-family: var(--wp--preset--font-family--sans); font-weight: 200; font-size: 11px;
  text-transform: uppercase; letter-spacing: .2em; color: var(--aem-muted);
}
.aem-entry__facts li { margin: 0; }
.aem-entry__facts strong { font-weight: 400; color: var(--wp--preset--color--text); letter-spacing: .14em; }

/* Vorbereitungsliste mit Punkt */
ul.wp-block-list.aem-prep {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; margin: 0; padding: 0; list-style: none;
}
.aem-prep li {
  padding: 16px 0; border-bottom: 1px solid var(--wp--preset--color--rule-soft); font-size: 16px;
  display: flex; gap: 14px; align-items: baseline; margin: 0;
}
.aem-prep li::before {
  content: ""; width: 4px; height: 4px; background: var(--aem-clay); flex: 0 0 4px; border-radius: 50%; transform: translateY(-3px);
}

/* Dreier-/Viererreihe Bilder mit Unterschrift */
.aem-triptych { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 52px; }
.aem-triptych > * { margin: 0 !important; }
.aem-triptych figcaption { margin: 12px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--wp--preset--color--clay-deep); }

/* Porträt mit Unterschrift (Über uns) */
.wp-block-image.aem-por { margin: 30px 0 0; }
/* Ausnahme zum !important-Reset in .aem-about (P19): Porträt 30px über, kollabiert mit den 20px des Absatzes */
.aem-about .wp-block-column > .wp-block-image.aem-por { margin-top: 30px !important; }
.aem-por figcaption { margin: 10px 0 0; font-size: 12.5px; color: var(--aem-muted); }

/* Notruf */
.aem-urgent { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.aem-urgent > * { margin: 0 !important; }
.aem-urgent__text > * { margin: 0; }
.aem-urgent__text > .is-style-label + * { margin-top: 20px; } /* Label-Abstand trotz Reset (P19) */
p.aem-urgent__num {
  font-family: var(--wp--preset--font-family--serif); font-weight: 300;
  font-size: clamp(72px, 10vw, 124px); line-height: 1; color: var(--aem-action); margin: 0;
}
p.aem-urgent__note { margin: 24px 0 0; max-width: 44ch; font-size: 16px; }

/* Nummernliste */
.aem-dir { border-top: 1px solid var(--aem-rule); }
.aem-dir > * { margin: 0 !important; }
.aem-dir__row {
  display: grid; grid-template-columns: 1fr auto; gap: 24px 40px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--wp--preset--color--rule-soft);
}
.aem-dir__row > * { margin: 0 !important; }
.aem-dir__name > * { margin: 0; }
.aem-dir__name h3 { margin-bottom: 4px; }
.aem-dir__name p { font-size: 14.5px; line-height: 1.7; color: var(--aem-muted); max-width: 58ch; }
p.aem-dir__num {
  font-family: var(--wp--preset--font-family--serif); font-weight: 400; font-size: 24px;
  color: var(--aem-action); white-space: nowrap;
}
p.aem-dir__num.aem-dir__num--todo {
  font-family: var(--wp--preset--font-family--sans); font-weight: 200; font-size: 11px;
  text-transform: uppercase; letter-spacing: .24em; color: var(--aem-muted);
  border: 1px dashed var(--aem-rule); padding: 5px 10px; border-radius: 2px;
}
.aem-dir.aem-dir--plain { border-top: 1px solid rgba(141, 91, 49, .25); margin-top: 28px; }
.aem-dir--plain .aem-dir__row { border-bottom: 1px solid rgba(141, 91, 49, .18); }

/* Varianten aus Inline-Styles des Mockups (dort style="…", hier benannte Klassen; gelten auf allen Breiten wie Inline-Styles) */
[class*="is-style-sec"].aem-sec--joined { padding-top: 0; border-top: 0; }   /* Sektion schließt an die vorige an */
.is-style-sec-clay { padding-top: 112px; padding-bottom: 112px; background: var(--wp--preset--color--clay-band); border-top: 1px solid var(--aem-rule); } /* volle Sektion im Clay-Band */
[class*="is-style-sec"].aem-sec--pt-56 { padding-top: 56px; }
.aem-mt-56 { margin-top: 56px !important; }
.aem-mt-48 { margin-top: 48px !important; }
.aem-mb-56 { margin-bottom: 56px !important; }
.aem-mb-64 { margin-bottom: 64px !important; }
.wp-block-heading.aem-fs-22 { font-size: 22px; }
.wp-block-heading.aem-fs-23 { font-size: 23px; }

/* Themenkarten auf Unterseiten: Überschrift als h2 mit Kartengröße */
.aem-spokes h2.aem-spoke__name { margin: 18px 0 0; }
.aem-spokes .aem-spoke__name + p { margin-top: 8px; }

/* ============ Footer ============ */
.aem-ftr { border-top: 1px solid var(--aem-rule); padding-top: 64px; padding-bottom: 56px; }
.wp-block-columns.aem-ftr__in { gap: 44px; margin-block: 0; }
.aem-ftr__in > .wp-block-column:first-child { flex-grow: 1.5; }
.aem-ftr__in p { font-size: 14.5px; line-height: 1.8; margin: 0; }
.aem-ftr__in p.is-style-label { font-size: 10.5px; margin-bottom: 16px; }
.aem-ftr__in .is-style-label + * { margin-top: 0; }
.aem-ftr__in p.aem-logo { font-size: 14.5px; line-height: 1.8; }
.aem-ftr__in p.aem-logo a { display: block; color: var(--aem-muted); }
.aem-ftr__links a { display: block; color: var(--aem-muted); text-decoration: none; transition: color .2s ease; }
.aem-ftr__links a:hover { color: var(--aem-action); }
.aem-ftr__in p.aem-ftr__lede { margin-top: 0 !important; max-width: 34ch; color: var(--wp--preset--color--text); }
.aem-ftr__in p.is-style-small-muted { color: var(--wp--preset--color--text); font-size: 14.5px; margin-top: 0 !important; }
.aem-ftr__base {
  margin-top: 56px !important; padding-top: 24px; border-top: 1px solid var(--aem-rule);
  font-size: 12.5px; color: var(--aem-muted); gap: 24px;
}
.aem-ftr__base > * { margin: 0; }
.aem-ftr__base a { color: inherit; text-decoration: none; transition: color .2s ease; }
.aem-ftr__base a:hover { color: var(--aem-action); }
/* Livro de Reclamações Eletrónico: offizielles Symbol (livroreclamacoes.pt, Manual der DGC), Pflicht für Unterkünfte in PT.
   Sichtbar und lesbar in der Fußzeile jeder Seite; Schwarz auf hellem Grund (zulässig: Rot, Blau, Weiß, Schwarz). */
.aem-ftr__base { align-items: center; }
.aem-ftr__base p.aem-ftr__lre { line-height: 0; }
.aem-ftr__lre img { display: block; width: 105px; height: auto; }

/* ============ Einblenden beim Scrollen ============ */
.aem-rise { opacity: 0; transform: translateY(8px); transition: opacity .7s ease, transform .7s ease; }
.aem-rise.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .aem-rise { opacity: 1; transform: none; }
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .aem-urgent { gap: 40px; }
  /* Seitenrand stufig wie Mockup (.wrap): >1024 32px, ≤1024 28px, ≤680 20px. theme.json-clamp() trifft das nur an den Enden (P29) */
  html body { --wp--style--root--padding-left: 28px; --wp--style--root--padding-right: 28px; --aem-pad: 28px; } /* WP definiert die Variablen auf body */
  .aem-unit { flex-basis: calc(60% - 16px); }
}
@media (max-width: 960px) {
  .wp-block-columns.aem-hero { grid-template-columns: 1fr; gap: 0; }
  .aem-hero > .aem-hero__img { order: -1; }
  .aem-hero > .aem-hero__text { padding: clamp(48px, 7vw, 72px) 32px clamp(40px, 6vw, 64px); }
  .aem-hero__img img { aspect-ratio: 3 / 2; min-height: 0; height: auto; }
  .aem-hero > .wp-block-column { flex-basis: auto !important; width: 100%; }
  h1.wp-block-heading.aem-hero__h1 { max-width: 16ch; }
}
@media (max-width: 900px) {
  /* Unterseiten-Bausteine einspaltig */
  .aem-entry { grid-template-columns: 1fr; gap: 22px; }
  .aem-entry > .aem-entry__media { order: -1; }
  ul.wp-block-list.aem-prep { grid-template-columns: 1fr; gap: 0; }
  .aem-urgent { grid-template-columns: 1fr; gap: 40px; }
  .aem-urgent > :not(.aem-urgent__text) { order: -1; }
  .is-style-sec, .is-style-sec-surface, .is-style-sec-clay { padding-top: 88px; padding-bottom: 88px; }
  .is-style-sec-tight { padding-top: 60px; padding-bottom: 60px; }
  .aem-unit { flex-basis: 66%; }
  .wp-block-columns.aem-spokes, .wp-block-columns.aem-about { flex-wrap: wrap !important; gap: 40px; }
  .wp-block-columns.aem-spokes { gap: 36px; } /* Mockup: .spokes gap 36px (eigene Regel), .about 40px */
  .aem-avail { gap: 40px; flex-direction: column; align-items: flex-start !important; } /* Mockup: .avail einspaltig, gap 40px ab 900 px */
  .aem-spokes > .wp-block-column, .aem-about > .wp-block-column { flex-basis: 100% !important; }
  .wp-block-columns.aem-ftr__in { flex-wrap: wrap !important; gap: 36px; }
  .aem-ftr__in > .wp-block-column { flex-basis: calc(50% - 18px) !important; flex-grow: 0 !important; }
}
@media (max-width: 680px) {
  .aem-triptych { grid-template-columns: 1fr; gap: 26px; }
  .aem-dir__row { grid-template-columns: 1fr; gap: 10px; }
  p.aem-dir__num { font-size: 22px; }
  p.aem-dir__num.aem-dir__num--todo { justify-self: start; }
  p.aem-urgent__note { font-size: 15.5px; }
  .aem-answer { padding: 24px 20px; }
  .aem-entry { padding: 28px 0; }
  .is-style-sec, .is-style-sec-surface, .is-style-sec-clay { padding-top: 64px; padding-bottom: 64px; }
  .is-style-sec-tight { padding-top: 44px; padding-bottom: 44px; }
  html body { --wp--style--root--padding-left: 20px; --wp--style--root--padding-right: 20px; --aem-pad: 20px; }
  .aem-hero > .aem-hero__text { padding-left: 20px; padding-right: 20px; }
  .aem-hdr__in { padding-top: 18px; padding-bottom: 18px; }
  .aem-logo { font-size: 24px; }
  .aem-today { padding-top: 56px; padding-bottom: 60px; }
  .aem-today__in { display: grid !important; grid-template-columns: 1fr 1fr; gap: 22px 20px !important; }
  .aem-today__cell { flex-direction: column; align-items: flex-start !important; gap: 6px !important; }
  .aem-today__v { font-size: 25px; }
  .aem-today__note { text-align: left; margin-top: 26px !important; max-width: 600px; } /* Mockup: 640px inkl. 2×20px Innenabstand */
  .aem-unit { flex-basis: 84%; }
  .aem-slider { gap: 20px; }
  .aem-ftr__in > .wp-block-column { flex-basis: 100% !important; }
  /* Kartenlogo bleibt mobil 19 px wie auf Desktop: bewusste Abweichung vom Mockup (dort 24 px durch die
     Kaskade .logo{font-size:24px}, P12/P28), Entscheidung des Nutzers vom 04.11.2026. */
}
@media (max-width: 400px) {
  .aem-today__in { gap: 18px 16px !important; }
  .aem-today__v { font-size: 23px; }
  .aem-unit { flex-basis: 90%; }
}

/* ============ Mobilmenü als Klappmenü unter dem Header (wie Mockup) ============
   WordPress klappt die Navigation erst unter 600 px zusammen, das Mockup unter 680 px.
   Theme: MENU schon ab 800 px (Entscheidung 04.11.2026), weil die Navigation bei 681–800 px
   in zwei Reihen umbricht. Seitenrand im Klappmenü = Seitenrand der Seite (28 bzw. 20 px).
   Das Overlay des Navigation-Blocks ist ein Vollbild-Dialog; hier wird es zum Klappmenü.
   Selektoren mit .aem-hdr + :not(.has-background) + :not(.disable-default-overlay) (0,6,0),
   weil die Kernregel für Hintergrund und Farbe 0,5,0 hat (P27). */
@media (min-width: 600px) and (max-width: 800px) {
  .aem-hdr .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
  .aem-hdr .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
@media (max-width: 800px) {
  .wp-block-buttons.aem-hdr__cta { display: none; }
  .aem-hdr { position: relative; }
  .aem-hdr .wp-block-navigation { position: static; }
  html.has-modal-open { overflow: visible; }
  .aem-hdr .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) {
    position: absolute; top: 100%; left: 0; right: 0; bottom: auto; height: auto; z-index: 20;
    overflow: visible; animation: none;
    padding: 24px var(--wp--style--root--padding-right) 28px var(--wp--style--root--padding-left);
    background: var(--wp--preset--color--page); color: var(--wp--preset--color--text);
    border-bottom: 1px solid var(--aem-rule);
  }
  /* Innenleben: gleiches 0,6,0-Präfix, sonst gewinnen Kernregeln gleicher Spezifität, die später geladen werden
     (z. B. padding-top: calc(2rem + 24px) als Platz für den Schließen-Knopf). */
  .aem-hdr .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-container-close {
    display: none; /* nur der Knopf; …__responsive-close ist der Rahmen um den Inhalt */
  }
  .aem-hdr .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-dialog,
  .aem-hdr .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-container-content {
    margin: 0; padding: 0;
  }
  .aem-hdr .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-container-content,
  .aem-hdr .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__container {
    align-items: flex-start; gap: 18px;
  }
  /* Liste über die volle Breite, damit der Button sich strecken kann (Container richtet sonst nach Inhalt aus) */
  .aem-hdr .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-dialog,
  .aem-hdr .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-container-content,
  .aem-hdr .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__container {
    width: 100%; align-self: stretch;
  }
  /* Kern setzt im Overlay padding:0 an den Links; Mockup-Links haben unten 2 px (Unterstreichungs-Abstand) */
  .aem-hdr .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation-item:not(.aem-nav-cta) > .wp-block-navigation-item__content {
    padding: 0 0 2px;
  }
  .aem-hdr .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__container > .aem-nav-cta {
    align-self: stretch; align-items: stretch; width: 100%; margin-top: 6px;
  }
  .aem-hdr .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .aem-nav-cta > .wp-block-navigation-item__content {
    width: 100%;
  }
}

/* ============ Button zweitrangig (Mockup .btn--ghost) ============ */
.wp-block-button.is-style-ghost > .wp-block-button__link {
  background: transparent; color: var(--wp--preset--color--text);
  border: 1px solid var(--wp--preset--color--outline);
}
.wp-block-button.is-style-ghost > .wp-block-button__link:hover { background: transparent; color: var(--wp--preset--color--text); border-color: var(--wp--preset--color--text); }

/* ============ Homes: Wohnungen als Akkordeon (Mockup .acc) ============
   Jede Wohnung und „The house below“: core/details, Zusammenfassung mit <em> = Logo, <strong> = Name.
   Aufgeklappt: Fotos, Beschreibung, Fakten, Button „Check dates & book“ (Wohnungen, nicht die Vorschau). */
.aem-acc { border-top: 1px solid var(--aem-rule); }
.aem-acc > * { margin-block: 0 !important; }
.aem-acc__item { border-bottom: 1px solid var(--aem-rule); }
.aem-acc__sub, .aem-acc__item--details > summary { font-size: 14.5px; color: var(--aem-muted); }
.aem-acc__item--details > summary {
  position: relative; list-style: none; cursor: pointer;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 16px;
  padding: 34px 39px 34px 0;
}
.aem-acc__item--details > summary::-webkit-details-marker { display: none; }
.aem-acc__item--details > summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-family: var(--wp--preset--font-family--serif); font-weight: 300; font-size: 27px; color: var(--aem-muted);
  transition: transform .2s ease;
}
.aem-acc__item--details[open] > summary::after { transform: translateY(-50%) rotate(45deg); }
.aem-acc__item--details > summary em {
  font-style: normal; font-family: var(--wp--preset--font-family--hand); font-size: 19px; line-height: 1;
  word-spacing: -.2em; letter-spacing: .01em; color: var(--aem-muted);
}
.aem-acc__item--details > summary strong {
  font-weight: 300; font-family: var(--wp--preset--font-family--serif); font-size: 23px; line-height: 1.22;
  letter-spacing: -.003em; color: var(--wp--preset--color--text);
}
.aem-acc__item--details > :not(summary) { margin: 0; padding-bottom: 56px; }
.aem-acc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.aem-acc__imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.aem-acc__imgs > * { margin: 0 !important; }
.aem-acc__imgs > :first-child { grid-column: 1 / -1; }
.aem-acc__grid > * { margin: 0 !important; }
.aem-acc__text > * { margin-block: 0; }
.aem-acc__text > p, .aem-acc__text > p:first-child { margin-block-start: 1em; } /* Mockup: p mit 1em oben, auch der erste
   (:first-child nötig, sonst gewinnt WordPress' :root :where(.is-layout-flow) > :first-child mit 0,2,0) */
/* Statt des Mockup-Kalenders (.cal: 36 px Abstand, Linie, 28 px) der Button zur Wohnungsseite (.cal__actions) */
.wp-block-buttons.aem-acc__book { margin-top: 36px; border-top: 1px solid var(--aem-rule); padding-top: 28px; }
.wp-block-group.aem-req__actions { margin-top: 26px; gap: 18px; align-items: center; }
.aem-req__actions > * { margin: 0 !important; }
.aem-req__actions--solo { margin-top: 28px; }

/* „Before you arrive“: Liste „And what there isn't“ (Mockup .nope) */
.aem-nope { margin-top: 56px !important; padding-top: 36px; border-top: 1px solid var(--aem-rule); }
.aem-nope > * { margin-block: 0; }
ul.wp-block-list.aem-nope__list {
  list-style: none; padding: 0; margin: 20px 0 0; /* Mockup: Label 20 px unten, Liste 18 px oben, Ränder fallen zusammen */
  display: flex; flex-wrap: wrap; gap: 10px 32px; font-size: 16px; color: var(--aem-muted);
}

/* ============ Wohnungsseite (templates/single-mphb_room_type.html) ============
   Kein exaktes Mockup: Raster, Abstände und Typografie aus dem geöffneten Akkordeon der Homes-Seite
   (.acc__grid 1fr 1fr / 56 px, .acc__imgs 10 px, .spec, .cal). */
.aem-room-head .aem-sec-head { margin-bottom: 0; }
.wp-block-post-excerpt.aem-room__sub { margin-block-start: 18px; color: var(--aem-muted); font-size: 14.5px; }
.aem-room__sub .wp-block-post-excerpt__excerpt { margin: 0; }
.aem-room { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.aem-room > * { margin: 0 !important; }
.aem-gal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.aem-gal > figure { margin: 0; background: var(--wp--preset--color--placeholder); }
.aem-gal__main { grid-column: 1 / -1; }
.aem-gal img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.aem-gal__main img { aspect-ratio: 3 / 2; }
.aem-room__text > * { margin-block: 0; }
.aem-room__content > * { margin-block: 0; }
.aem-room__content > p + p { margin-block-start: 1em; }
.aem-room__content > :first-child { margin-block-start: 0; }

/* Fakten-Tabelle (Mockup .spec) */
.wp-block-table.aem-spec { margin: 26px 0 0 !important; overflow-x: visible; }
.wp-block-table.aem-spec table { width: 100%; border-collapse: collapse; }
.wp-block-table.aem-spec td {
  border: 0; border-bottom: 1px solid var(--aem-rule-soft); padding: 11px 0;
  font-size: 14.5px; line-height: 1.8; vertical-align: top; /* Mockup .spec td erbt 1.8 vom body */
}
.wp-block-table.aem-spec td:first-child { color: var(--aem-muted); width: 42%; }

/* Kalender und Formular (Mockup .cal: Linie oben, 36/28 px) */
.aem-room__cal, .aem-room__form { margin-top: 36px !important; border-top: 1px solid var(--aem-rule); padding-top: 28px; }
.aem-room__cal > *, .aem-room__form > * { margin-block: 0; }
.aem-room__cal > .is-style-label + *, .aem-room__form > .is-style-label + * { margin-block-start: 20px; }
.aem-cal-key { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 20px 0 0; font-size: 12.5px; color: var(--aem-muted); }
.aem-cal-key__sw::before {
  content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 7px; vertical-align: -1px;
  border: 1px solid var(--aem-rule); background: var(--wp--preset--color--page);
}
.aem-cal-key__sw--busy::before { background: var(--wp--preset--color--page-warm); }
.aem-room__ask { margin-top: 22px !important; }

/* Buchungsseiten (templates/page-booking.html): Titel wie Seitenkopf, Inhalt auf Inhaltsbreite */
.aem-booking .aem-sec-head { margin-bottom: 40px; }
.aem-booking__content > * { margin-block: 0; }
.aem-booking__content > * + * { margin-block-start: 1em; }

@media (max-width: 900px) {
  .aem-acc__grid, .aem-room { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}
@media (max-width: 680px) {
  .aem-acc__item--details > summary { padding-top: 26px; padding-bottom: 26px; }
  .aem-acc__item--details > summary { gap: 6px 14px; }
  .aem-acc__imgs { grid-template-columns: 1fr; }
  .wp-block-table.aem-spec td { font-size: 14px; }
  .wp-block-table.aem-spec td:first-child { width: 46%; }
  .wp-block-table.aem-spec td:first-child { width: 46%; }
}

/* Zeilenhöhen wie Mockup-Button (.acc__btn erbt line-height: normal): Zeile = 34 + 33 (Zeichen) + 34 px. */
p.aem-acc__sub, .aem-acc__item--details > summary { line-height: normal; }
.aem-acc__item--details > summary { min-height: 101px; align-content: center; }
.aem-acc__item--details > summary::after { line-height: 33px; }
@media (max-width: 680px) {
  .aem-acc__item--details > summary { min-height: 85px; }
}
@media (max-width: 680px) {
  ul.wp-block-list.aem-nope__list { gap: 8px 22px; } /* Mockup .nope__list mobil */
}
