/* ==========================================================================
   FOOTER - Styles for FSE footer template part
   ========================================================================== */

/* Remove default gap before footer template part */
.wp-block-template-part:has(.site-footer) {
    margin-top: 0 !important;
}

.site-footer {
    margin-top: 0;
}

/* Footer text colors */
.site-footer .footer-tagline,
.site-footer .footer-followers,
.site-footer .footer-newsletter-text,
.site-footer .footer-contact-item,
.site-footer .footer-copyright {
    color: rgba(255, 255, 255, 0.7);
}

.site-footer .footer-followers strong {
    color: var(--wp--preset--color--white);
}

/* Footer links */
.site-footer .footer-links {
    list-style: none;
}

.site-footer .footer-links a,
.site-footer .footer-contact-item a,
.site-footer .footer-legal a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-footer .footer-links a:hover,
.site-footer .footer-contact-item a:hover,
.site-footer .footer-legal a:hover {
    color: var(--wp--preset--color--white);
}

/* Footer CTA links */
.site-footer .footer-link-cta a {
    color: var(--wp--preset--color--white);
    text-decoration: none;
}

.site-footer .footer-link-cta a:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Footer links - override global red */
.site-footer a {
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--wp--preset--color--white) !important;
}

/* Footer CTA links (Voir les formules, etc.) */
.site-footer p[style*="uppercase"] a {
    color: var(--wp--preset--color--white) !important;
}

/* Footer social icons */
.site-footer .footer-social .wp-social-link {
    background: rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    transition: all 0.15s ease;
}

.site-footer .footer-social .wp-social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.site-footer .footer-social .wp-social-link svg {
    width: 20px;
    height: 20px;
}

/* Footer newsletter button */
.site-footer .footer-newsletter-btn .wp-block-button__link {
    background: linear-gradient(135deg, #B0001D 0%, #DC2626 50%, #7C3AED 100%);
    box-shadow: 0 4px 14px rgba(176, 0, 29, 0.25);
    transition: all 0.15s ease;
}

.site-footer .footer-newsletter-btn .wp-block-button__link:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(176, 0, 29, 0.35);
}

/* ==========================================================================
   FOOTER LAYOUT - Desktop
   ========================================================================== */

/* Footer responsive - tablet */
@media (max-width: 1024px) {
    .site-footer .footer-columns {
        flex-wrap: wrap;
    }

    .site-footer .footer-columns .wp-block-column {
        flex-basis: calc(50% - var(--wp--preset--spacing--md));
    }
}

/* Footer columns - Desktop */
.site-footer .footer-columns {
    gap: 48px;
}

.site-footer .footer-column {
    min-width: 150px;
}

/* Footer logo - constrained size via CSS */
.site-footer .footer-logo {
    max-width: 120px !important;
    width: 120px !important;
}

.site-footer .footer-logo img {
    width: 100% !important;
    max-width: 120px !important;
    height: auto !important;
}

/* Social icons - center icons in bubbles */
.site-footer .wp-block-social-links .wp-social-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.site-footer .wp-block-social-links .wp-social-link a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

.site-footer .wp-block-social-links .wp-social-link svg {
    margin: 0 !important;
}

/* Footer brand max-width on desktop */
@media (min-width: 769px) {
    .site-footer .footer-brand {
        max-width: 400px;
        text-align: left;
    }

    .site-footer .jurible-newsletter {
        max-width: 360px;
    }
}

/* ==========================================================================
   FOOTER MOBILE - Accordion Style
   ========================================================================== */

@media (max-width: 768px) {
    /* Footer top - stack vertically */
    .site-footer .footer-top {
        flex-direction: column;
        text-align: center;
        gap: 32px;
        overflow: hidden;
    }

    .site-footer .footer-brand {
        max-width: 100%;
        width: 100%;
        align-items: center;
    }

    .site-footer .footer-brand .wp-block-image {
        margin: 0 auto;
    }

    .site-footer .footer-social,
    .site-footer .wp-block-social-links {
        justify-content: center;
    }

    /* Newsletter full width on mobile */
    .site-footer .jurible-newsletter {
        max-width: 100%;
        width: 100%;
        text-align: center;
        padding: 0;
        box-sizing: border-box;
        overflow: hidden;
    }

    .site-footer .jurible-newsletter__form {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .site-footer .jurible-newsletter__input,
    .site-footer .jurible-newsletter input[type="email"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        background: rgba(255, 255, 255, 0.15) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        color: var(--wp--preset--color--white) !important;
        padding: 14px 16px !important;
        border-radius: 8px;
        font-size: 16px !important; /* Prevent iOS zoom */
        box-sizing: border-box !important;
    }

    .site-footer .jurible-newsletter__input::placeholder,
    .site-footer .jurible-newsletter input[type="email"]::placeholder {
        color: rgba(255, 255, 255, 0.6) !important;
    }

    .site-footer .jurible-newsletter__btn {
        width: 100%;
        box-sizing: border-box;
    }

    /* Columns - Accordion style on mobile */
    .site-footer .footer-columns {
        flex-direction: column;
        gap: 0;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .site-footer .footer-column {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 0;
    }

    /* Accordion header (h4) */
    .site-footer .footer-column > .wp-block-heading {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 0;
        margin-bottom: 0 !important;
        cursor: pointer;
        user-select: none;
    }

    .site-footer .footer-column > .wp-block-heading::after {
        content: '▼';
        font-size: 10px;
        color: rgba(255, 255, 255, 0.5);
        transition: transform 0.2s ease;
    }

    /* Accordion content (links) - hidden by default */
    .site-footer .footer-column > p {
        display: none;
        padding-left: 0;
    }

    /* Accordion open state */
    .site-footer .footer-column.is-open > .wp-block-heading::after {
        transform: rotate(180deg);
    }

    .site-footer .footer-column.is-open > p {
        display: block;
    }

    /* Last column (Contact) - always visible */
    .site-footer .footer-column--contact > p {
        display: block;
    }

    .site-footer .footer-column--contact > .wp-block-heading::after {
        display: none;
    }

    .site-footer .footer-column--contact > .wp-block-heading {
        cursor: default;
    }

    /* Bottom */
    .site-footer .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .site-footer .footer-legal {
        justify-content: center;
    }
}
