/* ===== Gallery cards ===== */
.card img { cursor: pointer; transition: transform .35s ease; }
.card img:hover { transform: scale(1.05); }

/* ===== Lift modal ABOVE fixed widgets (social widget / scroll-top) ===== */
.modal-backdrop { z-index: 9990 !important; }
#imageModal     { z-index: 10000 !important; }

/* ===== Modal shell ===== */
#imageModal .modal-content {
    position: relative;
    background: #0f1417;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0,0,0,.6);
}
.modal-backdrop.show {
    background: rgba(10,12,14,.8);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* ===== Image ===== */
.modal-img-wrap { position: relative; }
.modal-img {
    width: 100%; height: auto; max-height: 78vh;
    object-fit: cover; display: block;
    transition: opacity .25s ease, transform .25s ease;
}
.modal-img.is-changing { opacity: 0; transform: scale(.985); }
.modal-img-wrap::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
    background: linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,0));
    pointer-events: none;
}

/* ===== Caption pill ===== */
.overlay-text {
    position: absolute; left: 20px; bottom: 20px; z-index: 5;
    color: #fff; background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px); 
    padding: 8px 18px; border-radius: 999px;
    font-size: .95rem; letter-spacing: .3px; max-width: 65%;
    pointer-events: none;
}

/* ===== Counter pill ===== */
.modal-counter {
    position: absolute; top: 16px; left: 16px; z-index: 6;
    color: #fff; background: rgba(0,0,0,.45);
    border: 1px solid rgba(255,255,255,.2);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px); 
    padding: 5px 14px; border-radius: 999px;
    font-size: .78rem; letter-spacing: 1.5px;
    pointer-events: none;
}

/* ===== Close (top-right) ===== */
.close-btn {
    position: absolute; top: 14px; right: 14px; z-index: 10;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.25); border-radius: 50%;
    background: rgba(0,0,0,.45);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px); 
    color: #fff; font-size: 1rem; cursor: pointer;
    pointer-events: auto; transition: all .3s ease;
}
.close-btn:hover { background: #d30707; border-color: #d30707; transform: rotate(90deg); }

/* ===== Prev / Next (bottom-right) ===== */
.slideshow-controls {
    position: absolute; bottom: 18px; right: 18px; z-index: 10;
    display: flex; gap: 10px;
}
.slideshow-controls button {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.25); border-radius: 50%;
    background: rgba(0,0,0,.45);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff; font-size: .9rem; cursor: pointer;
    pointer-events: auto; transition: all .25s ease;
}
.slideshow-controls button:hover {
    background: #fff; color: #0f1417;
    transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,0,0,.4);
}
.slideshow-controls button:active { transform: translateY(-1px) scale(.95); }

/* ===== Responsive sizing: phones → PCs, portrait + landscape ===== */
#imageModal .modal-dialog { margin: 12px auto; max-width: calc(100vw - 24px); }

@media (max-width: 575.98px) {
    #imageModal .modal-dialog { max-width: calc(100vw - 20px); margin: 10px auto; }
    .modal-img { max-height: 62vh; }
}
@media (max-height: 480px) and (orientation: landscape) {
    #imageModal .modal-dialog { max-width: min(92vw, 620px); }
    .modal-img { max-height: 70vh; }
    .slideshow-controls button { width: 36px; height: 36px; font-size: .8rem; }
    .close-btn { width: 34px; height: 34px; }
    .overlay-text { font-size: .78rem; padding: 5px 12px; bottom: 12px; left: 12px; }
    .modal-counter { top: 10px; left: 10px; font-size: .68rem; }
}
@media (min-width: 576px) {
    #imageModal .modal-dialog { max-width: min(92vw, 560px); }
    .modal-img { max-height: 66vh; }
}
@media (min-width: 768px) {   /* tablets & iPad portrait */
    #imageModal .modal-dialog { max-width: min(90vw, 720px); }
    .modal-img { max-height: 70vh; }
}
@media (min-width: 992px) {   /* tablets/iPad landscape, small PCs */
    #imageModal .modal-dialog { max-width: min(88vw, 900px); }
    .modal-img { max-height: 74vh; }
}
@media (min-width: 1024px) and (orientation: landscape) {
    #imageModal .modal-dialog { max-width: min(86vw, 960px); }
}
@media (min-width: 1200px) {  /* PC large */
    #imageModal .modal-dialog { max-width: min(84vw, 1080px); }
    .modal-img { max-height: 78vh; }
}
@media (min-width: 1400px) {  /* PC extra-large */
    #imageModal .modal-dialog { max-width: min(80vw, 1240px); }
    .modal-img { max-height: 80vh; }
}


/* .card img {
      cursor: pointer;
      transition: transform 0.3s;
    }
    .card img:hover {
      transform: scale(1.05);
    }
    .modal-img {
      width: 100%;
      height: auto;
    }
    .overlay-text {
      position: absolute;
      bottom: 10px;
      left: 15px;
      color: #fff;
      background: rgba(0,0,0,0.6);
      padding: 5px 10px;
      border-radius: 5px;
      max-width: 60%;
    }
    .close-btn {
      position: absolute;
      top: 10px;
      right: 15px;
      color: #424040;
      font-size: 1.5rem;
      cursor: pointer;
      z-index: 10;
    }

    .close-btn:hover {
      position: absolute;
      top: 10px;
      right: 15px;
      color: #d30707;
      font-size: 1.5rem;
      cursor: pointer;
      z-index: 10;
    }

    .slideshow-controls {
      position: absolute;
      bottom: 10px;
      right: 15px;
      display: flex;
      gap: 10px;
    }
    .slideshow-controls button {
      background: rgba(0,0,0,0.6);
      border: none;
      color: #fff;
      padding: 6px 12px;
      border-radius: 5px;
      cursor: pointer;
    }
    .modal-content {
      position: relative;
      background: transparent;
      border: none;
    }

    /* Responsive adjustments *
    @media (max-width: 576px) {
      .overlay-text {
        font-size: 0.8rem;
        max-width: 70%;
      }
      .slideshow-controls button {
        padding: 4px 8px;
        font-size: 0.8rem;
      }
      .card img {
        height: auto;
      }
      .close-btn {
        position: absolute;
        top: 10px;
        right: 15px;
        color: #424040;
        font-size: 1.2rem;
        cursor: pointer;
        z-index: 10;
      }
      .close-btn:hover {
        position: absolute;
        top: 10px;
        right: 15px;
        color: #d30707;
        font-size: 1.2rem;
        cursor: pointer;
        z-index: 10;
      }
    } */