/* Nigandu — the second setting.
 *
 * The three oldest of these ten books are நிகண்டு: thesaurus-poems, where a
 * headword is answered with a list of synonyms rather than a sentence. Six of
 * the ten still answer that way. Read down six such lists and you cannot see
 * that five of them begin from the same word — so in this setting the entry
 * opens with every sense the sources give, each set in the size of its
 * agreement, and the glosses follow underneath.
 *
 * Where Olai is a material — leaf, cord, cut — this is a printed thing:
 * indigo, chalk and saffron off a Madras job press, flat surfaces, hairlines,
 * and the headword as large as the page will carry.
 *
 * Almost all of it is done by redefining the tokens app.css already uses. The
 * rules below are only the places where the two settings disagree about
 * structure rather than about colour: the bundle has leaves and a binding,
 * and this one has neither.
 */

:root[data-setting="nigandu"] {
  --ground: #1b2a6b;
  --band: #141f52;
  --rim: #26377f;
  --leaf: #223173;
  --leaf-lit: #2a3b8a;
  --leaf-open: #26377f;

  --incise: #f4efe2;       /* the page inverts: chalk on indigo */
  --incise-soft: #a7afd0;
  --chalk: #f4efe2;
  --cord: #f5a623;         /* saffron: the accent, and focus */
  --cord-deep: #e24b3f;    /* madder: the slab under the headword */

  /* Tamil is set in the sans here. The leaf wants a serif because a stylus
     cut has weight where it turns; a press does not. */
  --serif: "Noto Sans Tamil", system-ui, -apple-system, "Segoe UI", sans-serif;
  --latin: system-ui, -apple-system, "Segoe UI", sans-serif;

  color-scheme: dark;
}

/* Nothing is a leaf ---------------------------------------------------- */

/* The cord and the string holes it passes through. There is no bundle here. */
:root[data-setting="nigandu"] .entry::before,
:root[data-setting="nigandu"] .entry .headword::before,
:root[data-setting="nigandu"] .sense::before,
:root[data-setting="nigandu"] .sense::after { display: none; }

:root[data-setting="nigandu"] .rail a {
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0.18rem 0;
  color: var(--incise-soft);
  font-weight: 400;
}
:root[data-setting="nigandu"] .rail a:hover {
  color: var(--chalk);
  transform: none;
}
:root[data-setting="nigandu"] .rail a[aria-current="true"] {
  background: none;
  box-shadow: none;
  border-left: 0;
  color: var(--cord);
  font-weight: 600;
}
:root[data-setting="nigandu"] .rail .place {
  border-bottom-color: var(--rim);
  color: var(--incise-soft);
}

/* The headword, as large as the measure will carry, on a madder slab. */
:root[data-setting="nigandu"] .entry .headword {
  padding: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  font-weight: 700;
  font-size: clamp(3.5rem, 11vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 1.4rem;
  border-bottom: 6px solid var(--cord-deep);
  padding-bottom: 0.5rem;
}

/* The senses: rows off a press, separated by a hairline and nothing else. */
:root[data-setting="nigandu"] .sense {
  padding: 1rem 0;
  margin: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  border-top: 1px solid var(--rim);
}
:root[data-setting="nigandu"] .sense .meaning {
  font-weight: 300;
  font-size: 1.1rem;
  line-height: 1.75;
  color: #dfe3f2;
}
/* Tamil has no case and no small caps, so `text-transform` buys nothing here
   and the tracking that would go with it only pulls the clusters apart.
   Weight and colour carry the source instead. */
:root[data-setting="nigandu"] .sense .citation {
  font-family: var(--serif);
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--cord);
}

/* The consensus field -------------------------------------------------- */

:root[data-setting="nigandu"] .consensus { display: block; margin: 0 0 2.5rem; }

/* Baseline-aligned and ragged, not a grid: the words are of wildly different
   sizes and setting them on a common baseline is what makes a run of them
   read as one field rather than as a table of chips. */
:root[data-setting="nigandu"] .field {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1em 0.5em;
  max-width: 44ch;
  margin: 0 0 1rem;
}
:root[data-setting="nigandu"] .field span {
  font-family: var(--serif);
  line-height: 1.15;
  color: var(--chalk);
}
/* Size is the data. Five hands is the most any sense reaches in practice, so
   the scale tops out there and everything below it steps down evenly. */
:root[data-setting="nigandu"] .field span[data-hands="5"] { font-size: 3.2rem; font-weight: 700; color: var(--cord); }
:root[data-setting="nigandu"] .field span[data-hands="4"] { font-size: 2.3rem; font-weight: 600; }
:root[data-setting="nigandu"] .field span[data-hands="3"] { font-size: 1.6rem; font-weight: 500; }
:root[data-setting="nigandu"] .field span[data-hands="2"] { font-size: 1.1rem; font-weight: 400; color: #d5d8e9; }
:root[data-setting="nigandu"] .field span[data-hands="1"] { font-size: 0.92rem; font-weight: 300; color: var(--incise-soft); }

:root[data-setting="nigandu"] .field-note {
  max-width: 40ch;
  margin: 0;
  font-family: var(--latin);
  font-size: 0.85rem;
  color: var(--incise-soft);
}
:root[data-setting="nigandu"] .field-note b {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--cord);
}

/* The rest of the furniture -------------------------------------------- */

:root[data-setting="nigandu"] .masthead { border-bottom: 3px solid var(--cord); }
:root[data-setting="nigandu"] .colophon {
  border-top: 3px solid var(--cord);
  font-style: normal;
}
:root[data-setting="nigandu"] .wordmark { font-weight: 700; }

:root[data-setting="nigandu"] #search-input {
  background: var(--rim);
  border-bottom: 0;
  border-radius: 2px;
}
:root[data-setting="nigandu"] #search-input:hover,
:root[data-setting="nigandu"] #search-input:focus { background: #2e409a; }
:root[data-setting="nigandu"] #search-input::placeholder { font-style: normal; }

:root[data-setting="nigandu"] .message {
  background: var(--rim);
  border-left: 3px solid var(--cord);
  color: var(--chalk);
}

:root[data-setting="nigandu"] .matches li {
  background: none;
  box-shadow: none;
  border-radius: 0;
  border-bottom: 1px solid var(--rim);
  margin: 0;
}
:root[data-setting="nigandu"] .matches a { color: var(--chalk); padding-left: 0; }
:root[data-setting="nigandu"] .matches a:hover { color: var(--cord); }
:root[data-setting="nigandu"] .matches .citation { padding-left: 0; }

:root[data-setting="nigandu"] .reverse-btn {
  background: var(--cord-deep);
  color: var(--chalk);
}
:root[data-setting="nigandu"] .reverse-btn:hover { background: #ef6055; }

:root[data-setting="nigandu"] .setting-btn {
  border-color: rgba(244, 239, 226, 0.35);
  font-style: normal;
  font-weight: 500;
}

/* The opening ---------------------------------------------------------- */

/* On the stage there is one word and one line under it. The field counts
   agreement between sources, and the specimen is showing one of them. */
:root[data-setting="nigandu"] body[data-view="specimen"] .consensus { display: none; }

:root[data-setting="nigandu"] body[data-view="specimen"] .entry .headword {
  padding: 0 0 0.6rem;
  border-bottom: 6px solid var(--cord-deep);
  font-size: clamp(3.25rem, 14vw, 9.5rem);
}
:root[data-setting="nigandu"] body[data-view="specimen"] .sense { border-top: 0; }
:root[data-setting="nigandu"] body[data-view="specimen"] .sense .meaning { color: #dfe3f2; }

@media (max-width: 820px) {
  :root[data-setting="nigandu"] .entry .headword { font-size: 2.6rem; }
  :root[data-setting="nigandu"] .field { max-width: none; }
  :root[data-setting="nigandu"] .field span[data-hands="5"] { font-size: 2.4rem; }
  :root[data-setting="nigandu"] .field span[data-hands="4"] { font-size: 1.8rem; }
  :root[data-setting="nigandu"] .field span[data-hands="3"] { font-size: 1.35rem; }
}
