/*
  Photo Gallery Custom CSS
  Based on Tailwind layout provided by user
*/

.dmh-pgal {
    --pgal-primary: #f20d0d;
    --pgal-primary-hover: #cc0b0b;
    --pgal-text-main: #181111;
    --pgal-text-muted: #8a6060;
    --pgal-border: #e5e7eb;
    --pgal-bg-white: #ffffff;
    --pgal-card-bg: #f3f4f6;

    width: 100%;
    margin: 2rem 0;
    font-family: 'Inter', 'Noto Sans', sans-serif;
}

/* Dark mode support (if body has .dark or woodmart dark theme) */
.dark .dmh-pgal,
.woodmart-dark .dmh-pgal {
    --pgal-text-main: #f3f4f6;
    --pgal-text-muted: #9ca3af;
    --pgal-border: #374151;
    --pgal-bg-white: #1f2937;
    --pgal-card-bg: #111827;
}

.dmh-pgal__container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header Area */
.dmh-pgal__head {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-bottom: 1px solid var(--pgal-border);
    padding-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .dmh-pgal__head {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

.dmh-pgal__head-titles {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dmh-pgal__title {
    color: var(--pgal-text-main);
    font-size: 1.875rem; /* 3xl */
    line-height: 1.1;
    font-weight: 900;
    margin: 0;
    letter-spacing: -0.025em;
    font-family: 'Noto Sans Armenian', 'Inter', 'Noto Sans', sans-serif !important;
    text-transform: none !important;
}

@media (min-width: 768px) {
    .dmh-pgal__title {
        font-size: 2.25rem; /* 4xl */
    }
}

.dmh-pgal__subtitle {
    color: var(--pgal-text-muted);
    font-size: 1rem;
    margin: 0;
}

@media (min-width: 768px) {
    .dmh-pgal__subtitle {
        font-size: 1.125rem;
    }
}

/* Filters */
.dmh-pgal__filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

@media (min-width: 768px) {
    .dmh-pgal__filters {
        justify-content: flex-end;
    }
}

.dmh-pgal__filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background-color: var(--pgal-bg-white);
    color: var(--pgal-text-main);
    border: 1px solid var(--pgal-border);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    font-family: 'Noto Sans Armenian', 'Inter', 'Noto Sans', sans-serif !important;
    text-transform: none !important;
}

.dmh-pgal__filter-btn .material-symbols-outlined {
    font-size: 18px;
    display: none; /* hidden unless active */
}

.dmh-pgal__filter-btn:hover {
    border-color: var(--pgal-primary);
    color: var(--pgal-primary);
}

.dmh-pgal__filter-btn:active {
    transform: scale(0.95);
}

.dmh-pgal__filter-btn.is-active {
    background-color: var(--pgal-primary);
    color: #fff;
    border-color: var(--pgal-primary);
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(242, 13, 13, 0.2), 0 2px 4px -1px rgba(242, 13, 13, 0.1);
}

.dmh-pgal__filter-btn.is-active .material-symbols-outlined {
    display: block; /* show checkmark */
}

/* Grid */
.dmh-pgal__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .dmh-pgal__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .dmh-pgal__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Card */
.dmh-pgal__card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dmh-pgal__card.is-hidden {
    display: none;
}

/* Card Image Wrapper */
.dmh-pgal__card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 0.75rem;
    background-color: var(--pgal-card-bg);
}

.dmh-pgal__card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.dmh-pgal__card-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.3s ease, opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.dmh-pgal__card-overlay .material-symbols-outlined {
    color: #fff;
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 3px rgba(0,0,0,0.3));
}

.dmh-pgal__card:hover .dmh-pgal__card-bg {
    transform: scale(1.1);
}

.dmh-pgal__card:hover .dmh-pgal__card-overlay {
    background-color: rgba(0, 0, 0, 0.2);
    opacity: 1;
}

/* Card Info */
.dmh-pgal__card-info {
    display: flex;
    flex-direction: column;
    padding: 0 0.25rem;
}

.dmh-pgal__card-title {
    color: var(--pgal-text-main);
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    transition: color 0.2s ease;
}

.dmh-pgal__card-subtitle {
    color: var(--pgal-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.dmh-pgal__card:hover .dmh-pgal__card-title {
    color: var(--pgal-primary);
}

/* Lightbox */
.dmh-pgal__lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.dmh-pgal__lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

.dmh-pgal__lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
}

.dmh-pgal__lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.dmh-pgal__lightbox-close::before,
.dmh-pgal__lightbox-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: #fff;
}
.dmh-pgal__lightbox-close::before { transform: rotate(45deg); }
.dmh-pgal__lightbox-close::after { transform: rotate(-45deg); }

.dmh-pgal__lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.dmh-pgal__lightbox-nav {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.dmh-pgal__lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}

.dmh-pgal__lightbox-nav .material-symbols-outlined {
    font-size: 32px;
}

.dmh-pgal__lightbox-img-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dmh-pgal__lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.dmh-pgal__lightbox-caption {
    margin-top: 1rem;
    text-align: center;
    color: #fff;
}

.dmh-pgal__lightbox-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.dmh-pgal__lightbox-subtitle {
    font-size: 0.875rem;
    color: #ccc;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .dmh-pgal__lightbox-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0,0,0,0.5);
    }
    .dmh-pgal__lightbox-prev {
        left: 0;
    }
    .dmh-pgal__lightbox-next {
        right: 0;
    }
    .dmh-pgal__lightbox-img {
        max-width: 100%;
    }
}
