/*
Theme Name: Astra Child
Template: astra
Version: 1.0
Description: Mobile-first Child Theme für wohnung.matland.ch
*/

/* ============================================================
   BASE: Mobile-First (alles für <768px zuerst)
   ============================================================ */

/* Flüssige Bilder und Videos */
img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* Lesbarkeit auf kleinen Screens */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
  color: #334155;
  /* Weiches, edles Dunkelgrau für Text */
}

/* Abstände grosszügiger auf Mobile */
.entry-content p,
.entry-content li {
  margin-bottom: 1.3em;
}

/* ============================================================
   HERO / Header-Bild Sektion
   ============================================================ */

/* Hintergrundbild-Container: genug Höhe auf Mobile */
.uagb-is-root-container[style*="background"] {
  min-height: 45vh !important;
}

/* ============================================================
   HAUPTINHALT: Padding auf Mobile
   ============================================================ */

.entry-content,
.uagb-container-inner-blocks-wrap {
  padding-left: 18px !important;
  padding-right: 18px !important;
  box-sizing: border-box;
}

/* ============================================================
   ÜBERSCHRIFTEN: skalierend
   ============================================================ */

h1,
h2,
h3,
h4 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  /* Moderne, enge Laufweite für Titel */
  color: #0f172a;
}

h1 {
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  line-height: 1.25;
  margin-top: 2em;
}

h3 {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
}

/* ============================================================
   CTA-BUTTON (virtuelle Tour)
   ============================================================ */

.uagb-cta__button-link-wrapper {
  display: inline-block;
  padding: 16px 32px !important;
  font-size: 1.05rem !important;
  font-weight: 600;
  border-radius: 8px !important;
  /* Etwas weichere Box */
  background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%) !important;
  /* Premium Farbverlauf */
  color: #fff !important;
  text-decoration: none !important;
  margin-top: 16px;
  min-width: 220px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
}

.uagb-cta__button-link-wrapper:hover {
  background: linear-gradient(135deg, #c5a059 0%, #a48141 100%) !important;
  /* Goldener Leuchteffekt */
  color: #fff !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(197, 160, 89, 0.4);
}

/* CTA-Block: Button immer unter dem Text zentrieren (Mobile & Desktop) */
.wp-block-uagb-call-to-action {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center;
  padding: 32px 18px !important;
  gap: 16px;
}

/* ============================================================
   BILDER & KARTEN: Moderner Look
   ============================================================ */

/* Bilder auf Mobile abrunden für weicheren Premium-Look */
.wp-block-image img,
.wp-block-gallery .wp-block-image img {
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  /* Sanfter Schatten für mehr Tiefe */
}

/* ============================================================
   TABELLE: Modern, Responsive & Saubere Umbrüche
   ============================================================ */

.wp-block-table {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  padding: 16px;
  margin-top: 1.5em;
  margin-bottom: 2em;
  box-sizing: border-box;
}

.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  table-layout: fixed;
  /* Verhindert das Zerstören des Layouts durch lange Wörter */
}

.wp-block-table td {
  padding: 14px 12px;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  /* Saubere Silbentrennung für lange Wörter wie "Erneuerungsfonds" */
}

.wp-block-table tr:last-child td {
  border-bottom: none;
}

.wp-block-table tr:nth-child(odd) td {
  background: transparent;
}

.wp-block-table td:first-child {
  font-weight: 600;
  color: #475569;
  white-space: normal;
  /* Verhindert das Reindrücken der zweiten Spalte! */
  width: 35%;
  /* Feste Breite für Layout-Stabilität auf Desktop */
}

/* Preis-Zeile hervorheben */
.wp-block-table td strong {
  color: #c5a059;
  font-size: 1.05em;
}

/* Mobile: Tabelle als gestapelte Liste anzeigen (App-Feeling) */
@media (max-width: 600px) {

  .wp-block-table table,
  .wp-block-table tbody,
  .wp-block-table tr,
  .wp-block-table td {
    display: block;
    width: 100%;
  }

  .wp-block-table tr {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 0;
  }

  .wp-block-table tr:last-child {
    border-bottom: none;
  }

  .wp-block-table td {
    border-bottom: none;
    /* Linien nun am kompletten Block/Row */
    padding: 4px 8px;
  }

  .wp-block-table td:first-child {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding-bottom: 2px;
  }

  .wp-block-table td:last-child {
    font-size: 1.05rem;
    color: #0f172a;
    padding-top: 0;
  }
}

/* ============================================================
   LISTEN: mehr Luft auf Mobile
   ============================================================ */

.entry-content ul.wp-block-list {
  padding-left: 20px;
}

.entry-content ul.wp-block-list li {
  margin-bottom: 0.75em;
  padding-left: 4px;
}

/* ============================================================
   NAVIGATIONSMENÜ: Touch-freundlich
   ============================================================ */

.main-header-menu .menu-item a {
  padding: 12px 16px !important;
  font-size: 1rem;
}

/* Hamburger-Icon grösser & Edle Farben (Auch für Transparent-Header Override) */
.ast-mobile-menu-buttons button,
.menu-toggle,
.ast-theme-transparent-header .ast-mobile-menu-buttons .menu-toggle,
.ast-theme-transparent-header [data-section="section-header-mobile-trigger"] .ast-button-wrap .ast-mobile-menu-trigger-minimal {
  padding: 12px !important;
  min-width: 48px;
  min-height: 48px;
  color: #2c3e50 !important;
  /* Edles Anthrazit statt grellem Grün */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.ast-mobile-menu-buttons button.toggled,
.ast-mobile-menu-buttons button:hover,
.menu-toggle:focus,
.ast-theme-transparent-header .ast-mobile-menu-buttons .menu-toggle:hover {
  color: #1b5e20 !important;
  /* Dunkelgrüner Hover */
}

/* Mobiles Dropdown-Menü im Premium-Look */
.ast-builder-menu-mobile .main-navigation {
  background: #ffffff !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.main-header-menu .menu-item a {
  padding: 12px 16px !important;
  font-size: 1rem;
  color: #2c3e50 !important;
  transition: color 0.3s ease;
}

.main-header-menu .menu-item a:hover,
.main-header-menu .current-menu-item>a {
  color: #1b5e20 !important;
  /* Dunkles Grün beim Überfahren / Aktive Seite */
  background: transparent !important;
}

.site-footer {
  font-size: 0.85rem;
  text-align: center;
  padding: 20px 18px;
}

/* ============================================================
   MOBILE STICKY CTA (Bottom Bar)
   ============================================================ */

.mobile-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px 18px;
  box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mobile-sticky-cta .uagb-cta__button-link-wrapper {
  margin-top: 0 !important;
  width: 100%;
}

/* Padding für den Body, damit die fixierte Leiste auf Mobile keine Inhalte verdeckt */
body {
  padding-bottom: 70px;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }

  .mobile-sticky-cta {
    display: none !important;
  }
}

/* ============================================================
   TABLET (≥768px)
   ============================================================ */

@media (min-width: 768px) {
  body {
    font-size: 16px;
  }

  .uagb-is-root-container[style*="background"] {
    min-height: 55vh !important;
  }

  .entry-content,
  .uagb-container-inner-blocks-wrap {
    padding-left: 32px !important;
    padding-right: 32px !important;
  }
}

/* ============================================================
   DESKTOP (≥1024px)
   ============================================================ */

@media (min-width: 1024px) {
  .uagb-is-root-container[style*="background"] {
    min-height: 65vh !important;
  }

  .entry-content,
  .uagb-container-inner-blocks-wrap {
    padding-left: 48px !important;
    padding-right: 48px !important;
  }

  .wp-block-table {
    display: table;
    overflow-x: visible;
  }
}

/* ============================================================
   DESKTOP SUBMENU FIX / VISIBILITY
   ============================================================ */
@media (min-width: 922px) {
  .main-header-menu .sub-menu {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px;
    padding: 10px 0 !important;
    border: 1px solid rgba(0, 0, 0, 0.05);
  }

  .main-header-menu .sub-menu .menu-item a {
    color: #2c3e50 !important;
  }

  .main-header-menu .sub-menu .menu-item a:hover {
    color: #1b5e20 !important;
    background: rgba(0, 0, 0, 0.02) !important;
  }
}

/* Stronger Desktop Submenu Overrides for Transparent Header */
@media (min-width: 922px) {

  .ast-theme-transparent-header .main-header-menu .sub-menu,
  .ast-theme-transparent-header .main-header-menu .children,
  .ast-builder-menu-1 .sub-menu {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
  }

  .ast-theme-transparent-header .main-header-menu .sub-menu .menu-item a,
  .ast-theme-transparent-header .main-header-menu .children .menu-item a,
  .ast-builder-menu-1 .sub-menu .menu-item a {
    color: #2c3e50 !important;
    background: transparent !important;
  }

  .ast-theme-transparent-header .main-header-menu .sub-menu .menu-item a:hover,
  .ast-theme-transparent-header .main-header-menu .sub-menu .current-menu-item>a,
  .ast-builder-menu-1 .sub-menu .menu-item a:hover {
    color: #1b5e20 !important;
    background: rgba(0, 0, 0, 0.02) !important;
  }
}

/* Fix contrast for ALL menu items on Desktop (even if they are top-level but visually act like submenus) */
@media (min-width: 922px) {
  .ast-theme-transparent-header #ast-hf-menu-1 .main-header-menu {
    background-color: rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    padding: 5px 15px !important;
    border-radius: 30px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
  }

  .ast-theme-transparent-header #ast-hf-menu-1 .main-header-menu .menu-link {
    color: #2c3e50 !important;
    text-shadow: none !important;
    font-weight: 500 !important;
  }

  .ast-theme-transparent-header #ast-hf-menu-1 .main-header-menu .menu-link:hover,
  .ast-theme-transparent-header #ast-hf-menu-1 .main-header-menu .current-menu-item .menu-link {
    color: #1b5e20 !important;
  }
}

/* Make Google Map taller on desktop */
@media (min-width: 922px) {
  iframe[src*="maps.google.com"] {
    height: 650px !important;
  }
}



/* Ensure the desktop menu pill shape is centered */
@media (min-width: 922px) {
  .ast-theme-transparent-header #ast-hf-menu-1 {
    justify-content: center !important;
    width: 100% !important;
  }

  .ast-theme-transparent-header #ast-hf-menu-1 .main-header-menu {
    width: fit-content !important;
    margin: 0 auto !important;
  }
}

/* Force strict centering of the entire navigation wrapper */
@media (min-width: 922px) {
  .ast-main-header-bar-alignment {
    justify-content: center !important;
    align-items: center !important;
  }

  .main-header-bar-navigation {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    flex: 1 1 auto !important;
  }

  .site-navigation {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
  }
}

@media (min-width: 922px) {
  .ast-theme-transparent-header .ast-builder-grid-row {
    position: relative;
  }

  .ast-theme-transparent-header .site-header-primary-section-right {
    justify-content: center !important;
    flex: 1 !important;
    width: 100% !important;
  }

  .ast-builder-menu-1 {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
  }

  /* We also need to make sure social icons don't overlap if they exist, but they are pushed to the right. */
  .ast-header-social-1-wrap {
    margin-left: auto !important;
  }
}

/* Ensure absolute centered menu does not break into two lines */
@media (min-width: 922px) {
  .ast-builder-menu-1 {
    width: max-content !important;
    white-space: nowrap !important;
    max-width: 100vw !important;
  }

  .ast-builder-menu-1 ul.main-header-menu {
    flex-wrap: nowrap !important;
    width: 100% !important;
  }
}

/* ============================================================
   SPECTRA IMAGE CAROUSEL DESKTOP HEIGHT LIMIT
   ============================================================ */
@media (min-width: 922px) {

  .wp-block-uagb-image-gallery .slick-slide img,
  .wp-block-uagb-image-gallery .swiper-slide img,
  .wp-block-uagb-image-gallery img {
    max-height: 80vh !important;
    width: 100% !important;
    object-fit: contain !important;
    background-color: transparent !important;
  }
}