/* True Stewards Advisory
   Cite-or-embed box + embeddable calculator view.
   Loaded on all eight tool pages alongside styles.css and tools-mobile.css.

   Two jobs:
   1. Style the "Cite or embed this calculator" block at the bottom of each tool page.
   2. Define embed mode (?embed=1), which strips the page down to the calculator plus
      an attribution and disclosure footer, for use inside a third-party iframe.
*/

/* ---------- Cite or embed box ---------- */

.citebox-wrap { background: var(--cream-2); }

.citebox-wrap .lead {
  max-width: 62ch;
}

.citebox {
  background: #fff;
  border: 1px solid #ece3d2;
  border-radius: 10px;
  margin-top: 18px;
  overflow: hidden;
}

.citebox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #faf7f0;
  border-bottom: 1px solid #ece3d2;
}

.citebox-head span {
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.copybtn {
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 600;
  color: var(--teal);
  background: #fff;
  border: 1px solid var(--teal);
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.copybtn:hover { background: var(--teal); color: #fff; }
.copybtn.is-copied { background: var(--gold); border-color: var(--gold); color: #2a2410; }

.citebox-body {
  margin: 0;
  padding: 14px;
  font-family: var(--sans);
  font-size: .88rem;
  line-height: 1.6;
  color: #3c4945;
  word-break: break-word;
}

pre.citebox-body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
  line-height: 1.65;
  white-space: pre-wrap;
  background: #fbfaf7;
  overflow-x: auto;
}

/* ---------- Embed mode (?embed=1) ---------- */

.embed-mode body > * { display: none !important; }
.embed-mode body > #tool { display: block !important; }

.embed-mode body { background: #fff; }
.embed-mode #tool { padding: 18px 0 22px !important; }

.embed-attrib {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #ece3d2;
}

.embed-brand {
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 600;
  color: var(--teal-deep);
  margin: 0 0 10px;
}

.embed-brand a { color: var(--teal); }

.embed-disc {
  font-family: var(--sans);
  font-size: .72rem;
  line-height: 1.55;
  color: #6b7873;
  margin: 0 0 7px;
}

.embed-disc a { color: var(--teal); }

@media (max-width: 640px) {
  .citebox-head { flex-wrap: wrap; }
  pre.citebox-body { font-size: .74rem; }
}
