/*
 * 33Gears theme for calc-core. Overrides --cc-* variables, then undoes the theme's article
 * styles inside the tool. Same family as the other 33gears tools: near-black card, red
 * #e11d2a accent, amber for links and focus, Oswald for the big numbers. No url() anywhere.
 *
 * Two classes (.cc.cc-33gears) so load order against calc-core.css does not matter. Theme rules
 * that beat that are written as .tg-content .cc.cc-33gears X (three classes): the theme styles
 * .tg-content a / table / ul / li / img / h2-h4 for prose. Embed pages have no .tg-content, so the
 * plain .cc.cc-33gears rules carry them.
 * Available variables for pack CSS: --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-link, --cc-s0 .. --cc-s5, --cc-out-min.
 */

.cc.cc-33gears {
  --cc-accent: #e11d2a;
  --cc-accent-ink: #ffffff;
  --cc-accent-soft: #2a1418;
  --cc-bg: #0f0f12;
  --cc-card: #1b1b21;
  --cc-text: #f3f1ec;
  --cc-muted: #b4b3ba;
  --cc-border: #3a3a43;
  --cc-radius: 4px;
  --cc-ok: #35c46b;
  --cc-warn: #ffb020;
  --cc-err: #ff8a90;
  --cc-link: #ffb020;
  --cc-s0: #ff5a64;
  --cc-s1: #ffb020;
  --cc-s2: #35c46b;
  --cc-s3: #8fc2ff;
  --cc-s4: #c3a6ff;
  --cc-s5: #9fb4c9;
  --cc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cc-disp: var(--font-display, Oswald), "Arial Narrow", Arial, sans-serif;
  color-scheme: dark;
  background: linear-gradient(160deg, #17171c 0%, #0f0f12 100%);
  border-color: var(--cc-border);
  border-top: 3px solid var(--cc-accent);
  box-shadow: 0 18px 44px -26px rgba(0, 0, 0, 0.7);
  clear: both;
  scroll-margin-top: 90px;
}

/* Big numbers in the site display face. */
.cc.cc-33gears .cc-answer,
.cc.cc-33gears .cc-stat-v,
.cc.cc-33gears .cc-ring-v { font-family: var(--cc-disp); font-weight: 600; letter-spacing: 0.01em; }
.cc.cc-33gears .cc-answer { font-weight: 500; }

/* Native controls follow the dark scheme (range, select arrow, number spinners). */
.cc.cc-33gears .cc-input { background: #0b0b0e; }

/* ---- theme traps: .tg-content styles prose elements, the tool is inside .tg-content ---- */

/* Links: theme is red and underlined with a dark hover; the card is dark, so use amber. Button-like links keep button colours. */
.tg-content .cc.cc-33gears a,
.cc.cc-33gears a { color: var(--cc-link); text-decoration: underline; text-underline-offset: 2px; }
.tg-content .cc.cc-33gears a:hover,
.cc.cc-33gears a:hover { color: #ffc85a; }
.tg-content .cc.cc-33gears a.cc-btn,
.tg-content .cc.cc-33gears a.cc-b,
.cc.cc-33gears a.cc-btn,
.cc.cc-33gears a.cc-b { color: var(--cc-text); text-decoration: none; }
.tg-content .cc.cc-33gears a.cc-b[aria-pressed="true"],
.cc.cc-33gears a.cc-b[aria-pressed="true"] { color: var(--cc-accent-ink); }

/* Lists: theme adds 24px padding, 24px bottom margin and bullets. */
.tg-content .cc.cc-33gears ul,
.tg-content .cc.cc-33gears ol,
.cc.cc-33gears ul,
.cc.cc-33gears ol { list-style: none; padding-left: 0; }
.tg-content .cc.cc-33gears ul:not(.cc-list),
.tg-content .cc.cc-33gears ol:not(.cc-list) { margin-top: 0; margin-bottom: 0; }
.tg-content .cc.cc-33gears li { margin: 0; }
.cc.cc-33gears li::before,
.cc.cc-33gears li::after { content: none; }
.cc.cc-33gears li::marker { content: ""; }

/* Tables: the theme makes them white with dark text, 20px cell padding, uppercase 11px headers and cream zebra rows. */
.tg-content .cc.cc-33gears table {
  margin: 0; border: 0; border-radius: 0; overflow: visible; background: transparent;
  font-family: var(--cc-font); font-size: 14px; width: 100%;
}
.tg-content .cc.cc-33gears table th,
.tg-content .cc.cc-33gears table thead th {
  font-family: var(--cc-font); font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none;
  color: var(--cc-text); background: var(--cc-card); padding: 8px 10px; border: 0; border-bottom: 1px solid var(--cc-border);
}
.tg-content .cc.cc-33gears table td {
  padding: 8px 10px; border: 0; border-bottom: 1px solid var(--cc-border); color: var(--cc-text); background: transparent;
}
.tg-content .cc.cc-33gears table tbody tr:nth-child(even),
.tg-content .cc.cc-33gears table tbody tr:nth-child(odd) { background: transparent; }

/* Headings, images, figures a pack might use. */
.tg-content .cc.cc-33gears h2,
.tg-content .cc.cc-33gears h3,
.tg-content .cc.cc-33gears h4 {
  margin: 0 0 8px; font-family: var(--cc-font); font-size: 18px; font-weight: 700; line-height: 1.3;
  letter-spacing: 0; text-transform: none; color: var(--cc-text);
}
.tg-content .cc.cc-33gears img { margin: 0; border-radius: 0; }
.tg-content .cc.cc-33gears figure { margin: 0; }
.tg-content .cc.cc-33gears figcaption { margin: 4px 0 0; font-family: var(--cc-font); font-size: 13px; letter-spacing: 0; color: var(--cc-muted); }
.tg-content .cc.cc-33gears blockquote { margin: 0; padding: 0; border: 0; }

/* SVG: stroke is inherited, so only explicit classes may set it; never put a stroke on the card or on svg itself. */
.cc.cc-33gears svg { max-width: 100%; }

/* Embed view: the page behind the iframe is the same near-black, so the card has no seam. */
.cc.cc-33gears.cc-embed { box-shadow: none; background: #0f0f12; border-top: 0; }

/* The tool is the page: the featured image stays for og:image, schema and the hub card, but the
   theme's hero and ribbon would push the tool below the fold. Class set by includes/assets.php. */
.tg-calc-page .tg-arthero,
.tg-calc-page .tg-ribbon { display: none; }

@media print {
  .cc.cc-33gears { background: #fff; box-shadow: none; border-top-width: 1px; color-scheme: light; --cc-text: #000; --cc-muted: #333; --cc-border: #999; --cc-card: #fff; --cc-bg: #fff; --cc-link: #000; }
  .tg-content .cc.cc-33gears table th,
  .tg-content .cc.cc-33gears table td { color: #000; background: transparent; }
}
