/* ========================================
   Xeriscaping Page Styles
======================================== */

/* Hero */
.xr-hero {
    position: relative;
    width: 100%;
    height: 310px;
    overflow: hidden;
    background: #333e3b;
}

.xr-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    display: block;
    filter: brightness(0.60);
}

.xr-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.xr-hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 3px 12px rgba(0,0,0,0.5);
    letter-spacing: 1px;
}

/* ========================================
   Intro
======================================== */
.xr-intro {
    background: #fff;
    padding: 50px 24px 20px;
}

.xr-intro-container {
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
}

.xr-intro-container p {
    font-size: 1rem;
    line-height: 1.85;
    color: #555;
}

/* ========================================
   Gallery Section
======================================== */
.xr-gallery-section {
    padding: 20px 0 60px;
    background: #fff;
}

.xr-section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 700;
    color: #333e3b;
    text-align: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

.xr-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   Image Grids
======================================== */
.xr-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.xr-grid-3col {
    grid-template-columns: repeat(3, 1fr);
}

.xr-grid-4col {
    grid-template-columns: repeat(4, 1fr);
    align-items: start;
}

.xr-img-item {
    overflow: hidden;
    border-radius: 5px;
    cursor: pointer;
    background: #e0e0e0;
    aspect-ratio: 4/3;
    position: relative;
}

/* The tall portrait image in row 2 */
.xr-img-item--tall {
    aspect-ratio: 3/5;
    grid-row: span 2;
    align-self: stretch;
}

.xr-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.xr-img-item:hover img {
    transform: scale(1.04);
}

/* ========================================
   Lightbox
======================================== */
.xr-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.xr-lightbox.active {
    display: flex;
}

.xr-lb-img-wrap {
    max-width: calc(100vw - 140px);
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.xr-lb-img-wrap img {
    max-width: 100%;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    display: block;
}

.xr-lb-close {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 2.4rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
}

.xr-lb-close:hover {
    color: #95a148;
    transform: scale(1.15);
}

.xr-lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.xr-lb-arrow:hover {
    background: #95a148;
}

.xr-lb-arrow svg {
    width: 30px;
    height: 30px;
}

.xr-lb-prev { left: 20px; }
.xr-lb-next { right: 20px; }

.xr-lb-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    font-family: 'Source Sans 3', sans-serif;
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 900px) {
    .xr-grid-3col {
        grid-template-columns: repeat(3, 1fr);
    }
    .xr-grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
    .xr-img-item--tall {
        grid-row: span 1;
        aspect-ratio: 4/3;
    }
}

@media (max-width: 600px) {
    .xr-grid-3col,
    .xr-grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
    .xr-img-item--tall {
        grid-row: span 1;
        aspect-ratio: 4/3;
    }
    .xr-hero {
        height: 220px;
    }
    .xr-lb-img-wrap {
        max-width: calc(100vw - 100px);
    }
    .xr-lb-prev { left: 10px; }
    .xr-lb-next { right: 10px; }
}
