/* AKGallery Styles - Desktop Optimized */

.akgallery-wrapper {
    position: relative;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 100%;
}

.akgallery-container {
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
}

.akgallery-track {
    width: 100%;
    overflow: hidden;
}

.akgallery-slider {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.akgallery-slide {
    flex: 0 0 auto;
    padding: 0 6px;
    box-sizing: border-box;
}

.akgallery-slide-inner {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #f8f9fa;
    height: 100%;
}

.akgallery-slide-inner:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* GRID-ONLY image sizing (fixed card heights) */
.akgallery--grid .akgallery-slide img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* Grid-only hover zoom effect */
.akgallery--grid .akgallery-slide-inner:hover img {
    transform: scale(1.05);
}

.akgallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: white;
    padding: 25px 15px 15px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
}

/* Navigation Arrows - Desktop */
.akgallery-arrow {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 2px solid #e0e0e0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    line-height: 1;
    padding: 0;
}

.akgallery-arrow:hover {
    background: #ffb400;
    color: white;
    border-color: #ffb400;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 180, 0, 0.3);
}

.akgallery-arrow:active {
    transform: scale(0.95);
}

.akgallery-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.5);
}

.akgallery-arrow:disabled:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #333;
    border-color: #e0e0e0;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Dots Navigation - outside wrapper so it appears below */
.akgallery-dots {
    text-align: center;
    margin: 20px 0 0 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
    clear: both;
}

.akgallery-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.akgallery-dot:hover {
    border-color: #999;
    background: #f0f0f0;
    transform: scale(1.2);
}

.akgallery-dot.active {
    background: #333;
    border-color: #333;
}

/* Modal Styles with Enhanced Z-index Management */
.akgallery-modal {
    position: fixed;
    z-index: 2147483647 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    isolation: isolate;
}

.akgallery-modal.active {
    opacity: 1;
    visibility: visible;
    z-index: 2147483647 !important;
}

.akgallery-modal-content {
    position: relative;
    margin: auto;
    max-width: 90%;
    max-height: 90%;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2147483647;
}

.akgallery-modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    margin-bottom: 20px;
}

.akgallery-modal-caption {
    color: white;
    font-size: 18px;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 25px;
    max-width: 80%;
    line-height: 1.5;
    backdrop-filter: blur(10px);
}

.akgallery-modal-close {
    position: absolute;
    bottom: 20px;
    right: 30px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2147483647;
    transition: all 0.3s ease;
    line-height: 1;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.akgallery-modal-close:hover {
    background: rgba(255, 0, 0, 0.7);
    transform: scale(1.1);
}

.akgallery-modal-prev,
.akgallery-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2147483647;
    transition: all 0.3s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.akgallery-modal-prev:hover,
.akgallery-modal-next:hover {
    background: rgba(255, 180, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.akgallery-modal-prev { left: 30px; }
.akgallery-modal-next { right: 30px; }

/* Prevent body scroll when modal is open */
body.akgallery-modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Mobile phones - stack arrows below gallery */
@media (max-width: 480px) {
    .akgallery-wrapper {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .akgallery-container {
        order: 1;
        width: 100%;
    }

    /* Create navigation row below gallery */
    .akgallery-nav-mobile {
        order: 2;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
    }

    .akgallery-arrow {
        background: rgba(255, 180, 0, 0.1);
        border: 2px solid #ffb400;
        color: #ffb400;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .akgallery-arrow:hover {
        background: #ffb400;
        color: white;
    }

    /* Grid-only mobile image height */
    .akgallery--grid .akgallery-slide img {
        height: 200px;
    }

    .akgallery-caption {
        font-size: 12px;
        padding: 15px 10px 8px;
    }

    .akgallery-modal-prev {
        left: 10px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .akgallery-modal-next {
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .akgallery-modal-close {
        width: 44px;
        height: 44px;
        font-size: 24px;
        top: 10px;
        right: 15px;
    }

    .akgallery-modal-caption {
        font-size: 14px;
        padding: 12px 18px;
        max-width: 90%;
    }

    /* Larger dots for better touch interaction */
    .akgallery-dot {
        width: 14px;
        height: 14px;
        margin: 0 6px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .akgallery-arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    /* Grid-only tiny image height */
    .akgallery--grid .akgallery-slide img {
        height: 140px;
    }

    .akgallery-wrapper {
        margin: 15px 0;
    }

    .akgallery-modal-prev,
    .akgallery-modal-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    /* Grid-only landscape image height */
    .akgallery--grid .akgallery-slide img {
        height: 120px;
    }

    .akgallery-modal-image {
        max-height: 60vh;
    }
}

/* Loading Animation */
.akgallery-loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ffb400;
    border-radius: 50%;
    animation: akgallery-spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes akgallery-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.akgallery-arrow:focus,
.akgallery-dot:focus,
.akgallery-modal-close:focus,
.akgallery-modal-prev:focus,
.akgallery-modal-next:focus {
    outline: 2px solid #ffb400;
    outline-offset: 2px;
}

/* Smooth transitions for all interactive elements */
* { box-sizing: border-box; }
.akgallery-wrapper * { box-sizing: border-box; }

/* ===========================
   SLIDER MODE (one per slide)
   =========================== */
.akgallery--slider .akgallery-container {
    /* width/height are set inline by PHP; keep responsive width */
    overflow: hidden;
}

.akgallery--slider .akgallery-slide,
.akgallery--slider .akgallery-slide-inner {
    height: 100%;
}

.akgallery--slider .akgallery-slide img.akgallery-img {
    width: 100%;
    height: 100%;
    object-fit: contain;   /* fit cleanly inside the box */
    image-rendering: auto; /* crisp resampling */
}
.akgallery-wrapper { position: relative; }
.akgallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  /* keep your existing size/style */
}
.akgallery-prev { left: 10px; }
.akgallery-next { right: 10px; }


/* Make sure wrapper is positioning context */
.akgallery-wrapper { position: relative; }

/* Arrows: fixed box, absolutely centered vertically, no size change on hover */
.akgallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);   /* don't scale on hover */
  width: 56px;                    /* pick your size */
  height: 56px;
  border-radius: 50%;
  border: 2px solid #e0e0e0;      /* keep same width on hover */
  background: rgba(255,255,255,0.95);
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;         /* border doesn't change overall size */
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  z-index: 5;
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

/* Left/right placement */
.akgallery-prev { left: 16px; }
.akgallery-next { right: 16px; }

/* Halo effect that doesn't change layout (no jump) */
.akgallery-arrow::after {
  content: "";
  position: absolute;
  inset: -6px;                    /* ring outside without changing size */
  border-radius: 50%;
  border: 3px solid transparent;
  pointer-events: none;
  transition: border-color .2s ease;
}

/* Hover: change colors + show halo; no transform scale */
.akgallery-arrow:hover {
  background: #ffb400;
  color: #fff;
  border-color: #ffb400;
  box-shadow: 0 4px 15px rgba(255,180,0,.3);
}

.akgallery-arrow:hover::after {
  border-color: #ffb400;          /* halo ring */
}

/* (Optional) smaller on phones but still no jump */
@media (max-width: 480px) {
  .akgallery-arrow {
    width: 48px;
    height: 48px;
  }
  .akgallery-prev { left: 10px; }
  .akgallery-next { right: 10px; }
}


/* --- Fix arrow hover jump (no size change on hover) --- */
.akgallery-wrapper { position: relative; }

.akgallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) !important;  /* lock position */
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #e0e0e0;               /* same in both states */
  background: rgba(255,255,255,0.95);
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  z-index: 5;

  /* kill any earlier hover scale rules */
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.akgallery-prev { left: 16px; }
.akgallery-next { right: 16px; }

/* Draw the hover halo WITHOUT changing element size */
.akgallery-arrow::after {
  content: "";
  position: absolute;
  inset: -6px;                 /* sits outside, no reflow */
  border-radius: 50%;
  border: 3px solid transparent;
  pointer-events: none;
  transition: border-color .2s ease;
}

/* Hover visual only; NO transform or border-width change */
.akgallery-arrow:hover {
  background: #ffb400;
  color: #fff;
  border-color: #ffb400;       /* same 2px width */
  box-shadow: 0 4px 15px rgba(255,180,0,.3);
}
.akgallery-arrow:hover::after {
  border-color: #ffb400;       /* the halo ring */
}

/* Optional: smaller on phones, still no jump */
@media (max-width: 480px) {
  .akgallery-arrow { width: 48px; height: 48px; }
  .akgallery-prev { left: 10px; }
  .akgallery-next { right: 10px; }
}



.akgallery-container { position: relative; }
.akgallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);   /* no scaling on hover */
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid #e0e0e0; background: rgba(255,255,255,.95);
  display:flex; align-items:center; justify-content:center;
  box-sizing:border-box; box-shadow:0 2px 8px rgba(0,0,0,.1); z-index:5;
}
.akgallery-prev { left: 16px; }
.akgallery-next { right: 16px; }

/* keep your "no-jump" hover from earlier (no scale) */
.akgallery-arrow::after { content:""; position:absolute; inset:-6px; border-radius:50%; border:3px solid transparent; pointer-events:none; transition:border-color .2s; }
.akgallery-arrow:hover { background:#ffb400; color:#fff; border-color:#ffb400; box-shadow:0 4px 15px rgba(255,180,0,.3); }
.akgallery-arrow:hover::after { border-color:#ffb400; }




