/* ==========================================================================
   Service Pages — Sticky Layout, Info Box, SEO Chips, Scroll Animations
   Loaded conditionally on is_singular('atehad_service') and taxonomy pages.
   All colours via CSS vars (never hardcoded hex).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Sticky 2-column wrapper
   Left: sticky image panel  |  Right: scrolling info box
   -------------------------------------------------------------------------- */
.atehad-svc-body {
  max-width: var(--atehad-page);
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.atehad-svc-sticky-wrap {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 40px;
  align-items: start; /* Critical — prevents equal-height stretch that breaks sticky */
}

/* --------------------------------------------------------------------------
   Left sticky panel
   -------------------------------------------------------------------------- */
.atehad-svc-sticky-left {
  position: sticky;
  top: calc(var(--atehad-nav-h, 76px) + 20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.atehad-svc-media {
  position: relative;
  border-radius: var(--atehad-radius-lg);
  overflow: hidden;
  background: var(--atehad-canvas-soft);
  aspect-ratio: 4 / 3;
  box-shadow:
    0 2px 8px rgba(56, 80, 102, .08),
    0 8px 32px rgba(56, 80, 102, .10);
  will-change: transform; /* composited layer for JS parallax */
}

.atehad-svc-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s cubic-bezier(.22, 1, .36, 1);
}

.atehad-svc-media:hover img {
  transform: scale(1.03);
}

/* Group badge overlaid on the image */
.atehad-svc-group-badge {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: var(--atehad-primary);
  color: var(--atehad-on-primary-btn, #11110d);
  font-size: .78rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: var(--atehad-pill);
  letter-spacing: .02em;
  backdrop-filter: blur(4px);
}

/* Quick trust card below the image */
.atehad-svc-trust-card {
  background: var(--atehad-canvas);
  border: 1px solid var(--atehad-line);
  border-radius: var(--atehad-radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.atehad-svc-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  color: var(--atehad-body);
  font-weight: 600;
}

.atehad-svc-trust-item .atehad-icon {
  width: 18px;
  height: 18px;
  color: var(--atehad-primary);
  flex-shrink: 0;
}

/* Left CTA buttons */
.atehad-svc-left-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   Right scrolling column
   -------------------------------------------------------------------------- */
.atehad-svc-scroll-right {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* --------------------------------------------------------------------------
   Service Info Box — the main card
   -------------------------------------------------------------------------- */
/* Info box is always visible — only child sections animate in */
.atehad-svc-info-box,
.atehad-svc-seo-block {
  opacity: 1 !important;
  transform: none !important;
}

.atehad-svc-info-box {
  background: var(--atehad-canvas);
  border: 1px solid var(--atehad-line);
  border-radius: var(--atehad-radius-xl);
  padding: 36px 40px 32px;
  box-shadow:
    0 2px 8px rgba(56, 80, 102, .06),
    0 16px 48px rgba(56, 80, 102, .08);
  position: relative;
  overflow: hidden;
}

/* Gold top accent bar */
.atehad-svc-info-box::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--atehad-primary) 0%, var(--atehad-primary-dark) 100%);
  border-radius: 0 2px 2px 0;
}

.atehad-svc-info-box-header {
  margin-bottom: 20px;
}

.atehad-svc-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--atehad-primary-pale, #fff0cc);
  color: var(--atehad-primary-dark);
  font-size: .78rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: var(--atehad-pill);
  margin-bottom: 14px;
  letter-spacing: .02em;
}

.atehad-svc-info-box h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--atehad-ink-deep);
  line-height: 1.3;
  margin: 0 0 12px;
}

.atehad-svc-short-desc {
  font-size: 1rem;
  color: var(--atehad-body);
  line-height: 1.75;
  margin: 0;
}

/* Divider */
.atehad-svc-divider {
  border: none;
  border-top: 1px solid var(--atehad-line);
  margin: 24px 0;
}

/* Features list */
.atehad-svc-features-title {
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--atehad-mute);
  text-transform: uppercase;
  margin: 0 0 14px;
}

.atehad-svc-features-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.atehad-svc-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .9rem;
  color: var(--atehad-ink);
  font-weight: 600;
  line-height: 1.55;
}

.atehad-svc-features-list li::before {
  content: '';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background-color: var(--atehad-primary);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

/* Info articles (ما هي / متى تحتاجها / المخرجات) */
.atehad-svc-articles {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.atehad-svc-article {
  padding: 20px 0;
  border-bottom: 1px solid var(--atehad-line);
}

.atehad-svc-article:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.atehad-svc-article h2 {
  font-size: .95rem;
  font-weight: 800;
  color: var(--atehad-ink-deep);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.atehad-svc-article h2::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--atehad-primary);
  flex-shrink: 0;
}

.atehad-svc-article p {
  font-size: .88rem;
  color: var(--atehad-body);
  line-height: 1.7;
  margin: 0;
}

.atehad-svc-article ol,
.atehad-svc-article ul {
  font-size: .88rem;
  color: var(--atehad-body);
  line-height: 1.7;
  margin: 6px 0 0;
  padding-inline-start: 1.4em;
}

.atehad-svc-article li {
  margin-bottom: 4px;
}

.atehad-svc-article strong {
  color: var(--atehad-ink-deep);
  font-weight: 700;
}

/* WordPress editor body content */
.atehad-svc-editor-content {
  font-size: .92rem;
  color: var(--atehad-body);
  line-height: 1.8;
}

.atehad-svc-editor-content h2,
.atehad-svc-editor-content h3 {
  color: var(--atehad-ink-deep);
  font-weight: 800;
}

.atehad-svc-editor-content ul,
.atehad-svc-editor-content ol {
  padding-inline-start: 20px;
}

/* --------------------------------------------------------------------------
   SEO Keywords Block (bottom box — plain text tags, no buttons)
   -------------------------------------------------------------------------- */
.atehad-svc-seo-block {
  border-top: 1px solid var(--atehad-line);
  padding: 16px 0 0;
}

.atehad-svc-keywords-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.atehad-svc-keyword-chip {
  display: inline;
  color: var(--atehad-mute);
  font-size: .78rem;
  font-weight: 500;
  cursor: default;
  user-select: text;
  pointer-events: none;
}

.atehad-svc-keywords-cloud li::after {
  content: ' ·';
  color: var(--atehad-line-strong);
  margin-left: 2px;
}

.atehad-svc-keywords-cloud li:last-child::after {
  content: '';
}

/* --------------------------------------------------------------------------
   Inline keywords strip inside the info box content area
   -------------------------------------------------------------------------- */
.atehad-svc-inline-keywords {
  padding: 12px 0 4px;
}

.atehad-svc-inline-keywords-text {
  margin: 0;
  font-size: .8rem;
  font-weight: 500;
  color: var(--atehad-mute);
  line-height: 1.9;
  word-spacing: .05em;
}

/* --------------------------------------------------------------------------
   Info Box CTA row
   -------------------------------------------------------------------------- */
.atehad-svc-info-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Breadcrumb enhancements (builds on existing .atehad-breadcrumb)
   -------------------------------------------------------------------------- */
.atehad-breadcrumb--service {
  background: var(--atehad-canvas-soft);
  border-bottom: 1px solid var(--atehad-line);
  padding: 14px 0;
}

.atehad-breadcrumb--service .atehad-breadcrumb {
  margin: 0 auto;
}

/* Schema-invisible but accessible */
.atehad-breadcrumb [aria-hidden="true"] {
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Scroll-reveal animation classes
   Applied by services.js IntersectionObserver
   -------------------------------------------------------------------------- */
/* atehad.css applies filter:blur(6px) + opacity:0 to .atehad-reveal globally.
   On service pages we neutralise that entirely when JS hasn't run yet. */
body.atehad-service-single .atehad-reveal,
body.atehad-projects-page .atehad-reveal {
  filter: none;
  opacity: 1;
  transform: none;
}

/* With JS active: fade+slide animation, zero blur. */
body.atehad-service-single.atehad-js .atehad-reveal,
body.atehad-projects-page.atehad-js .atehad-reveal {
  opacity: 0;
  filter: none;
  transform: translateY(16px);
  transition: opacity .55s cubic-bezier(.22, 1, .36, 1), transform .55s cubic-bezier(.22, 1, .36, 1);
}

body.atehad-service-single.atehad-js .atehad-reveal.is-visible,
body.atehad-projects-page.atehad-js .atehad-reveal.is-visible {
  opacity: 1;
  filter: none;
  transform: translateY(0);
}

body.atehad-service-single.atehad-js .atehad-reveal[data-delay="1"],
body.atehad-projects-page.atehad-js .atehad-reveal[data-delay="1"] { transition-delay: 80ms; }

body.atehad-service-single.atehad-js .atehad-reveal[data-delay="2"],
body.atehad-projects-page.atehad-js .atehad-reveal[data-delay="2"] { transition-delay: 160ms; }

body.atehad-service-single.atehad-js .atehad-reveal[data-delay="3"],
body.atehad-projects-page.atehad-js .atehad-reveal[data-delay="3"] { transition-delay: 240ms; }

body.atehad-service-single.atehad-js .atehad-reveal[data-delay="4"],
body.atehad-projects-page.atehad-js .atehad-reveal[data-delay="4"] { transition-delay: 320ms; }

/* --------------------------------------------------------------------------
   Group taxonomy page — breadcrumb bar
   -------------------------------------------------------------------------- */
.atehad-group-breadcrumb-bar {
  background: var(--atehad-canvas-soft);
  border-bottom: 1px solid var(--atehad-line);
  padding: 14px 0;
}

/* --------------------------------------------------------------------------
   Group page — service block (replaces existing minimal styling)
   -------------------------------------------------------------------------- */
.atehad-group-service-block {
  background: var(--atehad-canvas);
  border: 1px solid var(--atehad-line);
  border-radius: var(--atehad-radius-xl);
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 0 2px 8px rgba(56, 80, 102, .06);
  transition: box-shadow .2s ease;
}

.atehad-group-service-block:hover {
  box-shadow: 0 4px 24px rgba(56, 80, 102, .12);
}

.atehad-group-service-header {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
}

.atehad-group-service-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--atehad-canvas-soft);
}

.atehad-group-service-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1);
}

.atehad-group-service-block:hover .atehad-group-service-img img {
  transform: scale(1.04);
}

.atehad-group-service-intro {
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.atehad-group-service-intro h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--atehad-ink-deep);
  line-height: 1.35;
}

.atehad-group-service-intro h2 a {
  color: inherit;
  text-decoration: none;
}

.atehad-group-service-intro h2 a:hover {
  color: var(--atehad-primary-dark);
}

.atehad-group-service-desc {
  font-size: .88rem;
  color: var(--atehad-body);
  line-height: 1.65;
  margin: 0;
}

.atehad-group-service-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 800;
  color: var(--atehad-primary-dark);
  text-decoration: none;
  margin-top: 4px;
}

.atehad-group-service-cta:hover {
  color: var(--atehad-primary);
}

.atehad-group-service-articles {
  padding: 20px 28px 0;
  border-top: 1px solid var(--atehad-line);
}

.atehad-group-articles-title {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--atehad-mute);
  text-transform: uppercase;
  margin: 0 0 14px;
}

.atehad-group-service-footer {
  padding: 16px 28px 22px;
  border-top: 1px solid var(--atehad-line);
}

.atehad-group-all-articles-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 800;
  color: var(--atehad-mute);
  text-decoration: none;
  transition: color .18s;
}

.atehad-group-all-articles-btn:hover {
  color: var(--atehad-primary-dark);
}

/* --------------------------------------------------------------------------
   Responsive: collapse to single column on smaller screens
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .atehad-svc-sticky-wrap {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .atehad-svc-sticky-left {
    position: static; /* remove sticky on mobile */
    top: auto;
  }

  .atehad-svc-media {
    aspect-ratio: 16 / 9;
  }

  .atehad-svc-info-box {
    padding: 24px 20px 20px;
  }

  .atehad-group-service-header {
    grid-template-columns: 1fr;
  }

  .atehad-group-service-img {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 640px) {
  .atehad-svc-body {
    padding: 24px 16px 48px;
  }

  .atehad-svc-info-box {
    padding: 20px 16px 16px;
  }

  .atehad-svc-seo-block {
    padding: 18px 16px;
  }

  .atehad-svc-info-cta {
    flex-direction: column;
  }

  .atehad-svc-info-cta .atehad-btn {
    text-align: center;
    justify-content: center;
  }

  .atehad-group-service-intro {
    padding: 20px 16px 16px;
  }

  .atehad-group-service-articles,
  .atehad-group-service-footer {
    padding-inline: 16px;
  }
}
