/* ==========================================================================
   The page /features (wo22, 14 November 2026)

   What the site does, for somebody without an account (app/View/public/features.php). Loaded by
   that page alone, after app.css (layout.php's $styles). Only the site's tokens - app.css's :root
   and its two dark blocks - so the light and the dark theme follow by themselves. Phone first:
   one column, nothing wider than the screen from 320px (the row of phone screens scrolls inside
   itself); two columns of pictures from 640px, where that row wraps until all of it fits in one
   (its group 964px wide - a container query, so a scrollbar that takes room counts); the steps
   side by side and the picture beside the headline from 900px.
   ========================================================================== */

.features {
  display: grid;
  gap: 44px;
  grid-template-columns: minmax(0, 1fr);
  overflow-wrap: break-word;
}
/* Long German compounds break at a syllable rather than run past a narrow screen (html lang). */
.features p, .features li { hyphens: auto; }

/* --- The language switch ------------------------------------------------- */

.features-lang { display: flex; justify-content: flex-end; margin-bottom: -28px; }
/* The words in the middle of the link at any height (app.css gives a touch screen 38px). */
.features-lang .segmented a { display: inline-flex; align-items: center; padding: 6px 14px; font-size: var(--fs-sm); }
/* The language shown is marked by more than its colour: bold and underlined in the accent. */
.features-lang .segmented a[aria-current="page"] { font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }

/* --- The top ------------------------------------------------------------- */

.features-hero {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 8px 0 4px;
}
.features-hero__eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.features-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.85rem, 1.2rem + 3vw, var(--fs-hero));
  line-height: 1.12;
  letter-spacing: -0.024em;
  text-wrap: balance;
}
.features-hero__lede {
  margin: 0;
  max-width: 38rem;
  color: var(--ink-secondary);
  font-size: var(--fs-lg);
  line-height: 1.55;
  text-wrap: pretty;
}
.features-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
@media (max-width: 420px) {
  .features-hero__actions > .btn { flex: 1 1 auto; }
}
.features-hero__media { margin: 0; min-width: 0; }
.features-hero__media img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-sunken);
  box-shadow: var(--shadow-lg);
}
.features-hero__media figcaption {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: var(--fs-xs);
}
@media (min-width: 900px) {
  .features-hero--media { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 44px; }
}

/* --- Sections ------------------------------------------------------------ */

.features-section__title {
  margin: 0 0 6px;
  font-size: var(--fs-2xl);
  letter-spacing: -0.018em;
}
/* No heading ends in a lone word on a line of its own ("… und was / nicht" on a phone). */
.features-section__title, .features-group__head h3, .features-register__card h2, .features-step h3 { text-wrap: balance; }
.features-section__note {
  margin: 0 0 22px;
  max-width: 44rem;
  color: var(--ink-secondary);
}

/* --- How it works: three numbered steps ---------------------------------- */

.features-steps {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: features-step;
}
/* The number beside the step's title, the words under the title. */
.features-step {
  counter-increment: features-step;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  /* A card the row makes taller than its words keeps them together at the top. */
  align-content: start;
  padding: 18px 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.features-step::before {
  content: counter(features-step);
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.features-step h3 { margin: 4px 0 6px; font-size: var(--fs-md); }
.features-step p { margin: 0; color: var(--ink-secondary); }
/* Side by side only where each step keeps a column of readable width (below 900px about 150px). */
@media (min-width: 900px) {
  .features-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}

/* --- The gallery --------------------------------------------------------- */

.features-gallery {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr);
}
/* A query container: the row of phone screens below wraps by the width its group has, not the window's. */
.features-group { min-width: 0; container-type: inline-size; }
.features-group__head { margin-bottom: 14px; }
.features-group__head h3 { margin: 0 0 4px; font-size: var(--fs-xl); }
.features-group__head p { margin: 0; max-width: 44rem; color: var(--ink-secondary); }

/* The wide pictures: one column on a phone, two from 640px; each card as tall as its picture. */
.features-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 640px) {
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  /* A group of one wide picture (every flight in detail) takes the row, at a width it still reads at,
     in the middle - and so does the odd one out at the end of a group of three (the globe, the flight
     profile), which would otherwise stand alone in half a row. */
  .features-grid > .features-shot:last-child:nth-child(odd) { grid-column: 1 / -1; width: 100%; max-width: 880px; justify-self: center; }
  /* Follow My Flight's flight profile is a small screen: narrower, so it is not drawn far larger than
     the map and the globe above it. */
  #g-follow .features-grid > .features-shot:last-child:nth-child(odd) { max-width: 640px; }
}

/* Phone screens and mails: a row of narrow cards. On a phone it scrolls inside itself where it does
   not fit, so the page itself never does; from a 640px window it wraps into rows until all of it fits
   in one, so on a tablet no card hides past the edge. Its 6px of padding, taken back by the negative
   margin, leave room for a card's focus ring where the row clips it (scrolling) and for the card a
   swipe stops at. */
.features-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 230px);
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 6px;
  margin-inline: -6px;
  padding: 6px 6px 8px;
}
/* 12px and the row's 6px of padding: the 18px between the pictures of the grid. */
.features-grid + .features-strip { margin-top: 12px; }
.features-strip > .features-shot { scroll-snap-align: start; }
/* By the group's own width (.features-group, a query container), not the window's - a scrollbar that
   takes room (Windows) narrows the group, not the window: 608px is a 640px window less its two 16px
   gutters, 964px what five cards need in one row (5 x 180px and 4 gaps of 16px). A browser without
   container queries keeps the scrolling row. */
@container (min-width: 608px) and (max-width: 963.98px) {
  .features-strip { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(180px, 230px)); overflow: visible; }
}
/* A row of one card (a profile on a phone) stands in the middle, under the pictures above it. */
.features-strip:has(> .features-shot:only-child) { justify-content: center; }

.features-shot {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
/* Positioned, so the words only a screen reader hears (.sr-only, absolute) stay inside the card -
   never out at the end of a scrolling row, where they would widen the page. */
.features-shot__link {
  display: block;
  position: relative;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--line);
}
/* The focus ring around the whole card, against the page (which the ring inside a picture is not,
   on a light picture in the dark theme); without :has() it stays inside the picture. */
.features-shot__link:focus-visible { outline-offset: -3px; border-radius: var(--r-lg) var(--r-lg) 0 0; }
@supports selector(:has(a)) {
  .features-shot__link:focus-visible { outline: none; }
  .features-shot:has(> .features-shot__link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
}
.features-shot__img {
  display: block;
  width: 100%;
  height: auto;
}
/* A very long picture keeps its top in the card - a phone's screen in its row, a long page in the
   grid; the link shows the whole of it. */
.features-shot__img {
  max-height: 900px;
  object-fit: cover;
  object-position: top center;
}
.features-shot--tall .features-shot__img { max-height: 520px; }
.features-shot__caption {
  display: grid;
  gap: 7px;
  padding: 11px 14px 13px;
  color: var(--ink-secondary);
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.features-tag {
  justify-self: start;
  padding: 1px 9px;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.6;
}
.features-tag--real    { background: var(--good-soft);   color: var(--good); }
.features-tag--example { background: var(--accent-soft); color: var(--accent); }

/* --- What is public, and what is not ------------------------------------- */

.features-public {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.features-public__item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.features-public__item p { margin: 0; color: var(--ink-secondary); }
.features-public__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}
.features-public__icon svg { width: 19px; height: 19px; display: block; }
.features-public__item--public .features-public__icon { background: var(--accent-soft); color: var(--accent); }
.features-public__item--never  .features-public__icon { background: var(--good-soft);   color: var(--good); }
.features-public__item--choice .features-public__icon { background: var(--surface-sunken); color: var(--ink-secondary); }
@media (min-width: 900px) {
  .features-public { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}

/* --- The registration ---------------------------------------------------- */

.features-register { display: grid; justify-items: center; }
/* The section takes the focus when the address names it (#register, tabindex="-1") - for a screen
   reader to read on from there; a ring around the whole of it would only look like an error. */
.features-register:focus { outline: none; }
/* min-width 0: a grid item is never narrower than its longest word by default, so a long e-mail
   address in the "check your e-mail" panel widened the card and the page sideways on a phone; now
   the card keeps the column's width and the address breaks inside it (overflow-wrap above). */
.features-register__card {
  width: 100%;
  min-width: 0;
  max-width: 560px;
  padding: 22px 18px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
@media (min-width: 640px) {
  .features-register__card { padding: 30px 32px 32px; }
}
.features-register__card h2 { margin: 0 0 6px; font-size: var(--fs-2xl); letter-spacing: -0.018em; }
.features-register__lede {
  margin: 0 0 20px;
  color: var(--ink-secondary);
  font-size: var(--fs-md);
  text-wrap: pretty;
}
.features-register__note { margin: 0 0 14px; color: var(--ink-muted); font-size: var(--fs-sm); }
.features-register__links { margin: 20px 0 0; text-align: center; font-size: var(--fs-sm); }
.features-errors { margin-bottom: 18px; }
.features-errors ul { margin: 6px 0 0; padding-left: 18px; }
.features-errors li + li { margin-top: 3px; }
.features-form.stack--sm { gap: 16px; }
.features-form__privacy { margin: 0; }
.features-form .btn--block { margin-top: 6px; }
.features-done {
  margin: 4px 0 16px;
  padding: 14px 16px;
  border-left: 3px solid var(--good);
  border-radius: var(--r-md);
  background: var(--good-soft);
}
.features-done .features-register__lede { margin-bottom: 12px; color: var(--ink); }
.features-done .features-register__note { color: var(--ink-secondary); }
/* The panel's padding alone below its last line, as above its first. */
.features-done > p:last-child { margin-bottom: 0; }
/* The notice of a mail not sent stands where that panel would, spaced as it is. */
.features-register__card > .notice--warning { margin: 4px 0 16px; }

@media (min-width: 900px) {
  .features { gap: 64px; }
}
