:root {
    --white: #ffffff;
    --black: #141414;
    --netflix-blue: #007aff;
    --transition-fast: 0.3s ease;
    --transition-page: 0.5s ease-in-out;
    --slide-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--black);
    color: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body {
    opacity: 1;
    transition: opacity var(--transition-page);
}

body.fade-out {
    opacity: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* Sfumatura morbida di sfondo */
.netflix-ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(circle at center, rgba(35, 35, 35, 0.15) 0%, rgba(20, 20, 20, 1) 85%);
    pointer-events: none;
}

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- NAVBAR CON LOGO E NAV LINKS --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 40px;
    z-index: 10;
    opacity: 0;
    animation: fadeInUp 1s ease-out forwards;
}

.logo img {
    width: 80px;
    height: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links a img {
    width: 35px;
    height: auto;
    transition: transform var(--transition-fast), filter var(--transition-fast);
}

.nav-links a[href="/fanzine"] img { width: 50px; }

.nav-links a:hover img {
    transform: scale(1.1);
    filter: brightness(1.15);
}

/* --- CONTENUTO IN STILE NETFLIX --- */
.container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 130px 24px 70px;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.25s forwards;
}

.zine-shell {
    width: 100%;
    max-width: 980px;
    text-align: center;
}

.zine-title {
    margin: 0 0 15px; 
    font-size: clamp(30px, 4.5vw, 54px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-wrap: balance;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease;
}

/* --- SWITCH LINGUA ITA/ENG (SOTTO IL TITOLO) --- */
.lang-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    margin: 0 auto 30px auto;
    position: relative;
    z-index: 5;
}

.lang-switch {
    display: inline-block;
}

.lang-switch input {
    display: none;
}

/* Struttura base del toggle */
.lang-switch label {
    display: flex;
    align-items: center;
    width: 104px; 
    height: 36px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all var(--transition-fast);
}

/* Testi posizionati con Flexbox */
.lang-switch label .lang-it,
.lang-switch label .lang-en {
    flex: 1;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    z-index: 2; 
    color: rgba(255, 255, 255, 0.5); 
    transition: color 0.3s ease;
    line-height: 34px;
}

/* Gestione colore testo attivo */
.lang-switch input:not(:checked) + label .lang-it { color: var(--white); }
.lang-switch input:checked + label .lang-en { color: var(--white); }

/* PALLINO ANIMATO */
.lang-switch label .slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 48px;
    height: 30px;
    background-color: var(--netflix-blue); 
    border-radius: 50px;
    z-index: 1; 
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.3s ease;
}

/* Spostamento a destra e cambio colore per ENG */
.lang-switch input:checked + label .slider {
    transform: translateX(50px); 
    background-color: #00b4d8; 
}

/* === STATO DISABILITATO === */
.lang-switch.is-disabled label {
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.05);
}

.lang-switch.is-disabled label .slider {
    background-color: rgba(255, 255, 255, 0.15); 
}

.lang-switch.is-disabled label .lang-en {
    color: rgba(255, 255, 255, 0.1); 
}
/* ===================================================================== */

.zine-carousel {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.zine-viewport {
    overflow: hidden;
    width: 100%;
    padding: 15px 0 25px;
    touch-action: pan-y;
    z-index: 2; /* Inferiore alle frecce */
}

.zine-track {
    display: flex;
    width: 100%;
    transition: transform 0.65s var(--slide-ease);
    will-change: transform;
}

.zine-track.is-dragging {
    transition: none;
}

.zine-slide {
    min-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.zine-slide .zine-card {
    pointer-events: none; 
}

.zine-slide.is-active .zine-card {
    pointer-events: auto !important;
}

.zine-card {
    display: block;
    width: min(66vw, 360px);
    outline: none;
    transform: scale(0.88);
    opacity: 0.35;
    filter: blur(1px) brightness(0.7);
    transition: transform 0.45s ease, opacity 0.45s ease, filter 0.45s ease;
}

.zine-slide.is-active .zine-card {
    transform: scale(1);
    opacity: 1;
    filter: blur(0) brightness(1);
}

.zine-slide.is-active .zine-card:hover {
    transform: scale(1.04) translateY(-5px);
}

.zine-card img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.65));
    transition: filter 0.3s ease;
}

/* --- PULSANTI FRECCIA --- */
.carousel-btn {
    position: absolute;
    top: 50%;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.85); /* Leggermente più opaco per essere più visibile sulle card */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50; /* Priorità altissima per stare sempre sopra le fanzine */
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
    opacity: 0.85;
    color: var(--white);
    padding: 0;
}

.carousel-btn svg {
    display: block;
    width: 22px;
    height: 22px;
    pointer-events: none;
}

.carousel-prev { left: -28px; transform: translateY(-50%); }
.carousel-next { right: -28px; transform: translateY(-50%); }

.carousel-prev:hover, .carousel-next:hover { transform: translateY(-50%) scale(1.08); }

.carousel-btn:hover {
    background: rgba(35, 35, 35, 0.95);
    border-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* --- TITOLO DINAMICO SOTTO CAROSELLO --- */
.zine-dynamic-title {
    margin-top: -10px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
    min-height: 24px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

/* --- METADATI E PALLINI --- */
.zine-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 15px;
}

.zine-counter {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.15em;
    opacity: 0.6;
}

.zine-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.zine-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: width 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}

.zine-dot.is-active {
    width: 26px;
    border-radius: 999px;
    background: var(--netflix-blue);
}

.zine-dot:hover {
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.5);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.zine-card:focus-visible {
    outline: 2px solid var(--netflix-blue);
    outline-offset: 10px;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .navbar {
        padding: 20px;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    }

    .logo img { width: 65px; }
    .nav-links { gap: 16px; }
    .nav-links a img { width: 28px; }
    .nav-links a[href="/fanzine"] img { width: 42px; }

    .lang-container { height: 32px; margin-bottom: 25px; }
    .lang-switch label { width: 94px; height: 32px; }
    .lang-switch label .lang-it, .lang-switch label .lang-en { font-size: 10px; line-height: 30px; }
    .lang-switch label .slider { width: 43px; height: 26px; top: 2px; left: 2px; }
    .lang-switch input:checked + label .slider { transform: translateX(45px); }

    .container { padding: 100px 16px 40px; } 
    .zine-title { font-size: clamp(26px, 7vw, 38px); margin-bottom: 12px; }
    .zine-card { width: min(74vw, 310px); }

    .zine-dynamic-title { font-size: 0.95rem; }

    /* Frecce su tablet/smartphone medio-grandi */
    .carousel-btn { width: 44px; height: 44px; z-index: 50 !important; }
    .carousel-btn svg { width: 18px; height: 18px; }
    .carousel-prev { left: -10px; }
    .carousel-next { right: -10px; }
}

@media (max-width: 420px) {
    .zine-card { width: 78vw; }
    .zine-viewport { overflow: visible; }
    
    /* Frecce garantite e centrate per smartphone piccoli */
    .carousel-btn { 
        display: flex !important; /* Forza la visibilità sempre */
        width: 40px; 
        height: 40px; 
        z-index: 50 !important; /* Scavalca le animazioni delle card */
    }
    .carousel-btn svg { width: 16px; height: 16px; }
    /* Entrano un po' nella visuale per non essere tagliate dallo schermo */
    .carousel-prev { left: -5px; }
    .carousel-next { right: -5px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}