@tailwind base;
@tailwind components;
@tailwind utilities;

/* -------- CURSORE DI DEFAULT OVUNQUE -------- */
* { cursor: auto !important; }
a, button, [role="button"], summary { cursor: pointer !important; }
.custom-cursor { display: none !important; }

:root {
    --color-bg: #fafafa;
    --color-dark: #0a0a0a;
    --color-accent: #e63946;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-stacked: 'Bebas Neue', 'Playfair Display', sans-serif;
}

@layer base {
    html {
        scroll-behavior: smooth;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    body {
        font-family: var(--font-sans);
        background: var(--color-bg);
        color: var(--color-dark);
        cursor: none;
    }

    @media (max-width: 768px) {
        body {
            cursor: auto;
        }
    }

    ::selection {
        background: var(--color-dark);
        color: var(--color-bg);
    }
}

@layer components {
    .font-display {
        font-family: var(--font-display);
        font-feature-settings: "liga" 1, "dlig" 1;
    }

    .font-display-stacked {
        font-family: var(--font-stacked);
        letter-spacing: -0.02em;
    }

    .font-sans {
        font-family: var(--font-sans);
    }

    .custom-cursor {
        position: fixed;
        top: 0;
        left: 0;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--color-dark);
        mix-blend-mode: difference;
        pointer-events: none;
        z-index: 9999;
        transform: translate(-50%, -50%);
        transition: width 0.25s ease, height 0.25s ease, background 0.25s ease;
    }

    .custom-cursor.hover {
        width: 64px;
        height: 64px;
        background: rgba(230, 57, 70, 0.3);
    }

    .hero-media {
        position: absolute;
        inset: 0;
        overflow: hidden;
        z-index: 0;
    }

    .hero-media::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.1) 0%,
            rgba(0, 0, 0, 0) 45%,
            rgba(0, 0, 0, 0.55) 100%
        );
        pointer-events: none;
        z-index: 2;
    }

    .hero-zoom-img {
        transform: scale(1);
        transform-origin: center center;
        transition: transform 0.1s linear;
        will-change: transform;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .hero-overlay {
        z-index: 1;
        transition: background 0.3s ease;
    }

    .hero-logo-wrap {
        display: flex;
        align-items: center;
        justify-content: center;
        transform-origin: center center;
    }

    .hero-logo {
        max-width: min(90vw, 40rem);
        filter: drop-shadow(0 8px 40px rgba(0,0,0,0.55))
                contrast(1.02);
        -webkit-user-drag: none;
        user-select: none;
        pointer-events: none;
        will-change: transform, opacity;
        animation: heroLogoIn 1.4s cubic-bezier(0.2, 0.9, 0.3, 1) 0.45s both;
    }

    @keyframes heroLogoIn {
        0% {
            opacity: 0;
            transform: translateY(60px) scale(0.78);
            filter: blur(14px) drop-shadow(0 8px 40px rgba(0,0,0,0.55));
        }
        60% {
            opacity: 1;
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
            filter: blur(0) drop-shadow(0 8px 40px rgba(0,0,0,0.55));
        }
    }

    .hero-tag {
        animation: heroFadeIn 0.9s ease 0.2s both;
    }

    .hero-bottom {
        animation: heroFadeIn 0.9s ease 0.9s both;
    }

    @keyframes heroFadeIn {
        from { opacity: 0; transform: translateY(18px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .hero-scroll-cue {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero-scroll-cue.animate-bounce {
        animation: cueBounce 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    }

    @keyframes cueBounce {
        0%, 100% { transform: translateY(0); opacity: 0.9; }
        40%      { transform: translateY(10px); opacity: 0.55; }
        50%      { transform: translateY(10px); opacity: 0.55; }
        90%      { transform: translateY(0); opacity: 0.9; }
    }

    .reveal-text {
        opacity: 0;
        transform: translateY(60px);
        transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s,
                    transform 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
    }

    .reveal-text.visible {
        opacity: 1;
        transform: translateY(0);
    }

    .reveal-up {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .reveal-up.visible {
        opacity: 1;
        transform: translateY(0);
    }

    #featured-slot.reveal-up,
    #articles .article-card.reveal-up {
        will-change: transform, opacity;
        transform: translate3d(0, 64px, 0);
        transition: opacity 0.95s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.95s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #featured-slot.reveal-up.visible,
    #articles .article-card.reveal-up.visible {
        transform: translate3d(0, 0, 0);
    }

    .reveal-img {
        opacity: 0;
        clip-path: inset(0 0 100% 0);
        transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                    clip-path 1.2s cubic-bezier(0.77, 0, 0.175, 1);
    }

    .reveal-img.visible {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }

    .motion-carousel {
        cursor: grab;
    }

    .motion-carousel:active {
        cursor: grabbing;
    }

    .motion-link-letter,
    .stills-link-letter {
        display: inline-block;
        animation: letterFloat 4s ease-in-out infinite;
    }

    .motion-link-letter:nth-child(odd) {
        animation-delay: 0.2s;
    }

    .motion-link-letter:nth-child(3n) {
        animation-delay: 0.4s;
    }

    @keyframes letterFloat {
        0%, 100% {
            transform: translateY(0) rotate(0deg);
        }
        50% {
            transform: translateY(-8px) rotate(1deg);
        }
    }

    /* ============================================================
       MOBILE LOGO — RESET ALLA VERSIONE ORIGINALE
       ============================================================ */

    @media (max-width: 767px) {
        .nav-logo-link {
            position: relative;
            transform: none !important;
            z-index: 60;
            transition: opacity 0.3s ease;
            display: flex !important;
            justify-content: center;
            align-items: center;
        }
        .nav-logo {
            transition: none;
            transform: none !important;
        }
    }

    /* ============================
       STATO: MENU MOBILE APERTO
       ============================ */
    @media (max-width: 767px) {
        body.mobile-open .nav-logo-link {
            transform: none !important;
            pointer-events: auto !important;
        }
        body.mobile-open nav {
            background: rgba(0, 0, 0, 0.7) !important;
            backdrop-filter: blur(12px) !important;
            -webkit-backdrop-filter: blur(12px) !important;
        }
        body.mobile-open .nav-logo {
            transform: none !important;
            filter: none !important;
        }
    }

    /* Stesso timing MENU 500ms lineare (rimane invariato, riferimento!) */
    #mobile-menu {
        transition: transform 500ms linear !important;
    }

    #mobile-menu a {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 400ms ease, transform 400ms ease;
    }

    #mobile-menu.open a {
        opacity: 1;
        transform: translateY(0);
    }

    #mobile-menu.open a:nth-child(1) { transition-delay: 0.15s; }
    #mobile-menu.open a:nth-child(2) { transition-delay: 0.25s; }
    #mobile-menu.open a:nth-child(3) { transition-delay: 0.35s; }
    #mobile-menu.open a:nth-child(4) { transition-delay: 0.45s; }

    #mobile-menu.open {
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .parallax-slow {
        will-change: transform;
    }

    .marquee {
        display: flex;
        white-space: nowrap;
        animation: marquee 30s linear infinite;
    }

    @keyframes marquee {
        from { transform: translateX(0); }
        to { transform: translateX(-50%); }
    }

    .img-zoom {
        overflow: hidden;
    }

    .img-zoom img {
        transition: transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .img-zoom:hover img {
        transform: scale(1.08);
    }

    .underline-magic {
        background-image: linear-gradient(currentColor, currentColor);
        background-size: 0% 1px;
        background-repeat: no-repeat;
        background-position: 0 100%;
        transition: background-size 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    }

    .underline-magic:hover {
        background-size: 100% 1px;
    }

    .stagger-1 { transition-delay: 0.05s !important; }
    .stagger-2 { transition-delay: 0.1s !important; }
    .stagger-3 { transition-delay: 0.15s !important; }
    .stagger-4 { transition-delay: 0.2s !important; }
    .stagger-5 { transition-delay: 0.25s !important; }
    .stagger-6 { transition-delay: 0.3s !important; }
    .stagger-7 { transition-delay: 0.35s !important; }
    .stagger-8 { transition-delay: 0.4s !important; }
}

@layer utilities {
    .text-balance {
        text-wrap: balance;
    }

    .scrollbar-hide::-webkit-scrollbar {
        display: none;
    }

    .scrollbar-hide {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .writing-vertical {
        writing-mode: vertical-rl;
        text-orientation: mixed;
    }

    .text-shadow-lg {
        text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    }

    .mask-fade-bottom {
        mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
        -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    }
}

/* ============== ELURE MAGAZINE CUSTOM ============== */

/* Line clamp utilities (card previews) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Gallery grid staggered rows on md+ (editorial look) */
@media (min-width: 768px) {
    .gallery-grid .gallery-item:nth-child(4n+1) { margin-top: 0; }
    .gallery-grid .gallery-item:nth-child(4n+2) { margin-top: 2.5rem; }
    .gallery-grid .gallery-item:nth-child(4n+3) { margin-top: 0; }
    .gallery-grid .gallery-item:nth-child(4n+4) { margin-top: 2.5rem; }
}

/* Card subtle tilt + reveal delay stagger */
.article-card .aspect-\[4\/5\],
.gallery-item {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Filter chips accent on hover (buttons) */
#articles button {
    will-change: transform;
    transition: all 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* Newsletter input clean */
#newsletter input::placeholder {
    letter-spacing: 0.08em;
}
#newsletter input:focus {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.65);
}

/* Play button pulse on featured video */
@keyframes playPulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.55); }
    70%  { box-shadow: 0 0 0 18px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
#videos .group:hover .aspect-video > div:nth-child(2) > div:first-child {
    animation: playPulse 1.6s ease-out infinite;
}

/* Hero-overlay darken progress on scroll-in */
.hero-overlay { transition: background 0.3s ease; }

/* Nav logo smooth grow-in (solo DESKTOP — su mobile causa tremolio per conflitto col position:fixed) */
.nav-logo-link {
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.3s ease;
}
@media (min-width: 768px) {
    .nav-logo-link:hover { transform: scale(1.05); }
}
@media (max-width: 767px) {
    .nav-logo-link:hover,
    .nav-logo-link:active {
        transform: translate(1.5rem, 0.75rem) scale(1.05);
    }
}

/* =========================================================
   HERO HOME — Slow horizontal pan + zoom-in (stops at end)
   ========================================================= */
.hero-pan-wrap {
    position: absolute;
    inset: -6%;
    width: 112%;
    height: 112%;
    will-change: transform;
    transform-origin: center top;
    animation: heroPan 14s cubic-bezier(0.45, 0, 0.55, 1) forwards;
    pointer-events: none;
    backface-visibility: hidden;
}
.hero-pan-wrap > img,
.hero-pan-wrap picture,
.hero-pan-wrap picture img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes heroPan {
    0%   { transform: translate3d(-5%, 0, 0) scale(1.02); }
    100% { transform: translate3d(5%, 0, 0)  scale(1.12); }
}

/* ===== MOBILE HERO — pan orizzontale ridotto (ritratto) ===== */
@media (max-width: 767px) {
    .hero-pan-wrap {
        inset: -4%;
        width: 108%;
        height: 108%;
        animation: heroPanMobile 14s cubic-bezier(0.45, 0, 0.55, 1) forwards;
    }
}
@keyframes heroPanMobile {
    0%   { transform: translate3d(-2%, 0, 0) scale(1.02); }
    100% { transform: translate3d(2%, 0, 0)  scale(1.12); }
}

/* riduce moto per chi ha preferenze: panno spento */
@media (prefers-reduced-motion: reduce) {
    .hero-pan-wrap { animation: none; transform: translate3d(0,0,0) scale(1.07); }
}

/* =========================================================
   NAV CATEGORIE — SLIDING INDICATOR (underline animato)
   ========================================================= */
.nav-categories { position: relative; }

.nav-indicator {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    pointer-events: none;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition:
        left 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.35s ease,
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: left, width, transform, opacity;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.04),
                0 4px 12px rgba(255,255,255,0.18);
}

.nav-indicator.is-visible {
    opacity: 1;
    transform: scaleX(1);
}

/* fallback: le voci stanno in linea */
.nav-category-link {
    position: relative;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    display: inline-block;
}

@media (min-width: 768px) {
    .nav-category-link {
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }
}
@media (min-width: 1024px) {
    .nav-category-link {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
}

/* ============================================================
   NAV PRINCIPALE — nav-sections + nav-section-link (TUTTO QUI!)
   Modifica queste righe per fare prove, non serve toccare HTML.
   Formato cache busting 4 cifre: style.css?v=X.X.X.X
   ============================================================ */

/* .nav-sections = container delle voci (Cover, Articoli, Galleria, Video, Chi Siamo) */
.nav-sections {
    /* --- layout flex --- */
    position: relative;
    display: none !important;          /* default MOBILE (<768px): NASCOSTO */
    justify-content: flex-end !important;
    align-items: center !important;
    flex-direction: row;
    flex-wrap: nowrap;

    /* --- tipografia MOBILE --- */
    font-size: 0.65rem !important;     /* 10.4px */
    letter-spacing: 0.22em !important;
    text-transform: uppercase !important;
    color: #ffffff !important;

    /* --- gap MOBILE --- */
    gap: 1.25rem !important;
}

/* MD ≥ 768px: MENU DESKTOP VISIBILE */
@media (min-width: 768px) {
    .nav-sections {
        display: flex !important;
        font-size: 0.625rem !important;    /* 10px */
        letter-spacing: 0.24em !important;
        gap: 1.35rem !important;
    }
}

/* LG ≥ 1024px: desktop largo */
@media (min-width: 1024px) {
    .nav-sections {
        gap: 1.5rem !important;
        font-size: 0.6875rem !important;   /* 11px */
        letter-spacing: 0.25em !important;
    }
}

/* .nav-section-link = SINGOLO LINK */
.nav-section-link {
    color: inherit;
    text-decoration: none;
    white-space: nowrap !important;       /* Chi Siamo NON va a capo MAI */
    transition: opacity 300ms ease !important;
    opacity: 1;
    font-weight: 400;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.nav-section-link:hover {
    opacity: 0.6 !important;              /* = hover:opacity-60 Tailwind */
}
a.nav-section-link:last-child {
    white-space: nowrap !important;
}

/* ↓↓↓ FORZA SEMPRE py-3 (0.75rem) sul nav principale — vince su QUALSIASI classe Tailwind inline ↓↓↓ */
body > nav:first-of-type,
nav.fixed.top-0.z-50,
nav.fixed.top-0.left-0.right-0 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}
@media (max-width: 767px) {
    body > nav:first-of-type,
    nav.fixed.top-0.z-50,
    nav.fixed.top-0.left-0.right-0 {
        /* ↓↓↓ MOBILE: logo è position:fixed → fuori flow → nav collassa! Forzo altezza minima ↓↓↓ */
        min-height: calc(2.75rem + 0.75rem + 0.75rem) !important;  /* logo 44px + py-3 sopra/sotto = 4.25rem */
        box-sizing: border-box;
    }
}
@media (min-width: 768px) {
    body > nav:first-of-type,
    nav.fixed.top-0.z-50,
    nav.fixed.top-0.left-0.right-0 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
}

#subnav-categories {
    /* ↓↓↓ RIMOSSO overflow:clip e clip-path:inset(0) — ERANO LORO CHE TAGLIAVANO LE LETTERE A I BORDI! ↓↓↓ */
    overflow: hidden;      /* blocca solo sbordo verticale, lascia libero orizzontale per scroll nativo */
    clip-path: none;
    /* ↓↓↓ RIMUOVO BORDO NERO VISIBILE SULLO SCREENSHOT ↓↓↓ */
    border: none !important;
    border-bottom: none !important;
    border-top: none !important;
    box-shadow: none !important;
    outline: none !important;
    background-clip: padding-box;
}
/* ↓↓↓ Altezza nav fissata con py-3 + logo 2.75rem + border-b 1px ↓↓↓ */
@media (min-width: 768px) {
    #subnav-categories { top: 4.25rem !important; }
}
/* ↓↓↓ MOBILE (<768px): SUBNAV SEMPRE VISIBILE + top CALCOLATO + HEADER PADDING RIDOTTO ↓↓↓ */
@media (max-width: 767px) {
    #subnav-categories {
        display: block !important;      /* forzo visibile su mobile */
        top: calc(4.25rem - 2px ) !important;
    }

    /*
      👇👇👇 FIX SPAZIO BIANCO ARTICLE / ABOUT / CATEGORY MOBILE
        PRIMA:  header.section = padding-top: pt-32 Tailwind = 8rem (128px)
                Troppo! Il doppio nav (principale 4.25rem + subnav ~1.75rem) = 6rem.
                8rem - 6rem = 2rem SPAZIO VUOTO INUTILE visibile!
        ORA:    Ridotto a 6.5rem → gap relativo ~0.75rem = 12px (comodo ma non troppo!)
    */
    article header,
    body > header:first-of-type,
    section#top,
    section#top[class*="pt-32"],
    header[class*="pt-32"],
    section[class*="pt-32"] {
        padding-top: 6.75rem !important;   /* = prima 8rem → -1.25rem, no più spazio bianco! */
    }

    /* ↓↓↓ Su hero con foto grande (article.html cover) un pochino più di padding per non tagliare il soggetto ↓↓↓ */
    .article-cover header,
    .article-hero {
        padding-top: 7rem !important;
    }
}

/* ↓↓↓ COMPRESSIONE SUBNAV CATEGORIE + FONT LEGGERMENTE PIÙ GRANDE + NO TAGLIO ↓↓↓ */
#subnav-categories .nav-categories {
    min-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-left: 1.25rem;
    scroll-padding-right: 1.25rem;

    gap: 0.75rem !important;          /* prima 0.5rem → più distanziato */
    font-size: 0.625rem !important;   /* 10px invece 8px (8→10px = +25% più grande!) */
    letter-spacing: 0.15em !important;/* tracking 0.15em invece 0.14em */
    padding-top: 0.625rem !important;  /* 10px invece 8px, più aria */
    padding-bottom: 0.625rem !important;
    /* ↓↓↓ DOPPIO padding laterale: compensa tracking largo che faceva uscire lettere dal box ↓↓↓ */
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

/* PRIMO LINK (Celebrity): padding extra sx per MAI tagliare la C iniziale */
#subnav-categories .nav-categories a:first-of-type.nav-category-link,
#subnav-categories .nav-categories > a:first-child {
    padding-left: 0.75rem !important;
    scroll-snap-align: start;
}
/* ULTIMO LINK (Food & Travel): padding extra dx per MAI tagliare ultima lettera */
#subnav-categories .nav-categories a:last-of-type.nav-category-link,
#subnav-categories .nav-categories > a:last-child {
    padding-right: 0.75rem !important;
    scroll-snap-align: end;
}

@media (min-width: 768px) {
    #subnav-categories .nav-categories {
        gap: 1rem !important;           /* prima 0.75rem → più distanziato */
        font-size: 0.6875rem !important;/* 11px invece 9px → +22% più grande */
        letter-spacing: 0.16em !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}
@media (min-width: 1024px) {
    #subnav-categories .nav-categories {
        gap: 1.25rem !important;        /* prima 1rem → più aria */
        font-size: 0.75rem !important;  /* 12px invece 10px → +20% più grande */
        letter-spacing: 0.17em !important;
    }
}
@media (min-width: 1280px) {
    #subnav-categories .nav-categories {
        padding-left: 4rem !important;   /* ← xl doppio di prima */
        padding-right: 4rem !important;
    }
}
@media (min-width: 1536px) {
    #subnav-categories .nav-categories {
        padding-left: 6rem !important;   /* ← 2xl triplo */
        padding-right: 6rem !important;
    }
}
#subnav-categories .nav-categories::-webkit-scrollbar {
    display: none;                     /* Chrome/Safari: nascondi barra ma scrolla */
}

/* Reveal staggered already from main.js */

/* Issue number in corner (future) */

/* =========== ARTICLE DETAIL PAGE (ELURE MAGAZINE) =========== */

/* article max-width is 3xl/5xl in the markup; we add reading typography */
.article-body {
    max-width: 100%;
    color: #171717;
}

.article-body::after {
    content: "";
    display: block;
    clear: both;
}

.article-body p,
.article-body li {
    font-size: 1.0625rem;      /* 17px */
    line-height: 1.8;
    margin-bottom: 1.5em;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* ================================================================
   ELENCHI (UL / OL) — CORREZIONE TAILWIND RESET (list-style: none)
   Tailwind Preflight resetta i pallini; qui li ripristiniamo con
   !important per la visualizzazione pubblica degli articoli.
   ================================================================ */
.article-body ul {
    list-style-type: disc !important;
    padding-left: 1.9rem !important;
    margin: 1.6rem 0 !important;
}
.article-body ul li {
    list-style-type: disc !important;
    display: list-item !important;
    padding-left: 0.4rem !important;
    margin: 0.55rem 0 !important;
    margin-bottom: 0.55rem !important;  /* sovrascrive 1.5em del generico li */
}

.article-body ol {
    list-style-type: decimal !important;
    padding-left: 1.9rem !important;
    margin: 1.6rem 0 !important;
}
.article-body ol li {
    list-style-type: decimal !important;
    display: list-item !important;
    padding-left: 0.4rem !important;
    margin: 0.55rem 0 !important;
    margin-bottom: 0.55rem !important;
}

.article-body li::marker {
    color: #0a0a0a;
    font-weight: 700;
}

/* Blockquote (citazione editoriale) - riallineato al tema */
.article-body blockquote {
    border-left: 4px solid #d4a373;
    padding: 0.5em 0 0.5em 1.4rem;
    margin: 2.4rem 0;
    color: #4b5563;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.7;
    background: linear-gradient(180deg, transparent 0%, rgba(212, 163, 115, 0.05) 100%);
}

@media (min-width: 768px) {
    .article-body p,
    .article-body li {
        font-size: 1.15rem;        /* ~18.5px */
        line-height: 1.9;
    }
    .article-body blockquote {
        font-size: 1.5rem;
        padding-left: 2rem;
        margin: 3rem -0.5rem;
    }
}

.article-body em {
    font-family: var(--font-display);
    font-style: italic;
    color: #0a0a0a;
}

/* ================================================================
   FORMATTAZIONE INLINE ARTICOLI — correzione Tailwind Preflight
   Bold, italic, underline, strikethrough DEVONO essere visibili!
   ================================================================ */
.article-body strong,
.article-body b {
    font-weight: 700 !important;
    color: inherit;
}
.article-body em,
.article-body i {
    font-style: italic !important;
}
.article-body u,
.article-body ins {
    text-decoration: underline !important;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    color: inherit;
}
.article-body s,
.article-body strike,
.article-body del {
    text-decoration: line-through !important;
    color: inherit;
    opacity: 0.85;
}
.article-body mark {
    background: rgba(250, 204, 21, 0.35);
    color: inherit;
    padding: 0 0.2em;
    border-radius: 3px;
}
.article-body code,
.article-body pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
}
.article-body code {
    padding: 0.15em 0.4em;
    font-size: 0.92em;
}
.article-body pre {
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin: 2rem 0;
    line-height: 1.6;
}
.article-body sup,
.article-body sub {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}
.article-body sup { top: -0.4em; }
.article-body sub { bottom: -0.25em; }

.article-body .article-lead {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.55rem;
    line-height: 1.45;
    margin-bottom: 2.2em;
    padding-bottom: 1.6em;
    border-bottom: 1px solid #e5e5e5;
    color: #111;
}

@media (min-width: 768px) {
    .article-body .article-lead {
        font-size: 1.95rem;
    }
}

.article-body h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.9rem;
    line-height: 1.15;
    margin: 2.6em 0 0.8em;
    letter-spacing: -0.005em;
}

@media (min-width: 768px) {
    .article-body h3 {
        font-size: 2.4rem;
        margin-top: 3em;
    }
}

/* figures inside article */
.article-body .article-figure {
    margin: 2.8em 0;
    width: 100%;
}

/* Utility per immagini con aspect-ratio fisso (copertine, grid) */
.cover-photo,
.hero-zoom-img {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
}

/* Reset aggressivo per immagini articoli per evitare ogni distorsione */
.article-body img, 
.article-body figure img,
.article-body .article-image {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    min-height: 0 !important;
    display: block !important;
    object-fit: contain !important;
    aspect-ratio: auto !important;
    margin: 2.5rem auto !important;
}

.article-body .article-figure .article-image {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    display: block !important;
    border-radius: 2px;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.15);
}
.article-body .article-caption {
    margin-top: 0.9em;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #737373;
    text-align: center;
}

.article-body .article-figure--left,
    .article-body .article-figure--right {
        width: 100%;
        margin: 1.5em 0;
    }

    @media (min-width: 768px) {
    .article-body .article-figure--left,
    .article-body .article-figure--right {
        width: min(46%, 420px);
        margin-top: 0.4em;
    }

    .article-body .article-figure--left {
        float: left;
        margin-right: 2rem;
    }

    .article-body .article-figure--right {
        float: right;
        margin-left: 2rem;
    }
}

/* pull-quote — editorial style */
.article-body .pull-quote {
    position: relative;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1.35;
    text-align: center;
    margin: 2.8em 0;
    padding: 1.6em 1.8em;
    border-left: 2px solid #0a0a0a;
    border-right: 2px solid #0a0a0a;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.018) 50%, transparent 100%);
}

.article-body .pull-quote cite {
    display: block;
    font-family: var(--font-sans);
    font-style: normal;
    font-weight: 400;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #737373;
    margin-top: 1.1em;
}

@media (min-width: 768px) {
    .article-body .pull-quote {
        font-size: 2.1rem;
        padding: 2em 3em;
        margin: 3.2em -3em;
    }
}

/* gallery grid inside articles — 1 col mobile, 4 cols md+ */
.article-body .gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2.8em 0;
}

@media (min-width: 640px) {
    .article-body .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 768px) {
    .article-body .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.2rem;
    }
    /* staggered visual */
    .article-body .gallery-grid > :nth-child(odd) {
        transform: translateY(1.6rem);
    }
}

.article-body .gallery-grid figure {
    margin: 0;
    overflow: hidden;
    aspect-ratio: auto;
    background: #e5e5e5;
}
.article-body .gallery-grid .article-image {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
    transition: transform 1.4s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.article-body .gallery-grid figure:hover .article-image {
    transform: scale(1.06);
}

.article-body .article-table-wrap {
    overflow-x: auto;
    margin: 2.8em 0;
    border: 1px solid #e5e5e5;
    border-radius: 1rem;
    background: #fafaf9;
}

.article-body table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    margin: 0;
}

.article-body th,
.article-body td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
    vertical-align: top;
    font-size: 0.98rem;
    line-height: 1.7;
}

.article-body th {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #525252;
    background: #f5f5f4;
}

.article-body tr:last-child td {
    border-bottom: 0;
}

.article-body .note-box {
    margin: 2.8em 0;
    padding: 1.35rem 1.5rem;
    border: 1px solid #d4d4d4;
    border-left: 4px solid #0a0a0a;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.035) 100%);
}

.article-body .note-box p:last-child {
    margin-bottom: 0;
}

.article-body .article-end {
    margin-top: 4em;
    padding-top: 1.6em;
    text-align: center;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #a3a3a3;
    border-top: 1px solid #e5e5e5;
}

/* Fix: nested link underline in article.body */
.article-body a {
    color: inherit;
    border-bottom: 1px solid rgba(10,10,10,0.25);
    text-decoration: none;
    transition: border-color 0.2s;
}
.article-body a:hover { border-color: #0a0a0a; }

/* =============================================================
   MOBILE MENU — fuori da @layer (Tailwind CDN non lo processa!)
   Serve TUTTE le volte al volo
   ============================================================= */
#mobile-menu a {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#mobile-menu.open a {
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.open a:nth-child(1) { transition-delay: 0.15s; }
#mobile-menu.open a:nth-child(2) { transition-delay: 0.25s; }
#mobile-menu.open a:nth-child(3) { transition-delay: 0.35s; }
#mobile-menu.open a:nth-child(4) { transition-delay: 0.45s; }
#mobile-menu.open a:nth-child(5) { transition-delay: 0.55s; }
#mobile-menu.open a:nth-child(6) { transition-delay: 0.65s; }
#mobile-menu.open a:nth-child(7) { transition-delay: 0.75s; }
#mobile-menu.open a:nth-child(8) { transition-delay: 0.85s; }

/* =========================================================
   INSTAGRAM STORIES & LIGHTBOX
   ========================================================= */

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Layout a griglia per le storie */
#stories-track {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    overflow-x: hidden !important;
}

@media (min-width: 640px) {
    #stories-track {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    #stories-track {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem;
    }
}

#stories-track .story-item {
    width: 100% !important;
    margin: 0;
}

#stories-track-container {
    padding-bottom: 2rem;
}

/* Nascondi le frecce di navigazione poiché non c'è più scorrimento orizzontale */
#prev-story, #next-story {
    display: none !important;
}

.story-card-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    margin-bottom: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
}

.story-item:hover .story-card-wrap {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.5);
    border-color: rgba(255, 255, 255, 0.15);
}

.story-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.story-card-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.story-item:hover .story-card-inner img {
    transform: scale(1.05);
}

.story-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 40%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
    pointer-events: none;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.story-item:hover .story-card-overlay {
    opacity: 1;
}

.story-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.insta-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 2;
}

.insta-indicator svg {
    width: 16px;
    height: 16px;
    color: white;
}

/* Fallback per quando l'immagine Instagram non carica (Stories/Reels privati) */
.insta-fallback {
    background: #0a0a0a !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.insta-fallback::before {
    content: '';
    width: 44px;
    height: 44px;
    background: linear-gradient(45deg, #f09433 0%, #dc2743 50%, #bc1888 100%);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    display: block;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: 28px;
    mask-size: 28px;
}

.insta-fallback::after {
    content: 'CONTENUTO INSTAGRAM';
    color: rgba(255,255,255,0.4);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* Lightbox Animations */
#story-lightbox.visible {
    display: block;
    opacity: 1;
}

#story-lightbox #lightbox-content {
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#story-lightbox.visible #lightbox-content {
    transform: scale(1);
}

#story-progress {
    transition: width 0.1s linear;
}

@keyframes storyProgress {
    from { width: 0%; }
    to { width: 100%; }
}

/* ============================================================
   COOKIE BANNER — fixed bottom, stile glass editoriale
   ============================================================ */
#elure-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    padding: 0.75rem 1rem 1rem;
    background: rgba(10, 12, 16, 0.92);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.35s ease;
}
#elure-cookie-banner.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
#elure-cookie-banner.hidden {
    display: none;
}

#elure-cookie-banner .cookie-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}
@media (min-width: 768px) {
    #elure-cookie-banner { padding: 1rem 1.5rem 1.15rem; }
    #elure-cookie-banner .cookie-inner {
        flex-direction: row;
        align-items: center;
        gap: 1.5rem;
    }
}

#elure-cookie-banner .cookie-icon {
    display: none;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.2), rgba(188, 24, 136, 0.2));
    align-items: center;
    justify-content: center;
    color: #fca5a5;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
@media (min-width: 768px) {
    #elure-cookie-banner .cookie-icon { display: inline-flex; }
}

#elure-cookie-banner .cookie-copy {
    flex: 1;
    min-width: 0;
}
#elure-cookie-banner .cookie-title {
    font-family: var(--font-display, 'Playfair Display', Georgia, serif);
    color: #fff;
    font-size: 1.05rem;
    line-height: 1.15;
    margin: 0 0 0.35rem 0;
    font-weight: 600;
}
#elure-cookie-banner .cookie-text {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    line-height: 1.55;
    margin: 0;
    letter-spacing: 0.01em;
}
#elure-cookie-banner .cookie-text a {
    color: #93c5fd;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}
#elure-cookie-banner .cookie-text a:hover { color: #bfdbfe; }

#elure-cookie-banner .cookie-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}
@media (min-width: 640px) {
    #elure-cookie-banner .cookie-actions {
        flex-wrap: nowrap;
    }
}

#elure-cookie-banner .cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.22s ease;
    white-space: nowrap;
    line-height: 1;
}
#elure-cookie-banner .cookie-btn:active { transform: translateY(1px); }

#elure-cookie-banner .cookie-btn-secondary {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.72);
}
#elure-cookie-banner .cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

#elure-cookie-banner .cookie-btn-primary {
    background: #fff;
    color: #0a0a0a;
    border-color: #fff;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}
#elure-cookie-banner .cookie-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 26px rgba(255, 255, 255, 0.22);
    background: #f3f4f6;
}

/* Push footer su mobile se serve (non usiamo fixed footer ma giusto safety) */
@media (max-width: 767px) {
    #elure-cookie-banner.visible ~ * { /* fallback — non strettamente necessario */ }
}

