/* Property Gallery */
.lah-property-gallery {
    margin: 0;
}

/* Featured / main image */
.lah-gallery-featured {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
    background: #f5f5f5;
    /* Lock the frame to a consistent aspect ratio so the page doesn't
       jump as the user navigates between images of differing dimensions. */
    aspect-ratio: 4 / 3;
}

.lah-gallery-main-img {
    width: 100%;
    height: 100%;
    /* Fit the whole image inside the fixed frame without cropping;
       the featured background letterboxes any leftover space. */
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

/* Main image navigation arrows (overlaid on the image) */
.lah-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 2;
}

.lah-gallery-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}

.lah-gallery-prev { left: 10px; }
.lah-gallery-next { right: 10px; }

/* Thumbnail filmstrip */
.lah-gallery-thumbs-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.lah-gallery-thumbnails {
    display: flex;
    gap: 12px;
    flex: 1;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* IE / old Edge */
}

.lah-gallery-thumbnails::-webkit-scrollbar {
    display: none;              /* Chrome / Safari */
}

.lah-gallery-thumb {
    position: relative;
    flex: 0 0 auto;
    width: 120px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: pointer;
    background: #f5f5f5;
    opacity: 0.65;
    transition: opacity 0.2s ease;
}

.lah-gallery-thumb.active,
.lah-gallery-thumb:hover {
    opacity: 1;
}

.lah-gallery-thumb.active {
    outline: 3px solid #0073aa;
    outline-offset: -3px;
}

.lah-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Thumbnail filmstrip scroll arrows */
.lah-thumbs-arrow {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lah-thumbs-arrow:hover {
    background: #e8e8e8;
}

.lah-thumbs-prev { margin-right: 8px; }
.lah-thumbs-next { margin-left: 8px; }

.lah-arrow-hidden {
    visibility: hidden;
}

/* Lightbox */
.lah-lightbox {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 2147483000 !important;
    align-items: center !important;
    justify-content: center !important;
}

.lah-lightbox.active {
    display: flex !important;
}

.lah-lightbox-content {
    position: relative !important;
    max-width: 90% !important;
    max-height: 85vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.lah-lightbox-content img {
    max-width: 100% !important;
    max-height: 85vh !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    transition: opacity 0.2s ease !important;
}

/* Close button pinned to the image's top-right corner */
.lah-lightbox-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border: none !important;
    color: #fff !important;
    font-size: 30px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    z-index: 2 !important;
    transition: background 0.2s ease !important;
}

.lah-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.85) !important;
}

.lah-lightbox-prev,
.lah-lightbox-next {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 50px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    color: #fff !important;
    font-size: 22px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: background 0.2s ease, border-color 0.2s ease !important;
    z-index: 2 !important;
}

.lah-lightbox-prev { left: 20px !important; }
.lah-lightbox-next { right: 20px !important; }

.lah-lightbox-prev:hover,
.lah-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .lah-gallery-thumb {
        width: 90px;
    }

    .lah-gallery-arrow {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .lah-lightbox-close {
        top: 8px !important;
        right: 8px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 26px !important;
    }

    .lah-lightbox-prev,
    .lah-lightbox-next {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }

    .lah-lightbox-prev { left: 8px !important; }
    .lah-lightbox-next { right: 8px !important; }
}

/* Agent Cards (used in property_agents shortcode) */
.lah-agent-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0;
}

.lah-agent-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0;
    background: #fff;
}

.lah-agent-photo {
    flex-shrink: 0;
    line-height: 0;
}

.lah-agent-photo img {
    width: 100px;
    height: 100px;
    border-radius: 0;
    object-fit: cover;
    display: block;
}

.lah-agent-info {
    flex: 1;
    text-align: left;
}

.lah-agent-info h3 {
    margin: 0;
    font-size: 18px !important;
    font-weight: bold;
    color: #012169;
}

.lah-agent-info h3 a {
    color: #012169;
}

.lah-agent-info p,
.lah-agent-email p {
    margin: 0;
    font-size: 14px;
    padding: 0;
    line-height: 1.5;
    color: #777777;
}

.lah-agent-info a {
    color: #777777;
    text-decoration: none;
}

.lah-agent-info a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    .lah-agent-card {
        flex-direction: column;
        text-align: center;
    }
    
    .lah-agent-info {
        text-align: center;
    }
}

/* Agent Team Grid */
.lah-agent-team-grid {
    display: grid;
    gap: 40px;
}

.lah-agent-team-grid.lah-grid-cols-1 { grid-template-columns: 1fr; }
.lah-agent-team-grid.lah-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.lah-agent-team-grid.lah-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.lah-agent-team-grid.lah-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.lah-agent-team-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    padding: 0;
}

.lah-agent-team-photo {
    width: 100%;
    line-height: 0;
    margin-bottom: 15px;
}

.lah-agent-team-photo img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border: 2px solid #f5f5f5;
}

.lah-agent-team-card h3 {
    margin: 0 0 2px 0;
    font-size: 18px;
    font-weight: bold;
    color: #012169;
}

.lah-agent-team-card h3 a {
    color: #012169;
    text-decoration: none;
}

.lah-agent-team-card h3 a:hover {
    text-decoration: underline;
}

.lah-agent-team-title {
    margin: 0 0 5px 0;
    padding: 0;
    font-size: 14px;
    font-style: italic;
    color: #777777;
}

.lah-agent-team-card p {
    margin: 0 0 4px 0;
    padding: 0;
    font-size: 14px;
    color: #777777;
}

.lah-agent-team-card p a {
    color: #777777;
    text-decoration: none;
}

.lah-agent-team-card p a:hover {
    text-decoration: underline;
}

.lah-agent-view-properties {
    display: inline-block;
    margin-top: 4px;
    padding: 0;
    background: none;
    color: #a6192e;
    text-decoration: underline;
    font-size: 14px;
}

.lah-agent-view-properties:hover {
    color: #8a1526;
}

@media (max-width: 768px) {
    .lah-agent-team-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .lah-agent-team-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Agent List (simple layout) */
.lah-agent-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.lah-agent-list li {
    margin-bottom: 10px;
}

/* Property Cards (used in agent_properties shortcode) */
.lah-property-cards {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.lah-property-cards.lah-property-cards {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.lah-property-cards.lah-property-grid {
    grid-template-columns: repeat(3, 1fr);
}

.lah-property-card {
    border: 1px solid #ddd;
    border-radius: 0;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.lah-property-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.lah-property-image {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f5f5f5;
}

.lah-property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.lah-property-card:hover .lah-property-image img {
    transform: scale(1.05);
}

.lah-property-details {
    padding: 15px;
}

.lah-property-details h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.lah-property-details h3 a {
    color: #333;
    text-decoration: none;
}

.lah-property-details h3 a:hover {
    color: #0073aa;
}

.lah-property-details p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.lah-property-price {
    font-weight: bold;
    color: #333;
    font-size: 16px !important;
}

/* Property List (simple layout) */
.lah-property-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.lah-property-list li {
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .lah-property-cards.lah-property-grid {
        grid-template-columns: 1fr;
    }
    
    .lah-agent-cards {
        grid-template-columns: 1fr;
    }
}