/* ── Gallery Container ─────────────────────────────────────────── */
.hp-gallery-container {
    width: 100%;
    margin: 40px 0;
    font-family: 'DM Sans', sans-serif;
}

.hp-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 4), 1fr);
    gap: 24px;
    width: 100%;
    transition: opacity 0.2s ease;
}

.hp-gallery-grid.hp-grid-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Gallery Card ──────────────────────────────────────────────── */
.hp-gallery-card {
    position: relative;
    border-radius: 16px;
    cursor: pointer;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.35s cubic-bezier(.22,.68,0,1.2), box-shadow 0.35s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hp-gallery-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.14);
}

.hp-gallery-card:focus {
    outline: 3px solid #e85d26;
    outline-offset: 3px;
}

/* ── Image Wrapper (card) ──────────────────────────────────────── */
.hp-gallery-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 68%;
    overflow: hidden;
    background: #f0ece6;
    border-radius: 16px 16px 0 0;
}

.hp-gallery-image-wrapper img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(.25,.46,.45,.94);
}

.hp-gallery-card:hover .hp-gallery-image-wrapper img {
    transform: scale(1.06);
}

/* ── Image Count Badge ─────────────────────────────────────────── */
.hp-gallery-image-count {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(10,10,10,0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hp-gallery-image-count .dashicons {
    width: 13px; height: 13px; font-size: 13px;
    opacity: 0.85;
}

/* ── Card Body ─────────────────────────────────────────────────── */
.hp-gallery-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.hp-gallery-card-body h3 {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: #1a1612;
    line-height: 1.3;
}

.hp-gallery-card-body p {
    margin: 0;
    font-size: 12px;
    color: #6b6460;
    line-height: 1.5;
}

.hp-gallery-card-footer {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.hp-gallery-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #e85d26;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: gap 0.2s ease;
}

.hp-gallery-card:hover .hp-gallery-card-cta { gap: 8px; }

.hp-gallery-card-cta svg {
    width: 13px; height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.hp-no-gallery {
    text-align: center;
    padding: 60px 20px;
    color: #a09890;
    font-size: 15px;
}

/* ══════════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════════ */

.hp-gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}

/* Prev / Next arrow buttons */
.hp-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1.5px solid #e0dbd6;
    background: #fff;
    color: #1a1612;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.hp-page-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.hp-page-btn:hover:not(:disabled) {
    background: #f5f0eb;
    border-color: #c8c0b8;
    transform: scale(1.05);
}

.hp-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Page numbers wrapper */
.hp-page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Individual page number buttons */
.hp-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 6px;
    border-radius: 10px;
    border: 1.5px solid #e0dbd6;
    background: #fff;
    color: #3a3330;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

.hp-page-num:hover:not(.active) {
    background: #f5f0eb;
    border-color: #c8c0b8;
    color: #1a1612;
    transform: scale(1.05);
}

.hp-page-num.active {
    background: #e85d26;
    border-color: #e85d26;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(232, 93, 38, 0.35);
    cursor: default;
    transform: scale(1.05);
}

/* Ellipsis */
.hp-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 38px;
    color: #a09890;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    letter-spacing: 0.05em;
    user-select: none;
}

/* ══════════════════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════════════════ */

.hp-lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
}

.hp-lightbox-modal.active {
    display: flex;
}


.admin-bar .hp-lightbox-modal {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .hp-lightbox-modal {
        top: 46px;
    }
}

.hp-lightbox-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    animation: bdFadeIn 0.25s ease forwards;
}

.admin-bar .hp-lightbox-backdrop {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .hp-lightbox-backdrop {
        top: 46px;
    }
}

@keyframes bdFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.hp-lightbox-container {
    position: relative;
    z-index: 100000;
    width: 100%;
    max-width: 820px;
    height: 82vh;
    max-height: 680px;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
    animation: modalIn 0.35s cubic-bezier(.22,.68,0,1.1) forwards;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hp-lightbox-close {
    position: absolute;
    top: 5px;
    right: 60px;
    z-index: 100002;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.25);
    width: 36px;
    height: 36px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.hp-lightbox-close:hover {
    background: rgba(0,0,0,0.85);
    transform: rotate(90deg) scale(1.1);
}

.hp-lightbox-image-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hp-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.hp-lightbox-image-counter {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    font-family: 'DM Sans', sans-serif;
}

.hp-lightbox-info {
    flex-shrink: 0;
    height: 90px;
    background: #111;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border-top: 1px solid #1e1e1e;
    overflow: hidden;
}

.hp-lightbox-info-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #e85d26;
    font-family: 'DM Sans', sans-serif;
    line-height: 1;
}

.hp-lightbox-title {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-lightbox-description {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #888;
    font-family: 'DM Sans', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-lightbox-thumbnails {
    flex-shrink: 0;
    background: #0d0d0d;
    border-top: 1px solid #1a1a1a;
    padding: 10px 16px;
    height: 88px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.hp-thumbnails-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.hp-thumbnails-scroll::-webkit-scrollbar { height: 3px; }
.hp-thumbnails-scroll::-webkit-scrollbar-track { background: transparent; }
.hp-thumbnails-scroll::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.hp-lightbox-thumbnail {
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, opacity 0.2s;
    opacity: 0.45;
}

.hp-lightbox-thumbnail img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

.hp-lightbox-thumbnail:hover { border-color: #e85d26; opacity: 1; }
.hp-lightbox-thumbnail.active { border-color: #e85d26; opacity: 1; }

.hp-lightbox-nav {
    position: absolute;
    bottom: calc(90px + 88px + 50%);
    transform: translateY(50%);
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.22);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    transition: background 0.2s;
}

.hp-lightbox-nav:hover { background: rgba(255,255,255,0.25); }

.hp-lightbox-prev { left: 14px; }
.hp-lightbox-next { right: 14px; }

.hp-lightbox-nav .dashicons {
    width: 20px; height: 20px; font-size: 20px;
}

/* ══ Responsive ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .hp-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .hp-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }

    .hp-lightbox-modal { padding: 0; }

    .hp-lightbox-container {
        max-width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .hp-lightbox-info { height: 80px; }
    .hp-lightbox-thumbnails { display: none; }

    .hp-lightbox-nav {
        bottom: calc(80px + 50%);
    }

    .hp-lightbox-prev { left: 8px; }
    .hp-lightbox-next { right: 8px; }

    .hp-page-btn,
    .hp-page-num {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 12px;
    }

    .hp-gallery-pagination { gap: 4px; margin-top: 28px; }
}

@media (max-width: 480px) {
    .hp-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .hp-lightbox-title { font-size: 15px; }
    .hp-lightbox-description { font-size: 11px; }
    .hp-lightbox-nav { width: 36px; height: 36px; }
    .hp-gallery-card-body h3 { font-size: 14px; }
    .hp-gallery-card-body p  { font-size: 11px; }
}