/* Stili principali del sito Fotonica in Gioco. */
:root {
    --orange: #F28C28;
    --blue: #0057B8;
    --blue-dark: #003C7A;
    --text: #1d1d1f;
    --muted: #63666a;
    --bg: #f7f7f2;
    --card: #fff;
    --max: 1120px
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: Arial,Helvetica,sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.62
}

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

a:hover {
    text-decoration: underline
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 10px rgba(0,0,0,.08)
}

.topbar-inner {
    max-width: var(--max);
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 18px 24px
}

.logo {
    font-weight: 800;
    font-size: 1.45rem;
    line-height: 1;
    color: var(--blue)
}

.logo span {
    color: var(--orange)
}

nav {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    align-items: center
}

nav a {
    color: #111;
    font-weight: 700;
    font-size: .98rem
}

nav a.active {
    color: var(--blue);
    border-bottom: 3px solid var(--orange);
    padding-bottom: 6px
}

.contact-btn {
    background: var(--blue);
    color: white;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 700
}

.contact-btn:hover {
    text-decoration: none
}

.hero {
    position: relative;
    min-height: 560px;
    background-image: linear-gradient(90deg,rgba(0,0,0,.62),rgba(0,0,0,.18),rgba(0,0,0,.04)),url('assets/hero.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center
}

.hero-content {
    max-width: var(--max);
    width: 100%;
    margin: auto;
    padding: 80px 24px;
    color: white
}

.hero h1 {
    font-size: clamp(2.4rem,6vw,4.6rem);
    line-height: 1.04;
    margin: 0 0 18px;
    font-weight: 800
}

.hero p {
    font-size: clamp(1.35rem,2.5vw,2rem);
    max-width: 760px;
    font-weight: 700;
    color: #F28C28
}

.btns {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px
}

.btn {
    display: inline-block;
    padding: 13px 22px;
    border-radius: 999px;
    border: 2px solid white;
    color: white;
    font-weight: 700
}

.btn.primary {
    background: var(--blue);
    border-color: var(--blue)
}

.page-title {
    background: #EAF2FB;
    padding: 56px 24px 44px
}

.page-title .wrap,.content {
    max-width: var(--max);
    margin: auto
}

.page-title h1 {
    margin: 0;
    font-size: clamp(2rem,5vw,3.2rem)
}

.page-title p {
    max-width: 800px;
    font-size: 1.15rem;
    color: #333
}

.content {
    padding: 44px 24px 70px
}

.grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 22px;
    margin-top: -55px;
    position: relative;
    z-index: 2
}

.card,.box,section.panel {
    background: var(--card);
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0,0,0,.09);
    padding: 28px;
    margin-bottom: 24px
}

.card h3,.box h2,section.panel h2 {
    margin-top: 0
}

.highlight {
    font-weight: 800;
    color: var(--orange);
    letter-spacing: .04em
}

.lead {
    font-size: 1.2rem
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px
}

.list-clean {
    padding-left: 1.2em
}

.small {
    font-size: .94rem;
    color: var(--muted)
}

footer {
    background: #002147;
    color: white;
    padding: 32px 24px
}

footer .inner {
    max-width: var(--max);
    margin: auto;
    display: flex;
    justify-content: space-between;
    gap: 22px;
    flex-wrap: wrap
}

footer a {
    color: white
}

.note {
    border-left: 5px solid var(--orange);
    background: white;
    padding: 18px 22px;
    margin: 22px 0
}

.winners {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap: 16px
}

.winner {
    background: white;
    border-radius: 14px;
    padding: 18px;
    border: 1px solid #e6e6e6
}

.year {
    border-top: 4px solid var(--orange);
    padding-top: 24px;
    margin-top: 42px
}

.resources li {
    margin-bottom: 12px
}

@media(max-width:850px) {
    .topbar-inner {
        align-items: flex-start;
        flex-direction: column
    }

    nav {
        gap: 13px
    }

    .hero {
        min-height: 520px
    }

    .grid,.two-col {
        grid-template-columns: 1fr
    }

    .grid {
        margin-top: 24px
    }

    .content {
        padding-top: 28px
    }

}

/* Menu a tendina */
.dropdown {

    position: relative;

    display: inline-block;

}

.dropbtn {

    display: inline-block;

}

.dropdown-content {

    display: none;

    position: absolute;

    top: 100%;

    left: 0;

    min-width: 190px;

    background: #ffffff;

    border-radius: 0 0 14px 14px;

    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);

    padding: 10px 0;

    z-index: 20;

}

.dropdown-content a {

    display: block;

    margin: 0;

    padding: 12px 18px;

    white-space: nowrap;

}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {

    display: block;

}

@media (max-width: 900px)  {

    .dropdown {

        width: 100%;

        text-align: center;

    }

    .dropdown-content {

        position: static;

        display: block;

        box-shadow: none;

        background: transparent;

        padding: 0;

    }

}


/* Popup consenso cookie */
.cookie-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,.55)
}

.cookie-popup-overlay.is-visible {
    display: flex
}

.cookie-popup {
    width: min(560px,100%);
    background: #ffffff;
    color: var(--text);
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(0,0,0,.28);
    padding: 28px
}

.cookie-popup h2 {
    margin-top: 0;
    color: var(--blue)
}

.cookie-popup p {
    margin-bottom: 22px
}

.cookie-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap
}

.cookie-btn {
    border: 0;
    border-radius: 999px;
    padding: 11px 20px;
    font-weight: 700;
    cursor: pointer;
    font: inherit
}

.cookie-btn.primary {
    background: var(--blue);
    color: #ffffff
}

.cookie-btn.secondary {
    background: #e6e6e6;
    color: var(--text)
}

.center-image {
    display: block;
    margin: 0 auto;
}

/* =========================================================
   Correzioni responsive per smartphone.
   Desktop invariato: queste regole valgono solo sotto 700 px.
   ========================================================= */
@media (max-width: 700px) {
    body {
        font-size: 16px;
        line-height: 1.55;
        overflow-x: hidden;
    }

    .topbar {
        position: static;
    }

    .topbar-inner {
        padding: 12px 14px 14px;
        gap: 12px;
        align-items: center;
    }

    .logo img {
        height: auto !important;
        width: min(260px, 88vw);
        max-width: 100%;
        display: block;
    }

    nav {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 8px;
    }

    nav a,
    .dropbtn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        padding: 8px 11px;
        border-radius: 999px;
        background: #ffffff;
        border: 1px solid #e5e5e5;
        font-size: .92rem;
        line-height: 1.15;
        text-align: center;
    }

    nav a.active {
        border-bottom: 1px solid #e5e5e5;
        padding-bottom: 8px;
        color: var(--blue);
        box-shadow: inset 0 -3px 0 var(--orange);
    }

    .dropdown {
        width: auto;
        text-align: center;
    }

    .dropdown-content {
        position: static;
        display: flex;
        justify-content: center;
        gap: 6px;
        min-width: 0;
        width: 100%;
        padding: 6px 0 0;
        box-shadow: none;
        background: transparent;
        border-radius: 0;
    }

    .dropdown-content a {
        padding: 7px 10px;
        font-size: .84rem;
        white-space: normal;
        min-height: 34px;
    }

    .contact-btn {
        width: 100%;
        max-width: 260px;
        text-align: center;
        padding: 10px 16px;
    }

    .hero {
        min-height: 360px;
        background-position: center;
    }

    .hero-content {
        padding: 54px 18px;
    }

    .hero h1 {
        font-size: clamp(2.1rem, 12vw, 3.2rem);
    }

    .hero h2 {
        font-size: clamp(1.35rem, 7vw, 2rem);
        line-height: 1.16;
        margin: 0;
    }

    .page-title {
        padding: 34px 18px 28px;
    }

    .page-title h1 {
        font-size: clamp(1.9rem, 10vw, 2.6rem);
        line-height: 1.08;
    }

    .page-title p {
        font-size: 1rem;
    }

    .content {
        padding: 24px 14px 44px;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 16px;
    }

    .card,
    .box,
    section.panel {
        border-radius: 14px;
        padding: 18px;
        margin-bottom: 18px;
    }

    .two-col,
    .winners {
        grid-template-columns: 1fr;
    }

    img,
    .center-image,
    .winner img,
    section.panel img {
        max-width: 100% !important;
        height: auto !important;
    }

    iframe {
        display: block;
        width: 100% !important;
        max-width: 100%;
        aspect-ratio: 16 / 9;
        height: auto !important;
        margin: 0 0 18px;
    }

    table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }

    footer {
        padding: 26px 18px;
    }

    footer .inner {
        display: block;
    }

    .cookie-popup-overlay {
        padding: 14px;
    }

    .cookie-popup {
        max-height: calc(100vh - 28px);
        overflow-y: auto;
        padding: 20px;
        border-radius: 14px;
    }

    .cookie-popup-actions {
        justify-content: stretch;
    }

    .cookie-btn {
        flex: 1 1 130px;
    }
}

@media (max-width: 420px) {
    nav {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    nav a,
    .dropbtn {
        flex: 0 0 auto;
    }

    .dropdown {
        flex: 0 0 auto;
    }

    .dropdown-content {
        display: none;
    }
}
