/* Gallery Page + Gallery Album styles extracted from style.css and gallery.php */

:root {
    --site-page-gutter: 10vw;
    --site-page-width: 80vw;
}

            #gallery-card-grid-container {
                position: relative;
                padding: 0;
                width: var(--site-page-width);
                margin-right: var(--site-page-gutter);
                margin-left: var(--site-page-gutter);
                box-sizing: border-box;
            }
            
            #gallery-intro-container {
                position: relative;
                width: 80%;
                height: fit-content;
                border-radius: 20px;
                padding: 20px 50px;
                display: flex;
                flex-direction: column;
                align-items: center;
                text-align: center;
                justify-content: center;
                background-color: white;
                box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.3);
            }
            
            #gallery-intro-container h2 {
                font-size: 2rem;
                color: #2c5282;
                margin-bottom: 1rem;
            }
            
            #gallery-intro-container p {
                font-size: 1.1rem;
                color: #555;
            }
            
            .gallery-grid {
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
                gap: 30px;
                margin-top: 10px;
            }
            
            .gallery-card {
                background: white;
                border-radius: 12px;
                overflow: hidden;
                transition: transform 0.3s ease, box-shadow 0.3s ease;
                box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            }
            
            .gallery-card:hover {
                transform: translateY(-10px);
                box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
            }
            
            .gallery-card-image {
                height: 200px;
                overflow: hidden;
            }
            
            .gallery-card-image img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                transition: transform 0.5s ease;
            }
            
            .gallery-card:hover .card-image img {
                transform: scale(1.05);
            }
            
            .gallery-card-content {
                padding: 20px;
            }
            
            .gallery-card-content h3 {
                font-size: 1.2rem;
                color: #2c5282;
                margin-bottom: 10px;
                height: 50px;
                display: flex;
                align-items: center;
                justify-content: center;
                text-align: center;
            }
            
            .gallery-card-content p {
                color: #666;
                margin-bottom: 15px;
                font-size: 0.9rem;
                height: 65px;
                display: flex;
                align-items: center;
                justify-content: center;
                text-align: center;
            }
            
            .gallery-card-content .date {
                display: inline-block;
                background: #e6f7ff;
                color: #1890ff;
                padding: 5px 10px;
                border-radius: 5px;
                font-size: 0.85rem;
                font-weight: 500;
                font-family: Arial, sans-serif;
                margin-right: 20px;
            }
            
            .view-gallery-album {
                display: inline-flex;
                align-items: center;
                color: #2c5282;
                font-weight: 600;
                font-size: 1rem;
                font-family: Arial, sans-serif;
                text-decoration: none;
                margin-top: 10px;
                transition: color 0.2s ease;
                cursor: pointer;
            }
            
            .view-gallery-album i {
                margin-left: 5px;
                transition: transform 0.2s ease;
            }
            
            .gallery-card:hover .view-gallery-album {
                color: #1a3a5f;
            }
            
            .gallery-card:hover .view-gallery-album i {
                transform: translateX(5px);
            }
            
            @media (max-width: 768px) {
                .gallery-grid {
                    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
                    gap: 20px;
                }
            }
            
            @media (max-width: 480px) {
                .gallery-grid {
                    grid-template-columns: 1fr;
                }
            }

/******************** PHOTO ALBUM [PAGE] ********************/
#gallery-main-content-container {
    position: relative;
    width: var(--site-page-width);
    padding: 0;
    margin-right: var(--site-page-gutter);
    margin-left: var(--site-page-gutter);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.gallery-photo {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    aspect-ratio: 1;
}

.gallery-photo:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.gallery-photo.landscape {
    aspect-ratio: 16/9;
}

.gallery-photo.portrait {
    aspect-ratio: 9/16;
}

.gallery-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-photo:hover img {
    transform: scale(1.05);
}

.gallery-photo-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 20px 15px 15px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: 'Comfortaa';
    font-size: 0.9rem;
}

.gallery-photo:hover .gallery-photo-name {
    opacity: 1;
    transform: translateY(0);
}

.portal-gallery-lightbox-trigger {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    cursor: zoom-in;
    overflow: hidden;
    text-align: left;
}

.portal-gallery-lightbox-trigger img {
    transition: transform 0.35s ease, filter 0.35s ease;
}

.portal-gallery-lightbox-trigger span {
    position: absolute;
    right: 0.85rem;
    bottom: 0.85rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.portal-gallery-lightbox-trigger:hover img,
.portal-gallery-lightbox-trigger:focus-visible img {
    filter: brightness(0.78);
    transform: scale(1.04);
}

.portal-gallery-lightbox-trigger:hover span,
.portal-gallery-lightbox-trigger:focus-visible span {
    opacity: 1;
    transform: translateY(0);
}

.portal-gallery-lightbox-trigger:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 4px;
}

.portal-gallery-lightbox-open {
    overflow: hidden;
}

.portal-gallery-lightbox {
    z-index: 5000;
}

.portal-gallery-lightbox-content {
    width: min(1120px, 94vw);
    max-width: 1120px;
    max-height: 92vh;
}

.portal-gallery-lightbox .gallery-modal-img {
    max-height: 78vh;
    object-fit: contain;
    background: rgba(15, 23, 42, 0.85);
}

.portal-gallery-lightbox .gallery-modal-caption {
    justify-content: center;
    width: 100%;
    color: #f8fafc;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.gallery-close-btn.portal-gallery-lightbox-close {
    top: -18px;
    right: -18px;
    background: #fff;
    color: #0f172a;
    font-size: 1.5rem;
    line-height: 1;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.gallery-close-btn.portal-gallery-lightbox-close:hover,
.gallery-close-btn.portal-gallery-lightbox-close:focus-visible {
    background: #e2e8f0;
}

.portal-gallery-lightbox-controls {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    margin-bottom: 0;
    pointer-events: none;
}

.portal-gallery-lightbox-controls .gallery-prev,
.portal-gallery-lightbox-controls .gallery-next {
    pointer-events: auto;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    line-height: 1;
}

.portal-gallery-admin-menu {
    position: absolute;
    top: -18px;
    left: -18px;
    z-index: 3;
}

.portal-gallery-more-button {
    min-width: 78px;
    min-height: 42px;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
    cursor: pointer;
}

.portal-gallery-more-button:hover,
.portal-gallery-more-button:focus-visible {
    background: #e2e8f0;
}

.portal-gallery-admin-actions {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    width: min(320px, 86vw);
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
}

.portal-gallery-admin-actions[hidden] {
    display: none;
}

.portal-gallery-admin-action-form {
    display: grid;
    gap: 0.65rem;
    margin: 0;
}

.portal-gallery-admin-action-form label {
    display: grid;
    gap: 0.45rem;
    color: #0f172a;
    font-weight: 800;
}

.portal-gallery-admin-action-form input[type="text"] {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    color: #0f172a;
    font: inherit;
}

.portal-gallery-delete-button {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.24);
}

/* Modal Styles */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    padding: 20px;
}

.gallery-modal.open {
    opacity: 1;
    pointer-events: all;
}

.gallery-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-modal-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.gallery-modal-caption {
    color: white;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    margin-top: 20px;
    text-align: center;
    max-width: 600px;
    font-family: 'Comfortaa';
}

.gallery-close-btn {
    position: absolute;
    top: -20px;
    right: -20px;
    background: #e74c3c;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s ease;
    border: none;
    padding: 7.5px;
}

.gallery-close-btn:hover {
    background: #c0392b;
}

/* thumbnails */
.modal-button-container {
    position: absolute;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    z-index: 2000;
    margin-bottom: -25px;
    bottom: 0;
    align-self: end;
}

.gallery-prev, .gallery-next {
    position: relative;
    font-size: 2rem;
    color: white;
    background: rgba(0,0,0,0.5);
    border-radius: 5px;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.gallery-prev {left: 20px;}
.gallery-next {right: 20px;}

.breadcrumbs-current-page-text-long {
  display: block;
}

.breadcrumbs-current-page-text-short {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .gallery-modal-caption {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .gallery-photo.landscape, .gallery-photo.portrait {
        aspect-ratio: 1;
    }

  #gallery-main-content-container {
      position: relative;
      width: 100%;
      padding: 0 7.5%;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
      gap: 20px;
  }

  #main-breadcrumbs-container {
    font-size: 0.75rem;
    padding: 10px 25px;
    column-gap: 0;
    width: max-content;
    left: 50%;
    transform: translateX(-50%);
    justify-content: space-between;
    width: 80%;
    margin: 0;
  }

  .breadcrumbs-current-page-text-long,
  .breadcrumbs-home-page-text {
    display: none;
  }

  .breadcrumbs-current-page-text-short {
    display: block;
  }
}
