/* UPLOAD BUTTON */
.btn-multiple-upload {
    position: relative;
    min-width: 200px;
}

/* SINGLE DELETE BUTTON */
.delete-photo-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 0, 0, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    pointer-events: auto;
    transition: all 0.3s ease;
}

/* BARRA DI PROGRESSO */
.uploading-container-1 {
    margin-top: 15px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.uploading-container-2 {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.uploading-container-3 {
    height: 100%;
    background-color: #007bff;
    transition: width 0.3s ease;
}

/* ============================================
   MODALE FOTO - Stile coerente con il tema - START
   ============================================ */

/* Overlay scuro che copre tutto lo schermo */
.photo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-in-out;
    overflow-y: auto;
}

/* Animazione fade-in dell'overlay */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Container principale della modale */
.photo-modal-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Pulsante chiudi (X) */
.photo-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-box-shadow: 0px 14px 30px -15px rgba(0, 0, 0, 0.75);
    -moz-box-shadow: 0px 14px 30px -15px rgba(0, 0, 0, 0.75);
    box-shadow: 0px 14px 30px -15px rgba(0, 0, 0, 0.75);
}

.photo-modal-close span {
    display: block;
    margin-top: -3px;
}

.photo-modal-close:hover,
.photo-modal-close:focus {
    background: #F14E95;
    transform: scale(1.1);
    outline: none;
}

/* Wrapper dell'immagine */
.photo-modal-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 80px; /* Spazio per la barra azioni */
    animation: zoomIn 0.3s ease-in-out;
}

/* Animazione zoom-in dell'immagine */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Immagine */
.photo-modal-image {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 4px;
    -webkit-box-shadow: 0px 14px 40px -10px rgba(0, 0, 0, 0.75);
    -moz-box-shadow: 0px 14px 40px -10px rgba(0, 0, 0, 0.75);
    box-shadow: 0px 14px 40px -10px rgba(0, 0, 0, 0.75);
    object-fit: contain;
}

/* Barra delle azioni (download) */
.photo-modal-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Bottone download */
.photo-modal-download-btn {
    background: #F14E95;
    color: #fff;
    border: 2px solid #F14E95;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 400;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "Work Sans", Arial, sans-serif;
    -webkit-box-shadow: 0px 14px 30px -15px rgba(0, 0, 0, 0.75);
    -moz-box-shadow: 0px 14px 30px -15px rgba(0, 0, 0, 0.75);
    box-shadow: 0px 14px 30px -15px rgba(0, 0, 0, 0.75);
}

.photo-modal-download-btn:hover,
.photo-modal-download-btn:focus {
    background: #f366a3;
    border-color: #f366a3;
    transform: translateY(-2px);
    -webkit-box-shadow: 0px 20px 35px -15px rgba(0, 0, 0, 0.85);
    -moz-box-shadow: 0px 20px 35px -15px rgba(0, 0, 0, 0.85);
    box-shadow: 0px 20px 35px -15px rgba(0, 0, 0, 0.85);
    outline: none;
}

.photo-modal-download-btn:active {
    transform: translateY(0);
}

.photo-modal-download-btn i {
    font-size: 18px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media screen and (max-width: 768px) {
    .photo-modal-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 26px;
    }

    .photo-modal-image {
        max-height: 75vh;
    }

    .photo-modal-actions {
        padding: 15px;
    }

    .photo-modal-download-btn {
        padding: 10px 25px;
        font-size: 14px;
    }
}

/* Mobile */
@media screen and (max-width: 480px) {
    .photo-modal-overlay {
        padding: 10px;
    }

    .photo-modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .photo-modal-image-wrapper {
        margin-bottom: 70px;
    }

    .photo-modal-image {
        max-height: 70vh;
        border-radius: 2px;
    }

    .photo-modal-actions {
        padding: 12px;
    }

    .photo-modal-download-btn {
        padding: 8px 20px;
        font-size: 13px;
        gap: 8px;
    }

    .photo-modal-download-btn span {
        display: none; /* Nascondi il testo su mobile */
    }

    .photo-modal-download-btn i {
        font-size: 20px;
    }
}

/* Touch devices - migliora area di tap */
@media (hover: none) and (pointer: coarse) {
    .photo-modal-close,
    .photo-modal-download-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============================================
   MODALE FOTO - Stile coerente con il tema - END
   ============================================ */

/* ============================================
   MOBILE RESPONSIVE FIXES
   ============================================ */

/* --- Countdown: rimpicciolisce i cerchi su mobile --- */
@media screen and (max-width: 480px) {
    .simply-countdown > .simply-section {
        width: 65px;
        height: 65px;
        margin: 0 2px;
    }
    .simply-countdown > .simply-section > div {
        width: 65px;
        height: 65px;
    }
    .simply-countdown > .simply-section .simply-amount {
        font-size: 18px;
    }
    .simply-countdown > .simply-section .simply-word {
        font-size: 9px;
    }
}

/* --- Event section: rimuove altezza fissa su mobile --- */
@media screen and (max-width: 768px) {
    #fh5co-event {
        height: auto !important;
        padding: 5em 0;
    }
    #fh5co-event .display-t,
    #fh5co-event .display-tc {
        height: auto !important;
        display: block !important;
    }
}

/* --- CoupleSection: centra le immagini su mobile --- */
@media screen and (max-width: 768px) {
    .couple-half .groom,
    .couple-half .bride {
        float: none;
        margin: 0 auto;
        display: block;
    }
    .couple-half .desc-groom,
    .couple-half .desc-bride {
        padding-right: 0 !important;
        padding-left: 0 !important;
        text-align: center !important;
        margin-top: 10px;
    }
}

/* --- Header h1: scala meglio su schermi piccoli --- */
@media screen and (max-width: 380px) {
    .fh5co-cover .display-tc h1 {
        font-size: 26px !important;
    }
    .fh5co-cover .display-tc h2 {
        font-size: 14px !important;
    }
}

/* --- Timeline: fix su mobile stretto --- */
@media screen and (max-width: 480px) {
    ul.timeline:before {
        left: 30px;
    }
    ul.timeline > li > .timeline-badge {
        left: 0;
        margin-left: 0;
        width: 55px;
        height: 55px;
    }
    ul.timeline > li > .timeline-panel {
        width: calc(100% - 75px);
        float: right;
    }
    ul.timeline > li > .timeline-panel:before {
        border-left-width: 0;
        border-right-width: 15px;
        left: -15px;
        right: auto;
    }
    ul.timeline > li > .timeline-panel:after {
        border-left-width: 0;
        border-right-width: 14px;
        left: -14px;
        right: auto;
    }
}

/* --- Previeni overflow orizzontale globale --- */
body, html {
    overflow-x: hidden;
    max-width: 100%;
}

/* --- Container padding su mobile --- */
@media screen and (max-width: 480px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* ============================================
   HEADER MOBILE FIXES
   ============================================ */

/* Subtitle centrato (era già text-center sul parent,
   ma h2 ha margin auto di default che può disallinearsi) */
@media screen and (max-width: 768px) {
    .header-subtitle {
        text-align: center !important;
        width: 100%;
        display: block;
    }

    /* h1 del cover: assicura che il testo vada a capo correttamente */
    .fh5co-cover .display-tc h1 {
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        padding: 0 10px;
    }
}

@media screen and (max-width: 480px) {
    /* Ulteriore riduzione font su schermi molto piccoli */
    .fh5co-cover .display-tc h1 {
        font-size: 28px !important;
        line-height: 1.3;
    }

    .fh5co-cover .display-tc h2 {
        font-size: 15px !important;
        padding: 0 10px;
    }
}

/* ============================================
   NAVIGATION MOBILE FIXES
   ============================================ */

/* Hamburger: visibile solo su mobile (il CSS del template
   lo mostra già con display:block a <768px, ma serve
   nasconderlo su desktop dove c'è il menu normale) */
.js-fh5co-nav-toggle {
    display: none; /* nascosto di default su desktop */
}
@media screen and (max-width: 768px) {
    .js-fh5co-nav-toggle {
        display: block;
    }
    /* Nasconde la colonna del menu desktop su mobile */
    .menu-1 {
        display: none !important;
    }
}

/* Logo: centrato verticalmente e testo non troncato */
#fh5co-logo a {
    white-space: nowrap;
    display: inline-block;
}

/* Offcanvas: pannello slide-in da destra */
#fh5co-offcanvas {
    position: fixed;
    top: 0;
    right: -270px;       /* fuori schermo di default */
    width: 270px;
    height: 100%;
    background: #1a1a1a;
    z-index: 1999;
    padding: 40px 20px;
    overflow-y: auto;
    transition: right 0.3s ease;
    -webkit-transition: right 0.3s ease;
}
#fh5co-offcanvas.offcanvas-open {
    right: 0;            /* entra da destra */
}
#fh5co-offcanvas ul {
    list-style: none;
    padding: 0;
    margin: 60px 0 0 0;
}
#fh5co-offcanvas ul li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
#fh5co-offcanvas ul li a {
    display: block;
    padding: 14px 0;
    color: rgba(255,255,255,0.7);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}
#fh5co-offcanvas ul li a:hover,
#fh5co-offcanvas ul li a.active {
    color: #F14E95;
}

/* Overlay scuro quando il menu è aperto
   (la classe .offcanvas sul body è già gestita dal CSS del template) */
.offcanvas #page:after {
    content: "";
    position: fixed;    /* fixed invece di absolute per coprire tutto lo scroll */
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1998;
}