/* =====================================================================
   GALLERY PAGE
   New, additive stylesheet — does not modify style.css / added-sections.css.
   Reuses existing design tokens from style.css :root (brand colors,
   radii, shadows, transitions) so it matches the rest of the site exactly.
   ===================================================================== */

.gallery-section {
    padding: 90px 0 100px;
    background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-white) 360px);
}

/* ---------------------------------------------------------------------
   CATEGORY FILTERS
--------------------------------------------------------------------- */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 40px;
    max-width: 900px;
}

.gallery-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 22px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted);
    background: var(--bg-white);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.gallery-filter-btn:hover {
    border-color: var(--border-gold);
    color: var(--brand-primary-dark);
    background: var(--bg-gold-light);
}

.gallery-filter-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--text-white);
    box-shadow: var(--shadow-button);
}

/* ---------------------------------------------------------------------
   GRID — self-contained card layout for the full gallery page.
   Distinct from the homepage's hover-reveal `.am-gallery-item` teaser:
   here every card always shows its image, title and description, so
   the page reads as a proper photo catalogue, not a flat thumbnail wall.
--------------------------------------------------------------------- */
.gallery-grid-page {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px 24px;
    align-items: start;
}

.gallery-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(17, 17, 17, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-gold);
    box-shadow: 0 20px 40px rgba(17, 17, 17, 0.12);
}

.gallery-card-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-light);
    cursor: pointer;
}

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

.gallery-card:hover .gallery-card-media img {
    transform: scale(1.08);
}

.gallery-card-body {
    padding: 18px 20px 22px;
    border-top: 1px solid var(--border-light);
}

.gallery-card-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
}

.gallery-card-caption {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-item-tag {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 1;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.55);
    backdrop-filter: blur(3px);
    color: var(--text-white);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.gallery-zoom-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-round);
    background: rgba(255, 255, 255, 0.92);
    color: var(--brand-primary-dark);
    font-size: 16px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.gallery-card:hover .gallery-zoom-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ---------------------------------------------------------------------
   PAGINATION — restyles Laravel's stock "pagination::bootstrap-5" view
   (already used in the admin panel) to match the gold brand accent.
--------------------------------------------------------------------- */
.am-pagination-wrap {
    display: flex;
    justify-content: center;
    margin-top: 54px;
}

.am-pagination-wrap .pagination {
    gap: 6px;
    flex-wrap: wrap;
}

.am-pagination-wrap .page-link {
    min-width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition-fast);
}

.am-pagination-wrap .page-link:hover {
    border-color: var(--border-gold);
    background: var(--bg-gold-light);
    color: var(--brand-primary-dark);
}

.am-pagination-wrap .page-item.active .page-link {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--text-white);
}

.am-pagination-wrap .page-item.disabled .page-link {
    color: #C6C6C2;
    background: var(--bg-white);
}

.am-pagination-wrap .page-link:focus {
    box-shadow: 0 0 0 3px rgba(176, 141, 60, 0.15);
}

/* ---------------------------------------------------------------------
   EMPTY STATE
--------------------------------------------------------------------- */
.gallery-empty-state {
    max-width: 460px;
    margin: 30px auto 0;
    padding: 60px 30px;
    text-align: center;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-light);
}

.gallery-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-round);
    background: var(--bg-gold-light);
    color: var(--brand-primary);
    font-size: 28px;
}

.gallery-empty-state h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.gallery-empty-state p {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 22px;
}

/* ---------------------------------------------------------------------
   LIGHTBOX
--------------------------------------------------------------------- */
body.am-lightbox-locked {
    overflow: hidden;
}

.am-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.am-lightbox.is-open {
    visibility: visible;
    opacity: 1;
}

.am-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.92);
}

.am-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.am-lightbox-figure {
    margin: 0;
    width: 100%;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.am-lightbox-figure img {
    max-width: 100%;
    max-height: 68vh;
    width: auto;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.96);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.am-lightbox.is-open .am-lightbox-figure img {
    transform: scale(1);
    opacity: 1;
}

.am-lightbox-figure figcaption {
    margin-top: 18px;
    max-width: 620px;
    text-align: center;
}

.am-lightbox-figure figcaption h3 {
    color: var(--text-white);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
}

.am-lightbox-figure figcaption p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.6;
}

.am-lightbox-counter {
    position: absolute;
    top: -46px;
    left: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.am-lightbox-btn {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-round);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-fast);
}

.am-lightbox-btn:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

.am-lightbox-close {
    top: -46px;
    right: 0;
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.am-lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    font-size: 18px;
}

.am-lightbox-prev { left: -70px; }
.am-lightbox-next { right: -70px; }

/* ---------------------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------------------- */
@media screen and (max-width: 1199px) {
    .gallery-grid-page { grid-template-columns: repeat(3, 1fr); }
    .am-lightbox-prev { left: 10px; }
    .am-lightbox-next { right: 10px; }
    .am-lightbox-dialog { margin: 0 60px; }
}

@media screen and (max-width: 767px) {
    .gallery-section { padding: 60px 0 70px; }
    .gallery-grid-page { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
    .gallery-card-body { padding: 15px 16px 18px; }
    .gallery-card-title { font-size: 14.5px; }
    .gallery-card-caption { font-size: 13px; }
    .gallery-filters { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; margin-bottom: 30px; }
    .am-lightbox-figure img { max-height: 56vh; }
    .am-lightbox-close { top: -44px; right: 6px; }
    .am-lightbox-counter { top: -44px; left: 6px; }
}

@media screen and (max-width: 480px) {
    .gallery-grid-page { grid-template-columns: 1fr; gap: 18px; }
}