/* Lingua Atlas — verb card A3 landscape print stylesheet.
 * Colour tokens are grouped at the top; layout rules below.
 * A card is expected to override --accent and --accent-soft via inline
 * <style>:root{...}</style> emitted by the template from meta.accent.
 */

@page {
  size: A3 landscape;
  margin: 8mm 9mm 7mm;
}

:root {
  /* Semantic colour tokens */
  --accent: #173f6b;          /* fallback: French blue */
  --accent-soft: #e8eef5;
  --grid: #c9c8c5;
  --text: #242424;
  --muted: #6d6a67;
  --present: #e9f0e5;
  --past: #f1ebdd;
  --compound: #e1ede7;
  --future: #ece6f2;
  --periphrastic: #f4ede2;    /* light sand for periphrastic constructions */
  --aux: #9b7418;             /* auxiliary verbs (avoir, etc.) */
  --aux-sein: #506b40;        /* German auxiliary sein (olive) */
  --aux-werden: #6a3c86;      /* German werden (muted purple, matches "future") */
  --ending: #315f78;          /* endings across all languages */
  --irregular: #a33d43;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "DejaVu Sans", Arial, sans-serif;
  color: var(--text);
  font-size: 7.55pt;
  line-height: 1.15;
}

/* -------------------------------------------------------------------- Header */

header {
  border-top: 3px solid var(--accent);
  padding-top: 3.2mm;
}
.brand {
  text-align: center;
  letter-spacing: .24em;
  font-size: 8.5pt;
  font-weight: 700;
  color: #58514f;
}
.headrow {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: end;
  margin-top: 1.7mm;
}
.card-id { color: var(--accent); font-weight: 700; }
h1 {
  margin: 0;
  text-align: center;
  color: var(--accent);
  font-size: 21pt;
  line-height: 1;
}
.status { text-align: right; color: #54705c; font-size: 6.7pt; }
.status b {
  border: 1px solid #a9b9aa;
  border-radius: 10px;
  padding: 2px 7px;
  background: #eef4ed;
}
.subtitle {
  text-align: right;
  color: #6f6b67;
  margin-top: .8mm;
  font-size: 6.7pt;
}

/* -------------------------------------------------------- Principal-parts strip */

.topgrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--grid);
  margin-top: 2.4mm;
}
.fact {
  min-height: 10.5mm;
  padding: 1.7mm;
  border-right: 1px solid var(--grid);
}
.fact:last-child { border-right: 0; }
.fact-label {
  font-size: 6pt;
  color: #77736f;
  font-style: italic;
  margin-bottom: 1.4mm;
}
.fact-value { font-weight: 700; }

/* ------------------------------------------------------ Paradigm tables layout */

.table-group {
  display: grid;
  gap: 3mm;
  margin-top: 2.4mm;
}
.two   { grid-template-columns: 1fr 1fr; }
.three { grid-template-columns: 1fr 1fr 1fr; }

section { margin: 0; }
.section-title {
  color: var(--accent);
  font-weight: 800;
  font-size: 8.2pt;
  margin-bottom: .8mm;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
th, td {
  border: 1px solid var(--grid);
  padding: 1.08mm 1.1mm;
  vertical-align: middle;
  text-align: center;
}
th {
  font-style: italic;
  font-weight: 500;
  background: #f5f4f1;
}
th.person, td.person {
  width: 13%;
  text-align: left;
  font-style: italic;
  background: #f7f7f6;
}

/* Formation-rule row: subtitle under each column header explaining how
 * the tense is built. Small, italic, muted; keeps card scannable. */
.formation-row th {
  background: #fafaf7;
  font-size: 5.8pt;
  font-weight: 400;
  color: #6d6a67;
  padding-top: .4mm;
  padding-bottom: .8mm;
  line-height: 1.15;
}

/* Tense-family background tints */
.t-present       { background: var(--present); }
.t-past          { background: var(--past); }
.t-compound      { background: var(--compound); }
.t-future        { background: var(--future); }
.t-periphrastic  { background: var(--periphrastic); }

/* Row orientation aids.
 * 1) Subtle zebra on every other row via a gradient overlay — leaves
 *    the column-level tense tint untouched but helps the eye scan
 *    horizontally across a wide paradigm.
 * 2) The `person` column carries a slightly stronger zebra since it
 *    has no tense tint underneath.
 * 3) The border between the 3rd and 4th row is thickened to visually
 *    separate singular from plural — a grammatically meaningful cut,
 *    not decoration. */
tbody tr:nth-child(even) td:not(.person) {
  background-image: linear-gradient(rgba(0, 0, 0, .028), rgba(0, 0, 0, .028));
}
tbody tr:nth-child(even) td.person {
  background: #ececea;
}
tbody tr:nth-child(3) td {
  border-bottom: 1.4px solid #9a9895;
}

/* ------------------------------------------------- Periphrastic constructions */

.periphrastic {
  margin-top: 2.6mm;
  padding-top: 1.6mm;
  border-top: 1px dashed var(--grid);
}
.periphrastic-desc {
  margin: 0 0 1mm;
  font-size: 6.5pt;
  color: var(--muted);
  font-style: italic;
}

/* ---------------------------------------------------- Class-map card type */

/* Rebalance the bottom row on class-map cards so the members list has
 * more room than the standard usage box would. */
body.class-map .bottom {
  grid-template-columns: 1fr 1.8fr 1fr;
}

/* Class members grid — two-column multi-column flow (WeasyPrint handles
 * column-count more reliably than a nested display:grid, and it
 * automatically balances member heights across columns even when
 * some rows carry an optional note). */
.class-members-grid {
  column-count: 2;
  column-gap: 3mm;
  column-fill: balance;
}
.class-member {
  break-inside: avoid;      /* keep inf/cs/note together in the same column */
  font-size: 6.9pt;
  line-height: 1.2;
  padding: .2mm 0;
  border-bottom: 1px dotted #ded9d3;
}
.class-member:last-child { border-bottom: 0; }
.class-member-row {
  display: flex;
  justify-content: space-between;
  gap: 1.5mm;
}
.class-member-inf { font-weight: 700; color: var(--accent); }
.class-member-cs  { color: var(--text); text-align: right; }
.class-member-note {
  display: block;
  font-size: 5.8pt;
  color: var(--muted);
  font-style: italic;
  margin: .1mm 0 .3mm 1.5mm;
}

/* Spelling notes — full-width block below the paradigm. Two-column
 * grid so up to four typical exceptions fit on an A3 landscape page. */
.spelling-notes {
  margin-top: 2.6mm;
  padding-top: 1.6mm;
  border-top: 1px dashed var(--grid);
}
.spelling-notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2mm 3mm;
  margin-top: .8mm;
}
.spelling-note {
  border: 1px solid var(--grid);
  border-left: 3px solid var(--accent);
  padding: 1.4mm 1.8mm;
  background: #fafaf7;
  font-size: 6.8pt;
  line-height: 1.25;
}
.spelling-note-title {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: .5mm;
}
.spelling-note-desc     { color: var(--text); margin-bottom: .5mm; }
.spelling-note-pattern  { color: var(--text); margin: .3mm 0; }
.spelling-note-examples {
  margin-top: .6mm;
  font-size: 6.3pt;
  color: var(--muted);
}
.spelling-note-examples-label { font-style: italic; margin-right: .8mm; }
.spelling-note-example        { font-weight: 600; color: var(--accent); }

/* ---------------------------------------------------------------- Bottom row */

.bottom {
  display: grid;
  grid-template-columns: 1.35fr .95fr .74fr;
  gap: 2.6mm;
  margin-top: 2.6mm;
}
.box {
  border: 1px solid var(--grid);
  padding: 2.4mm;
  min-height: 38mm;
}
.box h3 { color: var(--accent); font-size: 8pt; margin: 0 0 1.7mm; }

.model-row {
  display: grid;
  grid-template-columns: 25mm 1fr;
  margin: .55mm 0;
}
.model-label { color: #77736f; font-style: italic; }
.muted { color: #666; }

ul { padding-left: 4mm; margin: .8mm 0; }
li { margin: .45mm 0; }
.related { margin-top: 1.5mm; font-weight: 700; color: var(--accent); }
.warning { margin-top: .8mm; }

.swatch {
  display: inline-block;
  width: 14mm;
  height: 3mm;
  border: 1px solid #bcb9b4;
  margin-right: 2mm;
  vertical-align: middle;
}
.legend-row { margin: .8mm 0; }
.pron       { margin-top: 2.4mm; }

/* -------------------------------------------------------- Grammar semantics */

.aux-avoir, .auxiliary { color: var(--aux); font-weight: 700; }
.aux-haben             { color: var(--aux); font-weight: 700; }
.aux-sein              { color: var(--aux-sein); font-weight: 700; }
.aux-etre              { color: var(--aux-sein); font-weight: 700; }
.aux-werden            { color: var(--aux-werden); font-weight: 700; }
.main-verb             { color: var(--accent); font-weight: 700; }
.irregular             { color: var(--irregular); font-weight: 700; }

.morph .stem,
.morph .aux-stem,
.morph .participle    { color: inherit; }
.morph .ending,
.morph .aux-ending    { color: var(--ending); font-weight: 800; }

.swatch.main-verb   { background: var(--accent-soft); }
.swatch.aux-avoir   { background: #eadfb9; }
.swatch.aux-haben   { background: #eadfb9; }
.swatch.aux-sein    { background: #dfe5d4; }
.swatch.aux-etre    { background: #dfe5d4; }
.swatch.aux-werden  { background: #e6dbee; }
.swatch.ending      { background: #cbdde2; }
.swatch.irregular   { background: #ddb7b9; }

/* -------------------------------------------------------------------- Footer */

footer {
  border-top: 1px solid #d2d0cd;
  margin-top: 2mm;
  padding-top: 1.3mm;
  font-size: 5.9pt;
  color: #726e69;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4mm;
}
.source-version { white-space: nowrap; font-weight: 700; }
