/* footer.css - Mobile-First Responsive Design with Accordion */

/* ---------- Core wrapper ---------- */
.footer-section {
    background-color: var(--dark-teal) !important;
    color: var(--white) !important;
    font-family: 'Harmonia Sans Pro Cyr', sans-serif !important;
}

/* ---------- Layout containers ---------- */
.footer-section .container {
    max-width: 1440px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Desktop container padding to match Figma */
@media screen and (min-width: 768px) {
    .footer-section .container {
        padding-left: 79px !important;
        padding-right: 79px !important;
    }
}

/* ---------- Mobile-First Layout ---------- */
.footer-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Footer Left - Logo, Contact & Social (Mobile: FIRST) */
.footer-left {
    order: 1; /* Mobile: Logo and contact FIRST */
}

.footer-logo {
    margin-bottom: 24px !important;
}

.footer-logo img {
    width: 120px;
    height: auto;
}

.contact-info {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 24px;
}

.contact-info p {
    margin-bottom: 8px !important;
}

/* ✅ SUBTLE ANIMATION: Email link with underline */
.contact-info a {
    color: var(--white) !important;
    text-decoration: none !important;
    position: relative;
    font-size: 14px !important;
    transition: color 0.2s ease;
    padding-bottom: 2px;
}

.contact-info a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--white);
    transition: width 0.25s ease;
}

.contact-info a:hover::after,
.contact-info a:focus::after {
    width: 100%;
}

.contact-info a:hover,
.contact-info a:focus {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* Social Media Icons - Mobile First */
.social-media-icons {
    display: flex;
    gap: 20px;
    margin-top: 24px !important;
    justify-content: flex-start;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 44px;  /* WCAG minimum touch target */
    height: 44px;
    border-radius: 4px;
    transition: opacity 0.2s ease;
}

.social-icon:hover,
.social-icon:focus {
    opacity: 0.8;
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

.social-icon img {
    width: 20px;
    height: 20px;
}

/* Footer Center - Navigation (Mobile: Second) */
.footer-center {
    order: 2; /* Mobile: Navigation after logo/contact */
}

.footer-nav-columns {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Accordion Sections */
.footer-nav-section {
    padding-bottom: 16px;
}

.footer-nav-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Accordion Toggle Buttons - Enhanced Accessibility */
.footer-nav-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 12px 0;
    min-height: 44px; /* WCAG touch target */
    transition: opacity 0.2s ease;
    border-radius: 4px;
    margin: 0 -8px;
    text-align: left;
}

.footer-nav-toggle:hover,
.footer-nav-toggle:focus {
    opacity: 0.8;
    outline: 2px solid var(--white);
    outline-offset: 2px;
    padding: 12px 8px;
}

.footer-nav-toggle h5 {
    font-family: 'Editorial New', serif !important;
    font-size: 18px !important;
    margin: 0 !important;
    font-weight: normal !important;
    color: var(--white) !important;
    text-align: left;
}

/* Chevron Arrows */
.footer-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

.footer-nav-toggle[aria-expanded="true"] .footer-chevron {
    transform: rotate(180deg);
}

/* Collapsible Content */
.footer-nav-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0;
    opacity: 0;
}

.footer-nav-content.active {
    max-height: 400px !important;
    padding: 12px 0 0 0;
    opacity: 1;
}

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

.footer-nav-content li {
    margin-bottom: 8px;
}

/* ✅ SUBTLE ANIMATION: Navigation links with underline */
.footer-nav-content a {
    color: var(--white) !important;
    text-decoration: none !important;
    font-size: 14px;
    line-height: 1.4;
    padding: 6px 0;
    display: block;
    position: relative;
    transition: color 0.2s ease;
    padding-bottom: 8px;
}

.footer-nav-content a::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--white);
    transition: width 0.3s ease;
}

.footer-nav-content a:hover::after,
.footer-nav-content a:focus::after {
    width: 100%;
}

.footer-nav-content a:hover,
.footer-nav-content a:focus {
    /* Only use the ::after underline animation, no outline border */
}

/* Portfolio Section - No Accordion (Standalone) */
.footer-portfolio h5 {
    font-family: 'Editorial New', serif !important;
    font-size: 18px !important;
    margin: 0 0 12px 0 !important;
    font-weight: normal !important;
    color: var(--white) !important;
}

/* Footer Right - Action Links */
.footer-right {
    order: 3; /* Mobile: After navigation */
}

.footer-action-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ✅ SUBTLE ANIMATION: Action links with arrow movement */
.footer-action-link a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    font-size: 14px;
    font-weight: 600;
    color: var(--white) !important;
    text-decoration: none !important;
    transition: border-color 0.3s ease, opacity 0.3s ease;
    min-height: 44px; /* WCAG touch target */
}

.footer-action-link span:last-child {
    transition: transform 0.2s ease;
}

.footer-action-link a:hover span:last-child,
.footer-action-link a:focus span:last-child {
    transform: translateX(4px);
}

.footer-action-link a:hover,
.footer-action-link a:focus {
    border-bottom-color: var(--white);
    opacity: 0.8;
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* Footer Bottom */
.footer-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 40px 0 24px 0;
}

.footer-bottom {
    order: 4; /* Always last */
}

.footer-copyright {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 14px;
    padding-bottom: 40px;
}

.content-copyright {
    color: var(--white);
}

.footer-legal-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ✅ SUBTLE ANIMATION: Legal links with underline */
.footer-legal-nav a {
    color: var(--white) !important;
    text-decoration: none !important;
    padding: 8px 0;
    position: relative;
    transition: color 0.2s ease;
    padding-bottom: 10px;
}

.footer-legal-nav a::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--white);
    transition: width 0.3s ease;
}

.footer-legal-nav a:hover::after,
.footer-legal-nav a:focus::after {
    width: 100%;
}

.footer-legal-nav a:hover,
.footer-legal-nav a:focus {
    /* Only use the ::after underline animation, no outline border */
}

/* ---------- Desktop Styles (Match Figma Design) ---------- */
@media screen and (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        align-items: flex-start;
        gap: 30px;
        margin-bottom: 40px;
        width: 100%;
    }
    
    /* Left: Logo, Contact, Social */
    .footer-left {
        flex: 0 0 auto;
        width: 177px;
        order: 1;
    }
    
    /* Center: Navigation Columns */
    .footer-center {
        flex: 1;
        order: 2;
        padding: 0;
        min-width: 0; /* Allow shrinking */
    }
    
    /* Desktop: Disable accordion, show all content */
    .footer-nav-columns {
        display: flex;
        flex-direction: row;
        gap: 20px;
        width: 100%;
        flex-wrap: wrap; /* Allow wrapping when needed */
    }
    
    .footer-nav-section {
        border-bottom: none;
        padding-bottom: 0;
        flex: 0 0 auto;
        min-width: 100px; /* Reduced for better fit */
        max-width: 140px; /* Added max-width to prevent too much spreading */
    }
    
    .footer-nav-toggle {
        pointer-events: none;
        padding: 0;
        min-height: auto;
        cursor: default;
        margin: 0;
    }
    
    .footer-nav-toggle:hover,
    .footer-nav-toggle:focus {
        background-color: transparent;
        outline: none;
        opacity: 1;
    }
    
    .footer-nav-toggle h5 {
        font-size: 20px !important;
        margin-bottom: 16px !important;
        font-family: 'Editorial New', serif !important;
        font-weight: normal !important;
    }
    
    .footer-chevron {
        display: none;
    }
    
    .footer-nav-content {
        max-height: none !important;
        overflow: visible !important;
        transition: none !important;
        padding: 0 !important;
        opacity: 1 !important;
    }
    
    .footer-nav-content.active {
        max-height: none !important;
        padding: 0 !important;
        opacity: 1 !important;
    }
    
    .footer-nav-content a {
        font-size: 14px;
        line-height: 1.3;
        padding: 0;
        margin: 0;
        padding-bottom: 2px;
    }
    
    .footer-portfolio h5 {
        font-size: 20px !important;
        margin: 0 0 16px 0 !important;
    }
    
    /* Right: Action Buttons Stack */
    .footer-right {
        flex: 0 0 auto;
        width: 182px;
        order: 3;
        min-width: 182px; /* Prevent shrinking below usable width */
    }
    
    .footer-action-links {
        gap: 16px;
    }
    
    .footer-action-link a {
        width: 182px;
        font-size: 14px;
        font-weight: 600;
        text-transform: uppercase;
        padding: 8px 0;
    }
    
    /* Bottom: Copyright Row */
    .footer-copyright {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .footer-legal-nav {
        flex-direction: row;
        gap: 16px;
    }
}

/* ---------- Responsive Layout for Tight Spaces ---------- */
/* When screen gets too narrow, move action links below nav columns */
@media screen and (min-width: 768px) and (max-width: 1200px) {
    .footer-content {
        flex-direction: column;
        gap: 32px;
    }
    
    /* Keep left column as is */
    .footer-left {
        order: 1;
        width: auto;
        align-self: flex-start;
    }
    
    /* Navigation columns stay in row layout */
    .footer-center {
        order: 2;
        width: 100%;
    }
    
    .footer-nav-columns {
        display: flex;
        flex-direction: row;
        gap: 16px;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .footer-nav-section {
        flex: 1;
        min-width: 120px;
        max-width: 160px;
    }
    
    /* Move action links below nav, in a single row */
    .footer-right {
        order: 3;
        width: 100%;
        margin-top: 16px;
    }
    
    .footer-action-links {
        display: flex;
        flex-direction: row;
        gap: 24px;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .footer-action-link {
        flex: 1;
        min-width: 160px;
        max-width: 220px;
    }
    
    .footer-action-link a {
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .footer-contact-button {
        margin-top: 24px;
        align-self: flex-start;
    }
}

/* For very wide screens, restore original 3-column layout */
@media screen and (min-width: 1201px) {
    .footer-content {
        flex-direction: row;
        gap: 41px;
    }
    
    .footer-left {
        width: 177px;
        order: 1;
    }
    
    .footer-center {
        flex: 1;
        order: 2;
    }
    
    .footer-right {
        width: 182px;
        order: 3;
    }
    
    .footer-action-links {
        flex-direction: column;
        gap: 16px;
    }
    
    .footer-action-link {
        flex: none;
        min-width: auto;
        max-width: none;
    }
    
    .footer-action-link a {
        width: 182px;
    }
}

/* ---------- Accessibility Enhancements ---------- */
@media (prefers-reduced-motion: reduce) {
    .social-icon,
    .footer-nav-content a,
    .footer-action-link a,
    .footer-nav-toggle,
    .footer-chevron,
    .footer-nav-content,
    .contact-info a::after,
    .footer-nav-content a::after,
    .footer-action-link span:last-child,
    .footer-legal-nav a::after {
        transition: none;
        animation: none;
    }
    
    .footer-action-link a:hover span:last-child {
        transform: none;
    }
}

.social-icon:focus {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* Services + Portfolio Stacked Column Layout (per Figma) */
.footer-services-portfolio {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Footer Contact Button */
.footer-contact-button {
    margin-top: 24px;
}

/* Portfolio Section in Right Column */
.footer-portfolio-section {
    margin-bottom: 32px;
}

.footer-portfolio-section h5 {
    font-size: 20px !important;
    margin-bottom: 0 !important;
    font-family: 'Editorial New', serif !important;
    font-weight: normal !important;
}

.footer-portfolio-section a {
    color: var(--white) !important;
    text-decoration: none !important;
    transition: opacity 0.2s ease;
}

.footer-portfolio-section a:hover,
.footer-portfolio-section a:focus {
    opacity: 0.8;
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

.footer-nav-subsection {
    display: flex;
    flex-direction: column;
}

/* On desktop, Services + Portfolio are stacked in center area */
@media screen and (min-width: 768px) {
    .footer-services-portfolio {
        gap: 24px;
        min-width: 120px;
    }
    
    .footer-nav-subsection .footer-nav-toggle h5 {
        margin-bottom: 16px !important;
    }
    
    .footer-contact-button {
        margin-top: 32px;
    }
}

/* Footer Dividers */
.footer-divider {
    border: none;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 40px 0 20px 0;
}

/* Footer Bottom */
.footer-bottom {
    margin-top: 20px;
}

.footer-copyright {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-legal-nav {
    display: flex;
    gap: 24px;
}

/* Mobile Collapsible Content */
.footer-nav-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.footer-nav-content[aria-hidden="true"] {
    max-height: 0;
}

.footer-nav-content[aria-hidden="false"] {
    max-height: 300px; /* Adjust based on content */
}

/* Reduced Motion Support - Accessibility Critical */
@media (prefers-reduced-motion: reduce) {
    .footer-nav-content a::after,
    .footer-action-link a::after,
    .footer-legal-nav a::after,
    .contact-info a::after {
        transition: none;
    }
    
    .footer-nav-toggle,
    .footer-chevron,
    .social-icon,
    .footer-action-link span:last-child {
        transition: none;
    }
    
    .footer-nav-content {
        transition: none;
    }
}

/* Mobile Responsive */
@media screen and (max-width: 767px) {
    .footer-content {
        flex-direction: column;
        gap: 32px;
    }
    
    .footer-left,
    .footer-center,
    .footer-right {
        flex: none;
        width: 100%;
        max-width: none;
    }
    
    .footer-nav-columns {
        flex-direction: column;
        gap: 0;
    }
    
        .footer-nav-section {
        /* No border - using individual link underlines only */
    }

    .footer-nav-section:last-child {
        /* No border needed */
    }
    
    .footer-copyright {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .footer-legal-nav {
        flex-direction: column;
        gap: 12px;
    }
    
    /* Fix contact button spacing on mobile */
    .footer-contact-button {
        margin-top: 40px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .footer-nav-toggle:focus,
    .footer-nav-content a:focus,
    .footer-action-link a:focus,
    .footer-legal-nav a:focus,
    .contact-info a:focus {
        outline-width: 3px;
    }
}

/* Print Styles */
@media print {
    .footer-section {
        background: none !important;
        color: black !important;
    }
    
    .footer-nav-content a::after,
    .footer-action-link a::after,
    .footer-legal-nav a::after,
    .contact-info a::after {
        display: none;
    }
}
