/**
 * Services Teaser Paragraph Component
 *
 * Template: templates/paragraph/paragraph--services.html.twig
 * Library:  acm_bootstrap/paragraph-services-teaser
 * Mockup:   designs/services-teaser-mockup.html
 *
 * All selectors scoped under .paragraph--type--services to prevent
 * conflicts with other components sharing st-* class names.
 *
 * Mobile-first breakpoints:
 *   Base     → single column, compact padding
 *   ≥ 600px  → tablet: 2 columns
 *   ≥ 992px  → desktop: 3 columns, bottom row centred
 */

/* ==========================================================================
   1. Design tokens (scoped to .paragraph--type--services)
   Prefix: --st-   (services teaser)
   Light palette is the default.
   Dark variant: .paragraph--type--services--dark
   ========================================================================== */

.paragraph--type--services {
  /* Brand accent */
  --st-orange:           #ff5c00;
  --st-orange-dim:       rgba(255, 92, 0, .07);
  --st-orange-border:    rgba(255, 92, 0, .22);

  /* Backgrounds */
  --st-bg:               #f4f7fb;
  --st-bg-overlay-line:  rgba(13, 31, 53, .04);
  --st-card-bg:          #ffffff;
  --st-card-bg-hover:    #ffffff;

  /* Text */
  --st-title-color:      #0d1f35;
  --st-subtitle-color:   rgba(13, 31, 53, .55);
  --st-card-title-color: #0d1f35;
  --st-card-desc-color:  rgba(13, 31, 53, .58);
  --st-card-link-color:  rgba(13, 31, 53, .40);

  /* Borders & effects */
  --st-card-border:      rgba(13, 31, 53, .10);
  --st-card-border-hover:rgba(255, 92, 0, .40);
  --st-card-shadow:      0 2px 12px rgba(13, 31, 53, .06);
  --st-card-shadow-hover:0 12px 32px rgba(13, 31, 53, .10);

  /* CTA button */
  --st-cta-color:        #0d1f35;
  --st-cta-border:       rgba(13, 31, 53, .25);

  /* Label */
  --st-label-color:      #ff5c00;
}

/* ── Dark palette overrides ──────────────────────────────────────────── */
.paragraph--type--services--dark {
  --st-orange-dim:       rgba(255, 92, 0, .10);
  --st-orange-border:    rgba(255, 92, 0, .20);

  --st-bg:               linear-gradient(160deg, #020c18 0%, #0a1e36 60%, #031a30 100%);
  --st-bg-overlay-line:  rgba(255, 255, 255, .03);
  --st-card-bg:          rgba(255, 255, 255, .04);
  --st-card-bg-hover:    rgba(255, 255, 255, .07);

  --st-title-color:      #ffffff;
  --st-subtitle-color:   rgba(255, 255, 255, .55);
  --st-card-title-color: #ffffff;
  --st-card-desc-color:  rgba(255, 255, 255, .55);
  --st-card-link-color:  rgba(255, 255, 255, .45);

  --st-card-border:      rgba(255, 255, 255, .09);
  --st-card-border-hover:rgba(255, 92, 0, .40);
  --st-card-shadow:      none;
  --st-card-shadow-hover:none;

  --st-cta-color:        #ffffff;
  --st-cta-border:       rgba(255, 255, 255, .25);
}

/* ==========================================================================
   2. Box-sizing reset — scoped
   ========================================================================== */

.paragraph--type--services *,
.paragraph--type--services *::before,
.paragraph--type--services *::after {
  box-sizing: border-box;
}

/* ==========================================================================
   3. Section wrapper — mobile base
   ========================================================================== */

.paragraph--type--services {
  background: var(--st-bg);
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
}

/* Subtle grid overlay */
.paragraph--type--services::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--st-bg-overlay-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--st-bg-overlay-line) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.paragraph--type--services .st-container {
  /*max-width: 1200px;*/
  /*margin: 0 auto;*/
  /*padding: 0 20px;*/
  /*position: relative;*/
}

/* ==========================================================================
   4. Section header — mobile base (centred)
   ========================================================================== */

.paragraph--type--services .st-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 36px;
}

.paragraph--type--services .st-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--st-label-color);
  margin-bottom: 14px;
}

.paragraph--type--services .st-label::before,
.paragraph--type--services .st-label::after {
  content: '';
  display: inline-block;
  width: 28px;
  height: 2px;
  background: var(--st-label-color);
}

.paragraph--type--services .st-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--st-title-color);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.paragraph--type--services .st-title span {
  color: var(--st-orange);
}

.paragraph--type--services .st-subtitle {
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--st-subtitle-color);
  line-height: 1.7;
  margin-bottom: 0;
}

/* ==========================================================================
   5. Card grid — mobile base: single column
   ========================================================================== */

.paragraph--type--services .st-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* ==========================================================================
   6. Card — mobile base
   ========================================================================== */

.paragraph--type--services .st-card {
  background: var(--st-card-bg);
  border: 1px solid var(--st-card-border);
  box-shadow: var(--st-card-shadow);
  padding: 28px 24px 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
  cursor: pointer;
}

/* Left accent bar — revealed on hover */
.paragraph--type--services .st-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.3s ease;
}

.paragraph--type--services .st-card:hover {
  border-color: var(--st-card-border-hover);
  background: var(--st-card-bg-hover);
  box-shadow: var(--st-card-shadow-hover);
  transform: translateY(-3px);
}

.paragraph--type--services .st-card:hover::after {
  background: var(--st-orange);
}

.paragraph--type--services .st-card:hover .st-card__arrow {
  transform: translateX(4px);
  color: var(--st-orange);
}

/* ── Card icon ────────────────────────────────────────────────────────── */
.paragraph--type--services .st-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--st-orange-dim);
  border: 1px solid var(--st-orange-border);
  color: var(--st-orange);
  flex-shrink: 0;
}

.paragraph--type--services .st-card__icon svg {
  width: 22px;
  height: 22px;
}

/* ── Card title ───────────────────────────────────────────────────────── */
.paragraph--type--services .st-card__title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.0625rem !important;
  font-weight: 500;
  color: var(--st-card-title-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
  margin: 0;
}

/* ── Card description ─────────────────────────────────────────────────── */
.paragraph--type--services .st-card__desc {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--st-card-desc-color);
  line-height: 1.65;
  flex-grow: 1;
  margin: 0;
}

/* ── Card footer link ─────────────────────────────────────────────────── */
.paragraph--type--services .st-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--st-card-link-color);
  margin-top: auto;
  padding-top: 8px;
  transition: color 0.25s ease;
}

.paragraph--type--services .st-card:hover .st-card__link {
  color: var(--st-orange);
}

.paragraph--type--services .st-card__arrow {
  transition: transform 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   7. Section CTA — mobile base
   ========================================================================== */

.paragraph--type--services .st-cta-wrap {
  text-align: center;
  margin-top: 40px;
}

.paragraph--type--services .st-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--st-cta-color);
  text-decoration: none;
  border: 1px solid var(--st-cta-border);
  padding: 12px 28px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.paragraph--type--services .st-cta svg {
  transition: transform 0.25s ease;
}

.paragraph--type--services .st-cta:hover {
  border-color: var(--st-orange);
  color: var(--st-orange);
  background: var(--st-orange-dim);
}

.paragraph--type--services .st-cta:hover svg {
  transform: translateX(4px);
}

/* ==========================================================================
   8. Responsive — mobile-first breakpoints
   ========================================================================== */

/* ≥ 600px — Tablet: 2 columns */
@media (min-width: 600px) {
  .paragraph--type--services {
    padding: 72px 0 80px;
  }

  .paragraph--type--services .st-container {
    /*padding: 0 24px;*/
  }

  .paragraph--type--services .st-header {
    margin-bottom: 48px;
  }

  .paragraph--type--services .st-title {
    font-size: 2.125rem;
  }

  .paragraph--type--services .st-subtitle {
    font-size: 1rem;
  }

  .paragraph--type--services .st-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .paragraph--type--services .st-card {
    padding: 32px 28px 28px;
    gap: 16px;
  }

  .paragraph--type--services .st-card__title {
    font-size: 1.125rem;
  }

  .paragraph--type--services .st-card__desc {
    font-size: 0.94rem;
  }

  .paragraph--type--services .st-cta-wrap {
    margin-top: 48px;
  }

  .paragraph--type--services .st-cta {
    padding: 14px 32px;
  }
}

/* ≥ 992px — Desktop: 3 columns, bottom row centred */
@media (min-width: 992px) {
  .paragraph--type--services {
    padding: 90px 0 100px;
  }

  .paragraph--type--services .st-header {
    margin-bottom: 64px;
  }

  .paragraph--type--services .st-title {
    font-size: clamp(2.125rem, 4vw, 2.625rem);
  }

  .paragraph--type--services .st-subtitle {
    font-size: 1rem;
  }

  .paragraph--type--services .st-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Centre the bottom row (cards 4 & 5) */
  .paragraph--type--services .st-grid .st-card:nth-child(4) {
    grid-column: 1 / 2;
  }
  .paragraph--type--services .st-grid .st-card:nth-child(5) {
    grid-column: 2 / 3;
  }

  .paragraph--type--services .st-card {
    padding: 36px 32px 32px;
    font-size: 1rem;
  }

  .paragraph--type--services .st-cta-wrap {
    margin-top: 56px;
  }
}

/* ==========================================================================
   9. Hover top variant
   Applied when field_hover_effect_style_variant = hover_top.
   Replaces the left ::after bar with a top border accent.
   ========================================================================== */

.paragraph--type--services--hover-top .st-card {
  border-top: 3px solid transparent;
  transition:
    border-top-color 0.3s ease,
    border-color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

/* ==========================================================================
   10. 4-column grid variant
   Applied when field_columns_per_row = 4.
   ========================================================================== */

@media (min-width: 992px) {
  .paragraph--type--services .st-grid--cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Reset the bottom-row centring rules that target a 3-col layout */
  .paragraph--type--services .st-grid--cols-4 .st-card:nth-child(4),
  .paragraph--type--services .st-grid--cols-4 .st-card:nth-child(5) {
    grid-column: auto;
  }
}

/* Suppress the left accent bar for this variant */
.paragraph--type--services--hover-top .st-card::after {
  display: none;
}

.paragraph--type--services--hover-top .st-card:hover {
  border-top-color: var(--st-orange);
  transform: translateY(-2px);
}

/* ── Static (non-linked) card — disable interactive styles ────────────── */
.paragraph--type--services .st-card--static {
  cursor: default;
  pointer-events: none;
}

.paragraph--type--services .st-card--static:hover {
  border-color: var(--st-card-border);
  background: var(--st-card-bg);
  box-shadow: var(--st-card-shadow);
  transform: none;
}

.paragraph--type--services .st-card--static::after {
  display: none;
}

.paragraph--type--services--hover-top .st-card--static:hover {
  border-top-color: transparent;
  transform: none;
}

.paragraph--type--services a.paragraph__card p {
  font-size: 0.875rem;
  font-weight: 300;
  color: rgba(13, 31, 53, .58);
  line-height: 1.65;
  flex-grow: 1;
}

.paragraph--type--services--dark.paragraph--type--services a.paragraph__card p {
  color: #ffffff8c;
}

.paragraph--type--services a.paragraph__card li {
  font-size: 13px;
  color: rgba(13, 31, 53, .50);
  display: flex;
  align-items: center;
  gap: 8px;
}

.paragraph--type--services a.paragraph__card li::before {
  content: '';
  width: 4px;
  height: 4px;
  background: #ff5c00;
  border-radius: 50%;
  flex-shrink: 0;
}

.paragraph--type--services a.paragraph__card ul {
  padding-left: 0;
}

/* ==========================================================================
   11. UL divider — shown in 3-col layout, hidden in 4-col
   Mirrors the sl-cap-card__list separator from the maintenance mockup.
   ========================================================================== */

.paragraph--type--services .st-grid--cols-3 .st-card ul {
  border-top: 1px solid rgba(13, 31, 53, .06);
  margin-top: 4px;
  padding-top: 12px;
}

/* Dark variant — use a light rule on the dark background */
.paragraph--type--services--dark .st-grid--cols-3 .st-card ul {
  border-top-color: rgba(255, 255, 255, .08);
}

/* 4-col layout — no divider, tighter cards benefit from the extra space */
.paragraph--type--services .st-grid--cols-4 .st-card ul {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}
