/* ============================================================
   SERVICES PAGE — css/pages/services.css

   Page-specific styles for the services overview page.
   Alternating two-column service blocks with oversized
   numeral accents, sticky section navigator, and
   certifications grid.
   ============================================================ */


/* ------------------------------------------------------------
   1. PAGE HERO — Compact banner (not full-height)
   Static background image with dark overlay for text contrast.
   ------------------------------------------------------------ */

.services-hero {
  min-height: 40vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--space-12);
}

/* Background: photo + dark gradient overlay */
.services-hero .hero__overlay {
  background:
    linear-gradient(
      to top,
      rgba(17, 17, 17, 0.85) 0%,
      rgba(17, 17, 17, 0.5) 40%,
      rgba(17, 17, 17, 0.3) 100%
    );
}

.services-hero__bg {
  position: absolute;
  inset: 0;
  z-index: var(--z-below);
  background-image: url('../../images/services/hero.jpg');
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
}

.services-hero .hero__content {
  position: relative;
  z-index: var(--z-raised);
}

.services-hero__subtitle {
  max-width: 36rem;
}

/* Entrance animation — staggered fade-in */
@keyframes serviceHeroFadeIn {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.services-hero .hero__content > * {
  opacity: 0;
  transform: translateY(1.25rem);
  animation: serviceHeroFadeIn 0.6s ease-out forwards;
}

.services-hero .hero__content > *:nth-child(1) { animation-delay: 0.1s; }
.services-hero .hero__content > *:nth-child(2) { animation-delay: 0.25s; }
.services-hero .hero__content > *:nth-child(3) { animation-delay: 0.4s; }


/* ------------------------------------------------------------
   2. STICKY SERVICE NAVIGATOR
   Horizontal bar of pill-style links. Sits below hero,
   becomes sticky on scroll. Active state tracks current
   viewport section via IntersectionObserver in main.js.
   ------------------------------------------------------------ */

.service-nav {
  position: sticky;
  top: 5rem;                       /* below fixed navbar height */
  z-index: var(--z-dropdown);
  background-color: var(--palette-charcoal);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow var(--transition-base);
}

/* Subtle shadow when stuck (toggled via JS) */
.service-nav.is-stuck {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.service-nav__inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--container-padding);
  max-width: var(--container-max);
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;           /* Firefox */
}

.service-nav__inner::-webkit-scrollbar {
  display: none;                   /* Chrome/Safari */
}

.service-nav__link {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: color var(--transition-fast),
              background-color var(--transition-fast),
              border-color var(--transition-fast);
}

.service-nav__link:hover {
  color: var(--color-text-on-dark);
}

.service-nav__link.is-active {
  color: var(--color-text-on-dark);
  background-color: rgba(63, 116, 255, 0.15);
  border-color: rgba(63, 116, 255, 0.35);
}


/* ------------------------------------------------------------
   3. SERVICE BLOCKS — Alternating two-column layout
   Each block: image on one side, text content on other.
   Odd blocks: image left. Even blocks: image right.
   Oversized faint numeral accent in each text column.
   ------------------------------------------------------------ */

.service-block {
  position: relative;
  overflow: hidden;
}

/* Alternating background colors for visual rhythm */
.service-block:nth-child(odd) {
  background-color: var(--color-surface-white);
}

.service-block:nth-child(even) {
  background-color: var(--color-surface-ghost);
}

.service-block__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: center;
}

@media (min-width: 64rem) {
  .service-block__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }

  /* Even blocks: swap column order (text left, image right) */
  .service-block:nth-child(even) .service-block__inner {
    direction: rtl;
  }

  .service-block:nth-child(even) .service-block__inner > * {
    direction: ltr;
  }
}

@media (min-width: 90rem) {
  .service-block__inner {
    gap: var(--space-16);
  }
}


/* --- Image Column ------------------------------------------ */

.service-block__image {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 3;
}

.service-block__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

/* Image hover: scale + accent bar triggered by hovering the image itself */
.service-block__image:hover img {
  transform: scale(1.03);
}

/* Accent bar along bottom of image — slides in on hover */
.service-block__image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--color-brand-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s ease-out;
  z-index: 1;
}

.service-block__image:hover::after {
  transform: scaleX(1);
}


/* --- Content Column ---------------------------------------- */

.service-block__content {
  position: relative;
  padding: var(--space-4) 0;
}

/* Oversized faint numeral — background accent */
.service-block__number {
  position: absolute;
  top: -0.5rem;
  right: 0;
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: clamp(5rem, 4rem + 5vw, 8rem);
  line-height: 1;
  color: var(--color-brand-accent);
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
}

/* On even (ghost bg) blocks, shift number to left since image is right */
@media (min-width: 64rem) {
  .service-block:nth-child(even) .service-block__number {
    right: auto;
    left: 0;
  }
}

.service-block__eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-brand-accent);
  margin-bottom: var(--space-3);
}

.service-block__title {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--color-text-heading);
  margin-bottom: var(--space-5);
}

.service-block__text {
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

.service-block__text + .service-block__text {
  margin-top: calc(-1 * var(--space-3));
}

/* Capability bullet list */
.service-block__bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.service-block__bullets li {
  position: relative;
  padding-left: var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
}

/* Custom bullet — small accent-colored bar */
.service-block__bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 1rem;
  height: 2px;
  background-color: var(--color-brand-accent);
}


/* ------------------------------------------------------------
   4. CERTIFICATIONS BAR
   Full-width dark band with icon/label grid showing
   qualifications and safety credentials.
   ------------------------------------------------------------ */

.cert-section {
  background-color: var(--palette-charcoal);
  color: var(--color-text-on-dark);
}

.cert-section .section-heading__title {
  color: var(--color-text-on-dark);
}

.cert-section .section-heading__subtitle {
  color: var(--color-text-on-dark-muted);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

@media (min-width: 48rem) {
  .cert-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 64rem) {
  .cert-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-5);
  }
}

.cert-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base),
              background-color var(--transition-base);
}

.cert-item:hover {
  border-color: rgba(63, 116, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.04);
}

.cert-item__icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand-accent);
}

.cert-item__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.cert-item__label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-on-dark);
  line-height: var(--leading-snug);
}

.cert-item__detail {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-on-dark-muted);
  line-height: var(--leading-normal);
  margin-top: calc(-1 * var(--space-1));
}


/* ------------------------------------------------------------
   5. SERVICES CTA — Closing call-to-action
   Navy background, mirrors homepage CTA pattern.
   ------------------------------------------------------------ */

.services-cta {
  position: relative;
  overflow: hidden;
  background-color: var(--palette-dark-blue);
  color: var(--color-text-on-dark);
}

.services-cta__ornament {
  position: absolute;
  top: -0.2em;
  right: -0.05em;
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: clamp(6rem, 4rem + 8vw, 14rem);
  line-height: 0.8;
  letter-spacing: var(--tracking-tight);
  color: var(--palette-royal);
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
  z-index: var(--z-base);
}

.services-cta__inner {
  position: relative;
  z-index: var(--z-raised);
  max-width: 48rem;
}

.services-cta__eyebrow {
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-brand-accent);
}

.services-cta__title {
  margin: 0 0 var(--space-6);
  max-width: 40rem;
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: clamp(1.75rem, 1.25rem + 2vw, 3rem);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-on-dark);
}

.services-cta__text {
  margin: 0 0 var(--space-8);
  max-width: 36rem;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: rgba(255, 255, 255, 0.82);
}

/* Bottom border to separate CTA from dark footer */
.services-cta {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 63.9375rem) {
  .services-cta__ornament {
    right: -0.15em;
    opacity: 0.04;
  }
}
