/* Central Idaho Wellness Center — shared site styles */

:root {
  --color-primary: #385848;
  --color-secondary: #65a397;
  --color-accent: #8db98a;
  --color-ink: #0e182c;
  --radius-button: 2px;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #b7c4bc; border-radius: 4px; }

.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.fade-in { transform: translateY(18px); filter: blur(3px); }
.fade-in.animate { opacity: 1; transform: translateY(0); filter: blur(0); }

.slide-up { transform: translateY(32px); }

/* Homepage service tiles — always visible; no scroll-animation dependency */
.service-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.service-tile {
  position: relative;
  display: block;
  min-height: 220px;
  height: 220px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  opacity: 1;
  background: #0e182c;
}
.service-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
  transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}
.service-tile-copy {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  background: linear-gradient(to top, rgba(14, 24, 44, 0.92) 0%, rgba(14, 24, 44, 0.25) 55%, transparent 100%);
}
.service-tile-copy h3 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  color: #fff;
}
.service-tile-copy p {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
  max-width: 36ch;
}
@media (min-width: 768px) {
  .service-tiles {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 380px;
  }
  .service-tile {
    min-height: 0;
    height: 100%;
  }
  .service-tile-copy {
    padding: 1.5rem;
  }
  .service-tile-copy h3 {
    font-size: 1.5rem;
  }
  .service-tile-copy p {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.45s ease, max-height 0.45s ease;
  }
  .service-tile:hover img,
  .service-tile:focus-visible img {
    transform: scale(1.05);
  }
  .service-tile:hover .service-tile-copy p,
  .service-tile:focus-visible .service-tile-copy p {
    opacity: 1;
    max-height: 6rem;
  }
}
.slide-up.animate { opacity: 1; transform: translateY(0); }
.scale-in { transform: scale(1.04); }
.scale-in.animate { opacity: 1; transform: scale(1); }
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* Service page hero — subtle entrance + slow ken-burns */
.service-hero-media img {
  transform: scale(1.04);
  transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s ease;
}
.service-hero.is-ready .service-hero-media img {
  transform: scale(1);
}
.service-hero-copy > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.service-hero.is-ready .service-hero-copy > *:nth-child(1) { transition-delay: 0.08s; }
.service-hero.is-ready .service-hero-copy > *:nth-child(2) { transition-delay: 0.16s; }
.service-hero.is-ready .service-hero-copy > *:nth-child(3) { transition-delay: 0.24s; }
.service-hero.is-ready .service-hero-copy > *:nth-child(4) { transition-delay: 0.32s; }
.service-hero.is-ready .service-hero-copy > *:nth-child(5) { transition-delay: 0.4s; }
.service-hero.is-ready .service-hero-copy > * {
  opacity: 1;
  transform: translateY(0);
}

/* Content media — soft hover zoom, consistent crop */
.media-frame {
  position: relative;
  overflow: hidden;
}
.media-frame > img {
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
@media (hover: hover) and (pointer: fine) {
  .media-frame:hover > img {
    transform: scale(1.03);
  }
}

/* Primary CTA band — full-width phone button on small screens */
.cta-band-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}
.cta-band-actions > a {
  justify-content: center;
  text-align: center;
}
@media (min-width: 768px) {
  .cta-band-actions {
    flex-direction: row;
    width: auto;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll,
  .fade-in,
  .slide-up,
  .scale-in,
  .service-hero-media img,
  .service-hero-copy > *,
  .media-frame > img {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  .service-hero.is-ready .service-hero-copy > * {
    transition-delay: 0s !important;
  }
}

.services-dropdown {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  visibility: hidden;
  transition: all 0.2s ease-out;
}
.services-menu:hover .services-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.flex-card {
  flex: 1;
  transition: flex 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
@media (hover: hover) and (pointer: fine) and (min-width: 769px) {
  .flex-card:hover { flex: 2.4; }
}

.faq-item[open] summary iconify-icon { transform: rotate(45deg); }
.faq-item summary::-webkit-details-marker { display: none; }

.hero-wash {
  background:
    linear-gradient(105deg, rgba(14, 24, 44, 0.88) 0%, rgba(40, 54, 24, 0.55) 48%, rgba(14, 24, 44, 0.25) 100%);
}

/* Avoid layout jump while chrome loads */
[data-include="header"]:empty {
  min-height: 7.5rem;
}
@media (min-width: 640px) {
  [data-include="header"]:empty {
    min-height: 9.25rem;
  }
}

/* Services explore carousel — continuous photo rail */
.services-carousel-viewport {
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.services-carousel-track {
  display: flex;
  gap: 0.75rem;
  width: max-content;
  will-change: transform;
}
.services-carousel-track.is-ready {
  animation: services-carousel-scroll var(--carousel-duration, 90s) linear infinite;
}
.services-carousel-viewport:hover .services-carousel-track.is-ready,
.services-carousel-viewport:focus-within .services-carousel-track.is-ready {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  .services-carousel-track.is-ready {
    animation: none;
  }
  .services-carousel-viewport {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    mask-image: none;
    -webkit-mask-image: none;
  }
}
@keyframes services-carousel-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.services-carousel-slide {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: min(78vw, 300px);
  height: 240px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
}
@media (min-width: 768px) {
  .services-carousel-slide {
    width: 320px;
    height: 260px;
  }
}
.services-carousel-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1), filter 0.4s ease;
  filter: brightness(0.7);
}
.services-carousel-slide img.is-contain {
  object-fit: contain;
  object-position: center;
  filter: none;
  background: #0e182c;
  padding: 1rem;
}
.services-carousel-overlay {
  position: absolute;
  inset: 0;
  background: rgba(101, 163, 151, 0.4);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}
.services-carousel-slide:hover img,
.services-carousel-slide:focus-visible img {
  transform: scale(1.05);
  filter: brightness(0.85);
}
.services-carousel-slide:hover .services-carousel-overlay,
.services-carousel-slide:focus-visible .services-carousel-overlay {
  opacity: 1;
}
.services-carousel-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.35rem 1.4rem 1.4rem;
  z-index: 2;
  background: linear-gradient(to top, rgba(14, 24, 44, 0.92) 0%, rgba(14, 24, 44, 0.35) 70%, transparent 100%);
}
.services-carousel-copy strong {
  display: block;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.25;
}
.services-carousel-copy p {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.82);
  max-width: 22ch;
}
.services-carousel-slide:focus-visible {
  outline: 2px solid #65a397;
  outline-offset: 3px;
}

/* Mobile / consistency helpers */
@media (max-width: 640px) {
  .service-hero .service-hero-copy h1 {
    font-size: 2.125rem;
    line-height: 1.12;
  }
  .service-hero .service-hero-copy p.text-lg {
    font-size: 1.05rem;
  }
}

/* Sticky header: keep mega-menu inside viewport on mid-width desktops */
@media (min-width: 1024px) and (max-width: 1180px) {
  .services-dropdown {
    width: min(840px, calc(100vw - 3rem));
  }
}

/* Blog article prose */
.prose-ciw > * + * { margin-top: 1.15rem; }
.prose-ciw h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.65rem;
  font-weight: 600;
  color: #385848;
  letter-spacing: -0.02em;
  margin-top: 2.5rem;
  line-height: 1.25;
}
.prose-ciw h3 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.3rem;
  font-weight: 500;
  color: #385848;
  margin-top: 2rem;
  line-height: 1.3;
}
.prose-ciw h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #385848;
  margin-top: 1.5rem;
}
.prose-ciw p {
  color: rgba(56, 88, 72, 0.78);
  font-size: 1.05rem;
  line-height: 1.75;
}
.prose-ciw ul {
  list-style: disc;
  padding-left: 1.25rem;
  color: rgba(56, 88, 72, 0.78);
  font-size: 1.05rem;
  line-height: 1.7;
}
.prose-ciw li + li { margin-top: 0.4rem; }
.prose-ciw strong { color: #385848; font-weight: 600; }
