/* Shared visual language for the September 2026 architectural refresh.
   Content is visible by default; visuals.js only adds a finite enhancement. */

.visual-service-hero .hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(36px, 5vw, 72px);
}

.visual-hero-copy {
  min-width: 0;
}
.visual-service-hero .hero-title {
  font-size: clamp(34px, 3.65vw, 52px);
  line-height: 1.14;
}
.visual-service-hero .hero-subtitle {
  font-size: 16px;
}
.visual-service-hero .hero-actions {
  flex-wrap: wrap;
  gap: 12px;
}
.visual-service-hero .hero-actions .btn {
  white-space: normal;
  text-align: center;
}

.visual-hero-figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.visual-hero-figure > picture {
  display: block;
}
.visual-hero-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1.05;
  object-fit: cover;
}
.visual-hero-figure figcaption {
  padding: 17px 22px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
}
.visual-hero-figure figcaption span {
  color: var(--color-accent);
}
.visual-hero-figure--office img {
  object-position: 50% 50%;
}
.visual-hero-figure--infrastructure img {
  object-position: 53% 50%;
}

/* A readable sequence, rather than a decorative dashboard or invented metric. */
.visual-process-figure {
  position: relative;
  border: 1px solid var(--color-border);
  padding: clamp(26px, 3vw, 40px);
  border-radius: var(--radius-lg);
}
.visual-process-figure::before {
  content: "";
  display: block;
  width: 62px;
  height: 4px;
  background: var(--color-accent);
  margin-bottom: 26px;
}
.visual-process-figure figcaption {
  padding: 0;
  border: 0;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--color-text-primary);
  max-width: 20ch;
}
.visual-process {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  counter-reset: visual-step;
}
.visual-process li {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
  padding: 0 0 30px;
  min-height: 78px;
  counter-increment: visual-step;
  color: var(--color-text-primary);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
}
.visual-process li::before {
  content: counter(visual-step, decimal-leading-zero);
  color: var(--color-accent);
  font-size: 13px;
  line-height: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.visual-process li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 33px;
  bottom: 9px;
  left: 8px;
  width: 1px;
  background: #b8cbe5;
}
.visual-process li:last-child {
  padding-bottom: 0;
  min-height: 0;
}
.visual-process small {
  display: block;
  margin-top: 5px;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 400;
}

/* Architecture sits at the edge of the masthead. All text has a solid ground. */
body .article-hero,
body .visual-masthead {
  position: relative;
  isolation: isolate;
  background-color: var(--color-bg-alt);
  background-image: url("assets/images/architectural-background.webp");
  background-position: right center;
  background-size: auto 100%;
  background-repeat: no-repeat;
}
body .article-hero::before,
body .visual-masthead::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgb(249 250 252 / 76%);
  pointer-events: none;
}
body .article-hero-inner {
  position: relative;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding-block: 24px;
}
body .article-hero .article-title {
  font-weight: 600;
  letter-spacing: -0.035em;
  font-size: clamp(32px, 3.8vw, 54px);
  line-height: 1.15;
}
body .visual-masthead .hero-inner {
  position: relative;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 40px);
}
.visual-masthead .hero-subtitle {
  margin-bottom: 0;
}

/* Long editorial categories stay inside their column at every text size. */
.blog-reading-list .blog-row-cat {
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
  line-height: 1.4;
}
.blog-reading-list {
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

/* Article templates share buttons but have different CTA containers. */
body .article-content .btn {
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
  min-width: 0;
  text-align: center;
}
body .article-content :not(pre) > code {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  /* Older headers place this action directly beside the mobile menu button. */
  .nav-inner > .btn-nav-cta {
    display: none;
  }

  /* Only unwrapped tables need their own scroll area; existing wrappers retain
     their layout. Minimum cell widths keep comparative data readable. */
  body .article-content > table {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
  }
  body .article-content > table :is(th, td) {
    min-width: 9rem;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .nav-links > li > a {
    position: relative;
  }
  .nav-links > li > a::after {
    content: "";
    position: absolute;
    height: 1px;
    left: 0;
    right: 0;
    bottom: 3px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms var(--ease-out);
  }
  .nav-links > li > a:hover::after {
    transform: scaleX(1);
  }
}

@media (max-width: 1000px) {
  .visual-service-hero .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }
  .visual-service-hero .hero-title {
    max-width: 24ch;
  }
  .visual-hero-figure {
    width: 100%;
  }
  .visual-hero-figure img {
    aspect-ratio: 1.7;
    max-height: 430px;
  }
  .visual-process-figure {
    max-width: 720px;
  }
}

@media (max-width: 767px) {
  .visual-service-hero .hero-title {
    font-size: clamp(30px, 8vw, 36px) !important;
  }
  .visual-service-hero .hero-subtitle {
    font-size: 15px;
  }
  .visual-hero-figure img {
    aspect-ratio: 1.18;
    max-height: none;
  }
  .visual-hero-figure figcaption {
    padding: 14px 18px;
  }
  .visual-process-figure {
    padding: 26px;
  }
  .visual-process-figure figcaption {
    padding: 0;
  }
  .visual-process li {
    font-size: 15px;
  }
  body .article-hero,
  body .visual-masthead {
    background-image: url("assets/images/architectural-background-640.webp");
    background-size: auto 100%;
  }
  body .article-hero-inner {
    padding-block: 22px;
    border-radius: 0;
  }
  body .visual-masthead .hero-inner {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-visual-enter] {
    transform: none !important;
    opacity: 1 !important;
  }
}
