/* =========================================
   GLOBAL LAYOUT
========================================= */

/* Site-Wrapper: Begrenzt alle Sections auf max-width 1200px */
.site-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
}

/* Container: Nur noch für Padding/Spacing innerhalb der Sections */
.container {
    width: 100%;
    margin: 0;
    padding: 0 var(--space-md);
}

/* =========================================
   HEADER / HERO
========================================= */

.site-header {
    display: block;
    width: 100%;
    margin: 0;
}

/* Banner-Container ohne Padding für volle Breite */
.site-header .container {
    padding: 0;
}

.header-inner {
    position: relative;
}

.hero-banner {
    position: relative;
    width: 100%;
    height: var(--hero-height);
    overflow: hidden;
}

/* Slides */

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero-slide.active {
    opacity: 1;
}

/* Dark overlay */

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.25);
}


/* =========================================
   MENU SECTION
========================================= */


.menu-section {
    padding: 0;
    width: 100%;
    margin: 0;
    overflow: visible;
}

.menu-section .nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.menu-section .nav-left {
    flex: 0 1 auto;
    min-width: 0;
}

/* Kaskadierendes Listing-Formular (Kaufen / Mieten) */
.listing-search-form {
    margin: 0;
    position: relative;
    --listing-control-h: 34px;
}

.listing-search-form__main {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    scrollbar-width: thin;
}

.menu-section .nav-wrapper--listing-search .nav-left {
    flex: 1 1 auto;
    min-width: 0;
}

.listing-type-buttons {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

a.listing-type-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

button.listing-type-btn {
    display: inline-flex;
    box-sizing: border-box;
    margin: 0;
    font: inherit;
    text-align: center;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
}

.listing-type-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: var(--listing-control-h);
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
}

.listing-type-btn:hover,
.listing-type-btn:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.listing-type-btn.is-active {
    background: #fff;
    color: var(--color-primary);
    border-color: #fff;
}

.listing-cascade-step2,
#listingCascadeStep2 {
    margin-top: 0;
    max-width: none;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.88);
}

.listing-cascade-step2__text {
    margin: 0;
}

.listing-cascade-step2__row,
.listing-cascade-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 0;
    flex: 0 1 auto;
    min-width: 120px;
    max-width: min(220px, 38vw);
}

.listing-search-submit-wrap.listing-cascade-field {
    max-width: none;
    min-width: 0;
    flex: 0 0 auto;
}

.listing-group-select {
    width: 100%;
    max-width: 100%;
    height: var(--listing-control-h);
    min-height: 0;
    padding: 0 10px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.2;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-primary);
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.listing-group-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.listing-search-submit {
    margin: 0;
    box-sizing: border-box;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    height: var(--listing-control-h);
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #fff;
    background: #fff;
    color: var(--color-primary);
    cursor: pointer;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.listing-search-submit:hover,
.listing-search-submit:focus-visible {
    background: rgba(255, 255, 255, 0.92);
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 2px;
}

.listing-cascade-step2__empty,
.listing-cascade-hint {
    flex-basis: 100%;
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.menu-section .listing-search-form .listing-cascade-step2__empty.listing-cascade-hint:not([hidden]) {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    z-index: 40;
    flex-basis: auto;
    width: max-content;
    max-width: min(92vw, 360px);
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    font-size: 12px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.95);
}

.menu-section .container {
    margin: 0;
    background: var(--color-primary);
    height: 80px;                /* feste Höhe */
    display: flex;
    align-items: center;         /* vertikal zentriert */
    justify-content: space-between;
    padding: 0 var(--space-md);  /* nur horizontal */
}

.menu-section .container.nav-wrapper--listing-search {
    height: 80px;
    min-height: 80px;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
    overflow: visible;
}



/* =========================================
   MAIN
========================================= */

main {
    /* Weniger Luft unter der Nav; unten weiterhin großzügig */
    padding: var(--space-md) 0 var(--space-xl) 0;
    width: 100%;
    margin: 0;
}

.main-content {
    background-color: var(--color-gray);
    border: 1px solid #bbbbbb;
}

.page-content__h1 {
    margin-top: 0;
    margin-bottom: var(--space-sm);
}

/* =========================================
   OBJECT-LIST: Card-Grid
========================================= */

.object-list-page {
    padding: var(--space-md) 0 var(--space-xl);
}

.object-list-page__intro {
    margin-bottom: var(--space-lg);
    max-width: 65ch;
    line-height: 1.65;
}

.object-list-empty {
    margin: var(--space-lg) 0;
    color: #444;
    font-size: 16px;
}

.object-list-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.object-list-grid__cell {
    margin: 0;
    padding: 0;
    min-width: 0;
}

.object-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #c8c8c8;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.object-card:hover,
.object-card:focus-visible {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    outline: none;
}

.object-card__media {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--color-primary) 0%, #2a4a6e 100%);
    opacity: 0.92;
}

.object-card__body {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.object-card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    color: #1a1a1a;
}

.object-card__price {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-primary);
}

@media (max-width: 600px) {
    .object-list-grid {
        grid-template-columns: 1fr;
    }
}

/* H1 steht außerhalb von .template-default: Abstand zur ersten Section im Body */
.page-content .page-body > .template-default:first-child {
    margin-top: var(--space-lg);
}

/* =========================================
   FOOTER
========================================= */

footer {
    padding: var(--space-lg) 0;
    background: var(--color-primary);
    width: 100%;
    margin: 0;
    color: white;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.footer-column h3 {
    margin: 0 0 var(--space-md) 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.footer-column p {
    margin: 0 0 var(--space-sm) 0;
    color: white;
    line-height: 1.6;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: var(--space-sm);
}

.footer-column a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.footer-column a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Mobile: Footer 1-spaltig */
@media (max-width: 991px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
}

/* =========================================
   DESKTOP (>= 992px)
========================================= */

@media (max-width: 991px) {

    .menu-section .container {
        height: auto;
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-md);
        gap: var(--space-md);
    }

    /* Menü + Burger in einer Zeile */
    .menu-section .nav-wrapper {
        flex-direction: row !important;
        justify-content: flex-end;
        align-items: center;
    }

}


/* =========================================
   TEMPLATE: DEFAULT
   (zweispaltiges Standard-Layout)
========================================= */

.template-default {
    padding: 0 0 var(--space-xl);
    /* Negativer Margin nur ohne vorgelagertes Seiten-H1 (Fallback) */
    margin-top: calc(var(--space-xl) * -0.5);
}

.template-default .header-container {
    max-width: var(--max-width);
    margin: 0 auto var(--space-lg);
    padding: 0 var(--space-md);
}

.template-default .header-container h1 {
    margin: 0 0 var(--space-sm) 0;
    font-size: 32px;
    font-weight: 600;
}

.template-default .header-container .subheader {
    margin: 0;
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.85;
}

.template-default .two-col-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: flex-start;
}

.template-default .col {
    font-size: 16px;
    line-height: 1.7;
}

.template-default .col-left {
    /* Haupttextspalte – kann später erweitert werden */
}

.template-default .col-right {
    /* Rechte Spalte – z.B. für Highlights, Listen etc. */
}

@media (max-width: 991px) {
    .template-default {
        padding: 0 0 var(--space-lg);
        margin-top: calc(var(--space-xl) * -0.5);
    }
    .template-default .header-container {
        padding: 0 var(--space-md);
    }

    .template-default .two-col-container {
        padding: 0 var(--space-md);
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
}

