/* ─────────────────────────────────────────────────────────────
   Laesi · Rule — no panel at all. Modern by subtraction: one
   hairline, a generous measure, and a real type scale. Cheapest
   thing here to render and the only one that behaves on e-ink.

   ".night_mode" must stay literally present for AnkiDroid.
   ───────────────────────────────────────────────────────────── */

:root { color-scheme: light dark; }

.card {
  color-scheme: light;
  --bg:#FBFBF8; --pane:#FBFBF8;
  --ink:#1A2228; --ink-soft:#5C6B74; --ink-faint:#9AA4AA;
  --hair:#DEDDD4;
  --ask:#2B6E72; --tell:#C4703F;
  --cue:#3F6FD0;
  --ask-wash:rgba(43,110,114,.12); --tell-wash:rgba(196,112,63,.15);
  --mark:rgba(196,112,63,.20);
  --chip-bg:transparent; --chip-edge:#DEDDD4;

  margin: 0;
  padding: 34px 20px 52px;
  background-color: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 17px; line-height: 1.5;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

.card.nightMode,
.card.night_mode {
  color-scheme: dark;
  --bg:#101113; --pane:#101113;
  --ink:#EDEBE6; --ink-soft:#9CA3A8; --ink-faint:#6A7075;
  --hair:#2A2C30;
  --ask:#64AFAB; --tell:#D98A62;
  --cue:#83ACF2;
  --ask-wash:rgba(100,175,171,.17); --tell-wash:rgba(217,138,98,.21);
  --mark:rgba(217,138,98,.26);
  --chip-bg:transparent; --chip-edge:#2A2C30;
}

.card2 { --ask: #5B8DEE; }
.card3 { --ask: #5FC28F; }

.pane {
  max-width: 33em; margin: 0 auto;
  padding-left: 18px;
  border-left: 2px solid var(--ask);
}
.pane--tell { margin-top: 30px; border-left-color: var(--tell); }

hr#answer { border: 0; height: 0; margin: 0; }

.tag {
  font: 500 10px/1 ui-monospace, "SF Mono", Consolas, monospace;
  letter-spacing: .17em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 13px;
}
.pane--tell .tag { color: var(--tell); }

.expression {
  font-family: Spectral, Charter, "Iowan Old Style", Georgia, serif;
  font-size: 31px; line-height: 1.28; letter-spacing: -.008em;
  color: var(--ink);
  text-wrap: balance;
}
.meaning { font-size: 21px; line-height: 1.42; color: var(--ink); }
.meaning--prompt { font-size: 27px; line-height: 1.34; }
.meaning--sub { font-size: 16.5px; color: var(--ink-soft); margin-top: 9px; }
.answer {
  font-family: Spectral, Charter, "Iowan Old Style", Georgia, serif;
  font-size: 31px; color: var(--tell);
}
.notes {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--hair);
  font-size: 14.5px; line-height: 1.5; color: var(--ink-soft);
}

/* Underline rather than a chip — nothing here is boxed, so the
   blank shouldn't be either. */
.cloze span {
  color: var(--cue) !important;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .62em; font-weight: 500;
  padding-bottom: .1em;
  border-bottom: 2px solid var(--cue);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

@media (max-width: 500px) {
  .card { padding: 20px 14px 36px; font-size: 16px; }
  .pane { padding-left: 14px; }
  .expression { font-size: 24px; }
  .meaning { font-size: 18.5px; }
  .meaning--prompt { font-size: 22px; }
  .answer { font-size: 24px; }
}

/* ── the word this card is about ───────────────────────────────
   Wrapped at export time. Without it the target is invisible on
   a sentence card — you can read the whole line and never learn
   which word you were being asked about. Takes the accent of
   whichever side it appears on, same logic as the spine.       */
.target, .counterpart {
  color: var(--ink);
  background: var(--target-wash);
  border-bottom: 2px solid var(--target-line);
  border-radius: 3px 3px 0 0;
  padding: 0 .08em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.pane--ask  .target, .pane--ask  .counterpart, .pane--ask  .partner { --target-wash: var(--ask-wash);  --target-line: var(--ask); }
.pane--tell .target, .pane--tell .counterpart, .pane--tell .partner { --target-wash: var(--tell-wash); --target-line: var(--tell); }

/* Words that form one expression with the target (op in står op) are
   wrapped in .partner at export time: the target's line, dotted, no wash. */
.partner {
  border-bottom: 2px dotted var(--target-line);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* ── gloss ─────────────────────────────────────────────────────
   The English words that translate the target are wrapped in
   .counterpart at export time and take its look. On the backs
   that test meaning, the word and its cloze hint sit on one line:
   ClozeExpression is printed whole and every part but the hint is
   set to nothing. A ClozeExpression without a cue span (a plain-text
   import) hides the line instead.                              */
.gloss { margin-top: 12px; font-size: 16px; line-height: 1.4; }
.gloss:not(:has(.cue)) { display: none; }
.gloss-word { font-family: Spectral, Charter, "Iowan Old Style", Georgia, serif; font-size: 18px; color: var(--ink); margin-right: .4em; }
.gloss-cue:has(.cue) { font-size: 0; }
.gloss-cue .cue { font-size: 16px; color: var(--ink-soft); }

/* ── dictionary identity ───────────────────────────────────────
   Serif is target-language throughout, sans is English — so the
   lemma is serif and the grammar note isn't. Margins sit on the
   children so an empty row has no height.                      */
.ident { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 11px; }
.lemma {
  margin-top: 12px;
  font-family: Spectral, Charter, "Iowan Old Style", Georgia, serif;
  font-size: 18px; color: var(--ink);
}
.grammar {
  margin-top: 12px;
  font: 500 11px/1.45 ui-monospace, "SF Mono", Consolas, monospace;
  letter-spacing: .06em; color: var(--ink-faint);
}

/* ── context paragraph ─────────────────────────────────────── */
.reading {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
  font-family: Spectral, Charter, "Iowan Old Style", Georgia, serif;
  font-size: 15.5px; line-height: 1.62;
  color: var(--ink-soft);
}
.reading mark {
  background: var(--mark);
  color: var(--ink);
  padding: .06em .18em; border-radius: 3px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* ── attribution ───────────────────────────────────────────── */
.src { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.src-item { display: flex; align-items: center; gap: 7px; margin-top: 15px; }
.src-label {
  font: 500 9.5px/1 ui-monospace, "SF Mono", Consolas, monospace;
  letter-spacing: .17em; text-transform: uppercase; color: var(--ink-faint);
}
.src-chip {
  font-size: 12.5px; line-height: 1.4; color: var(--ink-soft);
  padding: 3px 10px; border-radius: 999px;
  background: var(--chip-bg); border: 1px solid var(--chip-edge);
}
/* Laesi's four provenance colours, ready but unused — nothing
   currently sets these classes. See the templates panel. */
.src-chip.src-wikt   { color: #5B8DEE;   border-color: #5B8DEE; }
.src-chip.src-google { color: #5FC28F; border-color: #5FC28F; }
.src-chip.src-llm    { color: #D8A05A;    border-color: #D8A05A; }
.src-chip.src-user   { color: var(--ink-soft); }

/* ── media ─────────────────────────────────────────────────────
   Two replay-button markups exist. Desktop and AnkiMobile emit
   a.replay-button wrapping svg > circle + path. AnkiDroid emits
   a.replaybutton — no hyphen — wrapping an svg polygon. Style
   both; the absent one costs nothing.                          */
.audio { margin-top: 15px; }
.replay-button svg        { width: 30px; height: 30px; }
.replay-button svg circle { fill: var(--ask); stroke: none; }
.replay-button svg path   { fill: var(--pane); stroke: var(--pane); }
.replaybutton svg          { width: 30px; height: 30px; }
.replaybutton svg polygon  { fill: var(--ask); stroke: var(--ask); }
.replaybutton svg circle   { fill: var(--ask); stroke: none; }

/* Scoped to .shot, not bare img — a bare img selector also hits
   the star on marked cards. !important because AnkiDroid has
   ignored image dimension CSS without it. */
.shot { margin-top: 16px; }
.shot img {
  display: block; margin: 0;
  border-radius: 2px;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 38vh !important;
}

.clip { margin-top: 16px; }
.clip video {
  display: block;
  border-radius: 2px;
  max-width: 100% !important;
  height: auto !important;
}

/* ── annotation ───────────────────────────────────────────────
   A reading, romanization or morpheme breakdown of the target, set
   as ruby over it on the answer side. Latin script, so the UI sans.
   Empty on the Danish decks; the template omits it entirely then. */
.annotation, .annotation-rt {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 400; font-style: normal; color: var(--ink-soft);
}
.annotation { font-size: 14px; line-height: 1.4; margin: 0 0 8px; }
.annotation-rt { font-size: 0.5em; letter-spacing: 0.02em; ruby-align: center; }

@media (max-width: 500px) {
  .lemma    { font-size: 17px; }
  .reading  { font-size: 15px; }
  .annotation { font-size: 13px; }
  .gloss-word { font-size: 17px; }
  .gloss-cue .cue { font-size: 15px; }
  .shot img { max-height: 30vh !important; }
}
