/* ==========================================================================
   r2go4-Skin — 1:1 extrahiert aus packages/immo/assets/css/immo.css
   Refactor 2026-05-28
   ========================================================================== */

/* ── Listing-Page-Wrapper ──────────────────────────────────────────────────
   Padding-Strategie wie globaler .container: Desktop 0 seitlich,
   Tablet (≤1240) 50px, Mobile (≤767) 20px. */
.immo-search-page {
  max-width: var(--immo-results-width);
  margin: 0 auto;
  padding: 2rem 0 0.5rem;
}
@media (max-width: 1240px) {
  .immo-search-page { padding-inline: var(--content-edge-tablet); }
}
@media (max-width: 767px) {
  .immo-search-page { padding-inline: var(--content-edge-mobile); }
}

/* ── Results-Header + Container ──────────────────────────────────────────── */
.immo-search-results {
  margin: 0;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}

.results-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-count {
  font-size: 1.125rem;
  font-weight: 600;
  color: #333;
}

.results-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Sorting dropdown */
.sorting-wrapper {
  min-width: 12rem;
}

.sorting-wrapper select {
  height: 2.5rem;
  font-size: 0.875rem;
}

/* ==========================================================================
   RESULTS GRID & CARDS
   ========================================================================== */

.results-container {
  display: grid;
  gap: 2.5rem;
  margin-bottom: 0;
}

.layout-grid {
  grid-template-columns: repeat(3, 1fr);
}

.layout-list {
  grid-template-columns: 1fr;
}

/* ── Card ──────────────────────────────────────────────────────────────── */


/* ── No-Results ──────────────────────────────────────────────────────────── */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.75rem 1.25rem;
  color: #666;
}

.no-results-icon {
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

/* No-Results h3 — designed-Variante (kleinere Size + leicht hellerer Color
   für Error/Empty-State). Font-family/weight aus base.css. */
.no-results h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.5rem;
  color: #333;
}

/* ── Pagination / Load More ────────────────────────────────────────────── */


/* ── Listing-Grid-Responsive ────────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1400px) {
  .layout-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet Portrait: compact card content */

/* ── Compact-Mobile-View ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .immo-compact-mobile .results-container {
    display: flex;
    flex-direction: column;
    gap: 1.875rem;
  }

  .immo-compact-mobile .result-item {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: auto;
    border: none;
    overflow: visible;
    background: transparent;
    box-shadow: none;
  }

  .immo-compact-mobile .result-image {
    width: 7.5rem;
    height: 7.5rem;
    flex-shrink: 0;
    margin-right: 1rem;
  }

  .immo-compact-mobile .result-badge,
  .immo-compact-mobile .result-objektnummer-badge,
  .immo-compact-mobile .status-ribbon {
    display: none;
  }

  .immo-compact-mobile .result-content {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
  }

  .immo-compact-mobile .result-location {
    font-size: 0.875rem;
    color: #666;
    margin: 0 0 0.0625rem 0;
    order: -2;
  }

  .immo-compact-mobile .result-title {
    margin: 0 0 0.5rem 0;
    min-height: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: none;
    order: -1;
  }

  .immo-compact-mobile .result-props-grid {
    border-top: none;
    padding-top: 0;
    gap: 0.25rem 1rem;
    flex-wrap: wrap;
  }

  .immo-compact-mobile .prop-col-button,
  .immo-compact-mobile .details-button {
    display: none;
  }

  /* Compact: Wert + Kürzel inline (z.B. "78 m² Wfl", "3 Zi", "1.180 € / Mon") */
  .immo-compact-mobile .prop-col {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.25rem;
    line-height: 1.3;
  }

  .immo-compact-mobile .immo-prop-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text-dark, #1a1a1a);
  }

  /* Lange Labels weg, kurze Kürzel inline neben dem Wert */
  .immo-compact-mobile .immo-prop-label {
    display: none;
  }

  .immo-compact-mobile .immo-prop-label-short {
    display: inline;
    font-size: 0.8125rem;
    color: #666;
    font-weight: 400;
  }
}

/* Kurz-Labels nur in compact-mobile sichtbar — Default-View nutzt die langen */
.immo-prop-label-short {
  display: none;
}

/* ==========================================================================
   HEADLINE
   ========================================================================== */


/* ── Headlines + AdTiles ─────────────────────────────────────────────────── */
.immo-search-headline {
  text-align: center;
  margin-bottom: 2.5rem;
}

.immo-search-headline h2 {
  margin: 0 0 0.75rem;
}

.section--page-intro {
  padding-bottom: var(--space-sm);
}

/* Intro-Headline immer zentriert — auch wenn der Heading-Shift sie als h3
   rendert (Regio-Listing: echte h1 steckt im Info-Text, sichtbare Intro = h3.h2).
   Die globale Zentrier-Regel greift nur bei h1/h2-Tags. */
.section--page-intro > .container > h1,
.section--page-intro > .container > h2,
.section--page-intro > .container > h3 {
  text-align: center;
}

.section--page-intro + .immo-search-section,
.section--page-intro + .immo-search-section > .immo-search-page {
  padding-top: 0;
}

.immo-search-subline {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
  margin: 0 auto;
}

.immo-search-subline a {
  color: var(--immo-ci-color);
  text-decoration: underline;
}

.immo-search-subline a:hover {
  color: var(--immo-ci-color-hover);
}

/* ==========================================================================
   AD TILES (Werbekacheln)
   ========================================================================== */

.immo-adtile {
  background: white;
  border: 1px solid #ddd;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

/* Overlay-Link: ganze Adtile klickbar — Default versteckt, mobile aktiv */
.immo-adtile-overlay-link {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  text-decoration: none;
}

.immo-adtile-header {
  padding: 2.5rem 3.4375rem;
  text-align: center;
  aspect-ratio: var(--immo-image-aspect-ratio, 16/9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.immo-adtile-mini-headline {
  font-size: 0.6875rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1875rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.immo-adtile-main-headline {
  color: inherit;
  /* Wie globale h2: Desktop 2.55em, Tablet 2em (Override unten), Mobile h3 1.6rem */
  font-size: var(--h2-size, 2.55em);
  font-weight: 400;
  line-height: var(--h2-line-height, 1.2);
  margin: 0;
  font-family: var(--font-heading, 'Marcellus', serif);
}

.immo-adtile-body {
  background: #fff;
  padding: 40px 55px 45px;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.immo-adtile-text {
  margin: 0;
  line-height: 1.6;
  color: #333;
}

/* Adtile-Button erbt vom Site-Standard (.btn). Layout-Spezifika: zentriert
   im Body, oben Abstand auf auto so dass Button am Boden klebt. nowrap weil
   Text wie "Zur Wertermittlung" sonst in der schmalen 2-Spalten-Card umbricht. */
.immo-adtile-body .immo-adtile-button {
  align-self: center;
  margin-top: auto;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

@media (min-width: 769px) and (max-width: 1240px) {
  .immo-adtile-header {
    padding: 30px 30px;
  }
  .immo-adtile-body {
    padding: 30px 35px;
  }
  /* Tablet: etwas kleiner als globale h2-Tablet (2em) — Card ist schmal */
  .immo-adtile-main-headline {
    font-size: 1.8em;
  }
}

@media (max-width: 768px) {
  /* Adtile mobile: nur Header (Headline + Mini) sichtbar, Body weg.
     Ganze Card wird klickbar via Overlay-Link. Schriften wie Section-Frames
     (Mini-Headline = .section__label, Main-Headline = h2-mobile). */
  .immo-compact-mobile .result-item.immo-adtile {
    flex-direction: column;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
  }
  .immo-adtile {
    height: auto;
  }
  .immo-adtile-overlay-link {
    display: block;
  }
  .immo-adtile-header {
    padding: 2.5rem 1.5rem;
    aspect-ratio: auto;
    min-height: 0;
  }
  .immo-adtile-mini-headline {
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.1875rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    opacity: 1;
  }
  .immo-adtile-main-headline {
    font-size: 1.6rem;
    line-height: var(--h3-line-height, 1.3);
  }
  /* Body (Text + Button) auf Mobile ausblenden — Overlay-Link ersetzt Button */
  .immo-adtile-body {
    display: none;
  }
}
