/* Site-wide footer — listings, auth, dashboards, legal */

html,
body {
    margin: 0;
}

body.hh-dashboard-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.hh-dashboard-layout #hh-page-content {
    flex: 1 0 auto;
    width: 100%;
}

/* Templates set data-hh-layout on <html> (home, detail). */
html[data-hh-layout="listings"],
html[data-hh-layout="detail"] {
    height: 100%;
}

body[data-hh-skeleton="listings"],
body[data-hh-skeleton="detail"] {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

body[data-hh-skeleton="listings"] > .content,
body[data-hh-skeleton="detail"] > .house-details {
    flex: 1 0 auto;
    width: 100%;
}

/* Auth / wizard shell (base.html) */
body[data-hh-skeleton="auth"],
body[data-hh-wizard="1"] {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    align-items: stretch;
    justify-content: flex-start;
}

body[data-hh-skeleton="auth"] #hh-page-content,
body[data-hh-wizard="1"] #hh-page-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
}

body[data-hh-skeleton="auth"] .hh-page,
body[data-hh-wizard="1"] .hh-page {
    flex: 1 0 auto;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}

body[data-hh-skeleton="auth"] .hh-page-inner,
body[data-hh-wizard="1"] .hh-page-inner {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

body[data-hh-skeleton="auth"] .hh-page-inner > .site-footer--compact,
body[data-hh-wizard="1"] .hh-page-inner > .site-footer--compact {
    margin-top: auto;
}

.site-footer {
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    margin-top: auto;
    padding: 4rem clamp(1.75rem, 5.5vw, 4.5rem) 2rem;
    background: #f3e6d4;
    border-top: 1px solid #dcc9b0;
    color: #4a4035;
}

.site-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
}

.site-footer__top {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    gap: 3rem 3.5rem;
    align-items: start;
}

.site-footer__brand-title {
    margin: 0 0 0.85rem;
    font-size: 1.65rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.site-footer__brand-text {
    margin: 0;
    max-width: 28rem;
    font-size: 1.18rem;
    line-height: 1.65;
    color: #5c5348;
}

.site-footer__heading {
    margin: 0 0 1.05rem;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1a1a1a;
}

.site-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer__links li + li {
    margin-top: 0.8rem;
}

.site-footer__links a {
    font-size: 1.18rem;
    line-height: 1.6;
    color: #5c5348;
    text-decoration: none;
}

.site-footer__links a:hover {
    color: #c94f03;
    text-decoration: underline;
}

.site-footer__contact a {
    font-size: 1.18rem;
    color: #c94f03;
    font-weight: 600;
    text-decoration: none;
    word-break: break-all;
    line-height: 1.6;
}

.site-footer__contact a:hover {
    text-decoration: underline;
}

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.15rem 1.5rem;
    margin-top: 3.25rem;
    padding-top: 1.75rem;
    border-top: 1px solid #dcc9b0;
    font-size: 1.1rem;
    color: #6b6156;
    line-height: 1.55;
}

.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
}

.site-footer__legal a {
    font-size: 1.1rem;
    color: #5c5348;
    text-decoration: none;
}

.site-footer__legal a:hover {
    color: #1a1a1a;
    text-decoration: underline;
}

.site-footer__legal-sep {
    color: #b8aa98;
}

/* Compact variant (auth / narrow pages) */
.site-footer--compact {
    padding: 1rem 0 0;
    margin-top: auto;
    background: transparent;
    border-top: 1px solid var(--hh-border, #ddd);
}

.site-footer--compact .site-footer__inner {
    max-width: 420px;
}

.site-footer--compact .site-footer__top,
.site-footer--compact .site-footer__brand-text {
    display: none;
}

.site-footer--compact .site-footer__bottom {
    margin-top: 0;
    padding-top: 0.85rem;
    border-top: none;
    justify-content: center;
    text-align: center;
    font-size: 0.88rem;
}

.site-footer--compact .site-footer__copy {
    width: 100%;
}

/* Auth card embedded footers */
.hh-form-card .site-footer--compact,
.hh-legal-card .site-footer--compact {
    max-width: none;
    width: 100%;
}

body[data-hh-skeleton="auth"] .hh-page-inner > .site-footer--compact {
    max-width: 420px;
    width: 100%;
}

@media (max-width: 900px) {
    .site-footer {
        padding: 3.25rem clamp(1.5rem, 5vw, 2.75rem) 1.75rem;
    }

    .site-footer__top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2.35rem 2.5rem;
    }

    .site-footer__brand {
        grid-column: 1 / -1;
    }

    .site-footer__brand-title {
        font-size: 1.52rem;
    }
}

@media (max-width: 560px) {
    .site-footer {
        padding: 2.75rem 1.5rem 1.5rem;
    }

    .site-footer__top {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .site-footer__brand-title {
        font-size: 1.42rem;
    }

    .site-footer__brand-text,
    .site-footer__links a,
    .site-footer__contact a {
        font-size: 1.1rem;
    }

    .site-footer__heading {
        font-size: 1rem;
        margin-bottom: 0.85rem;
    }

    .site-footer__links li + li {
        margin-top: 0.65rem;
    }

    .site-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
        margin-top: 2.75rem;
        padding-top: 1.5rem;
        font-size: 1.04rem;
    }

    .site-footer__legal a {
        font-size: 1.04rem;
    }
}
