/*
 * UniCore | Spazio studenti
 *
 * File: assets/css/site-footer-columns.css
 * Funzione: Stili per site footer columns.
 *
 * Copyright © 2026 Davide Giovanni Paolo Di Salvatore.
 * Proprietario di UniCore. Tutti i diritti riservati.
 *
 * Condizioni d’uso del codice e dei materiali originali in LICENSE.md.
 */

body footer.unicore-footer {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #122d41 !important;
    color: #d0dce5 !important;
    text-align: start;
}

html[data-theme="dark"] body footer.unicore-footer {
    background: #0e2334 !important;
}

.unicore-footer-inner {
    width: min(100% - 3rem, 83rem);
    margin-inline: auto;
}

.unicore-footer-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: clamp(1.5rem, 3vw, 3rem);
    padding-block: clamp(2.5rem, 5vw, 4rem);
}

.unicore-footer-columns:not(:has(nav:nth-child(3))) {
    grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
}

body footer.unicore-footer h2 {
    position: relative;
    margin: 0 0 1.125rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid #ffffff36;
    font: 650 .875rem/1.4 system-ui, sans-serif;
    letter-spacing: .055em;
    text-transform: uppercase;
    color: #f5f9fc !important;
}

body footer.unicore-footer h2::after {
    position: absolute;
    inset: auto auto -1px 0;
    width: 2.5rem;
    height: 2px;
    background: #6ce3bb;
    content: "";
}

.unicore-footer ul { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.unicore-footer li, .unicore-footer p { overflow-wrap: anywhere; line-height: 1.6; }
body footer.unicore-footer p { max-width: 36ch; margin: 1rem 0 0; color: inherit; }

body footer.unicore-footer a {
    color: #f2f8fc;
    background: transparent;
    text-decoration: none;
}

body footer.unicore-footer a strong { color: inherit; }
body footer.unicore-footer small { color: inherit; }

body footer.unicore-footer a:hover { color: #88efcd; text-decoration: underline; text-underline-offset: .2em; }
.unicore-footer a:focus-visible { outline: 2px solid #88efcd; outline-offset: 4px; }

.unicore-footer-brand { display: inline-flex; align-items: center; gap: .65rem; font-size: 1.55rem; }
.unicore-footer-brand img { object-fit: contain; border-radius: .55rem; background: #f5f9fc; }
.unicore-footer-brand span { color: #6ce3bb; }

.unicore-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
    padding-block: 1.25rem;
    border-top: 1px solid #ffffff36;
}

.unicore-footer-credits { display: flex; flex: 1 1 16rem; flex-wrap: wrap; gap: .25rem 1rem; }
.unicore-footer-socials, .unicore-footer-socials ul { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.unicore-footer-socials > span { margin-inline-end: .3rem; font-size: .85rem; }
.unicore-footer-socials a { display: inline-block; padding: .4rem .7rem; border: 1px solid #ffffff42; border-radius: 1rem; font-size: .85rem; }
.unicore-footer-top { font-size: .875rem; }

@media (max-width: 880px) {
    .unicore-footer-columns, .unicore-footer-columns:not(:has(nav:nth-child(3))) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 880px) {
    html:has(footer.unicore-footer) { background: #122d41 !important; }
    html[data-theme="dark"]:has(footer.unicore-footer) { background: #0e2334 !important; }
    body footer.unicore-footer { padding-bottom: env(safe-area-inset-bottom, 0px) !important; }
}

@media (max-width: 480px) {
    .unicore-footer-inner { width: calc(100% - 2.5rem); }
    .unicore-footer-columns,
    .unicore-footer-columns:not(:has(nav:nth-child(3))) {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
        padding-block: 1.5rem;
    }
    .unicore-footer-identity { text-align: center; }
    body footer.unicore-footer .unicore-footer-identity p {
        max-width: 42ch;
        margin: .75rem auto 0;
        font-size: .875rem;
        line-height: 1.5;
    }
    .unicore-footer-columns > :is(nav, section) {
        min-width: 0;
        padding-top: .85rem;
        border-top: 1px solid #ffffff36;
    }
    body footer.unicore-footer h2 {
        margin: 0 0 .35rem;
        padding: 0;
        border: 0;
        color: #9ee9d1 !important;
        font-size: .75rem;
    }
    body footer.unicore-footer h2::after { content: none; }
    .unicore-footer-columns ul {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        column-gap: 1rem;
        row-gap: .15rem;
    }
    .unicore-footer-columns section li:first-child:has(~ li) { flex-basis: 100%; }
    .unicore-footer-columns a { display: inline-block; padding-block: .4rem; }
    .unicore-footer-bottom {
        justify-content: center;
        gap: .65rem 1rem;
        padding-block: .9rem;
    }
    .unicore-footer-credits {
        flex-basis: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* The student theme assigns text colors directly to headings and body copy. */
body.student-page footer.unicore-footer .unicore-footer-brand strong {
    color: #f5f9fc !important;
}

body.student-page footer.unicore-footer .unicore-footer-identity p,
body.student-page footer.unicore-footer .unicore-footer-credits small {
    color: #d0dce5 !important;
}

body.student-page footer.unicore-footer .unicore-footer-brand strong span {
    color: #6ce3bb !important;
}
