/* WEB3MB — custom.css
   Everything expressible through theme.json (color, type, spacing) lives there.
   This file covers the bespoke components the Design System defines that core
   blocks can't fully express on their own: the Evidence Card, the methodology
   diagram, icons, trust badges, and the universal focus-state / motion rules.
   Design System reference: Sections 5, 6.2, 6.9, 7, 8. */

/* ===== Accessibility — universal focus states, no exceptions (Design System §7) ===== */
a:focus-visible, button:focus-visible, .wp-element-button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--wp--preset--color--trust-green);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== Nav — hairline appears on scroll only, no shadow (Design System §6.6) ===== */
.web3mb-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--wp--preset--color--trust-blue);
  border-bottom: 1px solid transparent;
  transition: border-color 150ms var(--wp--custom--motion--easing, ease);
}
.web3mb-nav.is-scrolled {
  border-bottom-color: var(--wp--preset--color--border);
}
.web3mb-primary-nav a {
  text-decoration: none;
  color: var(--wp--preset--color--integrity-black);
}
.web3mb-primary-nav a:hover {
  color: var(--wp--preset--color--trust-green);
}

/* ===== Scroll-reveal (Design System §8) ===== */
.web3mb-reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms cubic-bezier(0.4,0,0.2,1), transform 400ms cubic-bezier(0.4,0,0.2,1);
}
.web3mb-reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .web3mb-reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Trust badges (hero) ===== */
.web3mb-trust-badges {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--wp--preset--color--border);
}
.web3mb-trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--wp--preset--color--stone);
}
.web3mb-trust-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--wp--preset--color--trust-green);
  flex-shrink: 0;
}

/* ===== Evidence Card (Design System §6.2, extended for self-assessment §6.9 honesty rule) ===== */
.web3mb-evidence-card {
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--paper-white);
  border-radius: 6px;
  padding: 28px;
}

/* ===== Buttons — Trust Green hover glow, "interactive states" per WEB3MB Trust System ===== */
.wp-block-button__link:hover,
.wp-element-button:hover {
  box-shadow: 0 0 0 6px rgba(0,143,106,0.15); /* Trust Green Glow — matches theme.json custom.trustGreenGlow */
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--wp--preset--color--surface-raised);
  border-color: var(--wp--preset--color--trust-green);
  color: var(--wp--preset--color--trust-green-deep);
  box-shadow: none;
}
.web3mb-status-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.web3mb-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.web3mb-status-dot.is-verified { background: var(--wp--preset--color--verification-green); }
.web3mb-status-dot.is-caution { background: var(--wp--preset--color--caution); }
.web3mb-status-dot.is-flagged { background: var(--wp--preset--color--flagged); }
.web3mb-status-dot.is-self-assessment { background: var(--wp--preset--color--seal-brass); }
.web3mb-status-note { font-size: 12px; color: var(--wp--preset--color--stone); margin-bottom: 14px; }
.web3mb-card-date { font-family: var(--wp--preset--font-family--plex-mono); font-size: 12px; color: var(--wp--preset--color--stone); margin-bottom: 16px; }

/* ===== What We Do — icons (Design System §4, replaces sequence numbering) ===== */
.web3mb-icon { width: 30px; height: 30px; color: var(--wp--preset--color--trust-green); margin-bottom: 16px; }

/* ===== Methodology diagram ===== */
.web3mb-diagram {
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 6px;
  background: var(--wp--preset--color--surface-raised);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.web3mb-diagram-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.web3mb-diagram-node { width: 10px; height: 10px; border-radius: 50%; background: var(--wp--preset--color--trust-green); flex-shrink: 0; }
.web3mb-diagram-node.is-scheduled { background: var(--wp--preset--color--seal-brass); }
.web3mb-diagram-line { flex: 1; height: 1px; background: var(--wp--preset--color--border); }

/* ===== Founder photo placeholder — remove once a real portrait is uploaded ===== */
.web3mb-founder-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--wp--preset--color--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--wp--preset--color--stone);
  text-align: center;
  padding: 16px;
  font-family: var(--wp--preset--font-family--plex-mono);
}

/* ===== Governance seal mark ===== */
.web3mb-gov-mark {
  width: 64px; height: 64px;
  border: 1.5px solid var(--wp--preset--color--seal-brass);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--wp--preset--color--seal-brass);
  font-family: var(--wp--preset--font-family--newsreader);
  font-size: 22px;
}

/* ===== Ledger Line — long-form pages only (Design System §5). Not used on the homepage;
   included here so it ships with the theme for the About / Research / Registry templates
   built in later phases. ===== */
.web3mb-ledger {
  position: relative;
  padding-left: 32px;
  border-left: 2px solid var(--wp--preset--color--border);
}
.web3mb-ledger-tick {
  font-family: var(--wp--preset--font-family--plex-mono);
  font-size: 11px;
  color: var(--wp--preset--color--stone);
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}

/* ===== Logo sizing — explicit, not inferred from block width (Correction 2, founder-specified) =====
   Block width attributes are set to a reasonable estimate for the editor preview, but actual
   rendered size is controlled here directly, since the source file's internal padding made the
   width-to-visible-size ratio unreliable to guess twice already. Nav target: 48–64px range,
   set to 56px. Footer stays modestly larger, in the same proportion used before this correction. */
.web3mb-nav-logo img,
.web3mb-nav .wp-block-site-logo img {
  height: 56px !important;
  width: auto !important;
  max-height: none;
}
.web3mb-footer-logo img,
footer .wp-block-site-logo img {
  height: 78px !important;
  width: auto !important;
  max-height: none;
}

/* ===== Mobile navigation — Correction 3 =====
   WordPress core's Navigation block ships with accessible overlay behavior built in: keyboard
   support, correct ARIA (aria-expanded on the toggle, role="dialog" + aria-modal on the panel),
   focus moved into the panel on open and returned to the toggle on close, and Escape-to-close —
   all provided by WordPress core, not hand-rolled here. This section configures and styles that
   built-in behavior rather than replacing it, which is the more robust choice than a custom
   implementation. The "overlayMenu":"mobile" attribute in parts/header.html enables it; the
   Request Verification button lives outside the wp:navigation block entirely, so it is never
   hidden behind the mobile toggle and stays reachable at every breakpoint. */
.wp-block-navigation__responsive-container-open {
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 4px;
  background: transparent;
}
.wp-block-navigation__responsive-container-open:focus-visible,
.wp-block-navigation__responsive-container-close:focus-visible {
  outline: 2px solid var(--wp--preset--color--trust-green);
  outline-offset: 2px;
}
.wp-block-navigation__responsive-container.is-menu-open {
  background: var(--wp--preset--color--trust-blue);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
  font-family: var(--wp--preset--font-family--plex-sans);
  font-size: 20px;
  color: var(--wp--preset--color--integrity-black);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:focus-visible {
  color: var(--wp--preset--color--trust-green);
}

/* Keep the nav row from crowding on narrow screens now that logo + toggle + CTA share one row */
@media (max-width: 480px) {
  .web3mb-nav .wp-block-buttons .wp-block-button__link {
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* ===== Long-form page components — Why WEB3MB, The Promise ===== */
.web3mb-ledger-entry { margin-bottom: 56px; }
.web3mb-ledger-entry:last-child { margin-bottom: 0; }

.web3mb-quote-block {
  border-left: 2px solid var(--wp--preset--color--border);
  padding-left: 24px;
  max-width: 620px;
}
.web3mb-quote-block p {
  font-family: var(--wp--preset--font-family--newsreader);
  font-style: italic;
  font-size: 22px;
  line-height: 1.45;
}

.web3mb-principle-row {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--wp--preset--color--border);
}
.web3mb-principle-row:last-child { border-bottom: 1px solid var(--wp--preset--color--border); }
.web3mb-principle-num {
  font-family: var(--wp--preset--font-family--plex-mono);
  font-size: 13px;
  color: var(--wp--preset--color--stone);
  width: 24px;
  flex-shrink: 0;
}
.web3mb-principle-text {
  font-family: var(--wp--preset--font-family--newsreader);
  font-size: 26px;
}

.web3mb-letter-section { background: var(--wp--preset--color--paper-white); }
.web3mb-letter-body { max-width: 640px; margin: 0 auto; }
.web3mb-letter-body p { font-size: 17px; margin-bottom: 22px; }
.web3mb-letter-sign { margin-top: 32px; font-family: var(--wp--preset--font-family--newsreader); font-size: 19px; }
.web3mb-letter-sign span { display: block; font-family: var(--wp--preset--font-family--plex-sans); font-size: 14px; color: var(--wp--preset--color--stone); margin-top: 4px; }

.web3mb-promise-item {
  font-family: var(--wp--preset--font-family--newsreader);
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.5;
  padding: 28px 0;
  border-top: 1px solid var(--wp--preset--color--border);
  list-style: none;
}
.web3mb-promise-list { list-style: none; margin: 0; padding: 0; }
.web3mb-promise-list li:last-child { border-bottom: 1px solid var(--wp--preset--color--border); }

/* ===== Shared components for Governance, Trust Standards, Research, Reading Room,
   Reports, Connect, Contact, Partner With Us — consolidated here so every page pulls
   from one definition instead of repeating ad hoc styles per page. ===== */

.web3mb-not-yet {
  border: 1px dashed var(--wp--preset--color--border);
  border-radius: 6px;
  padding: 20px 24px;
  font-size: 14px;
  color: var(--wp--preset--color--stone);
  margin-top: 12px;
  max-width: 680px;
}

.web3mb-version-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--wp--preset--color--border);
  font-size: 14px;
}
.web3mb-version-row:last-child { border-bottom: 1px solid var(--wp--preset--color--border); }
.web3mb-version-tag {
  font-family: var(--wp--preset--font-family--plex-mono);
  font-size: 12px;
  background: var(--wp--preset--color--surface-raised);
  padding: 4px 10px;
  border-radius: 4px;
}

.web3mb-cat-pill {
  font-family: var(--wp--preset--font-family--plex-mono);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--wp--preset--color--border);
  color: var(--wp--preset--color--stone);
  display: inline-block;
}
.web3mb-cat-pill.is-active {
  border-color: var(--wp--preset--color--trust-green);
  color: var(--wp--preset--color--trust-green);
  background: rgba(0,143,106,0.06);
  font-weight: 500;
}
.web3mb-cat-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.web3mb-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 700px) { .web3mb-card-grid { grid-template-columns: 1fr; } }
.web3mb-info-card {
  background: var(--wp--preset--color--paper-white);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 6px;
  padding: 22px;
}
.web3mb-info-card h3 { font-size: 18px; margin: 0 0 8px 0; font-family: var(--wp--preset--font-family--newsreader); font-weight: 500; }
.web3mb-info-card p { font-size: 14px; color: var(--wp--preset--color--stone); margin: 0; }
.web3mb-status-tag {
  display: inline-block;
  font-size: 11px;
  font-family: var(--wp--preset--font-family--plex-mono);
  color: var(--wp--preset--color--stone);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 12px;
  padding: 2px 10px;
  margin-top: 8px;
}

.web3mb-featured-card {
  background: var(--wp--preset--color--paper-white);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 6px;
  padding: 32px;
  max-width: 640px;
}
.web3mb-featured-card h3 { font-size: 22px; margin: 0 0 10px 0; }
.web3mb-featured-card p { color: var(--wp--preset--color--stone); font-size: 15px; margin: 0 0 14px 0; }
.web3mb-featured-card .web3mb-meta { font-family: var(--wp--preset--font-family--plex-mono); font-size: 12px; color: var(--wp--preset--color--stone); margin-bottom: 16px; }

/* Forms — Design System §6.7, shared across Contact and Connect */
.web3mb-form-panel {
  background: var(--wp--preset--color--paper-white);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 6px;
  padding: 32px;
  max-width: 560px;
}
.web3mb-form-panel label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.web3mb-form-panel .web3mb-req { color: var(--wp--preset--color--stone); font-weight: 400; }
.web3mb-form-panel input,
.web3mb-form-panel textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 6px;
  font-family: var(--wp--preset--font-family--plex-sans);
  font-size: 15px;
  margin-bottom: 18px;
  background: var(--wp--preset--color--trust-blue);
  color: var(--wp--preset--color--integrity-black);
}
.web3mb-form-panel input:focus-visible,
.web3mb-form-panel textarea:focus-visible {
  outline: 2px solid var(--wp--preset--color--trust-green);
  outline-offset: 2px;
  border-color: var(--wp--preset--color--trust-green);
}
.web3mb-form-panel textarea { min-height: 120px; resize: vertical; }
.web3mb-form-note { font-size: 12px; color: var(--wp--preset--color--stone); margin-top: 16px; }

.web3mb-intent-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.web3mb-intent-tab {
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 20px;
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--paper-white);
  color: var(--wp--preset--color--integrity-black);
}
.web3mb-intent-tab.is-active { border-color: var(--wp--preset--color--trust-green); color: var(--wp--preset--color--trust-green); font-weight: 500; }

.web3mb-report-table { width: 100%; border-collapse: collapse; margin-top: 32px; font-size: 14px; }
.web3mb-report-table th { text-align: left; padding: 10px 12px; font-weight: 500; color: var(--wp--preset--color--stone); border-bottom: 1px solid var(--wp--preset--color--border); }
.web3mb-report-table td { padding: 14px 12px; border-bottom: 1px solid var(--wp--preset--color--border); color: var(--wp--preset--color--stone); }

/* Page header — shared across every institutional page for a consistent first impression */
.web3mb-page-header { padding: 80px 0 40px; }
.web3mb-page-header h1 { font-size: clamp(32px, 4.5vw, 48px); max-width: 760px; }
.web3mb-page-header .web3mb-lead { font-size: 19px; color: var(--wp--preset--color--stone); max-width: 620px; }
