/**
 * Footer — basado en mockup v2
 * Breakpoints: móvil <480 | tablet 481-768 | desktop >768
 */

/* ============================================================
   CONTENEDOR PRINCIPAL
   ============================================================ */

.site-footer {
    background-color: #1d5f87;
    color: rgba(255, 255, 255, 0.8);
    padding: 60px 5% 20px;
    font-family: inherit;
    margin-top: 0; /* reset main.css */
    border-top: none;
}

/* ============================================================
   GRID DE COLUMNAS
   ============================================================ */

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================================
   COLUMNA MARCA — logo + descripción + redes
   ============================================================ */

.footer-col--brand {
    padding-right: 20px;
}

.footer-logo-link {
    display: inline-block;
    margin-bottom: 15px;
    text-decoration: none;
    transition: opacity 0.25s ease;
}

.footer-logo-link:hover {
    opacity: 0.85;
}

.footer-logo-img {
    display: block;
    max-height: 70px;
    width: auto;
    object-fit: contain;
}

.footer-tagline {
    font-size: 0.9rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

/* ── Redes sociales ── */

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}

.footer-social a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease;
}

.footer-social a:hover {
    background: #E74F08;
    transform: translateY(-3px);
}

.footer-social a:focus-visible {
    outline: 2px solid #E74F08;
    outline-offset: 3px;
}

/* ============================================================
   COLUMNAS DE MENÚ
   ============================================================ */

.footer-col__title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 20px;
    padding-bottom: 12px;
    position: relative;
    line-height: 1.2;
}

/* Línea naranja decorativa bajo el título */
.footer-col__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: #E74F08;
    border-radius: 2px;
}

/* ── Lista de menú generada por wp_nav_menu() ── */

.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-menu li {
    margin: 0;
    padding: 0;
}

/* WordPress añade submenús: ocultarlos en el footer */
.footer-menu .sub-menu {
    display: none;
}

.footer-menu a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.4;
    display: inline-block;
    transition: color 0.3s ease;
}

.footer-menu a:hover {
    color: #E74F08;
}

.footer-menu a:focus-visible {
    outline: 2px solid #E74F08;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ============================================================
   BARRA INFERIOR — copyright
   ============================================================ */

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 22px;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}

/* ============================================================
   RESPONSIVE — tablet  ≤ 900px
   ============================================================ */

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 35px 30px;
    }

    .footer-col--brand {
        grid-column: 1 / -1; /* Ocupa el ancho completo */
        padding-right: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================
   RESPONSIVE — móvil  ≤ 480px
   ============================================================ */

@media (max-width: 480px) {
    .site-footer {
        padding: 50px 5% 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-col--brand {
        grid-column: 1;
    }

    .footer-col__title {
        font-size: 1rem;
    }

    .footer-social {
        gap: 10px;
    }
}

/* ============================================================
   ACCESIBILIDAD — reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .footer-social a,
    .footer-logo-link,
    .footer-menu a {
        transition: none;
    }

    .footer-social a:hover {
        transform: none;
    }
}

/* ============================================================
   LOGOS INSTITUCIONALES
   ============================================================ */

/* ─── Logos institucionales ─────────────────────────────────────────────── */
.footer-logos {
    padding-top: 40px;
    border-top: 1px solid rgba(0, 108, 148, 0.15);
    background-color: #FFFFFF;
    padding: 10px 0 24px;
}

.footer-logos-row {
    width: min(100%, 1440px);
    margin: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: center;
    justify-items: center;
    padding: 0 24px;
}

.footer-logos-row + .footer-logos-row {
    margin-top: 24px;
}

.footer-logos-row-secondary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.footer-logo-img {
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: grayscale(20%);
    transition: filter 0.3s ease;
}

img.footer-logo-img.footer-logo-financiado-union-europea {
    max-height: 197px !important;
}

img.footer-logo-img.footer-logo-prtr {
    max-height: 95px !important;
}

img.footer-logo-img.footer-logo-gobierno-espana {
    max-height: 70px !important;
}

img.footer-logo-img.footer-logo-gobierno-principado-asturias {
    max-height: 105px !important;
}

img.footer-logo-img.footer-logo-cincovillas {
    max-height: 100px !important;
}

img.footer-logo-img.footer-logo-bajo-nalon-desarrollo-rural {
    max-height: 82px !important;
}

img.footer-logo-img.footer-logo-leader {
    max-height: 93px !important;
}

.footer-logo-img:hover {
    filter: grayscale(0%);
}

.footer-logos-full {
    display: flex;
    justify-content: center;
}

.footer-logos-full img {
    max-height: 80px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: grayscale(20%);
    transition: filter 0.3s ease;
}

.footer-logos-full img:hover {
    filter: grayscale(0%);
}

/* -- Enlaces legales del footer (RGPD / LSSI-CE) -- */
.footer-legal {
    margin: 0 0 12px;
}

.footer-legal__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
}

.footer-legal__item {
    position: relative;
}

.footer-legal__item:not(:last-child)::after {
    content: "\00B7";
    position: absolute;
    right: -11px;
    opacity: 0.5;
}

.footer-legal__link {
    color: inherit;
    opacity: 0.85;
    text-decoration: none;
    font-size: 0.85rem;
    transition: opacity 0.2s ease;
}

.footer-legal__link:hover,
.footer-legal__link:focus-visible {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-legal__link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

@media (max-width: 480px) {
    .footer-legal__item:not(:last-child)::after {
        display: none;
    }
}
