/* WiCS Research Resources — page styles.
   Reuses the theme variables from ../style.css (--bg, --surface, --accent, etc.). */

.wr-body #wics-root { padding-bottom: 4rem; }

.wr-wrap { max-width: 760px; }

.wr-loading,
.wr-error {
  padding: 3rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.wr-error { color: #f8b4b4; }

.wr-muted { color: var(--text-dim); }

/* ---------- header ---------- */
.wr-header { margin-bottom: 1.75rem; }

.wr-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, #e6edf3 0%, var(--accent) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wr-subtitle {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ---------- disclaimer (scrollable) ---------- */
.wr-disclaimer {
  max-height: 150px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid #f0b429;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.wr-disclaimer-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #f0b429;
  margin-bottom: 0.5rem;
  position: sticky;
  top: -0.15rem;
  background: var(--surface);
}

.wr-disclaimer .wr-p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.wr-disclaimer .wr-p + .wr-p { margin-top: 0.75rem; }

/* ---------- intro ---------- */
/* plain div, not a <section>, so it doesn't inherit the global section padding */
.wr-intro { padding: 0; margin: 0 0 1.75rem; }

.wr-p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
}
.wr-p + .wr-p { margin-top: 1rem; }

/* ---------- sections ---------- */
.wr-section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.wr-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-2);
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.wr-section-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 1rem;
}

.wr-subhead {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin: 2.25rem 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.wr-subhead::before {
  content: '';
  flex-shrink: 0;
  width: 4px;
  height: 1.05em;
  background: var(--accent);
  border-radius: 2px;
}
/* nested (second-level) subsections: white text, muted bar, a touch smaller */
h4.wr-subhead { font-size: 1.1rem; color: var(--text); margin-top: 1.75rem; }
h4.wr-subhead::before { height: 0.9em; background: var(--text-dim); }

.wr-bullets {
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}
.wr-bullets li { margin-bottom: 0.5rem; }

/* ---------- table ---------- */
.wr-table-block { margin-top: 1rem; }

.wr-table-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

/* filter + sort controls */
.wr-table-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.wr-filter {
  flex: 1 1 200px;
  min-width: 150px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
}
.wr-filter::placeholder { color: var(--text-dim); }
.wr-filter:focus { outline: none; border-color: var(--border-accent); background: var(--surface-hover); }
.wr-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.wr-sort select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: normal;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
}
.wr-sort select:focus { outline: none; border-color: var(--border-accent); }
.wr-toggle:disabled { opacity: 0.4; cursor: default; }

/* sortable column headers */
.wr-th-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}
.wr-th-sort:hover { color: var(--accent); }
.wr-sort-ind { font-size: 0.9em; color: var(--text-dim); }
.wr-th-sort:hover .wr-sort-ind { color: var(--accent); }

.wr-toggle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.wr-toggle:hover { background: rgba(129,140,248,0.2); color: var(--text); }

.wr-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.wr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--surface);
}

.wr-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: rgba(255,255,255,0.02);
}

.wr-table td {
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  line-height: 1.55;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.wr-table tr:last-child td { border-bottom: none; }
.wr-table tbody tr:hover { background: var(--surface-hover); }

.wr-table td:first-child { color: var(--text); font-weight: 500; }
.wr-table a { color: var(--accent); text-decoration: none; }
.wr-table a:hover { text-decoration: underline; }

/* ---------- callouts ---------- */
.wr-callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  margin-top: 1rem;
}
.wr-callout-tip { border-left-color: var(--accent-2); }

.wr-callout-title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}
.wr-callout-body .wr-bullets { margin: 0; }

/* ---------- resource lists ---------- */
.wr-resource-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.wr-resource {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  transition: border-color 0.2s, background 0.2s;
}
.wr-resource:hover { border-color: var(--border-accent); background: var(--surface-hover); }

.wr-resource-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
}
a.wr-resource-name:hover { color: var(--accent); }

.wr-resource-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 0.3rem;
}

/* ---------- byline ---------- */
.wr-byline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}
.wr-byline .wr-dot { margin: 0 0.5rem; }

/* ---------- inline links ---------- */
.wr-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.wr-dept-link {
  color: #f472b6;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(244,114,182,0.5);
  font-weight: 500;
}
.wr-dept-link:hover { text-decoration-color: #f472b6; }

/* ---------- quote ---------- */
.wr-quote {
  border-left: 3px solid var(--border-accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.35rem;
  margin: 1.25rem 0;
}
.wr-quote p { color: var(--text); font-style: italic; font-size: 0.95rem; line-height: 1.7; }
.wr-quote cite { display: block; margin-top: 0.6rem; font-style: normal; }
.wr-quote cite a { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); text-decoration: none; }
.wr-quote cite a::before { content: '— '; }
.wr-quote cite a:hover { color: var(--accent); }

/* ---------- guiding questions ---------- */
.wr-questions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.wr-q-cat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}
.wr-q-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}
.wr-q-cat .wr-bullets { font-size: 0.85rem; }

/* ---------- callout variants ---------- */
.wr-callout-note { border-left-color: var(--accent); }
.wr-callout-info { border-left-color: var(--accent); }
.wr-callout-warning { border-left-color: #f0b429; background: rgba(240,180,41,0.06); }
.wr-callout-body { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* ---------- standalone link button ---------- */
.wr-linkbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem 0 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.wr-linkbtn:hover { background: rgba(129,140,248,0.18); transform: translateY(-1px); }

/* ---------- inline mini-subsection ---------- */
.wr-mini { margin: 1.5rem 0; }
.wr-mini-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* ---------- numbered steps ---------- */
.wr-steps { list-style: none; display: flex; flex-direction: column; gap: 0.85rem; margin: 1rem 0; }
.wr-step { display: flex; gap: 0.85rem; align-items: flex-start; }
.wr-step-num {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}
.wr-step-title { font-weight: 600; color: var(--text); font-size: 0.9rem; margin-bottom: 0.15rem; }
.wr-step-text { color: var(--text-muted); font-size: 0.9rem; line-height: 1.65; }

/* ---------- opportunities ---------- */
.wr-opps { display: flex; flex-direction: column; gap: 1rem; margin: 1.25rem 0; }
.wr-opp {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.35rem;
}
.wr-opp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; margin-bottom: 0.4rem; }
.wr-opp-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.wr-opp-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  background: rgba(52,211,153,0.1);
  border-radius: 9999px;
  padding: 0.15rem 0.6rem;
}
.wr-opp .wr-p { font-size: 0.9rem; }
.wr-opp-details { margin-top: 0.5rem; }
.wr-tip-inline {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  background: rgba(129,140,248,0.06);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
}
.wr-tip-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-right: 0.5rem;
}
.wr-opp-link { display: inline-block; margin-top: 0.75rem; font-size: 0.85rem; font-weight: 500; text-decoration: none; }

/* ---------- references ---------- */
.wr-refs { margin: 0.75rem 0 1rem; }
.wr-refs-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}
.wr-refs ul { list-style: none; margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.25rem; }
.wr-refs a { font-size: 0.82rem; color: var(--accent); text-decoration: none; word-break: break-all; }
.wr-refs a:hover { text-decoration: underline; }

/* ---------- subsection wrapper ---------- */
.wr-subsection { margin-top: 1.75rem; }

/* ---------- table empty state + cross-out interaction ---------- */
.wr-table-empty {
  margin-top: 1rem;
  padding: 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
}
.wr-table-hint { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.5rem; }
.wr-toggle-on { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.wr-toggle-on:hover { background: var(--accent); color: var(--bg); }
.wr-row-off td { color: var(--text-dim); text-decoration: line-through; opacity: 0.65; }
.wr-row-off td.wr-cross-col { text-decoration: none; }
.wr-cross-col { width: 2.5rem; text-align: center; }
.wr-cross-col input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}

/* ---------- index / table of contents ---------- */
.wr-index {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.75rem;
}
.wr-index-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  margin-bottom: 0.9rem;
}
.wr-index-list { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.wr-index-top {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}
.wr-index-top:hover { color: var(--accent); }
.wr-index-num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); }
.wr-index-sub {
  list-style: none;
  margin: 0.45rem 0 0.2rem 1.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}
.wr-index-sub li { position: relative; }
.wr-index-sub li::before { content: '·'; color: var(--text-dim); position: absolute; left: -0.9rem; }
.wr-index-sub a { color: var(--text-muted); font-size: 0.875rem; text-decoration: none; }
.wr-index-sub a:hover { color: var(--accent); }

/* ---------- same-page anchor links ---------- */
.wr-anchor-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(129,140,248,0.5);
  cursor: pointer;
}
.wr-anchor-link:hover { text-decoration-color: var(--accent); }

/* ---------- feedback footer ---------- */
.wr-feedback {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ---------- arrow links + external marker ---------- */
.wr-arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}
.wr-arrow-link:hover { text-decoration: underline; }
.wr-ext { font-size: 0.85em; color: var(--accent); }

/* anchor offset so the fixed navbar doesn't cover a jumped-to heading */
.wr-section, .wr-subsection { scroll-margin-top: calc(var(--nav-h) + 1.5rem); }

/* ---------- responsive: stack table rows into labeled cards ---------- */
@media (max-width: 620px) {
  .wr-table-scroll { border: none; }
  .wr-table, .wr-table tbody, .wr-table tr, .wr-table td { display: block; width: 100%; }
  .wr-table thead { display: none; }

  .wr-table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    padding: 0.35rem 0;
  }

  .wr-table td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 1rem;
    text-align: left;
    overflow-wrap: anywhere;
  }
  .wr-table tr td:last-child { border-bottom: none; }

  .wr-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
}
