/* Gallery Section Styles */
.po-gallery-section {
    padding: 80px 0;
    background-color: #f8f9fa;
}

.po-section-title {
    text-align: center;
    margin-bottom: 50px;
}

.po-section-title h2 {
    font-size: 48px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.po-section-title p {
    font-size: 18px;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

/* Gallery Grid */
.po-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.po-gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: #fff;
}

.po-gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.po-gallery-item-img {
    width: 100%;
    height: 300px;
    overflow: hidden;
    position: relative;
}

.po-gallery-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.po-gallery-item:hover .po-gallery-item-img img {
    transform: scale(1.1);
}

.po-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.po-gallery-content {
    padding: 25px;
    background: #fff;
}

.po-gallery-content h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.po-gallery-content p {
    font-size: 15px;
    color: #666;
    margin-bottom: 15px;
}

.po-gallery-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.po-gallery-date {
    display: flex;
    align-items: center;
    color: #888;
    font-size: 14px;
}

.po-gallery-date i {
    margin-right: 8px;
    color: #dc3545;
}

.po-gallery-count {
    display: flex;
    align-items: center;
    color: #888;
    font-size: 14px;
}

.po-gallery-count i {
    margin-right: 8px;
    color: #dc3545;
}

/* Modal/Popup Styles */
/* Modal/Popup Styles */
.po-gallery-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0; /* shorthand for top/left/right/bottom 0 */
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    overflow-y: auto;  /* allows scrolling if image + thumbnails exceed viewport */
    animation: fadeIn 0.3s ease;
}

.po-gallery-modal.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.po-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    margin: 1px auto;
    padding: 20px;
    background: transparent;
    box-sizing: border-box;
}

.po-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.po-modal-title {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
}

.po-modal-close {
    border: none;
    color: #fff;
    font-size: 36px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.po-modal-close:hover {
    transform: rotate(90deg);
}

.po-modal-body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Center image and ensure it scales well */
.po-modal-image-container {
    position: relative;
    text-align: center;
    width: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.po-modal-image-container img {
    max-width: 100%;
    max-height: 80vh; /* slightly higher for better fit */
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

/* Navigation arrows */
.po-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(220, 53, 69, 0.8);
    border: none;
    color: #fff;
    font-size: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 20;
}
.po-modal-nav:hover {
    background: #dc3545;
    transform: translateY(-50%) scale(1.1);
}
.po-modal-prev { left: 20px; }
.po-modal-next { right: 20px; }

/* Counter — always visible */
.po-modal-counter {
    text-align: center;
    color: #fff;
    font-size: 18px;
    margin-top: 20px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.15);
    border-radius: 25px;
    display: inline-block;
    min-width: 120px;
    z-index: 30;
}

/* Thumbnails always visible under counter */
.po-modal-thumbnails {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding: 20px 10px 40px;
    margin-top: 15px;
    justify-content: center;
    width: 100%;
}

.po-modal-thumbnails::-webkit-scrollbar {
    height: 8px;
}
.po-modal-thumbnails::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
.po-modal-thumbnails::-webkit-scrollbar-thumb {
    background: #dc3545;
    border-radius: 10px;
}

.po-thumbnail-item {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}
.po-thumbnail-item:hover {
    border-color: #dc3545;
}
.po-thumbnail-item.active {
    border-color: #dc3545;
    transform: scale(1.1);
}
.po-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsiveness */
@media (max-width: 768px) {
    .po-modal-nav {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    .po-modal-close {
        width: 40px;
        height: 40px;
        font-size: 26px;
    }
    .po-modal-counter {
        font-size: 16px;
        margin-top: 15px;
    }
    .po-thumbnail-item {
        width: 60px;
        height: 60px;
    }
}
