@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700&display=swap');

:root {
    --primary-color: #ff00d9;
    --dark-color: #1a1a1a;
    --light-color: #ffffff;
    --gray-bg: #f4f4f4;
    --header-height: 80px;
}

/* =============================================
   RESET E GLOBALE
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================
   HEADER & NAVIGAZIONE
   ============================================= */
header {
    background: #fff;
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo a {
    text-decoration: none;
    color: var(--dark-color);
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.logo span {
    font-weight: 300;
    margin-left: 5px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 700;
    font-size: clamp(0.7rem, 1.1vw, 0.9rem);
    margin-left: clamp(12px, 2vw, 25px);
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav-links li a:hover {
    color: var(--primary-color);
}

/* =============================================
   HERO
   ============================================= */
.hero {
    width: 100%;
    background: url("MEDIA/COVER_HOME.jpg") center/cover no-repeat;
    position: relative;
    aspect-ratio: 16 / 9;
    min-height: 200px;
}

/* =============================================
   SEZIONI
   ============================================= */
.section {
    padding: clamp(40px, 8vw, 80px) 0;
}

.section-title {
    text-align: center;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 40px;
    text-transform: uppercase;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 15px auto 0;
}

.text-center {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

/* =============================================
   REGOLAMENTO
   ============================================= */
.regolamento-box {
    background: var(--gray-bg);
    padding: clamp(16px, 4vw, 30px);
    border-radius: 8px;
    border: 1px solid #ddd;
    text-align: left;
    font-size: clamp(0.85rem, 2vw, 1rem);
    line-height: 1.8;
}

.submission-link {
    text-align: center;
    margin-top: 30px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

.ff-button img {
    width: clamp(140px, 40vw, 200px);
    transition: transform 0.3s ease;
}

.ff-button img:hover {
    transform: scale(1.05);
}

/* =============================================
   ANIMAZIONI SCROLL REVEAL
   ============================================= */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
   SLIDER GALLERIA
   ============================================= */
.slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 30px; /* Spazio per le frecce, mai fuori dal viewport */
}

.slider-container {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 20px;
    scrollbar-width: none;
    padding: 10px 0;
    width: 100%;
}

.slider-container::-webkit-scrollbar {
    display: none;
}

.photo-item {
    flex: 0 0 calc(33.333% - 14px);
    height: clamp(180px, 25vw, 300px);
    border-radius: 8px;
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slider-arrow {
    position: absolute;
    background: var(--primary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.slider-arrow:hover { opacity: 0.85; }

.slider-arrow i {
    color: white;
    font-size: 1rem;
}

.prev { left: 0; }
.next { right: 0; }

/* =============================================
   PRIVACY & COOKIE POLICY - testo
   ============================================= */
.privacy-policy,
.cookies-policy {
    font-size: clamp(0.85rem, 2vw, 1rem);
    line-height: 1.8;
}

.privacy-policy p,
.cookies-policy p {
    margin-bottom: 12px;
}

.cookies-policy h2 {
    font-size: clamp(1rem, 3vw, 1.3rem);
    margin-top: 30px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.cookies-policy h3 {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    margin-top: 20px;
    margin-bottom: 8px;
}

.cookies-policy a,
.privacy-policy a {
    color: var(--primary-color);
    text-decoration: underline;
}

.cookies-policy table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 20px;
    font-size: clamp(0.78rem, 1.8vw, 0.9rem);
}

.cookies-policy table th,
.cookies-policy table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.cookies-policy table th {
    background: #e9e9e9;
    font-weight: 700;
}

.cookies-policy ul {
    margin: 10px 0 15px 20px;
}

.cookies-policy ul li {
    margin-bottom: 6px;
}

.cookie-intro {
    font-style: italic;
    color: #555;
    margin-bottom: 30px;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
    background: var(--dark-color);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-info h3 {
    margin-bottom: 8px;
    font-size: 1rem;
}

.footer-info p {
    font-size: 0.9rem;
    color: #ccc;
}

.social-links {
    display: flex;
    align-items: center;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    margin-left: 20px;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 20px;
    font-size: 0.8rem;
    color: #aaa;
}

.footer-link {
    color: #aaa;
    text-decoration: none;
}

.footer-link:hover {
    color: var(--primary-color);
}

/* =============================================
   COOKIE BANNER
   ============================================= */
#off-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    color: #fff;
    z-index: 9999;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

#off-cookie-banner.off-cookie-visible {
    transform: translateY(0);
}

.off-cookie-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.off-cookie-text strong {
    font-size: 1rem;
    display: block;
    margin-bottom: 5px;
}

.off-cookie-text p {
    font-size: 0.85rem;
    color: #ccc;
    margin: 0;
    max-width: 700px;
}

.off-cookie-text a {
    color: var(--primary-color);
    text-decoration: underline;
}

.off-cookie-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.off-btn-accept,
.off-btn-reject,
.off-btn-settings {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: opacity 0.2s, border-color 0.2s, color 0.2s;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
}

.off-btn-accept {
    background: var(--primary-color);
    color: #fff;
}

.off-btn-reject {
    background: transparent;
    color: #ccc;
    border: 1px solid #555;
}

.off-btn-settings {
    background: transparent;
    color: #fff;
    border: 1px solid #888;
}

.off-btn-accept:hover   { opacity: 0.85; }
.off-btn-reject:hover   { border-color: #fff; color: #fff; }
.off-btn-settings:hover { border-color: var(--primary-color); color: var(--primary-color); }

/* Pannello modale preferenze */
#off-cookie-panel {
    opacity: 0;
    transition: opacity 0.4s ease;
}

#off-cookie-panel.off-panel-visible {
    opacity: 1;
}

.off-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    backdrop-filter: blur(3px);
}

.off-panel-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    z-index: 9999;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.off-panel-box h3 {
    font-size: clamp(1rem, 3vw, 1.3rem);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.off-panel-box h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    margin-top: 8px;
}

.off-panel-subtitle {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 25px;
    margin-top: 10px;
}

.off-panel-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
    padding: 5px;
}

.off-panel-close:hover { color: var(--dark-color); }

.off-pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.off-pref-info { flex: 1; min-width: 0; }

.off-pref-info strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.off-pref-info span {
    font-size: 0.8rem;
    color: #777;
}

.off-toggle-disabled .off-toggle-label {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.off-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.off-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.off-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 26px;
    transition: 0.3s;
}

.off-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.off-switch input:checked + .off-slider { background: var(--primary-color); }
.off-switch input:checked + .off-slider::before { transform: translateX(20px); }

.off-panel-btns {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.off-panel-btns .off-btn-reject {
    color: #555;
    border-color: #ccc;
}

.off-panel-btns .off-btn-reject:hover {
    border-color: var(--dark-color);
    color: var(--dark-color);
}

/* =============================================
   HAMBURGER
   ============================================= */
.menu-toggle {
    display: none;
}

/* =============================================
   TABLET (769px – 1024px)
   ============================================= */
@media (max-width: 1024px) and (min-width: 769px) {

    .nav-links li a {
        font-size: 0.72rem;
        margin-left: 14px;
    }

    .photo-item {
        flex: 0 0 calc(50% - 10px);
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .social-links a:first-child {
        margin-left: 0;
    }
}

/* =============================================
   MOBILE (≤ 768px)
   ============================================= */
@media (max-width: 768px) {

    /* Hamburger */
    .menu-toggle {
        display: block;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 5px;
    }

    /* Menu a tendina full-screen */
    .nav-links {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        background: #fff;
        width: 100%;
        height: calc(100vh - var(--header-height));
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.4s;
        z-index: 999;
    }

    .nav-links.active { right: 0; }

    .nav-links li { margin: 18px 0; }

    .nav-links li a {
        font-size: 1.1rem;
        margin-left: 0;
    }

    /* Hero */
    .hero {
        aspect-ratio: unset;
        height: clamp(180px, 50vw, 320px);
    }

    /* Galleria */
    .photo-item {
        flex: 0 0 85%;
        height: clamp(160px, 50vw, 240px);
    }

    .slider-wrapper {
        padding: 0 44px;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .social-links a:first-child { margin-left: 0; }

    /* Cookie banner */
    .off-cookie-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .off-cookie-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* Pannello cookie */
    .off-panel-box {
        padding: 30px 20px;
        max-height: 85vh;
    }

    .off-panel-btns {
        flex-direction: column;
    }

    .off-panel-btns button {
        width: 100%;
        text-align: center;
    }

    /* Tabelle: scroll orizzontale su mobile */
    .cookies-policy table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* =============================================
   MOBILE PICCOLO (≤ 400px)
   ============================================= */
@media (max-width: 400px) {

    .container { padding: 0 14px; }

    .hero { height: 160px; }

    .off-cookie-actions {
        flex-direction: column;
    }

    .off-btn-accept,
    .off-btn-reject,
    .off-btn-settings {
        width: 100%;
        text-align: center;
    }
}