/* Book of Odds: base styles loaded on every page (and in the editor). */

/* Base */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--wp--preset--color--white);
  color: var(--wp--preset--color--navy);
  font-family: var(--wp--preset--font-family--inter);
}
a {
  text-underline-offset: .2em;
}
a:hover {
  text-decoration-thickness: 2px;
}
/* Focus system: one visible ring for every interactive element.
   Panels set --boo-focus so the ring keeps contrast against their background. */
:is(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 3px solid var(--boo-focus, var(--wp--custom--focus));
  outline-offset: 3px;
}
.has-navy-background-color:not(.wp-element-button),
.boo-quiz,
.boo-quiz-score,
.boo-corrections,
.boo-about-number,
.boo-outlier-sample,
.boo-editable .newsletter,
.boo-probability .newsletter {
  --boo-focus: var(--wp--custom--focus-on-dark);
}
.has-blue-background-color:not(.wp-element-button),
.boo-info-closing {
  --boo-focus: var(--wp--custom--focus-on-accent);
}
/* Light cards nested inside dark panels go back to the default ring. */
.boo-sample-card,
.boo-quiz-feedback {
  --boo-focus: var(--wp--custom--focus);
}

/* Layout, header and footer */
.wp-site-blocks {
  padding: 0 28px;
}
.wp-site-blocks>header,
.wp-site-blocks>footer {
  max-width: 1280px;
  margin: auto;
}
.boo-header {
  min-height: 106px;
  gap: 24px !important;
  margin: 0 auto !important;
}
.boo-wordmark {
  font-weight: 850;
  font-size: clamp(23px,2.3vw,34px);
  letter-spacing: -.07em;
  line-height: 1.15;
  white-space: nowrap;
}
.boo-wordmark a {
  color: var(--wp--preset--color--navy);
  text-decoration: none;
  text-transform: lowercase;
}
.boo-wordmark:after {
  content: '✱';
  color: var(--wp--preset--color--blue);
  margin-left: 4px;
  position: relative;
  top: -.2em;
  letter-spacing: 0;
}
.boo-header nav {
  font-size: 13px;
  font-weight: 650;
}
.boo-header-cta a {
  font-size: 13px;
  padding: 15px 20px;
}

/* Shared components: eyebrow and story cards */
.boo-eyebrow {
  font-size: 11px !important;
  letter-spacing: .18em;
  font-weight: 750;
  text-transform: uppercase;
  line-height: 1.5 !important;
}
.boo-stories {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 24px;
}
.boo-story img {
  width: 100%;
  height: auto;
  aspect-ratio: 3/2;
  object-fit: cover;
  display: block;
}
.boo-story h3 {
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -.04em;
  margin: 8px 0;
}
.boo-story h3 a {
  color: var(--wp--preset--color--navy);
  text-decoration: none;
}
.boo-story .boo-eyebrow {
  color: var(--wp--preset--color--blue);
  margin: 16px 0 6px;
}
.boo-story p {
  color: var(--wp--preset--color--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 10px 0;
}
.boo-story>a {
  display: inline-block;
  text-decoration: none;
}
.boo-demo-label {
  font-size: 11px;
  color: var(--wp--preset--color--muted);
  margin: 14px 0;
}

/* Quiz teaser block (kept in base: its h2/button/eyebrow rules must precede .boo-newsletter so a newsletter nested in a quiz panel keeps winning) */
.boo-quiz {
  background: var(--wp--preset--color--navy);
  color: var(--wp--preset--color--white);
  padding: 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 30px;
  margin: 40px 0;
}
.boo-quiz h2 {
  font-size: clamp(28px,4vw,48px);
  margin: 8px 0 25px;
}
.boo-quiz .boo-eyebrow {
  color: var(--wp--preset--color--lime);
  margin: 0;
}
.boo-quiz-choices {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.boo-quiz button {
  border: 1px solid #aab3c6;
  border-radius: 4px;
  background: transparent;
  color: var(--wp--preset--color--white);
  padding: 15px;
  text-align: left;
  font: 600 15px var(--wp--preset--font-family--inter);
  cursor: pointer;
  flex: 1;
  min-width: 160px;
}
.boo-quiz button:hover {
  background: var(--wp--custom--navy-hover);
}
.boo-quiz button[aria-pressed=true] {
  outline: 2px solid var(--wp--preset--color--lime);
}
.boo-quiz-art {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: clamp(80px,12vw,150px);
  line-height: 1;
  gap: 12px;
}
.boo-quiz-art b:first-child {
  color: var(--wp--preset--color--blue-on-dark);
  transform: rotate(-12deg);
}
.boo-quiz-art b:last-child {
  color: var(--wp--preset--color--lime);
  transform: rotate(12deg);
}
.boo-quiz-art span {
  font-size: 20px;
}
.boo-quiz-note {
  font-size: 12px;
  color: #c4cce0;
}
.boo-quiz-result {
  font-size: 15px;
}

/* Newsletter */
.boo-newsletter {
  border-top: 2px solid var(--wp--preset--color--blue);
  padding: 30px 0;
  margin: 38px 0;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
}
.boo-newsletter h2 {
  font-size: clamp(25px,3vw,37px);
  margin: 4px 0 10px;
  letter-spacing: -.045em;
}
.boo-newsletter p {
  font-size: 15px;
  color: var(--wp--preset--color--muted);
  margin: 0;
}
.boo-newsletter .boo-eyebrow {
  color: #304615;
}
.boo-newsletter input[type=email] {
  min-width: 0;
  max-width: 100%;
  padding: 15px;
  border: 1px solid var(--wp--custom--control-border);
  border-radius: 3px;
  font: 14px var(--wp--preset--font-family--inter);
}
.boo-newsletter input[type=submit],
.boo-newsletter button {
  background: var(--wp--preset--color--blue);
  color: var(--wp--preset--color--white);
  border: 0;
  padding: 16px 22px;
  border-radius: 3px;
  font: 600 14px var(--wp--preset--font-family--inter);
  cursor: pointer;
}
.boo-newsletter small {
  display: block;
  font-size: 11px;
  color: var(--wp--preset--color--muted);
  margin-top: 10px;
}
.boo-newsletter-preview {
  display: flex;
  gap: 8px;
}
.boo-newsletter button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* Footer */
.boo-footer {
  border-top: 1px solid var(--wp--custom--line);
  padding: 24px 0 32px;
  margin: 0 auto !important;
  gap: 30px;
}
.boo-footer .boo-wordmark {
  font-size: 25px;
}
.boo-footer nav {
  font-size: 12px;
}

/* Page and article shells */
.boo-page,
.boo-article {
  padding: 40px 0 60px;
  min-height: 50vh;
}
.boo-page h1,
.boo-article h1 {
  font-size: clamp(38px,5vw,64px);
  line-height: 1.04;
}

/* Big number (articles and hub cards) */
.boo-number {
  font-size: clamp(42px,6vw,76px);
  font-weight: 850;
  letter-spacing: -.055em;
  line-height: 1.05;
  color: var(--wp--preset--color--blue);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Charts and tables */
.boo-chart {
  margin: 26px 0;
}
.boo-chart svg {
  max-width: 100%;
  height: auto;
  display: block;
}
.boo-chart details {
  font-size: 13px;
  margin-top: 12px;
}
.boo-chart summary {
  cursor: pointer;
  color: var(--wp--preset--color--blue);
  font-weight: 650;
}
.boo-table-wrap {
  overflow-x: auto;
}
.boo-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  margin: 18px 0;
}
.boo-table th,
.boo-table td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--wp--custom--line);
}
.boo-table th {
  background: var(--wp--preset--color--lavender);
}

/* Utilities */
.boo-sort {
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.boo-skip {
  position: absolute;
  left: -9999px;
}
.boo-skip:focus {
  left: 20px;
  top: 20px;
  background: var(--wp--preset--color--white);
  z-index: 100000;
}
@media (max-width: 900px) {
  .boo-header-cta {
    display: none !important;
  }
  .boo-header nav {
    font-size: 12px;
  }
  .boo-quiz {
    padding: 28px;
  }
}
@media (max-width: 600px) {
  .wp-site-blocks {
    padding: 0 20px;
  }
  .boo-header {
    min-height: 78px;
  }
  .boo-header .boo-wordmark {
    font-size: 27px;
  }
  .boo-stories {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .boo-story h3 {
    font-size: 28px;
  }
  .boo-quiz {
    grid-template-columns: 1fr;
    padding: 25px;
    margin: 35px 0;
  }
  .boo-quiz-art {
    display: none;
  }
  .boo-newsletter {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .boo-newsletter-preview {
    flex-wrap: wrap;
  }
  .boo-newsletter h2 {
    font-size: 30px;
  }
  .boo-footer nav {
    flex-basis: 100%;
  }
  .boo-page,
  .boo-article {
    padding-top: 25px;
  }
  .boo-number {
    font-size: 48px;
  }
  .boo-quiz-choices {
    flex-direction: column;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}

/* Breadcrumb (browse) */
.boo-breadcrumb {
  font-size: 14px;
  margin: 0 0 36px;
}
.boo-breadcrumb a {
  color: var(--wp--preset--color--blue);
  text-decoration: none;
}

/* Topic pills */
.boo-topic-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 0 26px;
  margin: 32px 0;
  border-bottom: 1px solid var(--wp--custom--line);
}
.boo-topic-nav a {
  color: var(--wp--preset--color--navy);
  text-decoration: none;
  border: 1px solid var(--wp--custom--line);
  border-radius: 30px;
  padding: 10px 18px;
  font-size: 13px;
}
.boo-topic-nav a:hover {
  background: var(--wp--preset--color--lavender);
}
.boo-topic-nav a[aria-current=page] {
  color: var(--wp--preset--color--white);
  background: var(--wp--preset--color--blue);
  border-color: var(--wp--preset--color--blue);
}

/* Story placeholder and pagination */
.boo-story-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3/2;
  background: var(--wp--preset--color--lavender);
  color: var(--wp--preset--color--blue);
  font-size: 80px;
}
.boo-browse-pagination {
  margin: 36px 0;
}
.boo-browse-pagination ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 0;
}
.boo-browse-pagination a,
.boo-browse-pagination span {
  display: block;
  padding: 10px 14px;
  border: 1px solid var(--wp--custom--line);
  border-radius: 3px;
  color: var(--wp--preset--color--navy);
  text-decoration: none;
  font-size: 14px;
}
.boo-browse-pagination .current {
  background: var(--wp--preset--color--blue);
  border-color: var(--wp--preset--color--blue);
  color: var(--wp--preset--color--white);
}
@media (max-width: 600px) {
  .boo-topic-nav {
    gap: 8px;
  }
  .boo-topic-nav a {
    padding: 9px 12px;
    font-size: 12px;
  }
  .boo-breadcrumb {
    margin-bottom: 24px;
  }
}

/* Provider forms */
.boo-provider-form {
  margin: 26px 0;
  scroll-margin-top: 24px;
}
.boo-provider-form label {
  display: block;
  font-size: 15px;
  margin-bottom: 8px;
}
.boo-provider-form input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]),
.boo-provider-form select,
.boo-provider-form textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--wp--preset--color--navy);
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--custom--control-border);
  border-radius: 3px;
}
.boo-provider-form textarea {
  min-height: 160px;
}
.boo-provider-form button,
.boo-provider-form input[type=submit] {
  background: var(--wp--preset--color--blue);
  color: var(--wp--preset--color--white);
  border: 0;
  border-radius: 3px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.boo-provider-form button:disabled,
.boo-provider-form input:disabled {
  opacity: .6;
  cursor: default;
}
.boo-form-note {
  font-size: 13px !important;
  line-height: 1.6;
  color: var(--wp--preset--color--muted);
  margin-top: 14px !important;
}
.boo-form-note a {
  color: var(--wp--preset--color--blue);
}
@media (max-width: 600px) {
  .boo-provider-form button,
  .boo-provider-form input[type=submit] {
    width: 100%;
  }
}

/* Evidence lines (category layouts and hub cards) */
.boo-category-evidence {
  font-size: 12px !important;
  overflow-wrap: anywhere;
}
.boo-editable .small,
.boo-category-evidence {
  font-size: .9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

/* Charts (v1.5) */
.boo-chart {
  margin: 20px 0;
}
.boo-chart svg {
  width: 100%;
  height: auto;
  max-height: 640px;
}
.boo-chart figcaption {
  font-size: .9rem;
}
.boo-chart details {
  margin-top: 12px;
}
/* Charts: tabular figures and wide/narrow renditions (renderer emits both). */
.boo-chart svg {
  font-variant-numeric: tabular-nums;
}
/* Show the 360-wide rendition whenever the chart's own box is narrow (phones, sidebars, hero cards),
   so labels are never scaled below legibility. */
.boo-chart {
  container-type: inline-size;
}
.boo-chart-narrow {
  display: none;
}
@container (max-width: 560px) {
  .boo-chart-wide {
    display: none;
  }
  .boo-chart-narrow {
    display: block;
  }
}

/* Editor-only notes and panels */
.boo-editor-note {
  padding: 16px;
  background: #fff2bf;
  color: #423400;
  border-left: 4px solid #a07500;
}
.boo-editor-panel {
  background: var(--wp--custom--surface-alt);
  color: var(--wp--preset--color--navy);
  border: 1px solid var(--wp--custom--line);
  padding: 20px;
}
.boo-editor-panel details {
  padding: 12px;
  margin: 12px 0;
  border: 1px solid var(--wp--custom--line);
}
.boo-editor-panel summary {
  cursor: pointer;
  font-weight: 700;
}
.boo-editor-panel input,
.boo-editor-panel textarea {
  color: var(--wp--preset--color--navy);
}

/* Provider form hardening */
.boo-provider-form input:not([type=hidden]) {
  max-width: 100%;
}
.boo-provider-form {
  overflow-wrap: anywhere;
}
@media (max-width: 540px) {
  .boo-chart svg {
    min-width: 0;
  }
}
