/* ============================================================
   PHOTO GALLERY — gallery.css
   ============================================================ */

/* ── Hero search header ─────────────────────────────────────── */
.pg-hero {
    background: #f0f0f0;
    padding: 28px 24px 22px;
    text-align: center;
    margin-bottom: 24px;
}
.pg-hero h1 {
    color: #222;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}
.pg-hero p {
    color: #666;
    font-size: 14px;
    line-height: 1.75;
    max-width: 600px;
    margin: 0 auto 20px;
}

/* ── In-page language selector ──────────────────────────────── */
.pg-lang {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 22px;
}
.pg-lang a {
    display: inline-block;
    padding: 4px 13px;
    border: 1px solid #444;
    border-radius: 3px;
    color: #888;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    transition: all 0.15s;
}
.pg-lang a:hover {
    border-color: #aaa;
    color: #ddd;
}
.pg-lang a.pg-lang--active {
    background: #fff;
    color: #111;
    border-color: #fff;
}

/* ── Search bar ─────────────────────────────────────────────── */
.pg-search-wrap {
    max-width: 520px;
    margin: 0 auto;
    position: relative;
}
.pg-search {
    display: flex;
    border-radius: 4px;
    overflow: visible;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.pg-search input {
    flex: 1;
    padding: 13px 18px;
    border: none;
    outline: none;
    font-size: 15px;
    color: #222;
    background: #fff;
    border-radius: 4px 0 0 4px;
    min-width: 0;
}
.pg-search-btn {
    padding: 13px 24px;
    background: #e8b84b;
    color: #111;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    transition: background 0.15s;
    border-radius: 0 4px 4px 0;
    white-space: nowrap;
    flex-shrink: 0;
}
.pg-search-btn:hover {
    background: #d4a63a;
}

/* ── Autocomplete dropdown ──────────────────────────────────── */
.pg-autocomplete {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 200;
    display: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.pg-autocomplete.open {
    display: block;
}
.pg-ac-item {
    padding: 9px 18px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
    transition: background 0.1s;
}
.pg-ac-item:hover,
.pg-ac-item.highlighted {
    background: #f5f0e4;
    color: #111;
}

/* ── Status bar ─────────────────────────────────────────────── */
.pg-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 13px;
    color: #888;
}
.pg-status strong {
    color: #222;
    font-size: 15px;
}
.pg-clear {
    display: inline-block;
    padding: 3px 11px;
    background: #ebebeb;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    font-family: inherit;
    transition: background 0.15s;
}
.pg-clear:hover {
    background: #d8d8d8;
    color: #111;
}

/* ── No results ─────────────────────────────────────────────── */
.pg-no-results {
    text-align: center;
    padding: 70px 20px;
    color: #bbb;
    font-size: 16px;
}

/* ── Gallery grid (CSS columns masonry) ─────────────────────── */
.pg-grid {
    column-count: 4;
    column-gap: 6px;
    margin-top: 4px;
}

/* ── Gallery item ───────────────────────────────────────────── */
.pg-item {
    break-inside: avoid;
    margin: 0 0 6px 0;
    overflow: hidden;
    background: #ddd;
    display: block;
    position: relative;
    cursor: pointer;
}
.pg-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    position: relative;
}
.pg-item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;
}
.pg-item:hover img {
    transform: scale(1.06);
}
.pg-item figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.78));
    color: #fff;
    padding: 28px 10px 9px;
    font-size: 11px;
    line-height: 1.4;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    pointer-events: none;
}
.pg-item:hover figcaption {
    transform: translateY(0);
}

/* ── Lazy-load fade-in ──────────────────────────────────────── */
.pg-img {
    opacity: 0;
    transition: opacity 0.45s ease;
}
.pg-img.pg-img--loaded {
    opacity: 1;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .pg-grid { column-count: 3; }
}
@media (max-width: 720px) {
    .pg-grid { column-count: 2; }
    .pg-hero { padding: 32px 16px 28px; }
    .pg-hero h1 { font-size: 22px; }
    .pg-search-wrap { max-width: 100%; }
}
@media (max-width: 420px) {
    .pg-grid { column-count: 1; }
}
