:root {
    --rosso:      #7e2227;
    --rosso-dark: #5c1519;
    --scuro:      #0f0f0f;
    --testo:      #ffffff;
    --header-h:   100px;
}

/* ===================================
   RESET & FONTS
   =================================== */
@import url('fonts.css');

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

img { display: block; max-width: 100%; height: auto; }
a   { text-decoration: none; color: inherit; }

.skip-link {
    position: absolute; top: -200%; left: 50%;
    transform: translateX(-50%);
    background: var(--rosso); color: #fff;
    padding: 10px 20px; z-index: 9999;
    border-radius: 0 0 4px 4px;
}
.skip-link:focus { top: 0; }

/* ===================================
   DESKTOP: tutto in 100dvh
   body è la colonna flex che contiene tutto
   =================================== */
body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--scuro);
}

/* Gli elementi 24Ore si ridimensionano allo spazio che prendono,
   non rubano spazio alla nostra area principale */
.__s24 {
    flex-shrink: 0;
    overflow: hidden;
    line-height: 0;         /* evita spazio extra da inline elements */
}

/* ===================================
   HEADER EDITORIALE
   =================================== */
#site-header {
    flex-shrink: 0;
    height: var(--header-h);
    background: var(--scuro);
    border-bottom: 2px solid var(--rosso);
    position: relative;
    z-index: 100;
}

.header-container {
    height: 100%;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
}

.logo-wrapper .logo {
    height: 65px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    flex-shrink: 0;
}

/* Il logo MinTur ha i colori istituzionali (bandiera) — non applicare il filtro bianco */
.logo-wrapper .logo-mintur {
    filter: none;
    opacity: 0.92;
    border-left: 1px solid rgba(255,255,255,0.15);
    padding-left: 18px;
    margin-left: 18px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    overflow: hidden;
    white-space: nowrap;
}

.header-info .infodata-logo {
    height: 30px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.75;
    flex-shrink: 0;
}

/* ===================================
   MAIN: occupa tutto lo spazio rimasto
   =================================== */
#site-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===================================
   COVER: immagine a tutto schermo nella sua metà
   =================================== */
.cover-section {
    overflow: hidden;
    position: relative;
    max-height: 52vh;
}

.cover-full-image {
    width: 100%;
    aspect-ratio: 1056 / 621;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

/* ===================================
   RIBBON ROSSO
   =================================== */
.cover-ribbon {
    flex-shrink: 0;
    height: 7px;
    background: var(--rosso);
}

/* ===================================
   SEZIONE INFERIORE: titolo + stats
   =================================== */
.lower-section {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
}

/* ===================================
   AREA TITOLO — sfondo rosso, testo bianco
   =================================== */
.title-area {
    background: var(--rosso) url('../background.png') center 75% / cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4vh 3.5vw 4vh 3vw;
    gap: 0;
}

/* Font sizing con vh: scala su qualsiasi altezza schermo */
.hero-title {
    font-family: 'Oswald', sans-serif;
    color: #fff;
    margin-bottom: 1.8vh;
    flex-shrink: 0;
}

.hero-title-city {
    display: block;
    font-size: clamp(38px, 7.2vh, 100px);
    font-weight: 600;
    line-height: 0.88;
    letter-spacing: -0.04em;
}

.hero-title-divider {
    display: block;
    width: 52px;
    height: 4px;
    background: rgba(255,255,255,0.5);
    margin: 1.2vh 0 1vh;
    border: none;
    flex-shrink: 0;
}

.hero-title-main {
    display: block;
    font-size: clamp(20px, 3.9vh, 54px);
    font-weight: 300;
    line-height: 1.04;
    letter-spacing: -0.02em;
}

.hero-title-years {
    display: block;
    font-family: 'Oswald', sans-serif;
    font-size: clamp(13px, 1.9vh, 26px);
    font-weight: 200;
    letter-spacing: 0.25em;
    color: rgba(255,255,255,0.65);
    margin-top: 1.2vh;
    flex-shrink: 0;
}

.hero-subtitle {
    font-size: clamp(12px, 1.55vh, 17px);
    font-weight: 400;
    color: rgba(255,255,255,0.82);
    line-height: 1.55;
    margin-bottom: 1.8vh;
    border-left: 3px solid rgba(255,255,255,0.4);
    padding-left: 12px;
    flex-shrink: 0;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Bottone bianco, testo rosso — inversione rispetto allo sfondo */
.download-link {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: clamp(12px, 1.6vh, 17px);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rosso);
    background: #ffffff;
    padding: 1.2vh 2.2vw;
    display: inline-flex;
    align-items: center;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.download-link:hover { background: var(--rosso-dark); color: #fff; }

.download-icon {
    cursor: pointer;
    display: inline-block;
    width: clamp(32px, 4vh, 46px);
    height: auto;
    transition: transform 0.2s ease, opacity 0.2s ease;
    filter: brightness(0) invert(1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.download-icon:hover  { transform: scale(1.12); opacity: 0.8; }
.download-icon:active { transform: scale(1.04); }
.download-icon:focus  { outline: 2px solid rgba(255,255,255,0.6); outline-offset: 2px; }

/* ===================================
   AREA STATISTICHE — sfondo scuro
   =================================== */
.stats-area {
    background: var(--scuro);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2vh 2.5vw;
    overflow: hidden;
    border-left: 1px solid rgba(200,66,0,0.25);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
}

.stat-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.2vh 1.5vw;
    border-right: 1px solid rgba(255,255,255,0.07);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    overflow: hidden;
}

/* Rimuovi bordi extra per griglia 2×2 */
.stat-item:nth-child(2)  { border-right: none; }
.stat-item:nth-child(3)  { border-bottom: none; }
.stat-item--last         { border-right: none; border-bottom: none; }
.stat-item--br           { border-bottom: none; }

.stat-number {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(22px, 3.8vh, 52px);
    font-weight: 600;
    color: var(--rosso);
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.stat-number sup {
    font-size: 0.42em;
    font-weight: 400;
    vertical-align: super;
    letter-spacing: 0;
}

.stat-label {
    font-size: clamp(9px, 1vh, 12px);
    font-weight: 400;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    line-height: 1.4;
    margin-top: 0.4vh;
}

/* ===================================
   FRASE DI COMMITTENZA
   =================================== */
.commissioning-note {
    flex-shrink: 0;
    background: var(--scuro);
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 10px 32px;
    text-align: center;
}

.commissioning-note p {
    font-size: 11px;
    color: rgba(255,255,255,0.58);
    line-height: 1.55;
    font-style: italic;
    max-width: 852px;
    margin: 0 auto;
}

.commissioning-note strong {
    font-weight: 600;
    color: rgba(255,255,255,0.78);
    font-style: normal;
}

/* ===================================
   FOCUS
   =================================== */
a:focus, button:focus {
    outline: 2px solid rgba(255,255,255,0.7);
    outline-offset: 2px;
}

/* ===================================
   TABLET & MOBILE — layout scorrevole
   Su mobile niente vincolo di altezza
   =================================== */
@media screen and (max-width: 1024px),
       screen and (min-width: 1025px) and (max-width: 1400px) and (max-height: 820px) {

    .__s24 { line-height: normal; }

    .cover-section {
        max-height: 58vw;
    }

    .lower-section {
        display: flex;
        flex-direction: column;
    }

    .title-area {
        padding: 36px 32px 28px;
        gap: 0;
    }

    .hero-title-city  { font-size: clamp(52px, 8vw, 72px); }
    .hero-title-main  { font-size: clamp(28px, 4.5vw, 44px); }
    .hero-title-years { font-size: clamp(14px, 2vw, 20px); letter-spacing: 4px; }

    .hero-title       { margin-bottom: 18px; }
    .hero-title-divider { margin: 14px 0 12px; }
    .hero-subtitle    { font-size: 14px; margin-bottom: 20px; }
    .download-link    { font-size: 15px; padding: 14px 28px; }

    .stats-area {
        padding: 28px 32px;
        border-left: none;
        border-top: 4px solid var(--rosso);
    }

    .stats-grid {
        height: auto;
        gap: 24px 0;
    }

    .stat-item { padding: 0 20px 0 0; border: none; }
    .stat-item + .stat-item { border-left: 1px solid rgba(255,255,255,0.1); padding-left: 20px; }
    .stat-item:nth-child(3) { border-left: none; padding-left: 0; }

    .stat-number { font-size: clamp(28px, 5vw, 44px); }
    .stat-label  { font-size: 11px; }
}

@media screen and (max-width: 768px) {

    /* Header: va a capo su mobile */
    #site-header { height: auto; }
    .header-container {
        padding: 12px 20px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    .logo-wrapper .logo      { height: 40px; }
    .logo-wrapper .logo-mintur { padding-left: 12px; margin-left: 12px; }
    .header-info { font-size: 11px; gap: 6px; flex-wrap: wrap; justify-content: center; }
    .header-info .infodata-logo { height: 15px; }

    .commissioning-note { padding: 10px 20px; }
    .commissioning-note p { font-size: 10px; }

    .cover-full-image { max-height: 56vw; }

    .title-area { padding: 28px 20px 22px; }
    .hero-subtitle { border-left: none; padding-left: 0; border-top: 3px solid rgba(255,255,255,0.3); padding-top: 12px; }

    .stats-area { padding: 24px 20px; }
    .stats-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 20px 0; }
    .stat-item { padding: 0 14px 0 0; border: none !important; }
    .stat-item + .stat-item { border-left: 1px solid rgba(255,255,255,0.1) !important; padding-left: 14px; }
    .stat-item:nth-child(3) { border-left: none !important; padding-left: 0 !important; }
    .stat-number { font-size: 28px; }
}

@media screen and (max-width: 480px) {
    .hero-title-city { font-size: 44px; }
    .hero-title-main { font-size: 24px; }
    .download-link   { font-size: 12px; padding: 10px 18px; }
    .stat-number     { font-size: 24px; }
}

/* ===================================
   REDUCED MOTION
   =================================== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
