/* =========================================================
   LUX EMPIRE — view_house.php: top bar, gallery, video stage
   Theme-safe: only theme variables. Loaded after bookings.css.
   ========================================================= */

/* ---------- Top bar with visible back button ---------- */

.vh-topbar{
    margin-bottom:18px;
}

.vh-back-btn{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:12px 22px;
    border-radius:14px;
    background:var(--glass);
    border:1px solid var(--gold);
    color:var(--gold);
    font-weight:700;
    font-size:0.95rem;
    text-decoration:none;
    box-shadow:var(--shadow-gold);
    transition:0.25s ease;
}

.vh-back-btn:hover{
    background:linear-gradient(135deg, var(--gold), var(--gold-secondary));
    color:var(--black);
    transform:translateY(-2px);
}

/* ---------- Media wrapper ---------- */

.house-hero-media{
    padding:16px 16px 0;
}

/* ---------- Gallery mosaic ---------- */

.vh-gallery-frame{
    height:auto;
}

.vh-gallery-frame .media-enlarge-btn{
    display:none;
}

.vh-gallery{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    grid-auto-rows:190px;
    grid-auto-flow:dense;
    gap:10px;
}

.vh-gallery-tile{
    position:relative;
    padding:0;
    border:none;
    border-radius:16px;
    overflow:hidden;
    cursor:zoom-in;
    background:var(--glass);
    display:block;
}

.vh-gallery-tile img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    transition:transform 0.5s ease;
}

.vh-gallery-tile:hover img{
    transform:scale(1.06);
}

.vh-gallery-tile::after{
    content:'';
    position:absolute;
    inset:0;
    background:linear-gradient(to top, rgba(0,0,0,0.25), transparent 45%);
    opacity:0;
    transition:opacity 0.3s ease;
    pointer-events:none;
}

.vh-gallery-tile:hover::after{
    opacity:1;
}

/* First photo is the large feature tile. */
.vh-gallery-tile:nth-child(1){
    grid-column:span 2;
    grid-row:span 2;
}

/* 4 photos: last one spans the bottom-right so the block is fully filled. */
.vh-gallery[data-count="4"] .vh-gallery-tile:nth-child(4){
    grid-column:span 2;
}

/* 3 photos: one tall feature + two stacked. */
.vh-gallery[data-count="3"]{
    grid-template-columns:2fr 1fr;
    grid-auto-rows:230px;
}

.vh-gallery[data-count="3"] .vh-gallery-tile:nth-child(1){
    grid-column:auto;
    grid-row:span 2;
}

/* 2 photos: side by side. */
.vh-gallery[data-count="2"]{
    grid-template-columns:1fr 1fr;
    grid-auto-rows:380px;
}

.vh-gallery[data-count="2"] .vh-gallery-tile:nth-child(1){
    grid-column:auto;
    grid-row:auto;
}

/* 1 photo: full width. */
.vh-gallery[data-count="1"]{
    grid-template-columns:1fr;
    grid-auto-rows:460px;
}

.vh-gallery[data-count="1"] .vh-gallery-tile:nth-child(1){
    grid-column:auto;
    grid-row:auto;
}

/* ---------- Video stage ---------- */

.vh-video-stage{
    position:relative;
    width:100%;
    aspect-ratio:16 / 9;
    max-height:580px;
    border-radius:22px;
    overflow:hidden;
    background:#000;
    box-shadow:0 18px 50px rgba(0,0,0,0.35);
    border:1px solid var(--lux-card-border);
}

.vh-video-stage .media-frame{
    width:100%;
    height:100%;
}

.vh-video-stage .media-video{
    width:100%;
    height:100%;
    object-fit:contain;
    background:#000;
}

.vh-no-media{
    min-height:260px;
    border-radius:22px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--glass);
    border:1px solid var(--lux-card-border);
    color:var(--gold);
}

/* ---------- Title row / tags ---------- */

.vh-title-row{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:6px;
}

.vh-title-row .house-title{
    margin-bottom:0;
}

.vh-listing-tag{
    display:inline-block;
    padding:6px 14px;
    border-radius:12px;
    font-weight:700;
    font-size:0.72rem;
    letter-spacing:0.3px;
    text-transform:uppercase;
    white-space:nowrap;
}

.vh-listing-tag.is-sale{
    background:rgba(0, 200, 120, 0.85);
    color:#04140c;
}

.vh-listing-tag.is-rent{
    background:rgba(47, 111, 168, 0.85);
    color:#ffffff;
}

.vh-price-suffix{
    font-size:0.9rem;
    font-weight:500;
    opacity:0.85;
}

/* ---------- Responsive ---------- */

@media (max-width:768px){

    .house-hero-media{
        padding:10px 10px 0;
    }

    .vh-gallery,
    .vh-gallery[data-count]{
        grid-template-columns:repeat(2, 1fr);
        grid-auto-rows:170px;
        gap:8px;
    }

    .vh-gallery .vh-gallery-tile{
        grid-column:auto !important;
    }

    .vh-gallery .vh-gallery-tile:nth-child(1){
        grid-column:span 2 !important;
        grid-row:span 2 !important;
    }

    .vh-gallery[data-count="1"] .vh-gallery-tile:nth-child(1),
    .vh-gallery[data-count="2"] .vh-gallery-tile:nth-child(1){
        grid-row:span 1 !important;
    }

    /* An even total leaves one orphan at the end — let it span the full row. */
    .vh-gallery .vh-gallery-tile:last-child:nth-child(even){
        grid-column:span 2 !important;
    }

    .vh-video-stage{
        border-radius:16px;
    }

    .vh-back-btn{
        width:100%;
        justify-content:center;
    }
}
