/**
 * ZanCo. ltd Footer Styles
 * Dark footer: aligns with Property_details / Properties_index references (brand black, ivory, muted links, gold).
 *
 * @package ZanCo
 * @since 1.0.0
 */

/* ==========================================================================
   Footer CSS Custom Properties
   ========================================================================== */

:root {
    --footer-bg: var(--wp--preset--color--black, #0f0f0f);
    --footer-border: #27272a;
    --footer-text: var(--wp--preset--color--ivory, #f8f6f0);
    --footer-text-muted: var(--wp--preset--color--footer-text, #9ca3af);
    --footer-text-subtle: #6b7280;
    --footer-link-hover: var(--wp--preset--color--gold, #c2a878);
    --footer-brand-gold: var(--wp--preset--color--gold, #c2a878);
    --footer-brand-wordmark: var(--wp--preset--color--ivory, #f8f6f0);
    --footer-input-bg: #171717;
    --footer-input-border: #27272a;
    --footer-button-bg: #b89168;
    --footer-button-hover: #a07d57;
    --footer-divider: #27272a;
}

/* ==========================================================================
   Base Footer Styles
   ========================================================================== */

.site-footer {
    background-color: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    color: var(--footer-text);
    padding-top: 4rem;
    padding-bottom: 2.5rem;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    clear: both;
}

@media (min-width: 1024px) {
    .site-footer {
        padding-top: 5rem;
    }
}

/* FSE: template part wrapper is a div; full-bleed dark bar */
.wp-block-template-part:has(.site-footer) {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
    padding-top: 0;
}

/* Remove any top margin from footer template part wrapper */
footer.site-footer,
.wp-block-template-part > footer,
.site-footer.wp-block-group {
    margin-top: 0 !important;
}

/* Remove block gap/margin before footer in all templates */
main + .wp-block-template-part,
main + footer,
.wp-block-group > .wp-block-template-part:last-child,
.is-layout-flow > .wp-block-template-part:last-child {
    margin-top: 0 !important;
}

/* Remove WordPress default block gap before footer */
body .is-layout-flow > *:last-child:has(> .site-footer),
body .is-layout-constrained > *:last-child:has(> .site-footer),
body > .wp-block-template-part:has(.site-footer) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Global footer margin reset for all templates */
.site-footer,
footer.site-footer,
.site-footer.wp-block-group,
[data-amp-original-class*="site-footer"] {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
}

.site-footer__container {
    max-width: 1440px;
    margin-inline-start: auto;
    margin-inline-end: auto;
    padding-inline-start: 1.5rem;
    padding-inline-end: 1.5rem;
}

@media (min-width: 1024px) {
    .site-footer__container {
        padding-inline-start: 3rem;
        padding-inline-end: 3rem;
    }
}

/* ==========================================================================
   Footer Main Grid
   ========================================================================== */

.site-footer__main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-block-end: 3.5rem;
}

@media (min-width: 768px) {
    .site-footer__main {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem 2rem;
    }
}

@media (min-width: 1024px) {
    .site-footer__main {
        grid-template-columns: 4fr 2fr 3fr 3fr;
        gap: 4rem;
    }
}

/* Mobile / narrow: hide link columns + newsletter (brand + bottom bar only) */
@media (max-width: 782px) {
    .site-footer__main {
        grid-template-columns: 1fr;
        gap: 0;
        margin-block-end: 2rem;
    }

    .site-footer__column--company,
    .site-footer__column--services,
    .site-footer__column--newsletter {
        display: none !important;
    }
}

/* ==========================================================================
   Footer Columns
   ========================================================================== */

.site-footer__column {
    min-width: 0; /* Prevent flex overflow */
}

/* Brand Column */
.site-footer__column--brand {
    max-width: 100%;
}

@media (min-width: 1024px) {
    .site-footer__column--brand {
        max-width: 22rem;
    }
}

/* ==========================================================================
   Footer Brand
   ========================================================================== */

.site-footer__brand {
    margin-block-end: 1.5rem;
}

.site-footer__brand .custom-logo-link {
    display: inline-block;
    line-height: 0;
    text-decoration: none;
}

.site-footer__brand .custom-logo {
    max-height: 56px;
    width: auto;
    height: auto;
    display: block;
}

@media (min-width: 768px) {
    .site-footer__brand .custom-logo {
        max-height: 64px;
    }
}

.site-footer__brand-link {
    display: inline-block;
    text-decoration: none;
}

.site-footer__brand-name,
.site-footer .site-footer__brand-link {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.5rem, 2.5vw, 1.875rem);
    font-weight: 400;
    color: var(--footer-brand-wordmark);
    letter-spacing: 0;
    line-height: 1.2;
}

.site-footer__brand-description {
    font-size: 0.875rem;
    line-height: 1.625;
    font-weight: 300;
    color: var(--footer-text-muted);
    margin-block-start: 0;
    margin-block-end: 2rem;
    max-width: 22rem;
}

/* ==========================================================================
   Footer Social Links
   ========================================================================== */

.site-footer__social-list {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--footer-border);
    border-radius: 9999px;
    color: var(--footer-text-muted);
    text-decoration: none;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.site-footer__social-link:hover,
.site-footer__social-link:focus {
    color: var(--footer-link-hover);
    border-color: var(--footer-link-hover);
}

.site-footer__social-link i {
    font-size: 0.875rem;
}

/* wp_nav_menu( footer_social ) — links usually lack .site-footer__social-link */
.site-footer__social-list > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--footer-border);
    border-radius: 9999px;
    color: var(--footer-text-muted);
    text-decoration: none;
    transition: color 0.3s ease, border-color 0.3s ease;
    font-size: 0.875rem;
    box-sizing: border-box;
}

.site-footer__social-list > li > a:hover,
.site-footer__social-list > li > a:focus {
    color: var(--footer-link-hover);
    border-color: var(--footer-link-hover);
}

/* ==========================================================================
   Footer Column Titles
   ========================================================================== */

.site-footer__column-title,
.site-footer h4.site-footer__column-title.wp-block-heading {
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--footer-text);
    margin-block-start: 0;
    margin-block-end: 1.5rem;
    line-height: 1.3;
}

/* ==========================================================================
   Footer Navigation
   ========================================================================== */

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

.site-footer__nav-list li {
    margin-block-end: 0.75rem;
}

.site-footer__nav-list li:last-child {
    margin-block-end: 0;
}

.site-footer__nav-list a {
    font-size: 0.875rem;
    font-weight: 300;
    color: var(--footer-text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer__nav-list a:hover,
.site-footer__nav-list a:focus {
    color: var(--footer-link-hover);
}

/* ==========================================================================
   Footer Newsletter
   ========================================================================== */

.site-footer__newsletter-intro {
    font-size: 0.875rem;
    line-height: 1.625;
    font-weight: 300;
    color: var(--footer-text-muted);
    margin-block-start: 0;
    margin-block-end: 1rem;
}

.site-footer__newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}

@media (min-width: 640px) {
    .site-footer__newsletter-form {
        flex-direction: row;
    }
}

.site-footer__newsletter-input {
    flex: 1;
    min-width: 0;
    background-color: var(--footer-input-bg);
    border: 1px solid var(--footer-input-border);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--footer-text);
    outline: none;
    transition: border-color 0.3s ease;
}

.site-footer__newsletter-input::placeholder {
    color: rgba(248, 246, 240, 0.35);
}

.site-footer__newsletter-input:focus {
    border-color: var(--footer-link-hover);
}

.site-footer__newsletter-button {
    background-color: var(--footer-button-bg);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.site-footer__newsletter-button:hover,
.site-footer__newsletter-button:focus {
    background-color: var(--footer-button-hover);
}

/* ==========================================================================
   Footer Bottom Bar
   ========================================================================== */

.site-footer__bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-block-start: 2rem;
    border-top: 1px solid var(--footer-divider);
}

@media (min-width: 640px) {
    .site-footer__bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

.site-footer__copyright {
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--footer-text-subtle);
    margin: 0;
}

.site-footer__bottom-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}

/* ==========================================================================
   Footer Legal Links
   ========================================================================== */

.site-footer__legal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer__legal-list a {
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--footer-text-subtle);
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer__legal-list a:hover,
.site-footer__legal-list a:focus {
    color: var(--footer-link-hover);
}

/* ==========================================================================
   Footer Language Switcher
   ========================================================================== */

.site-footer__language-list {
    display: flex;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer__language-list a {
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--footer-text-subtle);
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer__language-list a:hover,
.site-footer__language-list a:focus,
.site-footer__language-list a[aria-current="true"] {
    color: var(--footer-link-hover);
}

/* ==========================================================================
   Block Theme Footer Styles (for parts/footer.html)
   ========================================================================== */

.wp-block-group.site-footer--home2 {
    background-color: var(--footer-bg);
}

.wp-block-group.site-footer--home2 .footer-brand-title {
    font-family: 'Playfair Display', Georgia, serif;
}

.wp-block-group.site-footer--home2 .footer-social-links {
    gap: 0.75rem;
}

.wp-block-group.site-footer--home2 .footer-social-links .wp-block-social-link {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--footer-border);
    border-radius: 9999px;
}

.wp-block-group.site-footer--home2 .footer-social-links .wp-block-social-link a {
    color: var(--footer-text-muted);
    transition: color 0.3s ease;
}

.wp-block-group.site-footer--home2 .footer-social-links .wp-block-social-link:hover {
    border-color: var(--footer-link-hover);
}

.wp-block-group.site-footer--home2 .footer-social-links .wp-block-social-link:hover a {
    color: var(--footer-link-hover);
}

/* Newsletter input in block footer */
.wp-block-group.site-footer--home2 .footer-newsletter-input {
    flex: 1;
    min-width: 0;
    background-color: var(--footer-input-bg);
    border: 1px solid var(--footer-input-border);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--footer-text);
    outline: none;
    transition: border-color 0.3s ease;
    width: 100%;
}

.wp-block-group.site-footer--home2 .footer-newsletter-input::placeholder {
    color: rgba(248, 246, 240, 0.35);
}

.wp-block-group.site-footer--home2 .footer-newsletter-input:focus {
    border-color: var(--footer-link-hover);
}

/* Footer navigation in block theme */
.wp-block-group.site-footer--home2 .footer-nav {
    font-size: 0.875rem;
    font-weight: 300;
}

.wp-block-group.site-footer--home2 .footer-nav a {
    color: var(--footer-text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.wp-block-group.site-footer--home2 .footer-nav a:hover {
    color: var(--footer-link-hover);
}

.wp-block-group.site-footer--home2 .footer-nav .wp-block-navigation__container {
    gap: 0.75rem;
}

/* Legal links in block footer */
.wp-block-group.site-footer--home2 .footer-legal-links {
    gap: 1.5rem;
}

.wp-block-group.site-footer--home2 .footer-legal-link a {
    color: var(--footer-text-subtle);
    transition: color 0.3s ease;
}

.wp-block-group.site-footer--home2 .footer-legal-link a:hover {
    color: var(--footer-link-hover);
}

/* ==========================================================================
   Responsive Column Adjustments for Block Footer
   ========================================================================== */

@media (max-width: 781px) {
    .footer-main-columns .wp-block-column {
        flex-basis: 100% !important;
    }
}

@media (min-width: 782px) and (max-width: 1023px) {
    .footer-main-columns .wp-block-column {
        flex-basis: 50% !important;
    }
    
    .footer-brand-column,
    .footer-newsletter-column {
        flex-basis: 50% !important;
    }
    
    .footer-nav-column--company,
    .footer-nav-column--services {
        flex-basis: 50% !important;
    }
}
