.services-gallery {
    --sg-gold: #dfb68c;
    --sg-line: #d9b28b38;
    color: #f5eee5;
    padding: clamp(28px, 5vw, 76px)
             max(clamp(20px, 5vw, 80px), calc((100% - 1440px) / 2))
             clamp(48px, 7vw, 100px);
    background:
        radial-gradient(ellipse at 8% 0%, #3d2e22 0%, transparent 58%),
        repeating-linear-gradient(125deg, #ffe1b805 0 1px, transparent 1px 8px),
        #171411;
}
.sg-trail {
    display: flex;
    gap: 10px;
    color: #cbbbab;
    font-size: .85rem;
    margin-bottom: 18px;
}
.services-gallery h1 {
    font: 600 clamp(2.6rem, 5.5vw, 5.5rem)/1.08 Montserrat, system-ui, sans-serif;
    letter-spacing: -.05em;
    padding-bottom: clamp(18px, 3vw, 36px);
    border-bottom: 1px solid var(--sg-line);
}
.sg-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(24px, 4vw, 56px) clamp(16px, 2.6vw, 38px);
    margin-top: clamp(24px, 4vw, 48px);
}
.sg-card { display: block; min-width: 0; }
.sg-photo { aspect-ratio: 5 / 4; overflow: hidden; background: #30271f; }
.sg-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.sg-card:hover .sg-photo img { transform: scale(1.04); }

.sg-card:nth-child(6n + 1) .sg-photo {
    clip-path: polygon(0 0, 88% 0, 100% 17%, 100% 100%, 0 100%);
}
.sg-card:nth-child(6n + 2) .sg-photo {
    border-radius: 50% 50% 0 0 / 38% 38% 0 0;
}
.sg-card:nth-child(6n + 3) .sg-photo {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 15% 100%, 0 80%);
}
.sg-card:nth-child(6n + 4) .sg-photo {
    border-radius: 24% 0 24% 0 / 30% 0 30% 0;
}
.sg-card:nth-child(6n + 5) .sg-photo {
    clip-path: polygon(0 0, 100% 0, 100% 78%, 89% 78%, 89% 100%, 0 100%);
}
.sg-card:nth-child(6n + 6) .sg-photo {
    clip-path: polygon(12% 0, 100% 0, 100% 82%, 88% 100%, 0 100%, 0 18%);
}
.sg-photo-empty {
    display: grid;
    place-items: center;
    color: var(--sg-gold);
    background:
        linear-gradient(#dfb68c18 1px, transparent 1px) 0 0 / 26px 26px,
        linear-gradient(90deg, #dfb68c18 1px, transparent 1px) 0 0 / 26px 26px,
        #31251c;
}
.sg-photo-empty svg { width: 42%; max-width: 160px; }
.sg-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding-block: 12px;
    border-bottom: 1px solid var(--sg-line);
}
.services-gallery .sg-caption h2 {
    font: 600 clamp(1rem, 1.65vw, 1.55rem)/1.25 Montserrat, system-ui, sans-serif;
    overflow-wrap: anywhere;
}
.sg-arrow {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    height: 36px;
    border: 1px solid var(--sg-line);
    border-radius: 50%;
    color: var(--sg-gold);
}
.sg-card:hover .sg-arrow { background: var(--sg-gold); color: #211912; }
.services-gallery a:focus-visible { outline: 2px solid var(--sg-gold); outline-offset: 5px; }
.sg-empty { grid-column: 1 / -1; }
.sg-pagination { margin-top: 28px; }

@media (max-width: 900px) {
    .sg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .sg-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .sg-photo img { transition: none; }
}

/* Arch.az mobile service captions */
@media (max-width: 600px) {
    .services-gallery .sg-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }
    .services-gallery .sg-card {
        position: relative;
        isolation: isolate;
    }
    .services-gallery .sg-photo {
        aspect-ratio: 16 / 10;
    }
    .services-gallery .sg-caption {
        position: absolute;
        inset: 0;
        z-index: 1;
        display: grid;
        place-items: center;
        min-height: 0;
        padding: 16px;
        border: 0;
        text-align: center;
    }
    .services-gallery .sg-caption h2 {
        max-width: 85%;
        margin: 0;
        padding: 8px 14px;
        border: 1px solid #dfb68c55;
        border-radius: 8px;
        background: #191511e6;
        color: #fff5e9;
        font-size: clamp(15px, 4vw, 18px);
        line-height: 1.3;
    }
    .services-gallery .sg-caption .sg-arrow {
        display: none;
    }
}
