/* Final results on the homepage (#results), right after the first screen.
   The doctor's composite photographs (before in black and white, the result in colour) sit in
   one row that scrolls sideways, each with a short caption under it, like prints laid out on a
   table. It is plain on purpose: the page colour, thin captions and the photographs themselves,
   with no glow, gradient or stacked cards. Written with logical properties, so the same rules
   work right to left; this file is not part of the generated rtl.css. */

.finals {
  --finals-height: clamp(330px, 58svh, 540px);
  --finals-edge: max(var(--gutter), calc((100% - 1500px) / 2 + var(--gutter)));
  padding-block: 104px 92px;
  background: var(--page);
}
.finals-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 34px;
}
.finals-kicker {
  margin: 0 0 18px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
.finals-head h2 {
  margin: 0;
  font-size: clamp(42px, 4.4vw, 66px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.06em;
  color: var(--ink);
}
.finals-key {
  margin: 0;
  padding-bottom: 4px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  text-align: end;
}

/* Nose or Ears: a small two-part switch above the filter, in the same sage and dark green as the gallery's group switch. */
.finals-switch {
  margin-bottom: 18px;
}
.finals-areas {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #e8eee6;
  border: 1px solid #d3ddd4;
  border-radius: 999px;
}
.finals-areas button {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  min-width: 112px;
  min-height: 40px;
  padding: 8px 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 999px;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
.finals-areas button > span {
  font-size: 11px;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}
.finals-areas button:hover {
  background: #f3f6f0;
}
.finals-areas button[aria-pressed='true'] {
  color: #fff;
  background: var(--ink);
}
.finals-areas button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Filter on the start side, arrows and count on the end side, over a hairline. */
.finals-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-top: 16px;
  /* The hairline spans the text column only, not the side padding. */
  background: linear-gradient(var(--line), var(--line)) top / 100% 1px no-repeat content-box;
}
.finals-filters {
  display: flex;
  gap: 28px;
}
.finals-filters button {
  position: relative;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  background: none;
  transition: color 0.2s ease;
}
.finals-filters button > span {
  margin-inline-start: 4px;
  font-size: 11px;
  color: #93a08b;
  font-variant-numeric: tabular-nums;
}
.finals-filters button:hover,
.finals-filters button[aria-pressed='true'] {
  color: var(--ink);
}
.finals-filters button[aria-pressed='true']::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: var(--ink);
}
.finals-filters button:focus-visible,
.finals-arrow:focus-visible,
.finals-photo:focus-visible,
.finals-track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.finals-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.finals-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: transparent;
  border: 1px solid #9db5a5;
  border-radius: 50%;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}
.finals-arrow:hover:not(:disabled) {
  background: #e6eee7;
  border-color: var(--accent);
}
.finals-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}
.finals-arrow svg,
.finals-viewer-arrow svg {
  width: 18px;
  height: 18px;
}

/* The row runs to both edges of the window and starts in line with the text above it. */
.finals-track {
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0 var(--finals-edge) 6px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--finals-edge);
  scrollbar-width: none;
}
.finals-track::-webkit-scrollbar {
  display: none;
}
.finals-track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}
.finals-track.is-dragging .finals-photo {
  cursor: grabbing;
}
.finals-item {
  flex: none;
  /* As wide as its photograph; the caption wraps inside that width. */
  width: min-content;
  scroll-snap-align: start;
}
.finals-item[hidden] {
  display: none;
}
.finals-photo {
  display: block;
  padding: 0;
  overflow: hidden;
  background: #0b0d0c;
  border-radius: 4px;
  cursor: zoom-in;
}
.finals-photo img {
  display: block;
  width: auto;
  height: var(--finals-height);
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.25s ease;
}
.finals-photo:hover img {
  opacity: 0.9;
}
.finals-caption {
  display: flex;
  gap: 10px;
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
.finals-number {
  flex: none;
  color: #93a08b;
  font-variant-numeric: tabular-nums;
}
.finals-label {
  color: var(--text);
}
.finals-note {
  margin-top: 26px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---- Full-screen viewer ---------------------------------------------------- */
.finals-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: #e9eee9;
  background: #0c120f;
  border: 0;
}
.finals-viewer::backdrop {
  background: #0c120f;
}
.finals-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.finals-viewer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px clamp(18px, 3vw, 40px);
  font-size: 12px;
  color: #a9b8ad;
  font-variant-numeric: tabular-nums;
}
.finals-viewer-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  color: #e9eee9;
  background: transparent;
  border: 1px solid #ffffff38;
  border-radius: 999px;
}
.finals-viewer-close:hover {
  background: #ffffff12;
}
.finals-viewer-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 0;
  margin: 0;
  padding: 0 88px 26px;
}
.finals-viewer-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100svh - 132px);
  border-radius: 4px;
  user-select: none;
  -webkit-user-drag: none;
}
.finals-viewer-figure figcaption {
  font-size: 13px;
  line-height: 1.5;
  color: #c9d4cc;
}
.finals-viewer-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
  background: #ffffff0d;
  border: 1px solid #ffffff3d;
  border-radius: 50%;
  translate: 0 -50%;
}
.finals-viewer-arrow:hover {
  background: #ffffff1f;
}
.finals-viewer-arrow[data-viewer-step='-1'] {
  inset-inline-start: clamp(14px, 2.4vw, 36px);
}
.finals-viewer-arrow[data-viewer-step='1'] {
  inset-inline-end: clamp(14px, 2.4vw, 36px);
}
.finals-viewer-close:focus-visible,
.finals-viewer-arrow:focus-visible {
  outline: 2px solid #cfe0d4;
  outline-offset: 2px;
}

@media (max-width: 850px) {
  .finals {
    --finals-height: clamp(300px, 52svh, 460px);
    padding-block: 86px 76px;
  }
  .finals-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 26px;
  }
  .finals-key {
    text-align: start;
  }
}
@media (max-width: 700px) {
  .finals {
    --finals-height: min(58svh, 440px, 112vw);
    padding-block: 70px 60px;
  }
  .finals-kicker {
    margin-bottom: 12px;
  }
  .finals-head h2 {
    font-size: 40px;
  }
  .finals-key {
    font-size: 12px;
  }
  .finals-bar {
    margin-bottom: 18px;
    padding-top: 10px;
  }
  .finals-filters {
    gap: 20px;
  }
  /* Phones swipe the row, so only the count stays. */
  .finals-arrow {
    display: none;
  }
  .finals-track {
    gap: 12px;
  }
  .finals-caption {
    gap: 8px;
    margin-top: 10px;
    font-size: 11px;
  }
  .finals-viewer-figure {
    padding: 0 14px 92px;
  }
  .finals-viewer-figure img {
    max-height: calc(100svh - 190px);
  }
  .finals-viewer-arrow {
    top: auto;
    bottom: 22px;
    translate: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .finals-photo img,
  .finals-areas button,
  .finals-arrow,
  .finals-filters button {
    transition: none;
  }
}
