.gallery-container {
    margin: 0 auto;
    font-family: inherit;
    max-width: 1600px;
}

.house-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.gallery-section .gallery-description {
    margin-bottom: 8.75rem;
}



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

@media (max-width: 767px) {
    .house-nav {
        gap: 0.625rem;
    }
}

.house-tab-btn {
  padding: 0.75rem 1rem !important;
  border: 1px solid #000;
  background: transparent;
  text-align: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.3s ease;
  border-radius: 0.5rem !important;
}

.house-tab-btn:hover {
    background-color: #000 !important;
    color: #ffffff !important;
    border-color: #000 !important;
}

.house-content {
  display: block;
  border-bottom: 1px solid #eee;
  margin-bottom: 12rem;
}

@media (max-width: 767px) {
    .house-content {
        margin-bottom: 5rem;
    }
}

.house-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.house-info-grid {
    display: flex;
    flex-direction: column;
    gap: 1.875rem;
    margin-bottom: 4rem;
}

@media (min-width: 768px) {
    .house-info-grid {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

@media (max-width: 767px) {
    .house-info-grid {
        margin-bottom: 2.5rem !important;
    }
}

.house-title-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.875rem;
}

@media (max-width: 1119px) {
    .house-title-area {
        gap: 1rem;
    }
}

.house-title-area h1 {
    font-size: 5rem;
    margin: 0;
    font-weight: 400;
}

@media (max-width: 1440px) {
    .house-title-area h1 {
        line-height: 3.90625rem !important;
    }
}

@media (max-width: 1119px) {
    .house-title-area h1 {
        font-size: 2.313rem !important;
        line-height: 100% !important;
    }
}
@media (max-width: 1119px) {
    .house-title-area .house-size-label {
        font-size: 1.5rem;
    }
}

.house-size-label {
    font-size: 3.125rem;
    color: #000;
    font-weight: 200;
}

.house-text-area {
    flex: 1;
    font-size: 1.125rem;
    line-height: 1.5rem;
    color: #000;
    max-width: 500px;
}

@media (max-width: 767px) {
    .house-text-area {
        font-size: 1rem;
        line-height: 1.5rem;
    }
}

.bento-gallery {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 18rem;
    grid-auto-flow: row dense;
    gap: 1.5rem;
}

.bento-item {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background: #f0f0f0;
}

@media screen and (min-width: 1280px) and (max-width: 1727px) {
    .gallery-section .gallery-description {
        margin-bottom: 7.5rem;
    }
    .house-text-area {
        font-size: 0.938rem;
    }
}

/* Flexible bento spans (12-col grid) — driven by the per-photo ACF fields. */
@media (min-width: 768px) {
    .bento-item.w-3  { grid-column: span 3; }
    .bento-item.w-4  { grid-column: span 4; }
    .bento-item.w-6  { grid-column: span 6; }
    .bento-item.w-8  { grid-column: span 8; }
    .bento-item.w-12 { grid-column: span 12; }
    .bento-item.h-1  { grid-row: span 1; }
    .bento-item.h-2  { grid-row: span 2; }
}

.bento-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.25rem 1rem 1rem;
    color: #fff;
    font-size: 0.875rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.bento-item:hover .bento-caption {
    opacity: 1;
}

.bento-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block;
}

@media (max-width: 767px) {
    .bento-gallery {
        grid-auto-rows: auto !important;
        gap: 0.625rem;
    }
    
    .bento-item,
    .item-main, .item-side, .item-full, .item-half {
        grid-column: span 12 !important;
        grid-row: span 1 !important;
    }
    
    .bento-item {
        width: 100% !important;
        aspect-ratio: 4 / 3 !important;
        height: auto !important;
    }

    .bento-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        display: block;
    }

    .house-title-area h1 {
        font-size: 3.5rem;
    }
}

@media (min-width: 768px) {
    .item-main { grid-column: span 8; grid-row: span 2; }
    .item-side { grid-column: span 4; grid-row: span 2; }
    .item-full { grid-column: span 12; grid-row: span 2; }
    .item-half { grid-column: span 6; grid-row: span 2; }
}

.gallery-description {
    text-align: center;
    font-size: 0.875rem;
    color: #A8A8A8;
    margin-bottom: 4rem;
}