/* FIX-08: scoped to home service cards and the detailed services page. */
.services .service { height: auto; min-height: 390px; border: 1px solid #ad825b70; transition: transform 500ms, border-color 500ms; }
.services .service img { position: absolute; inset: 0; filter: brightness(1.06); transition: transform 500ms, filter 500ms; }
.services .service:nth-child(1) img { object-position: 50% 32%; }
.services .service:nth-child(2) img { object-position: 50% 45%; }
.services .service:nth-child(3) img { object-position: 50% 15%; }
.services .service::after { background: none; pointer-events: none; }
.services .service-content { position: relative; inset: auto; margin-top: 160px; min-height: 230px; padding: 26px; align-content: end; background: linear-gradient(180deg, transparent, #03111f8c 18%, #03111f9e); text-shadow: 0 1px 4px #03111fb3; }
.services .service-content > span, .services .service-content strong { color: white; }
.services .service-content small { opacity: 1; transform: none; }
.services .service:focus-visible { outline: 3px solid var(--copper2); outline-offset: 4px; }
.services .service:focus-visible img { transform: scale(1.04); }
.service-details { background: var(--paper, #f6f4ef); }
.service-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: center; padding-block: clamp(38px, 6vw, 88px); border-bottom: 1px solid #ad825b40; scroll-margin-top: calc(var(--header-height, 86px) + 24px); }
.service-detail:first-child { padding-top: 0; }
.service-detail:last-child { border-bottom: 0; padding-bottom: 0; }
.service-detail:nth-child(even) .service-detail-media { order: 2; }
.service-detail-media, .service-detail-copy { min-width: 0; }
.service-detail figure { margin: 0; overflow: hidden; border: 1px solid #ad825b55; background: #eae6df; }
.service-detail-main { display: block; width: 100%; height: auto; filter: brightness(1.06) contrast(1); transition: transform 500ms; }
body[data-page="services"] .service-detail-media > figure { border-radius: 20px; }
body[data-page="services"] .service-detail-main {
  /* The 3:4 originals keep their full width at 86% of the previous height. */
  aspect-ratio: 75 / 86;
  object-fit: cover;
  object-position: center;
}
body[data-page="services"] #structural .service-detail-main { object-position: 50% 8%; transform-origin: center top; }
body[data-page="services"] #finishing .service-detail-main { object-position: 50% 33%; }
.service-detail-support { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.service-detail-support a { display: block; overflow: hidden; border: 1px solid #ad825b55; }
.service-detail-support img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; transition: transform 500ms, filter 500ms; }
.service-detail-support a:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; }
.service-detail-support a:focus-visible img { transform: scale(1.03); }
.service-detail-number { color: var(--copper); font: 600 16px Outfit, system-ui, sans-serif; display: flex; align-items: center; gap: 16px; }
.service-detail-number::after { content: ''; width: 60px; height: 1px; background: currentColor; }
.service-detail h2 { color: var(--navy); font-size: clamp(30px, 3vw, 46px); line-height: 1.35; margin-block: 20px; overflow-wrap: anywhere; }
.service-detail p, .service-detail li { color: #344859; font-size: 17px; line-height: 1.9; }
.service-detail h3 { font-size: 19px; margin-block: 26px 12px; color: var(--navy); }
.service-detail ul { padding-inline-start: 22px; margin-block: 0 28px; }
.service-detail li { padding-inline-start: 5px; margin-bottom: 8px; }
.service-detail li::marker { color: var(--copper); }
.service-detail .button { white-space: normal; max-width: 100%; text-align: center; transition: background 400ms, box-shadow 400ms; }
.service-detail .button:focus-visible { outline: 3px solid var(--copper); outline-offset: 4px; }
.service-detail.is-visible { animation: service-section-enter 600ms ease both; }
@keyframes service-section-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.service-gallery { width: min(1000px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100svh - 32px); padding: 18px; border: 1px solid var(--copper); background: var(--navy); color: white; }
.service-gallery::backdrop { background: #03111fdb; }
.service-gallery img { display: block; width: 100%; height: auto; max-height: 65svh; object-fit: contain; }
.service-gallery-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.service-gallery button { border: 1px solid var(--copper2); background: transparent; color: white; padding: 10px 16px; font: inherit; cursor: pointer; }
.service-gallery button:focus-visible { outline: 3px solid white; outline-offset: 2px; }
.service-gallery p { color: white; margin-block: 12px 0; line-height: 1.5; }
@media (hover: hover) and (pointer: fine) {
  .services .service:hover { transform: translateY(-4px); border-color: var(--copper2); }
  .services .service:hover img { transform: scale(1.04); filter: brightness(1.1); }
  .service-detail figure:hover .service-detail-main, .service-detail-support a:hover img { transform: scale(1.03); }
  .service-detail-support a:hover img { filter: brightness(1.05); }
}
@media (max-width: 980px) {
  .service-detail { grid-template-columns: minmax(0, 1fr); }
  .service-detail:nth-child(even) .service-detail-media { order: 0; }
  .service-detail-media { width: min(100%, 580px); justify-self: center; }
}
@media (max-width: 375px) {
  .service-detail p, .service-detail li { font-size: 16px; }
  .service-detail-support { gap: 8px; }
  .services .service-content { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .services .service, .services .service img, .services .service-content small,
  .service-detail, .service-detail img, .service-detail .button {
    animation: none !important; transition: none !important; transform: none !important;
  }
}
