/*
 * Hilltop Brain Injury Services
 * Life Adjustment Program / node 900
 *
 * Designed for Drupal Layout Builder sections using:
 *   Container: Boxed
 *   Gutters: With Gutters
 *
 * The Layout Builder "Boxed" container should control the page width so it
 * matches the current theme. No competing max-width is imposed here.
 */

body.page-node-900 {
  --lap-navy: #15265f;
  --lap-olive: #5b5d20;
  --lap-olive-dark: #484a16;
  --lap-olive-soft: #eff0df;
  --lap-blue-soft: #eef7fc;
  --lap-text: #22252c;
  --lap-muted: #536077;
  --lap-border: #dfe3e8;
  --lap-card: #ffffff;
  --lap-shadow: 0 16px 38px rgba(21, 38, 95, 0.09);
  --lap-radius: 14px;
}

/* Keep custom blocks from inheriting odd theme spacing. */
body.page-node-900 .lap-hero,
body.page-node-900 .lap-pillars,
body.page-node-900 .lap-intro,
body.page-node-900 .lap-gallery-intro,
body.page-node-900 .lap-actions {
  box-sizing: border-box;
  color: var(--lap-text);
}

body.page-node-900 .lap-hero *,
body.page-node-900 .lap-pillars *,
body.page-node-900 .lap-intro *,
body.page-node-900 .lap-gallery-intro *,
body.page-node-900 .lap-actions * {
  box-sizing: border-box;
}

/* Screen-reader-only helper. */
body.page-node-900 .lap-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Reusable type. */
body.page-node-900 .lap-eyebrow {
  margin: 0 0 0.55rem;
  color: var(--lap-olive);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.35;
  text-transform: uppercase;
}

body.page-node-900 .lap-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  margin-top: 0.7rem;
  padding: 0.78rem 1.1rem;
  border: 2px solid var(--lap-olive);
  border-radius: 8px;
  background: var(--lap-olive);
  color: #fff !important;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none !important;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

body.page-node-900 .lap-button:hover {
  border-color: var(--lap-olive-dark);
  background: var(--lap-olive-dark);
  color: #fff !important;
  text-decoration: none !important;
  transform: translateY(-1px);
}

body.page-node-900 .lap-button:focus-visible,
body.page-node-900 .lap-carousel__button:focus-visible,
body.page-node-900 .lap-carousel__track:focus-visible {
  outline: 3px solid #1f6fb2;
  outline-offset: 3px;
}

body.page-node-900 .lap-button--small {
  min-height: 40px;
  margin-top: auto;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
}

/* ---------------------------------------------------------
   HERO
   --------------------------------------------------------- */
body.page-node-900 .lap-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: stretch;
  overflow: hidden;
  margin: 1.5rem 0 0.5rem;
  border: 1px solid var(--lap-border);
  border-radius: var(--lap-radius);
  background:
    linear-gradient(110deg, #fff 0%, #fff 52%, #f6f7f8 100%);
  box-shadow: var(--lap-shadow);
}

body.page-node-900 .lap-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.75rem, 4vw, 3.75rem);
}

body.page-node-900 .lap-hero h2 {
  max-width: 12ch;
  margin: 0 0 0.8rem;
  color: var(--lap-navy);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

body.page-node-900 .lap-hero__lead {
  max-width: 58ch;
  margin: 0;
  color: var(--lap-muted);
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  line-height: 1.7;
}

body.page-node-900 .lap-hero__media {
  min-height: 430px;
}

body.page-node-900 .lap-hero__media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 430px;
  object-fit: cover;
  object-position: center center;
}

/* ---------------------------------------------------------
   CULTURE / FOCUS / 5 THINGS
   --------------------------------------------------------- */
body.page-node-900 .lap-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 1.75rem 0 2.5rem;
  overflow: hidden;
  border: 1px solid var(--lap-border);
  border-radius: var(--lap-radius);
  background: #f8f9fa;
}

body.page-node-900 .lap-pillar {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 1rem;
  padding: clamp(1.3rem, 2.4vw, 2rem);
}

body.page-node-900 .lap-pillar + .lap-pillar {
  border-left: 1px solid var(--lap-border);
}

body.page-node-900 .lap-pillar__icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: #dfe4bd;
  color: var(--lap-olive-dark);
  font-size: 1.2rem;
}

body.page-node-900 .lap-pillar h3 {
  margin: 0 0 0.65rem;
  color: var(--lap-navy);
  font-size: 1.12rem;
  line-height: 1.25;
}

body.page-node-900 .lap-pillar ul {
  margin: 0;
  padding-left: 1.12rem;
}

body.page-node-900 .lap-pillar li {
  margin: 0.22rem 0;
  color: #40495c;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* ---------------------------------------------------------
   DAILY LIFE INTRO
   --------------------------------------------------------- */
body.page-node-900 .lap-intro {
  max-width: 800px;
  padding: clamp(1.5rem, 3vw, 2.4rem) 0 clamp(1.2rem, 2vw, 1.8rem);
}

body.page-node-900 .lap-intro h2,
body.page-node-900 .lap-gallery-intro h2 {
  margin: 0 0 0.55rem;
  color: #15171c;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

body.page-node-900 .lap-intro p,
body.page-node-900 .lap-gallery-intro p {
  max-width: 70ch;
  margin: 0;
  color: var(--lap-muted);
  font-size: 1rem;
  line-height: 1.65;
}

/* ---------------------------------------------------------
   GALLERY HEADINGS
   --------------------------------------------------------- */
body.page-node-900 .lap-gallery-intro {
  padding-top: clamp(1.2rem, 2.5vw, 2rem);
}

body.page-node-900 .lap-note {
  margin-top: 0.65rem !important;
  font-size: 0.9rem !important;
}

/* ---------------------------------------------------------
   EXISTING "IMAGE GALLERY" BLOCKS
   The JS enhancement turns these into accessible, non-autoplay
   carousels. With JS disabled, the native Drupal gallery remains.
   --------------------------------------------------------- */
body.page-node-900 .block-inline-blockmt-image-gallery {
  margin: 1rem 0 clamp(2.4rem, 4vw, 4rem);
}

body.page-node-900 .block-inline-blockmt-image-gallery img {
  max-width: 100%;
  height: auto;
}

/* When JS has built the carousel, hide only the original block content. */
body.page-node-900 .block-inline-blockmt-image-gallery.lap-gallery--enhanced > .content {
  display: none !important;
}

body.page-node-900 .lap-carousel {
  position: relative;
  margin-top: 1rem;
  padding-inline: 3.25rem;
}

body.page-node-900 .lap-carousel__viewport {
  overflow: hidden;
  border-radius: var(--lap-radius);
}

body.page-node-900 .lap-carousel__track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.15rem 0 0.55rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #a3a777 transparent;
  overscroll-behavior-inline: contain;
}

body.page-node-900 .lap-carousel__slide {
  flex: 0 0 calc((100% - 2rem) / 3);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--lap-border);
  border-radius: 12px;
  background: #f2f4f5;
  box-shadow: 0 8px 22px rgba(21, 38, 95, 0.07);
  scroll-snap-align: start;
}

body.page-node-900 .lap-carousel__slide img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
}

body.page-node-900 .lap-carousel__button {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--lap-olive);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    background-color 160ms ease,
    opacity 160ms ease;
}

body.page-node-900 .lap-carousel__button:hover {
  background: var(--lap-olive-dark);
}

body.page-node-900 .lap-carousel__button:disabled {
  opacity: 0.34;
  cursor: default;
}

body.page-node-900 .lap-carousel__button--prev {
  left: 0;
}

body.page-node-900 .lap-carousel__button--next {
  right: 0;
}

body.page-node-900 .lap-carousel__status {
  margin: 0.55rem 0 0;
  color: #6a7180;
  font-size: 0.82rem;
  text-align: center;
}

/* ---------------------------------------------------------
   CTA / ACTION CARDS
   This styles either the existing Icon Features block or
   06-actions-fallback.html.
   --------------------------------------------------------- */
body.page-node-900 .block-inline-blockmt-icon-features,
body.page-node-900 .lap-actions {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  border-radius: var(--lap-radius);
  background: #f2f3f4;
}

body.page-node-900 .block-inline-blockmt-icon-features > .title,
body.page-node-900 .lap-actions > h2 {
  margin: 0 0 1.2rem;
  color: var(--lap-navy);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  text-align: center;
}

body.page-node-900 .block-inline-blockmt-icon-features .field--name-field-mt-if-item {
  align-items: stretch;
}

body.page-node-900 .block-inline-blockmt-icon-features .field--name-field-mt-if-item > .field__item {
  display: flex;
  margin-bottom: 1rem;
}

body.page-node-900 .block-inline-blockmt-icon-features .paragraph--type--mt-icon-features {
  display: flex;
  width: 100%;
  border: 1px solid var(--lap-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(21, 38, 95, 0.05);
}

body.page-node-900 .block-inline-blockmt-icon-features .feature {
  display: flex;
  width: 100%;
  flex-direction: column;
}

body.page-node-900 .block-inline-blockmt-icon-features .feature__icon {
  color: #afb16e;
}

body.page-node-900 .block-inline-blockmt-icon-features .feature__title {
  margin-top: 0.85rem;
  margin-bottom: 0.5rem;
}

body.page-node-900 .block-inline-blockmt-icon-features .feature__title a {
  color: #bb1e64;
}

body.page-node-900 .block-inline-blockmt-icon-features .feature__link {
  margin-top: auto;
  padding-top: 0.75rem;
}

body.page-node-900 .lap-actions__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

body.page-node-900 .lap-action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 1.35rem;
  border: 1px solid var(--lap-border);
  border-radius: 12px;
  background: #fff;
}

body.page-node-900 .lap-action-card__icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 0.7rem;
  place-items: center;
  border-radius: 50%;
  background: var(--lap-olive-soft);
  color: var(--lap-olive);
  font-size: 1.15rem;
}

body.page-node-900 .lap-action-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

body.page-node-900 .lap-action-card h3 a {
  color: #bb1e64;
}

body.page-node-900 .lap-action-card p {
  margin: 0 0 1rem;
  color: var(--lap-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ---------------------------------------------------------
   EXISTING "Resources for Individuals with Brain Injuries"
   This block lives in the theme's Highlighted region, outside
   the Layout Builder node. Give it breathing room without
   changing its content or structure.
   --------------------------------------------------------- */
body.page-node-900 #highlighted {
  border-top: 1px solid #eceeef;
}

body.page-node-900 #highlighted .block > .title {
  color: var(--lap-navy);
}

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 991.98px) {
  body.page-node-900 .lap-hero {
    grid-template-columns: 1fr;
  }

  body.page-node-900 .lap-hero__media,
  body.page-node-900 .lap-hero__media img {
    min-height: 0;
  }

  body.page-node-900 .lap-hero__media img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  body.page-node-900 .lap-pillars {
    grid-template-columns: 1fr;
  }

  body.page-node-900 .lap-pillar + .lap-pillar {
    border-top: 1px solid var(--lap-border);
    border-left: 0;
  }

  body.page-node-900 .lap-carousel__slide {
    flex-basis: calc((100% - 1rem) / 2);
  }

  body.page-node-900 .lap-actions__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  body.page-node-900 .lap-hero {
    margin-top: 1rem;
  }

  body.page-node-900 .lap-hero__copy {
    padding: 1.4rem;
  }

  body.page-node-900 .lap-hero h2 {
    max-width: none;
    font-size: clamp(1.85rem, 9vw, 2.55rem);
  }

  body.page-node-900 .lap-pillar {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 1.2rem;
  }

  body.page-node-900 .lap-pillar__icon {
    width: 42px;
    height: 42px;
  }

  body.page-node-900 .lap-carousel {
    padding-inline: 2.55rem;
  }

  body.page-node-900 .lap-carousel__slide {
    flex-basis: 100%;
  }

  body.page-node-900 .lap-carousel__button {
    width: 38px;
    height: 38px;
  }

  body.page-node-900 .block-inline-blockmt-icon-features,
  body.page-node-900 .lap-actions {
    padding: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-node-900 *,
  body.page-node-900 *::before,
  body.page-node-900 *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
