/* ============================================================
   FontanHello — Stile comune a tutto il sito
   (reset, tipografia base, header, footer, bottoni, helper).
   Lo stile specifico delle singole pagine vive in
   www/frontend/pages/<pagina>/css/<pagina>.css
   ============================================================ */

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

:root {
    /* Brand */
    --primary: #1E6FB8;
    --primary-dark: #1E4B8C;
    --primary-deep: #0B2F57;
    --secondary: #E7344C;

    /* Acqua */
    --aqua-50: #F1FAFB;
    --aqua-100: #E1F3F5;
    --aqua-200: #C2E8ED;
    --aqua-300: #73C7D2;
    --ink: #0c2340;
    --ink-soft: #3a4a63;
    --muted: #6b7c93;

    --white: #ffffff;
    --max-width: 1180px;
    --radius: 22px;
    --radius-sm: 14px;

    --shadow-sm: 0 6px 20px -8px rgba(11, 47, 87, .18);
    --shadow-md: 0 18px 50px -18px rgba(11, 47, 87, .28);
    --shadow-lg: 0 40px 90px -30px rgba(11, 47, 87, .45);

    --ease: cubic-bezier(.22, 1, .36, 1);
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
    color: var(--ink-soft);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
    line-height: 1.12;
    margin: 0 0 .5em;
    letter-spacing: -.025em;
    color: var(--ink);
    font-weight: 800;
}

h1 { font-size: clamp(2.8rem, 7vw, 5rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }
strong { color: var(--ink); font-weight: 700; }

a { color: var(--primary); text-decoration: none; }

::selection { background: var(--aqua-200); color: var(--ink); }

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding-inline: clamp(1.1rem, 4vw, 2rem);
}

.section { padding: clamp(4.5rem, 9vw, 8rem) 0; position: relative; }

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--primary);
    color: #fff;
    padding: .7rem 1.2rem;
    border-radius: 0 0 10px 0;
    z-index: 100;
}
.skip-link:focus { left: 0; }

/* ====================== HEADER ====================== */
.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    padding: 1rem 0;
    transition: background .3s var(--ease), box-shadow .3s var(--ease), padding .3s var(--ease);
}
.site-header.is-scrolled {
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow: var(--shadow-sm);
    padding: .55rem 0;
}

.site-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-header__logo {
    height: 38px;
    width: auto;
    transition: transform .3s var(--ease);
}
.site-header__brand:hover .site-header__logo { transform: scale(1.04); }

.site-header__nav { display: flex; gap: 2rem; }
.site-header__nav a {
    color: var(--ink-soft);
    font-size: .95rem;
    font-weight: 600;
    position: relative;
    padding: .2rem 0;
}
.site-header__nav a::after {
    content: "";
    position: absolute;
    left: 0; bottom: -2px;
    width: 0; height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--aqua-300));
    border-radius: 2px;
    transition: width .25s var(--ease);
}
.site-header__nav a:hover { color: var(--primary); }
.site-header__nav a:hover::after { width: 100%; }

.site-header__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
}
.site-header__toggle span {
    width: 24px; height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform .3s var(--ease), opacity .2s var(--ease);
}
.site-header__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-header__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ====================== BUTTONS ====================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .8rem 1.6rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    border: 0;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.btn-sm { padding: .55rem 1.15rem; font-size: .88rem; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 12px 26px -10px rgba(30, 111, 184, .65);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -10px rgba(30, 111, 184, .75); }
.btn-ghost {
    background: rgba(30, 111, 184, .08);
    color: var(--primary);
    border: 1px solid rgba(30, 111, 184, .2);
}
.btn-ghost:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

/* ====================== FOOTER ====================== */
.site-footer-wrap {
    position: relative;
    background: linear-gradient(180deg, #0c1726, #0a1320);
    color: #aebfd4;
    padding: 5rem 0 2.5rem;
}
.footer-wave { position: absolute; top: 0; left: 0; right: 0; line-height: 0; transform: translateY(calc(-100% + 1px)); }
.footer-wave svg { display: block; width: 100%; height: clamp(50px, 7vw, 90px); }
.footer-wave path { fill: #0c1726; }

.site-footer {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.site-footer__logo { height: 42px; width: auto; filter: brightness(0) invert(1); margin-bottom: 1rem; }
.site-footer__payoff { max-width: 42ch; font-size: .96rem; color: #8ea2bd; }
.site-footer__title { color: #fff; font-weight: 700; margin-bottom: .8rem; font-size: .95rem; }
.site-footer__col { display: flex; flex-direction: column; gap: .55rem; }
.site-footer__col a { color: #aebfd4; font-size: .95rem; transition: color .2s var(--ease), transform .2s var(--ease); width: fit-content; }
.site-footer__col a:hover { color: #fff; transform: translateX(3px); }
.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem;
    padding-top: 1.8rem;
    font-size: .85rem;
    color: #6f82a0;
}
.site-footer__bottom p { margin: 0; }

.site-footer__credit {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .6rem;
    margin-top: 1.8rem;
    padding-top: 1.8rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .8rem;
    letter-spacing: .04em;
    color: #6f82a0;
    opacity: .9;
    transition: opacity .2s var(--ease);
}
.site-footer__credit:hover { opacity: 1; }
.site-footer__credit img { height: 16px; width: auto; }

/* ====================== RESPONSIVE (header/footer) ====================== */
@media (max-width: 900px) {
    .site-header__nav,
    .site-header__actions { display: none; }
    .site-header__toggle { display: flex; }
    .site-header.is-open .site-header__nav {
        display: flex;
        position: absolute;
        top: 100%; left: 1rem; right: 1rem;
        flex-direction: column;
        gap: 1.2rem;
        padding: 1.4rem;
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(16px);
        border-radius: 18px;
        box-shadow: var(--shadow-md);
    }

    /* Footer: da 3 colonne a 2 (brand a tutta larghezza) */
    .site-footer { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
    .site-footer-wrap { padding: 3.5rem 0 2rem; }
    .site-footer {
        grid-template-columns: 1fr;
        gap: 1.8rem;
        text-align: center;
    }
    .site-footer__brand { display: flex; flex-direction: column; align-items: center; }
    .site-footer__logo { margin-inline: auto; }
    .site-footer__payoff { margin-inline: auto; }
    .site-footer__col { align-items: center; }
    .site-footer__bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: .3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ====================== BLOG: CARD (condivisa home + lista) ====================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.6rem;
}
.blog-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(30, 111, 184, .12);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.blog-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(30, 111, 184, .3); }
.blog-card__cover {
    aspect-ratio: 16 / 10;
    background: linear-gradient(160deg, var(--aqua-100), var(--aqua-200));
    overflow: hidden;
}
.blog-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.blog-card__cover-placeholder { object-fit: contain !important; padding: 2.2rem; opacity: .5; }
.blog-card:hover .blog-card__cover img { transform: scale(1.05); }
.blog-card__body { display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem 1.4rem 1.7rem; flex: 1; }
.blog-card__date { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.blog-card__title { font-size: 1.2rem; margin: 0; color: var(--ink); }
.blog-card__subtitle { margin: 0; font-size: .96rem; color: var(--muted); }
.blog-card__more { margin-top: auto; padding-top: .6rem; font-weight: 700; font-size: .92rem; color: var(--primary); }

/* ====================== HELPER GENERICI (404 ecc.) ====================== */
.container-fluid { width: 100%; margin: 0 auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.row { display: flex; flex-wrap: wrap; }
.col-12 { flex: 0 0 100%; }
.text-center { text-align: center; }
.text-white { color: #fff; }
.bg-grey-dark { background: var(--ink); }
.section-header { padding: 8rem 0 4rem; }
.mt-2 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
