/* =============================================================
   ProAlert - Whitepaper / Technical Brief Styles
   Used by pages under /resources/. Loaded alongside main.css
   and features-detail.css. Inherits all brand tokens from
   main.css (--accent, --font-head, --font-body, etc).
   ============================================================= */

/* ===== DOCUMENT CONTROL BLOCK (in the dark module hero) ===== */
.wp-docmeta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 44px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.wp-docmeta div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 0;
}

.wp-docmeta dt {
  font-family: var(--font-head);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.wp-docmeta dd {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
}

/* ===== READING META (time to read, print/PDF actions) ===== */
.wp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding-bottom: 22px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-light);
}

.wp-actions i { color: var(--accent-dark); }

.wp-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--white);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dark);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.wp-print-btn:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ===== IN-PAGE CONTENTS ===== */
.wp-toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 40px;
}

.wp-toc h2 {
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 12px;
}

.wp-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 4px 24px;
}

.wp-toc a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.2s;
}

.wp-toc a:hover { color: var(--accent-dark); }

.wp-toc a b {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-dark);
  flex-shrink: 0;
}

/* ===== "THE SHORT ANSWERS" SUMMARY PANEL ===== */
.wp-summary {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--text-dark);
  border-radius: 0 0 8px 8px;
  padding: 26px 30px 10px;
  margin-bottom: 48px;
}

.wp-summary > h2 {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 4px;
}

.wp-summary ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wp-summary li {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 0 18px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.wp-summary li:first-child { border-top: none; }

.wp-summary li > b {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  padding-top: 4px;
}

/* The question itself, linked to its full section */
.wp-summary .wp-sq {
  display: block;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-dark);
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.wp-summary .wp-sq:hover { color: var(--accent-dark); }

.wp-summary .wp-sq i {
  font-size: 10px;
  color: var(--accent);
  margin-left: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}

.wp-summary .wp-sq:hover i { opacity: 1; }

.wp-summary li p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-mid);
}

/* Trailing pointer to the non-question section */
.wp-summary-more {
  padding: 16px 0 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-light);
}

.wp-summary-more a {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--accent-dark);
  text-decoration: none;
}

.wp-summary-more a:hover { text-decoration: underline; }

/* ===== NUMBERED Q&A SECTIONS WITH STICKY RAIL ===== */
.wp-qa {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0 40px;
  padding: 44px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 90px;
}

.wp-qa:first-of-type { border-top: none; padding-top: 8px; }

.wp-rail-sticky {
  position: sticky;
  top: 92px;
  display: block;
}

.wp-rail-num {
  display: block;
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}

.wp-rail-tag {
  display: block;
  margin-top: 8px;
  font-family: var(--font-head);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-light);
}

.wp-qa-body > h2 {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.25;
  margin-bottom: 18px;
}

.wp-qa-body h3 {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin: 32px 0 12px;
}

.wp-qa-body p {
  color: var(--text-mid);
  margin-bottom: 14px;
  max-width: 68ch;
}

.wp-qa-body strong { color: var(--text-dark); font-weight: 700; }

/* The question being answered */
.wp-question {
  margin: 0 0 24px;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--border);
  color: var(--text-light);
  font-style: italic;
  font-size: 14px;
  line-height: 1.7;
  max-width: 68ch;
}

/* Lead paragraph carrying the headline answer */
.wp-lead {
  font-size: 16.5px !important;
  line-height: 1.7;
  color: var(--text-dark) !important;
}

.wp-lead strong { color: var(--accent-dark) !important; }

/* ===== CAPTURE-METHOD PILLS ===== */
.wp-pill {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  padding: 2px 7px;
  margin-right: 8px;
  vertical-align: middle;
  white-space: nowrap;
}

.wp-pill-auto { background: #dbeafe; color: #1e40af; }
.wp-pill-man  { background: #dcfce7; color: #166534; }
.wp-pill-cfg  { background: #fef9c3; color: #854d0e; }

/* Rows that offer one capture method or the other */
.wp-opt { margin: 0 0 8px !important; font-size: 13px !important; }
.wp-opt:last-child { margin-bottom: 0 !important; }

.wp-either {
  margin: 0 0 8px !important;
  font-family: var(--font-head);
  font-size: 9.5px !important;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light) !important;
}

/* ===== FORMULA BLOCKS ===== */
.wp-formula {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 22px 26px;
  margin: 26px 0;
}

.wp-formula h4 {
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 14px;
}

.wp-formula dl { margin: 0; }

.wp-formula dl > div {
  display: grid;
  grid-template-columns: 15rem 1fr;
  gap: 0 20px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.wp-formula dl > div:first-of-type { border-top: none; }

.wp-formula dt {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
}

.wp-formula dd {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-mid);
}

.wp-formula .wp-op {
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 0 4px;
}

.wp-formula .wp-final {
  margin-top: 4px;
  border-top: 2px solid var(--accent) !important;
}

.wp-formula .wp-final dt { color: var(--accent-dark); }
.wp-formula .wp-final dd { color: var(--text-dark); font-weight: 700; }

.wp-formula-note {
  margin: 14px 0 0 !important;
  font-size: 12px !important;
  color: var(--text-light) !important;
  line-height: 1.6;
}

/* ===== TABLES ===== */
.wp-tscroll {
  overflow-x: auto;
  margin: 22px 0 26px;
  -webkit-overflow-scrolling: touch;
}

.wp-tscroll .fp-table { min-width: 34rem; margin-top: 0; }

.wp-tscroll caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-light);
  padding-bottom: 10px;
}

/* Row-header cells in tables that use <th scope="row"> */
.fp-table tbody th[scope="row"] {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dark);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.fp-table tbody tr:last-child th[scope="row"] { border-bottom: none; }

.fp-table .wp-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fp-table td.wp-num { font-weight: 600; color: var(--text-dark); }

.fp-table tr.wp-total th[scope="row"],
.fp-table tr.wp-total td {
  background: #f0fdf0;
  color: var(--text-dark);
  font-weight: 700;
  border-bottom: none;
}

.fp-table tr.wp-total td.wp-num { color: var(--accent-dark); }

/* ===== CLOSING CTA ===== */
.wp-cta {
  background: var(--text-dark);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 30px 34px;
  margin-top: 52px;
}

.wp-cta h2 {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
}

.wp-cta p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  margin-bottom: 20px;
  max-width: 62ch;
}

.wp-cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.wp-cta-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 5px;
  font-family: var(--font-head);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.wp-cta-links .wp-cta-primary {
  background: var(--accent);
  color: #06210a;
}

.wp-cta-links .wp-cta-primary:hover { background: var(--accent-dark); }

.wp-cta-links .wp-cta-secondary {
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.85);
}

.wp-cta-links .wp-cta-secondary:hover { border-color: var(--accent); color: var(--white); }

/* ===== RESOURCES INDEX CARDS ===== */
.wp-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.wp-index-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 6px;
  padding: 24px 26px 20px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}

.wp-index-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.wp-index-kind {
  font-family: var(--font-head);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 10px;
}

.wp-index-card h3 {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 10px;
}

.wp-index-card p {
  font-size: 13.5px;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 18px;
  flex: 1;
}

.wp-index-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-light);
}

.wp-index-foot span:last-child {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

/* Interactive tools read dark, echoing how ProAlert renders on the floor,
   so a tool is visually distinct from a document at a glance. */
.wp-index-card--tool {
  background: var(--text-dark);
  border-color: rgba(55, 202, 55, 0.28);
}

.wp-index-card--tool:hover { border-color: var(--accent); }
.wp-index-card--tool .wp-index-kind { color: var(--accent); }
.wp-index-card--tool h3 { color: var(--white); }
.wp-index-card--tool p { color: rgba(255, 255, 255, 0.66); }

.wp-index-card--tool .wp-index-foot {
  border-top-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.42);
}

.wp-index-card--tool .wp-index-foot span:last-child { color: var(--accent); }

/* Paired-companion callout: sends the reader between brief and sandbox */
.wp-pair {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--text-dark);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin: 30px 0;
}

.wp-pair-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(55, 202, 55, 0.14);
  border: 1px solid rgba(55, 202, 55, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 17px;
}

.wp-pair-text { flex: 1 1 300px; }

.wp-pair-text b {
  display: block;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.wp-pair-text span {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.62);
}

.wp-pair a.wp-pair-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 20px;
  border-radius: 5px;
  background: var(--accent);
  color: #06210a;
  font-family: var(--font-head);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s;
}

.wp-pair a.wp-pair-go:hover { background: var(--accent-dark); }

@media (max-width: 640px) {
  .wp-pair { padding: 18px; }
  .wp-pair a.wp-pair-go { width: 100%; justify-content: center; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .wp-qa { grid-template-columns: 1fr; gap: 0; padding: 34px 0; }
  .wp-rail-sticky {
    position: static;
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 14px;
  }
  .wp-rail-num { font-size: 22px; }
  .wp-rail-tag { margin-top: 0; }
  .wp-formula dl > div { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 640px) {
  .wp-summary { padding: 20px 20px 6px; }
  .wp-summary li { grid-template-columns: 1fr; gap: 6px; }
  .wp-qa-body > h2 { font-size: 20px; }
  .wp-docmeta { gap: 0 28px; }
  .wp-cta { padding: 24px; }
  .wp-cta-links a { flex: 1 1 100%; justify-content: center; }
  .wp-print-btn { margin-left: 0; }
}

/* ===== PRINT ===== */
@media print {
  body { background: var(--white) !important; }
  .bottom-nav,
  .nav-overlay,
  .nav-backdrop,
  .page-header,
  .site-footer,
  .wp-actions,
  .wp-toc,
  .wp-cta,
  .breadcrumb,
  .ghl-modal,
  #proalertHelpWidget { display: none !important; }

  .main-wrapper,
  .content-area { margin: 0 !important; padding: 0 !important; max-width: none !important; box-shadow: none !important; }

  .section { padding: 0 !important; }

  .module-hero {
    background: var(--white) !important;
    color: var(--text-dark) !important;
    border-bottom: 3px solid #000 !important;
    padding: 0 0 20px !important;
  }
  .module-hero h1,
  .module-hero p,
  .wp-docmeta dd { color: #000 !important; }
  .wp-docmeta dt { color: #555 !important; }
  .wp-docmeta { border-top-color: #ccc !important; }
  .module-hero-icon,
  .module-feature-count { display: none !important; }

  .wp-qa { page-break-inside: avoid; border-top: 1px solid #ccc; }
  .wp-tscroll { overflow: visible; page-break-inside: avoid; }
  .fp-table { font-size: 10pt; }
  .wp-formula, .wp-summary { page-break-inside: avoid; }
  a[href]::after { content: ""; }
}
