/* ╔══════════════════════════════════════════════════════════════════════════════╗
   ║                                                                              ║
   ║   IMAGES.CSS — Image Component System for Mission Auto Glass                 ║
   ║   Version: 1.0                                                               ║
   ║   Purpose: Styles for service card images, inline content images,            ║
   ║            before/after pairs, work gallery, and testimonial photos          ║
   ║                                                                              ║
   ╚══════════════════════════════════════════════════════════════════════════════╝ */

/* ═══════════════════════════════════════════════════════════════════════════════
   1. SERVICE CARD IMAGES
   Thumbnails at top of each service card in the services grid
   ═══════════════════════════════════════════════════════════════════════════════ */

.service-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-md, 8px) var(--radius-md, 8px) 0 0;
    display: block;
}

.service-card.has-img {
    display: flex;
    flex-direction: column;
    padding-top: 0;
    overflow: hidden;
}

.service-card.has-img h3,
.service-card.has-img p,
.service-card.has-img .service-price {
    padding-left: var(--space-5, 20px);
    padding-right: var(--space-5, 20px);
}

.service-card.has-img h3 {
    padding-top: var(--space-4, 16px);
}

.service-card.has-img .service-price {
    padding-bottom: var(--space-5, 20px);
    margin-top: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   2. INLINE CONTENT IMAGES
   Photos embedded within text content sections
   ═══════════════════════════════════════════════════════════════════════════════ */

.content-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md, 8px);
    margin: var(--space-6, 24px) 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: block;
    object-fit: cover;
}

.content-img-right {
    float: right;
    max-width: 42%;
    margin: 0 0 var(--space-5, 20px) var(--space-6, 24px);
    border-radius: var(--radius-md, 8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    object-position: center;
}

.content-img-left {
    float: left;
    max-width: 42%;
    margin: 0 var(--space-6, 24px) var(--space-5, 20px) 0;
    border-radius: var(--radius-md, 8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    object-position: center;
}

@media (max-width: 768px) {
    .content-img-right,
    .content-img-left {
        float: none;
        max-width: 100%;
        margin: var(--space-5, 20px) 0;
    }
}

/* Figure + Figcaption for inline images with captions */
.content-figure {
    margin: var(--space-6, 24px) 0;
    padding: 0;
}

.content-figure img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md, 8px);
    display: block;
    object-fit: cover;
}

.content-figure figcaption {
    font-size: 0.85rem;
    color: var(--color-neutral-600, #4b5563);
    margin-top: var(--space-2, 8px);
    font-style: italic;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   3. BEFORE / AFTER PAIRS
   Side-by-side comparison images with labels
   ═══════════════════════════════════════════════════════════════════════════════ */

.before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4, 16px);
    margin: var(--space-8, 32px) 0;
}

.before-after figure {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md, 8px);
}

.before-after img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-md, 8px);
}

.before-after figcaption {
    position: absolute;
    top: var(--space-2, 8px);
    left: var(--space-2, 8px);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: var(--space-1, 4px) var(--space-3, 12px);
    border-radius: var(--radius-sm, 4px);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 600px) {
    .before-after {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   4. WORK GALLERY GRID
   Portfolio-style grid of work photos
   ═══════════════════════════════════════════════════════════════════════════════ */

.work-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4, 16px);
    margin: var(--space-6, 24px) 0;
}

.work-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-md, 8px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.work-gallery img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

@media (max-width: 600px) {
    .work-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3, 12px);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   5. TESTIMONIAL / CUSTOMER IMAGES
   Circular crops for customer photos next to reviews
   ═══════════════════════════════════════════════════════════════════════════════ */

.testimonial-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-brand-blue, #183075);
    flex-shrink: 0;
}

.review-item.has-photo {
    display: flex;
    gap: var(--space-4, 16px);
    align-items: flex-start;
}

.review-item.has-photo .review-content {
    flex: 1;
}

@media (max-width: 600px) {
    .review-item.has-photo {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   6. CONTENT WITH PORTRAIT SIDEBAR
   Two-column layout: text content + portrait photo
   ═══════════════════════════════════════════════════════════════════════════════ */

.content-with-portrait {
    display: grid;
    grid-template-columns: 1fr 0.618fr;
    gap: var(--space-8, 32px);
    align-items: start;
}

.portrait-img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

@media (max-width: 768px) {
    .content-with-portrait {
        grid-template-columns: 1fr;
    }

    .portrait-img {
        max-width: 400px;
        margin: 0 auto;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   7. CLEARFIX FOR FLOATED IMAGES
   ═══════════════════════════════════════════════════════════════════════════════ */

.has-floated-img::after {
    content: "";
    display: table;
    clear: both;
}
