/*
 * Flora Fauna Fun theme for calc-core. Overrides --cc-* variables only, plus the ruki traps below. Same family as the
 * fff tool cards (goat, chicken, pig feed): cream card, forest green accent. No url() anywhere (Autoptimize and the
 * scope gate reject it; relative paths break when CSS is aggregated).
 *
 * Two classes (.cc.cc-florafaunafun) so load order against calc-core.css does not matter. Pack CSS must use the
 * variables: --cc-accent, --cc-accent-ink, --cc-accent-soft, --cc-bg, --cc-card, --cc-text, --cc-muted, --cc-border,
 * --cc-radius, --cc-gap, --cc-pad, --cc-font, --cc-mono, --cc-ok, --cc-warn, --cc-err, --cc-s0 .. --cc-s5, --cc-out-min.
 */

.cc.cc-florafaunafun {
  --cc-accent: #2e8540;
  --cc-accent-ink: #ffffff;
  --cc-accent-soft: #e4f2da;
  --cc-bg: #fffaf0;
  --cc-card: #f6f0e0;
  --cc-text: #1f2d1c;
  --cc-muted: #55644f;
  --cc-border: #e0d5b8;
  --cc-radius: 12px;
  --cc-ok: #1f6b34;
  --cc-warn: #8a5a00;
  --cc-err: #b42318;
  --cc-s0: #2e8540;
  --cc-s1: #2a7fa8;
  --cc-s2: #bf6f1c;
  --cc-s3: #7b64a8;
  --cc-s4: #c0504d;
  --cc-s5: #62ad4a;
  --cc-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  clear: both;
  scroll-margin-top: 76px;
  box-shadow: 0 10px 30px -18px rgba(31, 45, 28, 0.35);
}

/* ---- ruki traps ---- */

/* `.entry-content ul:not(.ruki-list) { list-style: initial }` (0,2,1) and `ul li { padding-left:15px; margin-bottom:15px }`
   leak into any list the tool draws (the combobox list). Two classes plus the tag beat both; the .entry-content
   variants cover the in-article case, the plain ones the embed page. */
.cc.cc-florafaunafun ul,
.cc.cc-florafaunafun ol,
.entry-content .cc.cc-florafaunafun ul,
.entry-content .cc.cc-florafaunafun ol { list-style: none; margin: 0; padding: 0; }
.cc.cc-florafaunafun li,
.entry-content .cc.cc-florafaunafun li { margin: 0; padding-left: 0; list-style: none; }
.cc.cc-florafaunafun li::before,
.cc.cc-florafaunafun li::after { content: none; }

/* Phones (max-width 390px): ruki sets `.entry-content td { display: block; border-right: 0 !important }`, which stacks
   table cells. calc-core already sets table-cell on .cc td; these (0,2,2) and (0,3,2) selectors keep it for tables a
   pack writes by hand and for the ruki `!important` border (cosmetic only: calc-core uses no right borders). */
.cc.cc-florafaunafun table { display: table; width: 100%; margin: 0; }
.cc.cc-florafaunafun thead { display: table-header-group; }
.cc.cc-florafaunafun tbody { display: table-row-group; }
.cc.cc-florafaunafun tr { display: table-row; border: 0; }
.cc.cc-florafaunafun td,
.cc.cc-florafaunafun th,
.entry-content .cc.cc-florafaunafun td,
.entry-content .cc.cc-florafaunafun th { display: table-cell; }

/* Links inside the tool: theme link colours are low specificity but the green must stay readable on cream. */
.cc.cc-florafaunafun a { color: var(--cc-ok); text-decoration: underline; }
.cc.cc-florafaunafun .cc-btn,
.cc.cc-florafaunafun .cc-b { text-decoration: none; }

/* Bare `input { border:3px solid; padding:15px; float on checkbox }` and `select { border:3px }` are (0,0,1)/(0,1,1);
   calc-core's .cc .cc-input is (0,2,0). Checkbox and radio floats are the only ones that can win: pin them. */
.cc.cc-florafaunafun input[type="checkbox"],
.cc.cc-florafaunafun input[type="radio"] { float: none; margin-right: 0; }

/* Theme svg rules must not leak into charts and meters. */
.cc.cc-florafaunafun svg { max-width: 100%; }

/* Phones: ruki pads .entry-content by 30px and the post card by 15px, which leaves a 300px tool on a 390px phone.
   Bleed 24px of the content padding like the goat feed card does. Scoped to ruki's .the-post so the calc-core test
   harness (which has its own .entry-content with 16px padding) and embed pages are not affected. */
@media (max-width: 700px) {
  .the-post .entry-content .cc.cc-florafaunafun { margin-left: -24px; margin-right: -24px; width: auto; max-width: none; }
}

/* Embed view: the page behind the iframe is cream too, so the card has no seam. */
.cc.cc-florafaunafun.cc-embed { box-shadow: none; background: #fffaf0; }

@media print {
  .cc.cc-florafaunafun { background: #fff; box-shadow: none; --cc-text: #000; --cc-muted: #333; --cc-border: #999; --cc-card: #fff; --cc-bg: #fff; }
}
