/* Homepage sections under the hero: Where we deliver (map), About Medsure, FAQ */

/* the hero page's body is navy (behind the scroll stage), so the sections bring their own white */
main {
  background: var(--white);
  color: var(--neutral-950);
}

.overline {
  display: block;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 18px;
  line-height: 24px;
  letter-spacing: 0.02em;
  color: var(--navy-920);
  margin-bottom: 24px;
}

.display {
  font-family: "Mona", sans-serif;
  font-weight: normal;
  font-size: clamp(48px, 6.4vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--navy-920);
}

.btn--soft {
  background: var(--neutral-100);
  color: var(--navy-950);
}

.btn--soft:hover {
  background: var(--neutral-200);
}

.btn--soft svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  transition: rotate 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn--soft:hover svg {
  rotate: 90deg;
}

/* (text reveal styles live in base.css, shared with Our services) */

/* ---------- Where we deliver ---------- */
.where {
  background: var(--neutral-50);
  padding: 80px 0 120px;
}

.where__title {
  max-width: 1100px;
}

.where__card {
  display: grid;
  grid-template-columns: 340px 1fr;
  margin-top: 56px;
  background: var(--white);
  border-radius: 24px;
  overflow: hidden;
}

.where__side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  padding: 48px 40px;
  border-right: 1px solid var(--neutral-100);
}

.where__label {
  margin-bottom: 16px;
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neutral-300);
}

.where__legend li,
.where__routes li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  line-height: 20px;
}

.where__legend li + li,
.where__routes li + li {
  margin-top: 12px;
}

.where__swatch {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--orange-500);
}

.where__swatch--home {
  border-radius: 50%;
  background: var(--navy-950);
  box-shadow: 0 0 0 3px var(--orange-50), 0 0 0 4px var(--orange-500);
}

.where__swatch--soon {
  background: #FFC9A3;
}

.where__routes {
  font-weight: 500;
}

.where__routes li {
  font-size: 20px;
  line-height: 28px;
}

.where__routes small {
  font-size: 13px;
  font-weight: 400;
  color: var(--neutral-300);
}

.where__side .btn {
  margin-top: auto;
}

.where__map {
  position: relative;
  min-width: 0;
}

.where__map svg {
  display: block;
  width: 100%;
  height: auto;
}

.where__map path {
  fill: var(--neutral-100);
  stroke: var(--white);
  stroke-width: 0.8;
  stroke-linejoin: round;
  transition: fill 0.25s;
}

.where__map path.is-active { fill: var(--orange-500); cursor: pointer; }
.where__map path.is-active:hover,
.where__map path.is-active:focus-visible { fill: var(--orange-600); outline: none; }
.where__map path.is-home { fill: var(--orange-700); }
.where__map path.is-soon { fill: #FFC9A3; cursor: pointer; }
.where__map path.is-soon:hover,
.where__map path.is-soon:focus-visible { fill: #FFB07A; outline: none; }

/* routes draw in from the home base once the map is in view */
.where__map path.is-active,
.where__map path.is-soon {
  transition: fill 0.25s, opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s);
}

.reveal-ready .where__map:not(.is-in) path:is(.is-active, .is-soon):not(.is-home) {
  opacity: 0;
}

.where__pin {
  pointer-events: none;
}

.where__pin-dot {
  fill: var(--navy-950);
  stroke: var(--white);
  stroke-width: 3;
}

.where__pin-pulse {
  fill: var(--navy-950);
  transform-box: fill-box;
  transform-origin: center;
  animation: where-pulse 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.where__pin-pulse:nth-of-type(2) {
  animation-delay: 1.2s;
}

@keyframes where-pulse {
  from { opacity: 0.35; transform: scale(1); }
  to { opacity: 0; transform: scale(2.6); }
}

.where__tip {
  position: absolute;
  z-index: 1;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--navy-950);
  color: var(--text-on-navy);
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
  pointer-events: none;
  translate: -50% calc(-100% - 12px);
  opacity: 0;
  transition: opacity 0.15s;
}

.where__tip.is-visible {
  opacity: 1;
}

.where__tip span {
  display: block;
  font-size: 13px;
  color: var(--neutral-200);
}

/* ---------- About Medsure ---------- */
.about {
  padding: 100px 0;
}

/* reference layout: photo column a little narrower than the text, both starting on the same line */
.about__grid {
  display: grid;
  grid-template-columns: 9fr 11fr;
  gap: 120px;
}

/* the text column runs the photos' full height, so the button lines up with the bottom of the last photo */
.about__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.about__body > .btn {
  margin-top: auto;
}

.about .display {
  font-size: clamp(44px, 5.2vw, 76px);
}

/* photos: one wide shot on top; under it the two team shots stacked left, the tall pallets shot right */
.about__media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.about__tile {
  aspect-ratio: 11 / 8;
  border-radius: 24px;
  background: var(--neutral-100);
  overflow: hidden;
}

.about__tile--wide {
  grid-column: 1 / -1;
  aspect-ratio: 10 / 7;
}

.about__tile--tall {
  grid-column: 2;
  grid-row: 2 / 4;
  aspect-ratio: auto;
}

.about__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.about__tile:hover img {
  transform: scale(1.04);
}

.about__text {
  max-width: 600px;
  margin: 28px 0 32px;
  font-size: 16px;
  line-height: 25px;
}

.about__text p + p {
  margin-top: 12px;
}

.about__lead {
  font-size: 21px;
  line-height: 29px;
  font-weight: 500;
}

.about__text .about__lead + p {
  margin-top: 18px;
}

/* ---------- FAQ: accordion rows in the reference's services-list style ---------- */
.faq {
  padding: 100px 0 160px;
}

/* --faq-indent: questions rest indented, and slide back to the container edge when hovered or open */
.faq__list {
  --faq-indent: 56px;
  border-bottom: 1px solid var(--neutral-200);
}

/* hover / keyboard focus (reference services list) and open: the whole item fills navy with the footer's
   faint diagonal lines, rising from the bottom; the question turns light, the + circle orange,
   and when open the answer sits under it in white */
.faq__item {
  position: relative;
  border-top: 1px solid var(--neutral-200);
}

.faq__item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg, rgba(244, 246, 251, 0.04) 0 1px, transparent 1px 32px), var(--navy-900);
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq__item.is-open::before,
.faq__item:has(.faq__q:hover)::before,
.faq__item:has(.faq__q:focus-visible)::before {
  transform: none;
}

/* the h3's default margin moves into the button's padding (+20 px), so the fill covers the whole row */
.faq__item > h3 {
  position: relative;
  margin-block: 0;   /* block only: the h3 is also the .container, centred by margin-inline: auto */
}

.faq__q:focus-visible {
  outline-offset: -2px;
}

/* question on hover / keyboard focus: text turns light over the navy fill and slides to the edge */
.faq__q:hover,
.faq__q:focus-visible {
  color: var(--neutral-200);
}

.faq__item.is-open .faq__q {
  padding-bottom: 28px;   /* the answer sits close under its question */
  color: var(--neutral-200);
}

.faq__q {
  position: relative;
  transition: color 0.35s, padding-bottom 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  width: 100%;
  min-height: 44px;
  padding: 60px 0;
  font: 400 64px/73px var(--font-body);
  text-align: left;
}

.faq__q > span:first-child {
  margin-right: var(--faq-indent);   /* room for the indent, so wrapped text never reaches the icon */
  translate: var(--faq-indent) 0;
  transition: translate 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq__q:hover > span:first-child,
.faq__q:focus-visible > span:first-child,
.faq__q[aria-expanded="true"] > span:first-child {
  translate: 0 0;
}

.faq__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--neutral-100);
  transition: background-color 0.3s, rotate 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq__q:hover .faq__icon,
.faq__q:focus-visible .faq__icon {
  background: var(--orange-500);
  color: var(--navy-950);
}

.faq__icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.faq__q[aria-expanded="true"] .faq__icon {
  background: var(--orange-500);
  color: var(--navy-950);
  rotate: 45deg;
}

.faq__a {
  position: relative;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq__a > div {
  overflow: hidden;
}

.faq__a p {
  max-width: 640px;
  padding-bottom: 56px;
  font-size: 18px;
  line-height: 28px;
  color: var(--text-on-navy);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq__item.is-open .faq__a {
  grid-template-rows: 1fr;
}

.faq__item.is-open .faq__a p {
  opacity: 1;
  transform: none;
  transition-delay: 0.1s;
}

/* ---------- responsive ---------- */
@media (max-width: 1199px) {
  .faq__q {
    font-size: 48px;
    line-height: 56px;
  }
}

@media (max-width: 991px) {
  .where__card {
    grid-template-columns: 1fr;
  }
  .where__side {
    order: 1;
    border-right: 0;
    border-top: 1px solid var(--neutral-100);
    padding: 32px;
  }
  .about__grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .about__media {
    max-width: 640px;
  }
  .faq__list {
    --faq-indent: 32px;
  }
  .faq__q {
    padding: 48px 0;
    font-size: 28px;
    line-height: 32px;
  }
  .faq__icon {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 767px) {
  .where {
    padding: 64px 0 80px;
  }
  .where__card {
    margin-top: 40px;
    border-radius: 16px;
  }
  .where__side {
    padding: 24px;
  }
  .overline {
    font-size: 16px;
  }
  .about {
    padding: 72px 0;
  }
  .about__media {
    gap: 12px;
  }
  .about__text {
    margin: 28px 0;
    font-size: 17px;
    line-height: 26px;
  }
  .about__lead {
    font-size: 20px;
    line-height: 28px;
  }
  .faq {
    padding: 72px 0 96px;
  }
  .faq__list {
    --faq-indent: 16px;
  }
  .faq__q {
    padding: 44px 0;
    font-size: 22px;
    line-height: 28px;
  }
  .faq__a p {
    padding-bottom: 28px;
    font-size: 17px;
    line-height: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .where__pin-pulse {
    animation: none;
    opacity: 0;
  }
  .faq__a,
  .faq__a p,
  .faq__q,
  .faq__item::before,
  .faq__icon,
  .faq__q > span:first-child,
  .about__tile img,
  .btn--soft svg {
    transition: none;
  }
  .faq__q:hover > span:first-child,
  .faq__q:focus-visible > span:first-child,
  .about__tile:hover img {
    translate: none;
    transform: none;
  }
}
