/* txdecoder.css — The Receipt.
 *
 * Modeled on honeypot.css: same dark-panel/gold-glow/Comic-Sans identity, same
 * BOX pattern (one 0.75 .container over the site art, 0.9x panels inside),
 * same sr-only/skip-link pattern — copied rather than shared, same reasoning
 * nav.css documents for itself: this file must be self-sufficient, since it
 * is the only stylesheet txdecoder.html links besides nav.css. Keep the four
 * nav tokens below — nav.css CONSUMES them and an unresolved var() fails
 * SILENTLY, rendering the navbar invisible. That already happened once on
 * nftviewer.html.
 */

* , *::before, *::after { box-sizing: border-box; }

:root {
  /* --navbar-bg and --glow deliberately match nav.css's OWN fallback values
     (rgba(0,0,0,0.95) / 0 0 10px rgba(255,69,0,0.7)) byte-for-byte rather than
     a page-specific tone — the same fix already made for revoker.css and
     honeypot.css: redefining these to a page-local theme made THAT page's
     navbar visibly diverge from every other page's, caught by
     tests/nav-appearance.spec.js. --c-orange matches the site (`orange`) for
     the same reason: nav.css builds the SHARED .navbar-link::after ember
     underline out of it, so a page-local value would desync hover colour too.
     The page's own warmer glow lives in --receipt-glow, which nav.css does
     not consume and cannot leak into. */
  --navbar-bg: rgba(0, 0, 0, 0.95);
  --glow: 0 0 10px rgba(255, 69, 0, 0.7);
  --c-gold: #ffcf48;
  --c-orange: orange;
  --receipt-glow: 0 0 12px rgba(255, 69, 0, .6);
}

body {
  margin: 0; font-family: var(--font-body, "Comic Sans MS", system-ui, sans-serif);
  background: url('images/BlazeitBG.png') no-repeat center center;
  background-size: cover;          /* cover, never 100% auto — see faucet/stats root cause */
  background-attachment: fixed; background-color: #b0e8f7;
  color: #fff; min-height: 100vh; overflow-x: hidden;
  padding-top: calc(var(--nav-h) + 24px);
  display: flex; flex-direction: column;
}

@media screen and (max-width: 768px) {
  body { padding-top: calc(var(--nav-h) + 16px); }
}

.container {                        /* the ONE box */
  /* flex: 1 0 auto (grow, never shrink, content basis) is the site's sticky-
     footer mechanism — same as honeypot.css/revoker.css. With a plain
     `flex: 1` the box stayed content-height and the footer dropped onto the
     pale background instead of sitting at the page bottom against the box. */
  flex: 1 0 auto; width: 100%; max-width: 1000px; margin: 24px auto; padding: 24px 20px 40px;
  box-sizing: border-box; background: rgba(0,0,0,.75);
  border: 1px solid rgba(255,207,72,.25); border-radius: 20px; box-shadow: var(--receipt-glow);
  text-align: center;
}

h1 {
  font-size: 2rem;
  margin: 0 0 5px;
  color: var(--c-gold, #ffcf48);
  text-shadow: 0 0 6px #ff8c00, 0 0 10px #ff4500;
  font-weight: bold;
}

.receipt-tagline {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 20px;
}

.receipt-panel { background: rgba(0,0,0,.55); border: 1px solid rgba(255,207,72,.2);
  border-radius: 14px; padding: 16px 18px; margin: 0 0 16px; text-align: left; }
.receipt-panel h2 { margin: 0 0 10px; color: var(--c-gold, #ffcf48); }
.receipt-panel ul { margin: 0; padding-left: 20px; }
.receipt-panel li { margin: 0 0 8px; font-size: 0.9rem; color: rgba(255,255,255,.85); line-height: 1.5; }
.receipt-panel li:last-child { margin-bottom: 0; }

#receiptFormPanel { text-align: center; }

#receiptTxInput {
  min-height: var(--touch, 44px);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 207, 72, 0.5);
  background: rgba(0, 0, 0, 0.45);
  color: var(--c-gold);
  width: 100%;
  max-width: 420px;
  margin-bottom: 10px;
}
#receiptTxInput::placeholder { color: rgba(255, 207, 72, 0.4); }

.receipt-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

#receiptRead, #receiptDemo {
  padding: 10px 20px;
  border-radius: 10px;
  background-color: orange;
  color: black;
  font-weight: bold;
  border: none;
  cursor: pointer;
  min-height: var(--touch);
  transition: background-color 0.2s, opacity 0.2s;
  font-family: inherit;
  font-size: 1rem;
}
#receiptRead:hover:not(:disabled), #receiptDemo:hover:not(:disabled) { background-color: darkorange; }
#receiptRead:disabled, #receiptDemo:disabled { opacity: 0.5; cursor: not-allowed; }

.receipt-status {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  min-height: 1.2em;
}

/* Basic/Advanced toggle — same pill pattern as honeypot.css/stats.css. */
.receipt-mode-toggle { display: inline-flex; gap: 6px; padding: 5px; margin: 0 0 12px;
  background: rgba(0,0,0,.5); border: 1px solid rgba(255,122,24,.4); border-radius: 999px;
    /* Five buttons no longer fit one row on a phone (nav-parity's 360px
     * overflow catch, 2026-08-31) - the pill wraps instead of pushing the
     * page wide. */
    flex-wrap: wrap; justify-content: center; max-width: 100%; box-sizing: border-box; }
.receipt-mode-btn { font-family: inherit; font-weight: bold; min-height: var(--touch);
  padding: 6px 16px; border: none; border-radius: 999px; background: transparent;
  color: rgba(255,255,255,.7); cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.receipt-mode-btn:hover { color: #fff; }
.receipt-mode-btn.is-active { background: linear-gradient(90deg, #ff4500, var(--c-gold)); color: #000; box-shadow: var(--receipt-glow); }
.receipt-mode-btn:focus-visible { outline: 3px solid var(--c-gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .receipt-mode-btn { transition: none; } }

.receipt-headline { font-weight: bold; font-size: 1.05rem; margin: 0 0 10px; color: rgba(255,255,255,.92); }
.receipt-lines { list-style: none; margin: 0; padding: 0; }
.receipt-lines li { border-left: 4px solid #888; padding: 8px 12px; margin: 8px 0;
  border-radius: 8px; background: rgba(255,255,255,.05); font-size: 0.9rem;
  color: rgba(255,255,255,.85); line-height: 1.5; list-style: none; }
.receipt-lines li:last-child { margin-bottom: 0; }

/* ---- The Advanced report (owner request 2026-09-02: "fully detailed,
   clear to read, informative, helpful and thorough").

   Three entry shapes come out of tx-narrate.js's buildAdvanced(): a section
   HEADING, a real PROSE paragraph, and a VERIFY link row. The rest stay the
   ordinary tight data rows above, so the page reads as sections of rows
   rather than one undifferentiated wall — data stays dense, prose gets the
   site's readability treatment (~70ch measure, 1.7 leading). ---- */
#receiptAdvanced .receipt-adv-heading {
  border-left: none;
  background: none;
  padding: 18px 0 4px;
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .01em;
  color: var(--c-gold);
  border-bottom: 1px solid rgba(255,255,255,.14);
}
#receiptAdvanced .receipt-adv-heading:first-child { padding-top: 2px; }
#receiptAdvanced .receipt-adv-prose {
  border-left: 4px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.03);
  max-width: 70ch;
  line-height: 1.7;
  color: rgba(255,255,255,.78);
}
#receiptAdvanced .receipt-adv-verify { border-left-color: var(--c-gold); }
/* Long values (addresses, raw units, topic hashes) must never push the page
   sideways — they wrap inside their own row. */
#receiptAdvanced li { overflow-wrap: anywhere; }

/* Advanced-only content: hidden in Basic, shown when the container flips to advanced. */
/* Five registers, one attribute. Basic shows the story lines; Advanced adds the
 * technical list on top of them (as always); ELI5/Degen/Gonzo replace the story
 * lines with their own container. The headline stays in every register — the
 * facts lead no matter the voice. */
[data-receipt-mode="basic"] .receipt-advanced-only,
[data-receipt-mode="eli5"] .receipt-advanced-only,
[data-receipt-mode="degen"] .receipt-advanced-only,
[data-receipt-mode="gonzo"] .receipt-advanced-only { display: none; }
[data-receipt-mode="eli5"] #receiptLines,
[data-receipt-mode="degen"] #receiptLines,
[data-receipt-mode="gonzo"] #receiptLines { display: none; }
.receipt-voice { display: none; }
[data-receipt-mode="eli5"] #receiptEli5 { display: block; }
[data-receipt-mode="degen"] #receiptDegen { display: block; }
[data-receipt-mode="gonzo"] #receiptGonzo { display: block; }
.receipt-gonzo p { margin: 0 0 12px; line-height: 1.75; text-align: left; }
.receipt-gonzo p:last-child { margin-bottom: 0; font-style: italic; }

/* ---- Shared a11y helpers ---- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--c-gold);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #000;
  color: var(--c-gold);
  padding: 10px 16px;
  z-index: 2000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* Footer — matches the canonical strip (arena.css/nftviewer.css/stats.css/
   honeypot.css): a full-width DARK band so the text never sits on the
   pale-blue body. */
.footer {
  width: 100%;
  text-align: center;
  padding: 10px 0;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 14px;
  margin-top: 20px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.footer p { margin: 0; }
.trust-strip {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: center;
  align-items: baseline;
  padding: 0 12px;
  font-size: 12px;
  color: #ded6c6; /* opaque: translucent text over a translucent panel has no contrast ratio (READABILITY rule) */
}
.trust-strip a { color: var(--c-gold); text-decoration: none; }
.trust-strip a:hover, .trust-strip a:focus-visible { color: var(--c-orange); text-decoration: underline; }
.trust-sep { opacity: 0.5; }

/* Every address the report shows will link to SonicScan (Task 6). Visited-safe
   pinning so a researched address stays readable, not purple — a bare rule
   (0,1,0) LOSES to the UA's `a:visited` (0,1,1), which is exactly the bug that
   made honeypot.html's finding links go purple (owner report 2026-08-10). */
.receipt-addr-link,
.receipt-addr-link:visited {
  color: var(--c-gold);
  text-decoration: underline;
  word-break: break-all;
}
.receipt-addr-link:hover { color: #fff; }

/* .receipt-tx-link (the tx-hash link under the headline) had no color rule
   of its own and rendered browser-default blue on this dark card — same
   bug .receipt-addr-link was already fixed for. #receiptLines a /
   #receiptAdvanced a pin the identical values directly on the two line
   containers (belt-and-suspenders alongside the .receipt-lines class rule
   below) so any anchor rendered inside a line item — e.g. the Revoker link —
   is covered even if a future change drops the shared class. Values match
   .receipt-addr-link exactly; never invent a new color here. */
.receipt-tx-link,
.receipt-tx-link:visited,
#receiptLines a,
#receiptLines a:visited,
#receiptAdvanced a,
#receiptAdvanced a:visited {
  color: var(--c-gold);
  text-decoration: underline;
  word-break: break-all;
}
.receipt-tx-link:hover,
#receiptLines a:hover,
#receiptAdvanced a:hover {
  color: #fff;
}

/* Any inline learn-more / revoker link inside a rendered line gets the same
   gold, high-contrast, visited-safe treatment — never the browser-default
   link blue that was unreadable on this dark panel. */
.receipt-lines a,
.receipt-lines a:visited {
  color: var(--c-gold);
  font-weight: bold;
  text-decoration: underline;
}
.receipt-lines a:hover { color: #fff; }

/* How it works — a plain-English primer, left rail. */
.receipt-help { text-align: left; }
.receipt-help h2 { margin: 0 0 10px; color: var(--c-gold); font-size: 1.05rem; }
.receipt-help p { margin: 0 0 10px; color: rgba(255,255,255,.9); line-height: 1.55; font-size: 0.92rem; }
.receipt-help p:last-child { margin-bottom: 0; }
.receipt-help strong { color: var(--c-gold); }

/* Three bands: how-it-works (left) · tool (center) · limits (right). Center is
   FIRST in source so it leads on a phone. On desktop the grid pins each band to
   its column regardless of source order. Fractional tracks (grow with the
   viewport) never fixed caps — the caps-collapse lesson from revoker.css. */
.receipt-grid { display: block; }
.receipt-center > * { margin-left: auto; margin-right: auto; }
.receipt-help, .receipt-limits { text-align: left; }

@media screen and (min-width: 1200px) {
  .container { max-width: 1500px; }
  .receipt-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(0, 2.1fr) minmax(240px, 1.15fr);
    gap: 20px;
    align-items: start;
  }
  .receipt-help    { grid-column: 1; grid-row: 1; margin: 0; }
  .receipt-center  { grid-column: 2; grid-row: 1; }
  .receipt-limits  { grid-column: 3; grid-row: 1; margin: 0; }
}

@media screen and (max-width: 768px) { .container { margin: 12px auto; padding: 16px 12px 32px; } }

/* Same as honeypot.css: centred full-width tagline, capped so it does not run
   to ~175 characters on a wide screen. Centred, so no gap. */
.receipt-tagline {
    max-width: 68ch;
    margin-left: auto;
    margin-right: auto;
}
