﻿/* گالری مکان — شبکه شبیه اینستاگرام */
.pg-page {
    background: var(--hmj-bg-page);
    min-height: 60vh;
}

.pg-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.pg-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--hmj-bg-card);
    border: 1px solid var(--hmj-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--hmj-text);
    text-decoration: none;
    flex-shrink: 0;
}

.pg-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.pg-subtitle {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: var(--hmj-text-muted);
}

.pg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
}

@media (min-width: 768px) {
    .pg-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
}

@media (min-width: 1200px) {
    .pg-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
        max-width: 960px;
        margin: 0 auto;
    }
}

.pg-grid__item {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--hmj-border);
    cursor: zoom-in;
}

.pg-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.pg-grid__item:hover img {
    transform: scale(1.04);
}

.pg-empty {
    text-align: center;
    padding: 48px 16px;
}

/* پیش‌نمایش ۳تایی در صفحه جزئیات — چیدمان شبیه Airbnb */
.place-gallery-preview {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    height: clamp(300px, 36vw, 440px);
    border-radius: 16px;
    overflow: hidden;
}

.place-gallery-preview__item {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--hmj-bg-highlight);
    text-decoration: none;
    min-height: 0;
    height: 100%;
}

.place-gallery-preview__item.is-main {
    grid-row: 1 / span 2;
    grid-column: 1;
}

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

.place-gallery-preview__item:hover img {
    transform: scale(1.03);
}

.place-gallery-preview__more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.52);
    color: var(--hmj-text-on-primary);
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    font-weight: 700;
    backdrop-filter: blur(3px);
}

.place-gallery-preview--single {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: clamp(280px, 32vw, 420px);
}

.place-gallery-preview--double {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    height: clamp(260px, 28vw, 380px);
}

@media (max-width: 575px) {
    .place-gallery-preview {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 200px 110px;
        height: auto;
        gap: 6px;
    }

    .place-gallery-preview__item.is-main {
        grid-row: 1;
        grid-column: 1 / span 2;
        height: 200px;
    }

    .place-gallery-preview__item:not(.is-main) {
        height: 110px;
    }
}

@media (min-width: 992px) and (max-width: 1399px) {
    .place-gallery-preview {
        height: 400px;
    }
}
