.aqm-service-features > .aqm-feature { scroll-margin-top: 35px; }
#services-toc { width: 100%; }
.services-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--aqm-line); background: var(--aqm-line); }
.service-card, .service-card-inv { min-width: 0; text-decoration: none; padding: clamp(22px, 2.4vw, 38px); background: #fff; transition: background .2s ease; }
.service-card:hover { background: #dceef1; }
.service-title, .service-title-inv { color: var(--aqm-deep); font-family: var(--aqm-display); font-weight: 550; line-height: 1.16; font-size: clamp(1.3rem, 2vw, 1.75rem); margin-bottom: 1.3rem !important; }
.service-card ul { margin: 0; padding-left: 1.1rem; color: var(--aqm-muted); font-size: .83rem; line-height: 1.75; }
.service-card li { margin-bottom: .5rem; }
.service-card li:last-child { margin-bottom: 0; }
.service-card-inv { background: var(--aqm-navy); display: grid; place-items: center; text-align: center; }
.service-title-inv { margin: 0 !important; color: white; }
.aqm-service-gallery { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.aqm-gallery-item { width: 100%; position: relative; overflow: hidden; border: 0; padding: 0; background: var(--aqm-blue-soft); color: white; text-align: left; }
.aqm-gallery-item img { width: 100%; height: 100%; aspect-ratio: 4 / 3.5; object-fit: cover; transition: transform .25s ease; }
.aqm-gallery-item:hover img { transform: scale(1.045); }
.aqm-gallery-label { position: absolute; inset: auto 0 0; padding: 2.5rem .9rem .75rem; background: linear-gradient(0deg, rgba(8,30,44,.85), transparent); font-weight: 700; font-size: .8rem; }
.aqm-gallery-popup-heading { padding: 24px 65px 0 22px; }
.aqm-gallery-popup-heading h2 { font-size: 1.65rem; }
@media (max-width: 1100px) { .services-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 850px) { .aqm-service-gallery { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 560px) { .services-grid { grid-template-columns: 1fr; } .aqm-service-gallery { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 5px; } .aqm-gallery-label { font-size: .7rem; } }

.aqm-gallery-item { cursor: pointer; aspect-ratio: 4 / 3; }
.aqm-gallery-item img { display: block; aspect-ratio: auto; width: 100%; height: 100%; }
.aqm-gallery-item.dual::after { content: 'Before / After'; position: absolute; top: .7rem; left: .7rem; background: rgba(14, 51, 72, .88); color: white; padding: .3rem .55rem; font-size: .7rem; font-weight: 700; }
.aqm-gallery-label { opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }
.aqm-gallery-item:hover .aqm-gallery-label, .aqm-gallery-item:focus-visible .aqm-gallery-label { opacity: 1; transform: translateY(0); }
.aqm-gallery-item:focus-visible { outline: 3px solid var(--aqm-blue); outline-offset: 2px; }
.aqm-modal[hidden] { display: none !important; }
@media (hover: none) {
    .aqm-gallery-label { opacity: 1; transform: none; }
}
@media (max-width: 560px) {
    .aqm-gallery-modal-body { grid-template-columns: minmax(0, 1fr); }
}

/* Land at the section content rather than the padded margin above it. */
.aqm-service-features > .aqm-feature { scroll-margin-top: 0; }
.aqm-service-features > .aqm-feature .aqm-title { scroll-margin-top: 16px; }

/* Completed pool by default; hover/focus reveals its original condition. */
.aqm-gallery-item.dual .aqm-gallery-after,
.aqm-gallery-item.dual .aqm-gallery-before { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.aqm-gallery-item.dual .aqm-gallery-after { z-index: 0; }
.aqm-gallery-item.dual .aqm-gallery-before { z-index: 1; opacity: 0; transition: opacity .32s ease; }
.aqm-gallery-item.dual:hover .aqm-gallery-before,
.aqm-gallery-item.dual:focus-visible .aqm-gallery-before { opacity: 1; }
.aqm-gallery-item.dual::after { z-index: 3; }
.aqm-gallery-label { z-index: 2; width: 100%; display: flex; flex-direction: column; gap: .24rem; }
.aqm-gallery-instruction { font-size: .73rem; font-weight: 500; color: #d5eff3; }

/* The two photos receive equivalent framed treatments in the dialog. */
#before-after-popup { padding: clamp(12px, 2.5vw, 32px); background: rgba(5, 28, 43, .88); }
#before-after-popup .aqm-modal-panel { width: min(100%, 1160px); background: #f6faf9; border: 1px solid rgba(255,255,255,.45); overflow: auto; }
#before-after-popup .aqm-gallery-popup-heading { padding: clamp(24px, 4vw, 42px) 75px 20px clamp(20px, 4vw, 42px); border-bottom: 1px solid var(--aqm-line); }
#before-after-popup .aqm-gallery-popup-heading .aqm-heading { font-size: clamp(1.5rem, 3vw, 2.7rem); line-height: 1.14; }
#before-after-popup .aqm-gallery-modal-body { padding: clamp(16px, 3vw, 36px); gap: clamp(12px, 2.5vw, 25px); align-items: stretch; }
#before-after-popup .aqm-gallery-modal-body figure { display: flex; flex-direction: column; background: #fff; border: 1px solid #d5e2e5; padding: 10px; min-width: 0; }
#before-after-popup .aqm-gallery-modal-body figure img { width: 100%; height: clamp(230px, 43vw, 540px); max-height: none; object-fit: contain; background: #f2f6f6; }
#before-after-popup .aqm-gallery-modal-body figcaption { margin: 0; padding: 14px 8px 5px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--aqm-deep); }
#before-after-popup .aqm-gallery-modal-body.aqm-single figure img { height: auto; max-height: 68vh; }
@media (hover: none) {
    .aqm-gallery-item.dual .aqm-gallery-before { opacity: 0; }
    .aqm-gallery-item.dual .aqm-gallery-label { opacity: 1; }
}
@media (max-width: 560px) {
    #before-after-popup .aqm-gallery-modal-body { grid-template-columns: minmax(0,1fr); }
    #before-after-popup .aqm-gallery-modal-body figure img { height: auto; max-height: 48vh; }
    #before-after-popup .aqm-gallery-popup-heading { padding-right: 68px; }
}
