/* ==========================================================================
   Denty — About the clinic
   Centered editorial statement (heading + one sentence) on a narrower
   measure than the section itself, then a bento-style photo gallery below:
   a wide carousel card (interior shots), two stacked square cards, and one
   tall portrait card — sizes/ratios/gap matched to the reference layout.
   Reveals as one staggered group via [data-reveal] (same mechanism as
   .closing) — see js/scroll-reveal.js. Carousel behavior: js/about-carousel.js.
   ========================================================================== */

.about {
  width: 100%;
  padding-inline: var(--container-padding);
  /* ~5.3cm — the gap the cards need to read as "done" before a new
     section starts; .services no longer carries its own margin-bottom
     (see services.css) so this is the sole source of that gap, not a
     margin-collapse sum of the two. */
  margin-top: 200px;
}

.about-inner {
  max-width: var(--container-width);
  margin-inline: auto;
  text-align: center;
}

.about-title {
  max-width: 780px;
  margin-inline: auto;
  font-family: var(--font-heading);
  font-size: clamp(46px, 5.6vw, 84px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #101828;
}

.about-title .accent {
  color: var(--color-primary);
}

.about-text {
  max-width: 640px;
  margin-inline: auto;
  /* ~2cm below the heading. */
  margin-top: 76px;
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.65;
  color: var(--color-secondary);
}

/* ------------------------------------------------------------ Gallery -- */

.about-gallery {
  /* ~4.4cm below the description. */
  margin-top: 168px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  gap: 12px;
  aspect-ratio: 41 / 20;
}

.about-gallery-item {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #eef3fb 0%, #e6edf9 45%, #dbe6f8 100%);
}

.about-gallery-item--lobby {
  grid-column: 1;
  grid-row: 1 / 3;
}

.about-gallery-item--tech {
  grid-column: 2;
  grid-row: 1;
}

.about-gallery-item--quality {
  grid-column: 2;
  grid-row: 2;
}

.about-gallery-item--comfort {
  grid-column: 3;
  grid-row: 1 / 3;
}

.about-gallery-photo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(1, 104, 255, 0.22);
}

.about-gallery-photo svg {
  width: 40px;
  height: 40px;
}

/* The real-photo counterpart to .about-gallery-photo — same fill-the-card
   footprint, add this class to the <img> the placeholder comments point to
   and remove the .about-gallery-photo div it replaces. */
.about-gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-gallery-caption {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--color-white);
  text-align: left;
}

/* Static (non-carousel) cards: the caption doubles as the scrim + its own
   absolute position. */
.about-gallery-item > .about-gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 24px 18px;
  background: linear-gradient(180deg, rgba(15, 26, 45, 0) 0%, rgba(15, 26, 45, 0.55) 100%);
}

/* ----------------------------------------------------------- Carousel -- */

.about-carousel {
  position: absolute;
  inset: 0;
}

/* A real horizontal scroller, not a JS crossfade — lets the user drag/swipe
   through the photos by hand (trackpad, touch) in addition to the arrows
   and dots, which just scroll it programmatically to the same snap points. */
.about-carousel-track {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.about-carousel-track::-webkit-scrollbar {
  display: none;
}

.about-carousel-slide {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.about-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-dark);
  cursor: pointer;
  opacity: 0;
  box-shadow: 0 4px 14px rgba(15, 26, 45, 0.16);
  transition: opacity 220ms ease, background 200ms ease;
}

.about-carousel-arrow svg {
  width: 18px;
  height: 18px;
}

.about-carousel-arrow--prev {
  left: 16px;
}

.about-carousel-arrow--next {
  right: 16px;
}

.about-carousel:hover .about-carousel-arrow {
  opacity: 1;
}

.about-carousel-arrow:hover {
  background: var(--color-white);
}

.about-carousel-arrow[hidden] {
  display: none;
}

.about-carousel-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 24px 18px;
  background: linear-gradient(180deg, rgba(15, 26, 45, 0) 0%, rgba(15, 26, 45, 0.55) 100%);
}

.about-carousel-dots {
  display: flex;
  gap: 6px;
}

.about-carousel-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: width 250ms ease, background 250ms ease;
}

.about-carousel-dot.is-active {
  width: 18px;
  background: var(--color-white);
}

@media (prefers-reduced-motion: reduce) {
  .about-carousel-track {
    scroll-behavior: auto;
  }
}

/* ================================================================== */
/* Responsive                                                          */
/* ================================================================== */

@media (max-width: 1240px) {
  .about {
    margin-top: 160px;
  }

  .about-text {
    margin-top: 60px;
  }

  .about-gallery {
    margin-top: 130px;
  }
}

@media (max-width: 860px) {
  .about {
    margin-top: 120px;
  }

  .about-text {
    margin-top: 44px;
  }

  /* Bento row-spans get cramped once columns are this narrow — collapse to
     a simpler 2-col layout where each card owns its own aspect-ratio
     instead of relying on the container's overall ratio + row spans. */
  .about-gallery {
    margin-top: 90px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    aspect-ratio: auto;
    gap: 10px;
  }

  .about-gallery-item--lobby {
    grid-column: 1 / 3;
    grid-row: 1;
    aspect-ratio: 16 / 10;
  }

  .about-gallery-item--tech {
    grid-column: 1;
    grid-row: 2;
    aspect-ratio: 1 / 1;
  }

  .about-gallery-item--quality {
    grid-column: 2;
    grid-row: 2;
    aspect-ratio: 1 / 1;
  }

  .about-gallery-item--comfort {
    grid-column: 1 / 3;
    grid-row: 3;
    aspect-ratio: 16 / 9;
  }

  .about-gallery-item {
    border-radius: 16px;
  }

  .about-gallery-caption,
  .about-carousel-footer {
    font-size: 15px;
  }

  .about-gallery-item > .about-gallery-caption,
  .about-carousel-footer {
    padding: 16px 18px 14px;
  }

  /* No hover on touch — keep the arrows visible rather than undiscoverable. */
  .about-carousel-arrow {
    opacity: 1;
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 560px) {
  .about {
    margin-top: 90px;
  }

  .about-text {
    margin-top: 36px;
  }

  .about-gallery {
    margin-top: 64px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .about-gallery-item--lobby,
  .about-gallery-item--tech,
  .about-gallery-item--quality,
  .about-gallery-item--comfort {
    grid-column: 1;
  }

  .about-gallery-item--lobby {
    grid-row: 1;
    aspect-ratio: 4 / 3;
  }

  .about-gallery-item--tech {
    grid-row: 2;
    aspect-ratio: 16 / 10;
  }

  .about-gallery-item--quality {
    grid-row: 3;
    aspect-ratio: 16 / 10;
  }

  .about-gallery-item--comfort {
    grid-row: 4;
    aspect-ratio: 4 / 3;
  }
}
