/* 54-features.css - the Features page. Class prefix: fe-.
   Every rule here is scoped by an fe- class, because the build links this file on every page. */

/* The word hangs as far as the home page's P does (the F has the same side bearing),
   so its stem stands on the edge every label below stands on. */
.fe-page .pe-word { margin-left: -0.08em; }

/* ── Rows ──────────────────────────────────────────────────────────────────
   A section of the page is one row that recuts as a whole. After Vlak's start
   row: a nested grid that spans the page grid, with the same columns and the
   same 1px gap, and no ground of its own, so the page's ground stays the only
   hairline. The first cell of every row is its lead: the name, a value, and
   one or two sentences. */
.fe-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(var(--pl-field), auto);
  gap: var(--pl-hairline);
  background: transparent;
}
.fe-row[hidden] { display: none; }
/* a cell that is taken away (a style this build has not got, a claim that does not hold) leaves no box */
.fe-page .pl-cell[hidden] { display: none; }
@media (min-width: 481px) { .fe-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 816px) { .fe-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1224px) { .fe-row { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ── The style on show, and the features by style ──────────────────────────
     six   style style | table table table table
     four  style style | table table
     two   style  /  table */
.fe-top { grid-template-areas: "style" "table"; grid-auto-rows: auto; }
.fe-top > .fe-style { grid-area: style; }
.fe-top > .fe-by-style { grid-area: table; }
@media (min-width: 481px) { .fe-top { grid-template-areas: "style style" "table table"; } }
@media (min-width: 816px) { .fe-top { grid-template-areas: "style style table table"; } }
@media (min-width: 1224px) { .fe-top { grid-template-areas: "style style table table table table"; } }
/* The switch, as on the Try page: a group as wide as its cell (to a limit), each
   segment the same width; a style that is here in ink, one to be drawn in gray. */
.fe-style-foot { display: grid; gap: 16px; }
.fe-style-foot .pl-meta { max-width: 34em; text-wrap: pretty; }
.fe-style .rs-toggle-group { display: flex; width: 100%; max-width: 26rem; }
.fe-style .rs-toggle-grouped { flex: 1 1 0; padding-inline: .625rem; }
.fe-style .rs-toggle:not(:disabled):not(.rs-toggle-pressed) { color: var(--text); }
.fe-style .rs-toggle:disabled { font-weight: 400; cursor: not-allowed; }
.fe-style .rs-toggle-pressed:focus-visible { outline-color: var(--bg); outline-offset: -4px; }
/* The table is set in the site's face whatever style is on show. A row is a
   feature, named, with its tag in gray; the column of the style on show is in ink. */
.fe-table { font-family: var(--pe-sans); font-size: 13px; letter-spacing: -.01em; }
.fe-table th, .fe-table td { padding: 8px 0; }
.fe-table thead th { padding-top: 0; }
.fe-table tbody th { padding-top: 8px; border-top: 1px solid var(--divider); font-size: 13px; font-weight: 400; color: var(--text); }
.fe-table .fe-tag { color: var(--text-secondary); white-space: nowrap; }
.fe-table td { color: var(--text-secondary); }
.fe-table td + td, .fe-table th + th { padding-left: 12px; }
.fe-table .pe-num { width: 15%; }
.fe-table .fe-col-on { color: var(--text); font-weight: 600; }
@media (min-width: 1224px) { .fe-table .pe-num { width: 17%; } }
/* on the narrowest phones the four columns stand closer */
@media (max-width: 400px) {
  .fe-table td + td, .fe-table th + th { padding-left: 8px; }
  .fe-table .pe-num { width: auto; }
}

/* a lead keeps a reading measure when its cell is wide */
.fe-lead .pl-meta { max-width: 34em; text-wrap: pretty; }
/* A section's name is its heading. It is set as the label it stands in; the value
   beside it is not part of the name. */
.fe-name { margin: 0; font: inherit; letter-spacing: inherit; color: var(--text); }

/* A feature: lead, off, on, and the code that turns it on. Only at six columns do
   the two samples stand side by side; below that one stands over the other, so
   what differs is read down the cell's left edge. Every cell is one field high.
     six columns   lead | off off | on on | code
     four          lead | off off off         the code under its lead,
                   code | on  on  on          beside the samples
     two           lead | code  /  off  /  on
     one           lead, off, on, code */
.fe-feature { grid-template-areas: "lead" "off" "on" "act"; }
.fe-feature > .fe-lead { grid-area: lead; }
.fe-feature > .fe-off { grid-area: off; }
.fe-feature > .fe-on { grid-area: on; }
.fe-feature > .fe-act { grid-area: act; }
@media (min-width: 481px) { .fe-feature { grid-template-areas: "lead act" "off off" "on on"; } }
@media (min-width: 816px) { .fe-feature { grid-template-areas: "lead off off off" "act on on on"; } }
@media (min-width: 1224px) { .fe-feature { grid-template-areas: "lead off off on on act"; } }

/* Figures: lead, the column in the style on show, the four styles in one
   column, the signs. The specimens are two fields high.
     six   lead | column column | mixed mixed | signs
     four  lead | column column column  /  signs | mixed mixed mixed
     two   lead  /  column  /  mixed | signs      (to 640px: lead, column, mixed, signs)
   Without the mixed column (a build of one style, or cells that differ) the
   row is as it was: lead, column, signs. */
.fe-figures { grid-template-areas: "lead" "col" "mix" "signs"; }
.fe-figures > .fe-lead { grid-area: lead; }
.fe-figures > .fe-col { grid-area: col; }
.fe-figures > .fe-mix-cell { grid-area: mix; }
.fe-figures > .fe-signs-cell { grid-area: signs; }
.fe-col, .fe-mix-cell, .fe-signs-cell { min-height: calc(2 * var(--pl-field)); }
.fe-figures.fe-unmixed { grid-template-areas: "lead" "col" "signs"; }
@media (min-width: 481px) {
  .fe-figures { grid-template-areas: "lead lead" "col col" "mix mix" "signs signs"; }
  .fe-figures.fe-unmixed { grid-template-areas: "lead lead" "col col" "signs signs"; }
}
@media (min-width: 641px) {
  .fe-figures { grid-template-areas: "lead lead" "col col" "mix signs"; }
  .fe-figures.fe-unmixed { grid-template-areas: "lead lead" "col signs"; }
}
@media (min-width: 816px) {
  .fe-figures { grid-template-areas: "lead col col col" "signs mix mix mix"; }
  .fe-figures.fe-unmixed { grid-template-areas: "lead col col signs"; }
}
@media (min-width: 1224px) {
  .fe-figures { grid-template-areas: "lead col col mix mix signs"; }
  .fe-figures.fe-unmixed { grid-template-areas: "lead col col col signs signs"; }
}

/* Arrows: lead, the set, the arrows in links.
     six   lead | set set set | links links
     four  lead | set set | links
     two   lead | links  /  set set */
.fe-arrows-row { grid-template-areas: "lead" "set" "links"; }
.fe-arrows-row > .fe-lead { grid-area: lead; }
.fe-arrows-row > .fe-set { grid-area: set; }
.fe-arrows-row > .fe-links-cell { grid-area: links; }
@media (min-width: 481px) { .fe-arrows-row { grid-template-areas: "lead links" "set set"; } }
@media (min-width: 816px) { .fe-arrows-row { grid-template-areas: "lead set set links"; } }
@media (min-width: 1224px) { .fe-arrows-row { grid-template-areas: "lead set set set links links"; } }

/* Dutch: lead and five words, one field each. At four columns the lead and the
   capital beside it take the first row, two fields each, and the four words in
   lowercase the second, so only the longest word stands in a wide cell.
     six   lead | IJ | ij | trema | ee | oo
     four  lead lead | IJ IJ  /  ij | trema | ee | oo
     two   lead | IJ  /  ij | trema  /  ee | oo */
@media (min-width: 816px) and (max-width: 1223px) {
  .fe-dutch-row > .fe-lead, .fe-dutch-row > .fe-lead + .pl-cell { --pl-four: 2; }
}

/* ── The code that turns a feature on, and the control that copies it ───────
   The label names the language; the mark sits in the label's value slot, its
   ink on the cell's inset and on the label's line, its 44px target around it.
   The answer ("Copied") is written beside it. */
.fe-act { position: relative; }
.fe-act > .pe-label { padding-right: 30px; }
.fe-act > .pe-label span { white-space: nowrap; }
.fe-code {
  display: block;
  min-width: 0;
  margin: 0 0 1px;
  font-family: var(--pe-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--text);
  overflow-wrap: normal;
}
.fe-copy {
  position: absolute;
  top: calc(var(--pl-cell-pad) - 14px);
  right: calc(var(--pl-cell-pad) - 17px);
}
.fe-copy svg { width: 1rem; height: 1rem; }
.fe-copy[data-fe-done] { color: var(--text); }
/* the ring is drawn around the mark, clear of the cell's seams */
.fe-copy:focus-visible { outline-offset: -6px; }

/* ── Samples and the drawings behind them ──────────────────────────────────
   One size for every feature, set so the longest sample fits its cell at every
   width. The baseline stands on the line of the lead's last line. */
.fe-sample { font-size: clamp(2.5rem, calc(var(--fe-fit, 24) * 1cqw), 6.5rem); line-height: .83; }
/* The Mono's own row is always in the Mono: seven characters of 600 units. */
.fe-mono-row { --fe-fit: 22; }
/* A sample with plumb hairlines under it (kerning, the minus) stands on the font's
   own widths: no tracking, no hang, so its first edge stands on the cell's inset. */
.fe-widths { margin-left: 0; letter-spacing: 0; }
.fe-kern-off { font-kerning: none; }
.fe-kern-on { font-kerning: normal; }
.fe-case-off { font-feature-settings: "case" 0; }
.fe-case-on { font-feature-settings: "case"; }
.fe-mark-off { font-feature-settings: "mark" 0; }
.fe-locl-off { font-feature-settings: "locl" 0; }

/* A drawing is a layer under the type, made by 34-features.js from what the
   browser measures: plumb hairlines at the widths the font gives its glyphs,
   level hairlines at the baseline and the cap height. Two inks, as on the home
   page's drawing: the divider for what is given, the gray for what is shown. */
.fe-draw { position: relative; isolation: isolate; min-width: 0; }
.fe-rules { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fe-rules > * { position: absolute; }
.fe-rule { top: 0; bottom: 0; width: 1px; background: var(--divider); }
/* what kerning takes out of a pair: a strip between the two edges, its value above it */
.fe-take {
  top: -8px;
  bottom: 0;
  box-sizing: border-box;
  border: solid var(--text-secondary);
  border-width: 0 1px;
  background: var(--control-fill);
}
.fe-val, .fe-level-name {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.fe-val { bottom: calc(100% + 13px); transform: translateX(-50%); }
.fe-level { left: 0; right: 0; height: 1px; background: var(--text-secondary); }
.fe-level-name { right: 0; transform: translateY(calc(-100% - 5px)); }

/* ── Figures and the signs on their width ────────────────────────────────
   One size for the three blocks, so they read as one table. 34-features.js sets
   it (--fe-fig) to the largest at which each block fits its cell in the style
   on show; the size here is what stands until it has measured. */
.pl-cell:has(.fe-figs) { container-type: inline-size; }
.fe-figs {
  margin: 0 0 -0.137em;
  font-family: var(--pe-spec);
  font-size: var(--fe-fig, clamp(1.5rem, 13cqw, 3.75rem));
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fe-figs > span { display: block; }
/* the column hangs left so the stem of the N stands on the cell's inset */
.fe-col .fe-figs { margin-left: -0.085em; }
/* in the Mono the N stands inside its cell, and the cell is what is drawn */
.fe-page[data-fe-style="mono"] .fe-col .fe-figs { margin-left: 0; }
/* a grid of signs shows advance widths; pairs of signs are not text */
.fe-signs { font-kerning: none; }
/* The four styles in one column: each line in its own style, its name at the
   size of text on the left, its figures on the right edge. The figures share one
   width in all four, so the hairlines drawn at the first line's cells hold for
   every line. */
.fe-figs.fe-mix > span {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--pe-spec);
}
/* in a cell of three fields the column keeps the width of two, so a name stays near its figures */
.fe-figs.fe-mix { max-width: 28rem; }
.fe-mix-name { font-size: 15px; font-weight: 400; letter-spacing: 0; }
.fe-mix-fig { font-kerning: none; }

/* ── Arrows ────────────────────────────────────────────────────────────── */
/* The set, on its own advances, the first tip on the cell's inset. It spans its
   cell: in two lines (the straight arrows, then the rest) where the cell is one
   column or two fields wide, in one line where it is three fields or a whole row
   of the two-column grid. How long the lines are depends on the arrows in the
   build; 34-features.js measures both, in em, and the size is the cell's width
   divided by that. The numbers here are those of the build this was written for. */
.fe-arrows {
  margin: 0 0 -0.06em -0.065em;                  /* two lines need air between them; the last stays where one line stands */
  font-size: min(4rem, calc(100cqw / var(--fe-set-half, 5)));
  line-height: .95;
  letter-spacing: 0;
  font-kerning: none;
}
.fe-arrows > span { display: block; }
@media (min-width: 641px) and (max-width: 815px), (min-width: 1224px) {
  .fe-arrows { margin-bottom: 0; font-size: min(6.5rem, calc(100cqw / var(--fe-set-line, 10.06))); line-height: .83; }
  .fe-arrows > span { display: inline; }
}
/* The arrows at work: three links at the size the arrows are drawn for, in Vlak's
   link grammar (ink, a hairline under the words that turns ink). Below six columns
   each link is a row of its own, 44px high; the last one's words stand on the
   cell's bottom line. */
.fe-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 calc((1.45em - var(--hit)) / 2);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.45;
  color: var(--text);
}
.fe-links a {
  display: flex;
  align-items: center;
  min-width: var(--hit);
  min-height: var(--hit);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.fe-links a > span {
  line-height: 1.2;                              /* the hairline stands directly under the words */
  border-bottom: 1px solid var(--divider);
  transition: border-color var(--duration-snap) var(--ease);
}
.fe-links a:hover > span { border-color: var(--text); }
.fe-links a:focus-visible { outline: none; }
.fe-links a:focus-visible > span { outline: 2px solid var(--text); outline-offset: 2px; }
.fe-sep { display: none; color: var(--text-secondary); }
/* in a cell of one field the label stands alone */
@media (min-width: 816px) and (max-width: 1223px) { .fe-links-cell .pe-label span { display: none; } }
/* at six columns the three stand in one line; each keeps a 44px target */
@media (min-width: 1224px) {
  .fe-links { display: block; margin-bottom: 0; }
  .fe-links a { display: inline; position: relative; min-width: 0; min-height: 0; }
  .fe-links a::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100%, var(--hit));
    height: var(--hit);
    transform: translate(-50%, -50%);
  }
  .fe-sep { display: inline; }
}

/* A word in a one-field cell. */
.fe-word { font-size: clamp(2.25rem, calc(var(--fe-word-fit, 33) * 1cqw), 4.75rem); line-height: .88; }
/* at four columns the capital's cell is two fields wide: every word keeps the size of a one-field cell */
@media (min-width: 816px) and (max-width: 1223px) {
  .fe-dutch-row .fe-word { font-size: clamp(2.25rem, calc((25vw - 41px) * var(--fe-word-fit, 33) / 100), 4.75rem); }
}
/* The details at work in two styles that are not the one on show: one of the
   pair alone (a build without the other) takes the row. */
.pl-cell.fe-at-work.fe-alone { grid-column: 1 / -1; }

/* ── Alphabets ─────────────────────────────────────────────────────────────
   A list in columns whose gap is two cell insets and a hairline, so every
   column keeps the edges of a cell of the page: two columns of two fields at
   four columns, three columns of two fields at six (they start where the cells
   of two fields start). A column is as wide as the lines need and no wider.
   The name column is in pixels, as the names are. */
.fe-languages { scroll-margin-top: var(--pl-bar); }
.fe-langs {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 1;
  column-gap: calc(2 * var(--pl-cell-pad) + var(--pl-hairline));
}
@media (min-width: 816px) { .fe-langs { columns: 2; } }
@media (min-width: 1224px) { .fe-langs { columns: 3; } }
.fe-langs li {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  column-gap: 16px;
  align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid var(--divider);
  break-inside: avoid;
}
.fe-lang-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.3;
  color: var(--text-secondary);
}
.fe-langs .pe-text { max-width: none; }
/* The notes under the list keep its columns and a reading measure: the note in
   the first, what is missing and the way on in the second; at three columns
   each has a column of its own. */
.fe-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px calc(2 * var(--pl-cell-pad) + var(--pl-hairline));
}
@media (min-width: 816px) { .fe-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fe-foot .pl-meta { max-width: 34em; text-wrap: pretty; }
.fe-foot-more { display: grid; gap: 8px; }
@media (min-width: 1224px) {
  .fe-foot { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fe-foot-more { display: contents; }
}
/* the link is a line of its own; its 44px target reaches above and below the words */
.fe-foot a { position: relative; white-space: nowrap; }
.fe-foot a::after { content: ""; position: absolute; inset: calc(50% - var(--hit) / 2) 0; }
.fe-foot a:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

@media (max-width: 640px) {
  .fe-code, .fe-lang-name, .fe-val, .fe-level-name { font-size: 13px; }
  .fe-links { font-size: 15px; }
  /* the bar is lower on a phone: a jump to the list lands with its seam on the bar's */
  .fe-languages { scroll-margin-top: calc(var(--pl-bar-phone) + env(safe-area-inset-top, 0px)); }
  /* the longest name is 71px at this size; at 375px the longest line keeps 11px to spare */
  .fe-langs li { grid-template-columns: 72px minmax(0, 1fr); column-gap: 8px; }
  /* Vlak makes a cell link a 44px box on a phone; here the target is drawn around the words instead */
  .fe-foot a { display: inline; min-width: 0; min-height: 0; }
}
/* where the longest line no longer fits beside its name, every name stands over its line */
@media (max-width: 374px) {
  .fe-langs li { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
}
