/* responsive.css — globale Mobile-Anpassungen
   Strategie: Inline-Styles bleiben für Desktop unangetastet.
   Auf kleinen Bildschirmen überschreiben wir mit !important die wichtigsten
   Layout-Eigenschaften, damit alle Seiten ohne JS-Refactor mobil funktionieren. */

/* ------- Burger-Menü Drawer ------- */
.burger-btn {
  display: none;
  background: transparent;
  border: 1.5px solid rgba(58, 36, 24, 0.3);
  width: 44px;
  height: 44px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border-radius: 2px;
  padding: 0;
}
.burger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #3a2418;
  transition: transform .25s, opacity .2s;
}
.burger-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-btn.is-open span:nth-child(2) { opacity: 0; }
.burger-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-drawer {
  position: fixed;
  inset: 0;
  background: #f5ede0;
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 28px 40px;
}
.mobile-drawer.is-open { display: flex; }
.mobile-drawer .drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.mobile-drawer .drawer-close {
  background: transparent;
  border: 1.5px solid rgba(58, 36, 24, 0.3);
  width: 44px;
  height: 44px;
  font-size: 22px;
  cursor: pointer;
  border-radius: 2px;
  color: #3a2418;
}
.mobile-drawer-section {
  border-top: 1px solid rgba(138, 105, 66, 0.18);
  padding: 18px 0;
}
.mobile-drawer-section:first-of-type { border-top: none; padding-top: 0; }
.mobile-drawer-link {
  display: block;
  padding: 14px 4px;
  text-decoration: none;
  color: #3a2418;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 26px;
  line-height: 1.1;
  border-bottom: 1px dashed rgba(138, 105, 66, 0.18);
}
.mobile-drawer-link:last-child { border-bottom: none; }
.mobile-drawer-link.is-active { color: #5a3474; }
.mobile-drawer-link .sub {
  display: block;
  font-family: "Work Sans", sans-serif;
  font-style: normal;
  font-size: 12px;
  color: #6a554a;
  margin-top: 3px;
  letter-spacing: 0.04em;
}
.mobile-drawer-cta {
  margin-top: 24px;
  display: block;
  background: #5a3474;
  color: #f5ede0;
  text-decoration: none;
  text-align: center;
  padding: 18px 24px;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 28px;
}
.mobile-drawer-kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8a6942;
  margin-bottom: 6px;
}

/* ------- Mobile-Breakpoint ------- */
@media (max-width: 880px) {
  /* TopNav: Desktop-Nav weg, Burger an */
  .topnav-desktop { display: none !important; }
  .burger-btn { display: flex !important; }

  /* Page-Header (TopNav-Container): kleineres Padding */
  header[data-topnav] {
    padding: 14px 18px !important;
  }

  /* Brand-Mark kleiner */
  header[data-topnav] [data-brand-text] {
    font-size: 18px !important;
  }
  header[data-topnav] [data-brand-sub] {
    font-size: 11px !important;
  }

  /* Hero (PageHero) — kleiner, weniger Padding */
  section[data-hero] {
    padding: 12px 14px 0 !important;
  }
  section[data-hero] [data-hero-frame] {
    height: 320px !important;
  }
  section[data-hero] h1 {
    font-size: 44px !important;
  }
  section[data-hero] [data-hero-text] {
    bottom: 22px !important;
    left: 22px !important;
    right: 22px !important;
  }
  section[data-hero] [data-hero-text] p {
    font-size: 14px !important;
    line-height: 1.55 !important;
  }
  section[data-hero] img[data-hero-logo] {
    height: 60px !important;
    top: 14px !important;
    right: 18px !important;
  }

  /* Sections: 96px / 56px Padding zähmen */
  .responsive-page section {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
  .responsive-page section[style*="120px"],
  .responsive-page section[style*="100px"],
  .responsive-page section[style*="90px"],
  .responsive-page section[style*="80px"] {
    padding-top: 56px !important;
    padding-bottom: 48px !important;
  }

  /* Grids alle stacken — egal welche Spaltenzahl */
  .responsive-page section > div[style*="grid"],
  .responsive-page section div[style*="gridTemplateColumns"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  /* Auch Hero-CTA-Bar stacken */
  section[data-cta] {
    flex-direction: column !important;
    gap: 24px !important;
    align-items: flex-start !important;
    padding: 44px 22px !important;
  }
  section[data-cta] a {
    padding: 16px 24px !important;
    font-size: 12px !important;
  }

  /* Schriftgrößen reduzieren */
  .responsive-page h1 { font-size: 44px !important; }
  .responsive-page h2 { font-size: 36px !important; line-height: 1.1 !important; }
  .responsive-page h3 { font-size: 28px !important; }
  .responsive-page p { font-size: 15px !important; }

  /* Section-Header */
  .responsive-page [data-section-header] h2 {
    font-size: 38px !important;
    line-height: 1.05 !important;
  }
  .responsive-page [data-section-header] {
    margin-bottom: 32px !important;
  }

  /* Footer — Spalten zu 1, kleinere Paddings */
  footer[data-footer] {
    padding: 44px 22px 28px !important;
  }
  footer[data-footer] > div:first-child {
    grid-template-columns: 1fr 1fr !important;
    gap: 28px !important;
  }
  footer[data-footer] > div:last-child {
    flex-direction: column !important;
    gap: 8px !important;
    text-align: left !important;
    align-items: flex-start !important;
  }

  /* Bilder, die als „aspectRatio" oder feste height haben */
  .responsive-page img[data-flex-img] {
    height: auto !important;
    max-height: 380px !important;
  }

  /* Fixe Höhen aufweichen */
  .responsive-page section [style*="height: 540px"],
  .responsive-page section [style*="height: 560px"],
  .responsive-page section [style*="height: 500px"],
  .responsive-page section [style*="height: 460px"] {
    height: 320px !important;
  }
  .responsive-page section [style*="height: 340px"],
  .responsive-page section [style*="height: 320px"] {
    height: 240px !important;
  }

  /* Stempel/Badges — etwas kleiner */
  .responsive-page [data-stamp] {
    font-size: 16px !important;
  }
}

@media (max-width: 540px) {
  .responsive-page h1, section[data-hero] h1 { font-size: 36px !important; }
  .responsive-page h2 { font-size: 30px !important; }
  .responsive-page [data-section-header] h2 { font-size: 30px !important; }
  section[data-hero] [data-hero-frame] { height: 280px !important; }
  footer[data-footer] > div:first-child { grid-template-columns: 1fr !important; }
  .mobile-drawer-link { font-size: 22px !important; }
}

/* ------- Mobile-Breakpoint 768px (Phones + small tablets) ------- */
@media (max-width: 768px) {
  /* Prevent horizontal scroll */
  html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* Burger: ensure it shows; desktop nav stays hidden */
  .topnav-desktop { display: none !important; }
  .burger-btn { display: flex !important; }

  /* Section padding */
  section, [data-section] {
    padding: 32px 16px !important;
  }

  /* Headings */
  h1 { font-size: clamp(28px, 8vw, 48px) !important; }
  h2 { font-size: clamp(24px, 7vw, 40px) !important; }
  h3 { font-size: clamp(20px, 6vw, 32px) !important; }

  /* Hero title (inside hero text block) */
  [data-hero-text] h1 {
    font-size: clamp(32px, 9vw, 52px) !important;
  }

  /* Handwritten / Caveat labels */
  [data-hero-text] span,
  .caveat { font-size: clamp(18px, 5vw, 26px) !important; }

  /* Body text */
  p, li { font-size: clamp(14px, 4vw, 16px); }

  /* Hero text position */
  [data-hero-text] {
    left: 20px !important;
    right: 20px !important;
    bottom: 24px !important;
  }

  /* Hero frames — same specificity as 880px rule so this (later) block wins */
  section[data-hero] [data-hero-frame],
  section[data-home-hero] [data-hero-frame] {
    height: 60vw !important;
    min-height: 240px !important;
    max-height: 420px !important;
  }

  /* Images */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Stack inline grids — exclude calendar grids which must stay 7-column */
  [style*="grid-template-columns"]:not(.cal-grid):not(.cal-wday) {
    grid-template-columns: 1fr !important;
  }

  /* Booking calendar: single-month view */
  #cal-grid {
    grid-template-columns: 1fr !important;
  }
  .cal-month:last-child {
    display: none !important;
  }

  /* Calendar: make scrollable, fix day cell minimum touch size */
  .cal-month {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .cal-grid,
  .cal-wday {
    min-width: 280px !important;
  }
  .cal-day {
    min-height: 40px !important;
    aspect-ratio: unset !important;
    font-size: 12px !important;
  }
  .price-label {
    font-size: 9px !important;
  }
  .cal-wday > div {
    font-size: 10px !important;
  }

  /* House tabs: stack vertically */
  #haus-tabs {
    flex-direction: column !important;
  }
  #haus-tabs button {
    width: 100% !important;
  }

  /* Booking page: hide sidebar, full-width calendar */
  #sidebar {
    display: none !important;
  }
  .buchung-layout {
    grid-template-columns: 1fr !important;
  }
}
