/* ==========================================================================
   Doors — three photographic entries.

   The card is an <a>, so everything inside it is a span told to behave as a
   block. The scrim is the same exception the hero takes: text sits on a
   photograph and its contrast cannot be left to the photograph.
   ========================================================================== */

.wl-doors__wrap {
  max-width: var(--wl-container-wide);
  margin-inline: auto;
  padding: var(--wl-space-section) var(--wl-gutter);
}

.wl-doors__head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wl-space-md) var(--wl-space-xl);
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--wl-space-2xl);
}

.wl-doors__heading {
  font-family: var(--wl-font-display);
  font-weight: 400;
  font-size: var(--wl-text-3xl);
  line-height: var(--wl-leading-tight);
  letter-spacing: var(--wl-tracking-tight);
  /* On the heading, where `ch` is measured in the font being limited. */
  max-width: 13ch;
}

.wl-doors__intro {
  max-width: 40ch;
  color: var(--wl-ink-soft);
}

.wl-section.is-ink .wl-doors__intro { color: var(--wl-on-ink-soft); }

/* ---- the row ------------------------------------------------------------ */

.wl-doors__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--wl-space-sm);
}

@media (min-width: 46em) {
  .wl-doors__row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- one door ----------------------------------------------------------- */

.wl-door {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  height: clamp(380px, 62vh, 660px);
  background: var(--wl-ink);
  color: var(--wl-on-ink);
  text-decoration: none;
}

.wl-door:focus-visible {
  outline: 3px solid var(--wl-highlight);
  outline-offset: 3px;
}

.wl-door__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 1100ms var(--wl-ease);
}

.wl-door:hover .wl-door__img,
.wl-door:focus-visible .wl-door__img { transform: scale(1.055); }

.wl-door__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgb(0 0 0 / 88%) 0%,
    rgb(0 0 0 / 66%) 32%,
    rgb(0 0 0 / 6%) 62%,
    rgb(0 0 0 / 42%) 100%
  );
}

.wl-door__top {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wl-space-md);
  padding: var(--wl-space-md);
}

/*
 * Where a reference layout would number the cards 01 / 02 / 03, this carries
 * the price band instead. Same column, same weight, but it answers the first
 * question a visitor has rather than counting to three for them.
 */
.wl-door__meta {
  display: flex;
  align-items: center;
  gap: var(--wl-space-sm);
  font-size: var(--wl-text-xs);
  letter-spacing: var(--wl-tracking-wide);
  text-transform: uppercase;
  color: var(--wl-on-ink);
}

.wl-door__meta::after {
  content: "";
  width: clamp(22px, 3vw, 46px);
  height: 1px;
  background: currentcolor;
  opacity: 0.5;
}

.wl-door__go {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid currentcolor;
  border-radius: 50%;
  color: var(--wl-on-ink);
  transition:
    background var(--wl-duration) var(--wl-ease),
    color var(--wl-duration) var(--wl-ease),
    border-color var(--wl-duration) var(--wl-ease);
}

.wl-door:hover .wl-door__go,
.wl-door:focus-visible .wl-door__go {
  background: var(--wl-highlight);
  border-color: var(--wl-highlight);
  color: var(--wl-on-highlight);
}

.wl-door__go svg { transition: transform var(--wl-duration) var(--wl-ease); }

.wl-door:hover .wl-door__go svg,
.wl-door:focus-visible .wl-door__go svg { transform: translate(2px, -2px); }

.wl-door__body {
  position: absolute;
  z-index: 2;
  inset: auto 0 0 0;
  padding: var(--wl-space-lg);
  transform: translateY(0);
  transition: transform 620ms var(--wl-ease);
}

.wl-door:hover .wl-door__body,
.wl-door:focus-visible .wl-door__body { transform: translateY(-8px); }

/* Both are spans inside an <a>, so they need telling to be blocks. */
.wl-door__title {
  display: block;
  font-family: var(--wl-font-display);
  font-weight: 400;
  font-size: var(--wl-text-2xl);
  line-height: var(--wl-leading-tight);
  letter-spacing: var(--wl-tracking-tight);
  text-wrap: balance;
}

.wl-door__note {
  display: block;
  margin-top: var(--wl-space-sm);
  max-width: 30ch;
  font-size: var(--wl-text-sm);
  line-height: 1.5;
  color: var(--wl-on-ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .wl-door__img,
  .wl-door__body,
  .wl-door__go,
  .wl-door__go svg { transition: none; }
}
