/**
 * Footer Styles - Universidad Villanueva
 *
 * Estilos para el footer sin Elementor.
 * Incluye acordeones CSS-only para móvil.
 *
 * Requiere Font Awesome 5+ para iconos de redes sociales.
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --vn-footer-bg: #000000;
    --vn-footer-text: #ffffff;
    --vn-footer-text-muted: #cccccc;
    --vn-footer-divider: #e31837;
    --vn-footer-link-hover: #5058FF;
    --vn-footer-padding-x: 50px;
    --vn-footer-padding-y: 40px;
    --vn-footer-font-family: inherit;
    --vn-footer-font-size: 14px;
    --vn-footer-line-height: 1.6;
}

/* ========================================
   Base Styles
   ======================================== */
.vn-footer {
    background-color: var(--vn-footer-bg);
    color: var(--vn-footer-text);
    font-family: var(--vn-footer-font-family);
    font-size: var(--vn-footer-font-size);
    line-height: var(--vn-footer-line-height);
}

.vn-footer *,
.vn-footer *::before,
.vn-footer *::after {
    box-sizing: border-box;
}

.vn-footer a {
    color: var(--vn-footer-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.vn-footer__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--vn-footer-padding-x);
}

/* ========================================
   Footer Top - 4 Columns Menu
   ======================================== */
.vn-footer-top {
    padding: var(--vn-footer-padding-y) 0;
}

.vn-footer-top .vn-footer__menu a {
    font-size: var(--vn-footer-font-size);
    color: #fff;
}
.vn-footer-top .vn-footer__container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

/* Titles */
.vn-footer__title .vn-footer__title-text {
    display: block;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    margin: 0 0 20px 0;
    color: #fff;
    text-transform: none;
    letter-spacing: 0;
}

/* Menu Styles */
.vn-footer__nav {
    margin: 0;
    padding: 0;
}

.vn-footer__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vn-footer__menu li {
    margin-bottom: 8px;
}

.vn-footer__menu li a{
    padding: 0 !important;
}

.vn-footer__menu a {
    font-size: 13px;
    color: var(--vn-footer-text-muted);
    display: block;
    padding: 2px 0;
}

.vn-footer-top .vn-footer__menu a:hover {
    color: var(--vn-footer-link-hover);
}

.vn-footer-bottom .vn-footer__menu a:hover {
    color: var(--vn-footer-text);
}

/* ========================================
   Accordion (Hidden on Desktop)
   ======================================== */
.vn-accordion__toggle {
    display: none;
}

.vn-accordion__icon {
    display: none;
}

/* ========================================
   Divider
   ======================================== */
.vn-footer__divider {
    height: 3px;
    background-color: var(--vn-footer-divider);
    margin: 0 var(--vn-footer-padding-x);
    max-width: calc(1200px - (var(--vn-footer-padding-x) * 2));
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   Footer Bottom - 5 Columns
   ======================================== */
.vn-footer-bottom {
    padding: var(--vn-footer-padding-y) 0;
}

.vn-footer-bottom i.fas {
    font-size: 16px;
    top: 0px;
    position: relative;
    color: #ffffff;
    font-weight: 600;
    rotate: 90deg;
}

.vn-footer__container--bottom {
    display: grid;
    grid-template-columns: 1fr 1.5fr 2fr 1.3fr;
    gap: 30px;
    align-items: start;
}

/* Wrapper Info + Legal */
.vn-footer__columns-info-legal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Subtitles */
.vn-footer__subtitle {
    display: block;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
    margin: 0 0 12px 0;
    text-transform: none;
}

/* Contact Column */
.vn-footer__contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vn-footer__contact-item i {
    font-size: 16px;
    color: var(--vn-footer-text);
}

.vn-footer__contact-item a {
    font-size: 14px;
}

/* Location Column */
.vn-footer__locations {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vn-footer__locations li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.vn-footer__location-icon {
    width: 14px;
    height: auto;
    flex-shrink: 0;
    margin-top: 3px;
    filter: brightness(0) invert(1);
}

.vn-footer__locations a {
    font-size: 13px;
    color: var(--vn-footer-text-muted);
    line-height: 1.4;
}

.vn-footer__locations a:hover {
    color: var(--vn-footer-text);
}

/* Social Column */
.vn-footer__social-icons {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 10px;
    gap: 10px;
}

.vn-footer__social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    font-size: 18px;
    color: var(--vn-footer-text);
    transition: transform 0.2s ease, color 0.2s ease;
}

.vn-footer__social-icons a:hover {
    color: #5058FF;
}

.vn-footer__social-x svg {
    width: 18px;
    height: 18px;
    transition: filter 0.2s ease;
}

.vn-footer__social-x:hover {
    fill: #5058FF;
}

/* Partners */
.vn-footer__subtitle--colaboran {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.vn-footer__partners {
    display: flex;
    flex-direction: row;
    gap: 15px;
}

.vn-footer__partner img {
    width: 92px;
    height: auto;
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.vn-footer__partner:hover img {
    opacity: 1;
}

/* ========================================
   Footer Copyright
   ======================================== */
.vn-footer-copyright {
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.vn-footer__container--copyright {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: center;
    padding: 0 45px
}

.vn-footer__logo-villanueva {
    width: 180px;
    height: auto;
}

.vn-footer__logo-fomento {
    width: 60px;
    height: auto;
}

.vn-footer__copyright-text {
    text-align: right;
}

.vn-footer__copyright-text p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.vn-footer__copyright-text strong {
    font-weight: 700;
}

/* ========================================
   Responsive - Tablet (< 1024px)
   ======================================== */
@media (max-width: 1023px) {
    :root {
        --vn-footer-padding-x: 30px;
    }

    .vn-footer-top .vn-footer__container {
        grid-template-columns: repeat(2, 1fr);
    }

    .vn-footer__container--bottom {
        grid-template-columns: repeat(3, 1fr);
    }

    .vn-footer__column--social {
        grid-column: span 3;
    }

    .vn-footer__social-icons {
        justify-content: flex-start;
    }

    .vn-footer__subtitle--colaboran {
        margin-top: 20px;
    }

    .vn-footer__partners {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }
}

/* ========================================
   Responsive - Mobile (< 768px)
   ======================================== */
@media (max-width: 767px) {
    :root {
        --vn-footer-padding-x: 20px;
        --vn-footer-padding-y: 20px;
    }

    /* ---- Footer Top - Accordions ---- */
    .vn-footer-top .vn-footer__container {
        display: block;
    }

    .vn-footer__column {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .vn-footer__column:last-child {
        border-bottom: none;
    }

    /* Accordion Toggle */
    .vn-footer__title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0;
        cursor: pointer;
        user-select: none;
    }

    .vn-footer__title .vn-footer__title-text {
        margin: 0;
        font-size: 15px;
        line-height: 20px;
    }

    /* Accordion Icon */
    .vn-accordion__icon {
        display: block;
        width: 12px;
        height: 12px;
        position: relative;
        transition: transform 0.3s ease;
    }

    .vn-accordion__icon::before,
    .vn-accordion__icon::after {
        content: '';
        position: absolute;
        background-color: var(--vn-footer-text);
        transition: transform 0.3s ease;
    }

    .vn-accordion__icon::before {
        width: 12px;
        height: 2px;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
    }

    .vn-accordion__icon::after {
        width: 2px;
        height: 12px;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }

    /* Accordion Content */
    .vn-footer__content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    /* Accordion Open State */
    .vn-accordion__toggle:checked~.vn-footer__title .vn-accordion__icon::after {
        transform: translateX(-50%) rotate(90deg);
        opacity: 0;
    }

    .vn-accordion__toggle:checked~.vn-footer__content {
        max-height: 500px;
        padding-bottom: 15px;
    }

    /* Focus state for accessibility */
    .vn-accordion__toggle:focus-visible~.vn-footer__title {
        outline: 2px solid var(--vn-footer-link-hover);
        outline-offset: 2px;
    }

    /* ---- Divider ---- */
    .vn-footer__divider {
        margin: 0 var(--vn-footer-padding-x);
    }

    /* ---- Footer Bottom ---- */
    .vn-footer__container--bottom {
        display: block;
    }

    .vn-footer__column--contact,
    .vn-footer__column--location {
        margin-bottom: 25px;
        padding-bottom: 25px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Info and Legal - 2 columns side by side */
    .vn-footer__columns-info-legal {
        display: flex;
        justify-content: space-between;
        gap: 20px;
        margin-bottom: 25px;
    }

    .vn-footer__column--info,
    .vn-footer__column--legal {
        flex: 1;
        margin-bottom: 0;
    }

    /* Social - Full width */
    .vn-footer__column--social {
        padding-top: 25px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .vn-footer__social-icons {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: flex-start;
    }

    .vn-footer__social-icons a {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .vn-footer__partners {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
        gap: 20px;
    }

    .vn-footer__partner img {
        width: 80px;
    }

    /* ---- Footer Copyright ---- */
    .vn-footer__container--copyright {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
    }

    .vn-footer__container--copyright div {
        width: 100%;
        text-align: center;
    }

    .vn-footer__logo-villanueva {
        width: 100px;
    }

    .vn-footer__logo-fomento {
        width: 50px;
    }

    .vn-footer__copyright-text {
        text-align: right;
    }

    .vn-footer__copyright-text p {
        font-size: 11px;
    }
}

/* ========================================
   Responsive - Small Mobile (< 480px)
   ======================================== */
@media (max-width: 479px) {
    :root {
        --vn-footer-padding-x: 15px;
    }

    /* Info and Legal - Stack vertically */
    .vn-footer__columns-info-legal {
        flex-direction: row;
        gap: 25px;
    }

    .vn-footer__social-icons a {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .vn-footer-bottom .vn-footer__menu .menu-item-type-custom a {
        margin-left: 0 !important;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .vn-footer {
        background-color: #fff;
        color: #000;
    }

    .vn-footer a {
        color: #000;
    }

    .vn-accordion__toggle,
    .vn-accordion__icon {
        display: none !important;
    }

    .vn-footer__content {
        max-height: none !important;
        overflow: visible !important;
    }
}

/* ===== Biblioteca (añadido; el resto es el CSS del pie de villanueva.edu) ===== */
.vn-footer--biblioteca { --vn-footer-link-hover: #ffbc00; --vn-footer-divider: #ffbc00; }
.vn-footer--biblioteca .vn-footer__contact-item { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.vn-footer--biblioteca .vn-footer__locations li { display: flex; gap: 10px; align-items: baseline; }
.vn-footer--biblioteca .vn-footer__locations i { width: 14px; text-align: center; color: var(--vn-footer-text-muted); }
.vn-footer--biblioteca .vn-footer__copyright-text { margin: 12px 0 0; font-size: 12px; color: var(--vn-footer-text-muted); }
.vn-footer--biblioteca .vn-footer__copyright-text a { color: inherit; text-decoration: underline; }
