/* Font locali condivisi; gli stili della homepage sono limitati a .portal. */
@font-face {
    font-family: "Titillium Web";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../bootstrap-italia/fonts/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.woff2") format("woff2");
}

@font-face {
    font-family: "Titillium Web";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../bootstrap-italia/fonts/Titillium_Web/titillium-web-v10-latin-ext_latin-600.woff2") format("woff2");
}

@font-face {
    font-family: "Titillium Web";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../bootstrap-italia/fonts/Titillium_Web/titillium-web-v10-latin-ext_latin-700.woff2") format("woff2");
}

body.portal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f2f7fc;
    color: #17324d;
}

.portal .it-header-center-wrapper {
    height: auto;
    padding: 2rem 0;
}

.portal .it-header-center-content-wrapper {
    height: auto;
}

.portal .it-brand-wrapper a {
    gap: 1.25rem;
}

.portal .it-brand-wrapper img {
    flex-shrink: 0;
    object-fit: contain;
    padding: .5rem;
    background: #fff;
    border-radius: .5rem;
}

.portal .it-brand-text {
    min-width: 0;
}

.portal-brand-title,
.portal-brand-description {
    display: block;
}

.portal-brand-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.portal-brand-description {
    margin-top: .5rem;
    font-size: 1rem;
    line-height: 1.4;
}

.portal-main {
    flex: 1;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.portal-intro {
    max-width: 58rem;
}

.portal-intro h1 {
    font-size: clamp(1.75rem, 3vw, 2.75rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.portal-intro p {
    line-height: 1.65;
}

.portal-sections {
    margin-top: 2.5rem;
}

.portal-sections h2 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.portal-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.portal-section-grid > .card-wrapper {
    min-width: 0;
    margin: 0;
    padding: 0;
}

/*
 * Colori per sezione, ripresi dalle frecce della homepage legacy.
 * --section-accent: colore originale (bordi e freccia, non per il testo);
 * --section-ink: tono scurito con contrasto >= 4.5:1 su bianco e su --section-tint;
 * --section-tint: fondo al passaggio del mouse e al focus.
 */
.portal .portal-section-card {
    --section-accent: #0066cc;
    --section-ink: #0059b3;
    --section-tint: #e6f0fa;
    height: 100%;
    border: 1px solid #c5d5e4;
    border-top: 6px solid var(--section-accent);
    border-radius: .5rem;
    background: #fff;
}

.portal .portal-theme-viola { --section-accent: #653edd; --section-ink: #653edd; --section-tint: #ede8fb; }
.portal .portal-theme-rosso { --section-accent: #b81b45; --section-ink: #b81b45; --section-tint: #f6e4e9; }
.portal .portal-theme-verde { --section-accent: #bfd804; --section-ink: #677502; --section-tint: #f7fae1; }
.portal .portal-theme-giallo { --section-accent: #f3c006; --section-ink: #886c03; --section-tint: #fef7e1; }
.portal .portal-theme-blu { --section-accent: #149dc5; --section-ink: #0f7492; --section-tint: #e3f3f8; }
.portal .portal-theme-arancione { --section-accent: #e65d03; --section-ink: #b34902; --section-tint: #fcece1; }
.portal .portal-theme-acqua { --section-accent: #42c091; --section-ink: #2a7b5d; --section-tint: #e8f7f2; }
.portal .portal-theme-blu-scuro { --section-accent: #08475f; --section-ink: #08475f; --section-tint: #e1e9ec; }

/* Freccia decorativa come nel vecchio portale. */
.portal .portal-section-card .card-body::before {
    content: "";
    display: block;
    width: 3.5rem;
    height: 1.25rem;
    margin-bottom: 1rem;
    background: var(--section-accent);
    clip-path: polygon(0 0, 72% 0, 100% 50%, 72% 100%, 0 100%);
}

.portal .portal-section-card::after {
    content: none;
}

.portal .portal-section-card .card-body {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.portal .portal-section-card .card-title {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.portal-section-card .card-title a {
    color: var(--section-ink, #0059b3);
    text-underline-offset: .2em;
    overflow-wrap: anywhere;
}

.portal .portal-section-card .card-text {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    color: #455b71;
}

.portal-card-action {
    margin-top: auto;
    padding-top: 1rem;
    color: var(--section-ink, #0059b3);
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
}

.portal-card-action:hover {
    color: var(--section-ink, #0059b3);
    text-decoration: underline;
    text-underline-offset: .2em;
}

.portal .portal-section-card:focus-within,
.portal .portal-section-card:hover {
    background: var(--section-tint);
    border-color: var(--section-accent);
}

.portal a:focus-visible,
.portal main:focus-visible {
    outline: 3px solid #ffb400;
    outline-offset: 3px;
}

.portal .it-footer p {
    margin: 0;
}

.portal .it-footer a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: .2em;
}

@media (max-width: 575px) {
    .portal .it-header-center-wrapper {
        padding: 1.25rem 0;
    }

    .portal .it-brand-wrapper a {
        gap: .75rem;
    }

    .portal .it-brand-wrapper img {
        width: 60px;
        height: auto;
    }

    .portal-brand-title {
        font-size: 2rem;
    }

    .portal-main {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}