/* 1.0.125: Fallacy check box (details.pb-fallacy-check) for PolicyBombs articles.
   Source: /workspace/fallacy-check/component.css. Every selector is scoped under
   body.single-post so the rules cannot apply on pages, archives, the home page or
   other post types. Enqueued only when is_singular( 'post' ) (see functions.php).
   Links point to /logical-fallacies/#<anchor> (anchors shipped in 1.0.124).
   No teal; palette from the theme. */

/* PolicyBombs "Fallacy check" component
   Markup: <details class="pb-fallacy-check"> ... see example.html
   Palette comes from the theme: navy #0F1E3A, blue #2F7DF6 / #1A62C7, muted #5B6578, orange #FF4D2E (accent only).
   No teal. Contrast checked: tag text #A82A12 on #FFF1EC = 6.3:1, muted #5B6578 on #F7F9FD = 5.6:1.
   Specificity note: theme rules `.single .entry-content p {color ... !important}` and `.single .entry-content a`
   force colors, so every selector below is prefixed `.pb-fallacy-check` with `!important` only where the theme does. */

body.single-post details.pb-fallacy-check {
  --pbfc-ink: #0F1E3A;
  --pbfc-muted: #5B6578;
  --pbfc-line: #D6E2F7;
  --pbfc-bg: #F7F9FD;
  --pbfc-blue: #1A62C7;
  --pbfc-tag-bg: #FFF1EC;
  --pbfc-tag-ink: #A82A12;
  box-sizing: border-box;
  margin: 1.6rem 0 1.4rem;
  background: var(--pbfc-bg);
  border: 1px solid var(--pbfc-line);
  border-radius: 6px;
  color: var(--pbfc-ink);
  font-size: .95rem;
  line-height: 1.5;
  scroll-margin-top: calc(var(--pb-header-h, 86px) + 12px);
  max-width: 100%;
}

body.single-post details.pb-fallacy-check *,
body.single-post details.pb-fallacy-check *::before,
body.single-post details.pb-fallacy-check *::after { box-sizing: border-box;
}

/* Summary row: one line on desktop, wraps on mobile. Whole row is the tap target (44px min). */
body.single-post details.pb-fallacy-check > summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem .75rem;
  min-height: 44px;
  padding: .55rem 2.4rem .55rem .9rem;
  position: relative;
  cursor: pointer;
  list-style: none;
  border-radius: 6px;
  user-select: none;
}

body.single-post details.pb-fallacy-check > summary::-webkit-details-marker { display: none;
}

body.single-post details.pb-fallacy-check > summary::marker { content: "";
}

body.single-post details.pb-fallacy-check > summary::after {          /* chevron, no icon font */
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: .5rem;
  height: .5rem;
  margin-top: -.4rem;
  border-right: 2px solid var(--pbfc-muted);
  border-bottom: 2px solid var(--pbfc-muted);
  transform: rotate(45deg);
  transition: transform .15s ease;
}

body.single-post details.pb-fallacy-check[open] > summary::after { transform: rotate(-135deg); margin-top: -.15rem;
}

body.single-post details.pb-fallacy-check > summary:hover { background: #EEF4FF;
}

body.single-post details.pb-fallacy-check > summary:focus-visible { outline: 2px solid #8CC4FF; outline-offset: 2px;
}

body.single-post .pb-fallacy-check .pb-fc__label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pbfc-blue);
  white-space: nowrap;
}

body.single-post .pb-fallacy-check .pb-fc__count { font-weight: 500; color: var(--pbfc-ink); overflow-wrap: anywhere;
}

/* Body */
body.single-post .pb-fallacy-check .pb-fc__body { padding: .15rem .9rem .9rem; border-top: 1px solid var(--pbfc-line);
}

body.single-post .entry-content .pb-fallacy-check .pb-fc__intro,
body.single-post .pb-fallacy-check .pb-fc__intro { margin: .7rem 0 .4rem; font-size: .85rem; color: var(--pbfc-muted) !important;
}

body.single-post .entry-content .pb-fallacy-check ol.pb-fc__list,
body.single-post .pb-fallacy-check ol.pb-fc__list { list-style: none; margin: 0; padding: 0;
}

body.single-post .pb-fallacy-check .pb-fc__item { margin: 0; padding: .85rem 0 .75rem; border-top: 1px solid var(--pbfc-line);
}

body.single-post .pb-fallacy-check .pb-fc__item:first-child { border-top: 0;
}

body.single-post .entry-content .pb-fallacy-check .pb-fc__item p,
body.single-post .pb-fallacy-check .pb-fc__item p { margin: 0 0 .5em; font-size: .93rem; line-height: 1.5; overflow-wrap: anywhere;
}

body.single-post .entry-content .pb-fallacy-check .pb-fc__item p:last-child { margin-bottom: 0;
}

/* Speaker line */
body.single-post .pb-fallacy-check .pb-fc__who { color: var(--pbfc-ink) !important;
}

body.single-post .pb-fallacy-check .pb-fc__side {
  display: inline-block;
  margin-left: .35rem;
  padding: .05rem .45rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: .08em;
}

body.single-post .pb-fallacy-check .pb-fc__side--for { color: var(--pbfc-blue);
}

body.single-post .pb-fallacy-check .pb-fc__side--against { color: var(--pbfc-ink);
}

/* Verbatim quote */
body.single-post .entry-content .pb-fallacy-check .pb-fc__quote,
body.single-post .pb-fallacy-check .pb-fc__quote {
  padding: .45rem .75rem;
  border-left: 3px solid var(--pbfc-line);
  background: #fff;
  border-radius: 0 4px 4px 0;
  font-style: normal;
}

body.single-post .pb-fallacy-check .pb-fc__cite { white-space: normal; font-size: .85em;
}

/* Fallacy tag: small pill, links to the Logical Fallacies page anchor */
body.single-post .entry-content .pb-fallacy-check a.pb-fc__tag,
body.single-post .pb-fallacy-check a.pb-fc__tag {
  display: inline-block;
  margin-right: .4rem;
  padding: .1rem .55rem;
  background: var(--pbfc-tag-bg);
  color: var(--pbfc-tag-ink);
  border: 1px solid #F3C4B6;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

body.single-post .entry-content .pb-fallacy-check a.pb-fc__tag:hover,
body.single-post .pb-fallacy-check a.pb-fc__tag:hover { text-decoration: underline; text-underline-offset: 2px;
}

body.single-post .pb-fallacy-check a.pb-fc__tag:focus-visible { outline: 2px solid #8CC4FF; outline-offset: 2px;
}

/* "Claim still holds?" note */
body.single-post .entry-content .pb-fallacy-check .pb-fc__holds,
body.single-post .pb-fallacy-check .pb-fc__holds { color: var(--pbfc-ink) !important;
}

body.single-post .pb-fallacy-check .pb-fc__holds strong { color: var(--pbfc-ink);
}

/* Full APA reference, smallest text */
body.single-post .entry-content .pb-fallacy-check .pb-fc__ref,
body.single-post .pb-fallacy-check .pb-fc__ref { font-size: .78rem !important; line-height: 1.45; color: var(--pbfc-muted) !important; padding-left: 1.5em; text-indent: -1.5em;
}

body.single-post .entry-content .pb-fallacy-check .pb-fc__ref a,
body.single-post .pb-fallacy-check .pb-fc__ref a { color: var(--pbfc-blue); overflow-wrap: anywhere;
}

/* Links inside the box keep the theme's underline but use the accessible blue */
body.single-post .entry-content .pb-fallacy-check a:not(.pb-fc__tag) { color: var(--pbfc-blue);
}

/* Charitable reading: second line under the "holds" note, muted */
body.single-post .pb-fallacy-check .pb-fc__charity { display: block; margin-top: .35em; font-size: .88em; color: var(--pbfc-muted);
}

body.single-post .pb-fallacy-check .pb-fc__charity strong { color: var(--pbfc-muted);
}

/* Nested "Sources" disclosure: keeps the open box short, full APA one tap away */
body.single-post .pb-fallacy-check details.pb-fc__src { margin: .1rem 0 0;
}

body.single-post .pb-fallacy-check details.pb-fc__src > summary {
  display: inline-block;
  padding: .3rem 0;
  min-height: 32px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--pbfc-blue);
  cursor: pointer;
  list-style: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.single-post .pb-fallacy-check details.pb-fc__src > summary::-webkit-details-marker { display: none;
}

body.single-post .pb-fallacy-check details.pb-fc__src > summary::marker { content: "";
}

body.single-post .pb-fallacy-check details.pb-fc__src > summary::before { content: "+"; text-decoration: none; display: inline-block; width: .9em;
}

body.single-post .pb-fallacy-check details.pb-fc__src[open] > summary::before { content: "-";
}

body.single-post .pb-fallacy-check details.pb-fc__src > summary:focus-visible { outline: 2px solid #8CC4FF; outline-offset: 2px;
}

body.single-post .pb-fallacy-check details.pb-fc__src .pb-fc__ref { margin-bottom: .4em;
}

@media (max-width: 480px) {
body.single-post details.pb-fallacy-check { margin: 1.3rem 0 1.2rem; font-size: .92rem;
}
body.single-post details.pb-fallacy-check > summary { padding-left: .75rem;
}
body.single-post .pb-fallacy-check .pb-fc__body { padding: .1rem .75rem .8rem;
}
body.single-post .pb-fallacy-check .pb-fc__quote { padding: .4rem .6rem;
}
}

@media (prefers-reduced-motion: reduce) {
body.single-post details.pb-fallacy-check > summary::after { transition: none;
}
}

@media print {
body.single-post details.pb-fallacy-check:not([open]) { display: none;
}
}

/* Zero case: "Fallacy check: none documented". Stays a quiet one-line closed box. */
body.single-post details.pb-fallacy-check--none > summary { min-height: 40px;
}

body.single-post details.pb-fallacy-check--none .pb-fc__count { color: var(--pbfc-muted); font-weight: 400;
}

body.single-post details.pb-fallacy-check--none .pb-fc__body { padding-bottom: .6rem;
}

