:root {
    --beige: #f5f0e6;
    --light: #ffffff;
    --gold: #b8860b;
    --gold-light: #d4af37;
    --bordeaux: #722f37;
    --cream: #fff9f0;
    --text-beige: #f7d0b6;
    --overlay-opacity: 0.1;
}

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

body {
    font-family: 'Playfair Display', serif;
    color: var(--text-dark);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    line-height: 1.6;
    /* Miglioramenti mobile */
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Background image container */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/sorsi-e-morsi-bg1.webp');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    z-index: -2;
}

/* Overlay regolabile */
.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--beige);
    opacity: var(--overlay-opacity);
    z-index: -1;
}

/* Fullscreen slide container */
.slide-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 1.5rem;
    overflow: hidden;
}

/* Text container inside slide */
.text-container {
    text-align: center;
    max-width: 800px;
    width: 100%;
    margin: 0;
    padding: 2rem 1.8rem;
    /*background: rgba(146, 139, 147, 0.4);*/
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 18px;
    box-shadow: 0 10px 35px rgba(114, 47, 55, 0.18);
    border: 1px solid rgba(184, 134, 11, 0.25);
    -webkit-overflow-scrolling: touch;
}

.text-container h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--gold);
    text-shadow: 0 2px 4px rgba(184, 134, 11, 0.2);
    letter-spacing: 0.8px;
    opacity: 0;
    transform: translateY(25px);
    animation: fadeInUp 1s forwards 0.3s;
}

.text-container p {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    font-style: italic;
    opacity: 0;
    transform: translateY(25px);
    animation: fadeInUp 1s forwards;
    line-height: 1.5;
}

.text-container p:nth-child(2) {
    animation-delay: 0.7s;
}

.text-container p:nth-child(3) {
    animation-delay: 1.2s;
}

.text-container p:nth-child(4) {
    animation-delay: 1.7s;
}

.text-color-beige{
    color: var(--text-beige);
}
.text-color-light{
    color: var(--light);
}


/* Countdown */
.countdown {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(25px);
    animation: fadeInUp 1s forwards 2.2s;
}

.countdown-item {
    background: var(--beige);
    /*border: 1px solid var(--gold);*/
    border-radius: 20px;
    padding: 0.9rem 0.7rem;
    min-width: 70px;
    text-align: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 8px rgba(114, 47, 55, 0.1);
    /* Miglioramenti mobile */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.countdown-item:hover,
.countdown-item:focus {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(184, 134, 11, 0.28);
    border-color: var(--gold-light);
}

/* Miglioramenti per touch */
@media (hover: none) and (pointer: coarse) {
    .countdown-item:hover {
        transform: translateY(0);
        box-shadow: 0 4px 8px rgba(114, 47, 55, 0.1);
    }

    .countdown-item:active {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(184, 134, 11, 0.25);
    }
}

.countdown-value {
    font-family: 'Cinzel', serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--bordeaux);
    text-shadow: 0 0 6px rgba(184, 134, 11, 0.3);
    line-height: 1.2;
}

.countdown-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dark);
    opacity: 0.75;
    margin-top: 0.3rem;
}

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet styles */
@media (min-width: 768px) {
    .text-container {
        padding: 2.8rem 2.5rem;
    }

    .text-container h1 {
        font-size: 2.8rem;
        margin-bottom: 2.5rem;
    }

    .text-container p {
        font-size: 1.8rem;
        margin-bottom: 1.8rem;
    }

    .countdown {
        gap: 1.5rem;
        margin-top: 2.5rem;
    }

    .countdown-item {
        padding: 1.2rem 0.9rem;
        min-width: 85px;
    }

    .countdown-value {
        font-size: 2.5rem;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .text-container h1 {
        font-size: 3.2rem;
    }

    .text-container p {
        font-size: 2rem;
    }

    .countdown-item {
        min-width: 95px;
        padding: 1.3rem 1rem;
    }

    .countdown-value {
        font-size: 2.8rem;
    }
}

/* Extra small mobile */

@media (max-width: 375px) {

    .text-container {

        padding: 1.8rem 1.5rem;

    }



    .text-container h1 {

        font-size: 2.1rem;

    }



    .text-container p {

        font-size: 1.45rem;

    }



    .countdown-item {

        min-width: 65px;

        padding: 0.8rem 0.6rem;

    }



    .countdown-value {

        font-size: 1.9rem;

    }



    .countdown-label {

        font-size: 0.8rem;

    }

}



@media (max-width: 767px) {

    .text-container {

        max-width: 100%;

        padding: 1.5rem;

        border-radius: 0;

        height: 100%;

        display: flex;

        flex-direction: column;

        justify-content: center;

    }



    .text-container h1 {

        font-size: 2rem;

    }



    .text-container p {

        font-size: 1.8rem;

    }



    .countdown-item {

        min-width: 60px;

        padding: 0.7rem 0.5rem;

    }



    .countdown-value {

        font-size: 1.5rem;

    }



    .countdown-label {

        font-size: 0.7rem;

    }



    .slide-container {

        padding: 0;

    }

}



.logo-container {

    position: static;

    width: 100%;

    display: flex;

    justify-content: center;

    align-items: center;

    margin: 0.5rem 0 1rem;

    z-index: 1;

}



.logo {

    width: clamp(140px, 38vw, 300px);

    height: auto;

}

/* Mobile overrides: ottimizzazione contenitore logo e dimensionamento fluido */
@media (max-width: 767px) {
    .logo-container {
        margin: 0.75rem 0 1rem;
    }
    .logo {
        width: clamp(120px, 42vw, 200px);
        height: auto;
    }
}

/* Extra-small mobile fine-tuning */
@media (max-width: 375px) {
    .logo {
        width: clamp(105px, 48vw, 170px);
        height: auto;
    }
}
