.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-block: 1.5rem;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 320px;
    padding: 0;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.gallery-item:hover {
    box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.14), 0 3px 8px -1px rgba(0, 0, 0, 0.08);
}

.gallery-image {
    width: 100%;
    min-height: 180px;
    max-height: 220px;
    object-fit: cover;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background: #e5e7eb;
    display: block;
}

.gallery-video-thumb {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.play-video-btn {
    margin-top: 1rem;
    padding: 0.35rem 1rem;
    font-size: 0.95em;
    background: #166534;
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.play-video-btn:hover {
    background: #115027;
}

.video-placeholder {
    width: 100%;
    height: 200px;
    background: #f3f3f3;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    color: #999;
}

.gallery-info {
    width: 100%;
    padding: 1rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.98em;
}

.gallery-info h3 {
    font-size: 1.15em;
    font-weight: bold;
    color: #166534;
    margin: 0 0 0.2em 0;
}

.gallery-desc {
    color: #444;
    font-size: 0.97em;
    margin-bottom: 0.1em;
}

.gallery-category,
.gallery-type,
.gallery-date {
    font-size: 0.86em;
    color: #666;
    margin-right: 8px;
    margin-top: 0.1em;
    display: inline-block;
}

.gallery-category {
    font-weight: 600;
    color: #256d3d;
}

.gallery-type {
    font-style: italic;
}

.gallery-date {
    color: #aaa;
}

@media (max-width: 700px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

.filter-bar {
    background: #166534;
    color: #fff;
    padding: 0.8rem;
    border-radius: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    font-size: 1em;
    font-weight: 600;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.filter-bar label {
    margin-right: 0.4em;
}

.filter-bar select,
.filter-bar input[type="date"] {
    border: 1px solid #cbd5e1;
    border-radius: 0.3em;
    font-size: 1em;
    padding: 0.25em 0.7em;
    margin-right: 0.3em;
}

.filter-bar .btn-primary {
    margin-left: 0.7em;
    padding: 0.4em 1.1em;
    border: none;
    background: #fff;
    color: #166534;
    border-radius: 999px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.filter-bar .btn-primary:hover {
    background: #115027;
    color: #fff;
}

.loading-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 2.5rem 0.2rem;
    color: #999;
}

.skeleton-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem;
    border-bottom: 1px solid #e2e8f0;
}

.skeleton-circle {
    width: 55px;
    height: 55px;
    background: #e2e8f0;
    border-radius: 50%;
}

.skeleton-text {
    flex-grow: 1;
}

.skeleton-line {
    height: 13px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 0.6rem;
}

.skeleton-line.full-width {
    width: 100%;
}

.skeleton-line.three-quarter-width {
    width: 75%;
}

.skeleton-line.half-width {
    width: 50%;
}

.skeleton-line.medium-height {
    height: 2.1rem;
}

.shimmer {
    background-image: linear-gradient(90deg, #f0f0f0 0%, #e2e2e2 20%, #f0f0f0 40%, #f0f0f0 100%);
    background-size: 1000px 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.pagination {
    margin-top: 1.3rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.pagination button,
.pagination a {
    background: #fff;
    color: #166534;
    padding: 0.4em 1em;
    border-radius: 0.375em;
    border: 1px solid #166534;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.97em;
}

.pagination button:hover,
.pagination a:hover {
    background: #166534;
    color: #fff;
}

.pagination .active {
    background: #166534;
    color: #fff;
    border-color: #166534;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    background: #e2e8f0;
    border-radius: 10px 10px 0 0;
}

/* Modal Styles */
.gallery-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 18, 20, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.gallery-modal-content {
    background: #fff;
    border-radius: 0.7em;
    max-width: 700px;
    width: 90vw;
    max-height: 90vh;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
    position: relative;
    overflow: auto;
    padding: 2em 1.5em 1.2em 1.5em;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2.2em;
    color: #333;
    cursor: pointer;
    font-weight: bold;
    z-index: 1;
    transition: color 0.2s;
}

.gallery-modal-close:hover {
    color: #166534;
}

.gallery-modal-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 0.5em;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.19);
}

.gallery-modal video,
.gallery-modal iframe {
    width: 100%;
    max-height: 70vh;
    border-radius: 0.5em;
    background: #222;
}

@media (max-width: 700px) {
    .gallery-modal-content {
        max-width: 98vw;
        padding: 1em 0.5em;
    }
}

.gallery-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 18, 20, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.gallery-modal-content {
    background: #fff;
    border-radius: 0.2em;
    max-width: 98vw;
    max-height: 98vh;
    width: 98vw;
    height: 98vh;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
    position: relative;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

.gallery-modal-close {
    position: absolute;
    top: 24px;
    right: 44px;
    font-size: 2.6em;
    color: #333;
    cursor: pointer;
    font-weight: bold;
    z-index: 2;
    transition: color 0.2s;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    padding: 0.15em 0.38em;
}

.gallery-modal-close:hover {
    color: #166534;
    background: rgba(255, 255, 255, 1);
}

.gallery-modal-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.2em;
    background: #222;
}

.gallery-modal-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal iframe,
.gallery-modal video {
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    border-radius: 0.2em;
    background: #222;
    display: block;
}

@media (max-width: 900px) {
    .gallery-modal-content {
        max-width: 100vw;
        max-height: 100vh;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .gallery-modal-close {
        top: 12px;
        right: 22px;
        font-size: 2.2em;
    }
}

.video-embed-wrap {
    width: 100%;
    height: 100%;
    position: relative;
    background: #222;
}

.video-embed-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0.2em;
}