/* ── CIPHER Research Wiki — Master Stylesheet ──────────────── */
/* Overhaul: March 2026 */

/* ── Global Typography & Spacing ──────────────────────────── */

.md-typeset {
  font-size: 0.92rem;
  line-height: 1.75;
}

.md-typeset h1 {
  font-weight: 300;
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.md-typeset h2 {
  font-weight: 400;
  font-size: 1.35rem;
  margin-top: 2.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.md-typeset h3 {
  font-weight: 500;
  font-size: 1.1rem;
}

/* Better table styling */
.md-typeset table:not([class]) {
  font-size: 0.88rem;
  border-collapse: collapse;
  width: 100%;
}

.md-typeset table:not([class]) th {
  background: rgba(255,255,255,0.04);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid rgba(255,255,255,0.1);
}

.md-typeset table:not([class]) td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.md-typeset table:not([class]) tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* PDF download links in tables */
.md-typeset table a[href$=".pdf"] {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  background: rgba(96,165,250,0.1);
  border: 1px solid rgba(96,165,250,0.2);
  border-radius: 6px;
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.md-typeset table a[href$=".pdf"]:hover {
  background: rgba(96,165,250,0.2);
  border-color: rgba(96,165,250,0.4);
  color: #bfdbfe;
}

/* Blockquotes */
.md-typeset blockquote {
  border-left: 3px solid rgba(96,165,250,0.4);
  padding: 1rem 1.5rem;
  background: rgba(96,165,250,0.04);
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
}

/* Horizontal rules */
.md-typeset hr {
  border: none;
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 2rem 0;
}

/* Code blocks */
.md-typeset code {
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* ── Tool Pages — Shared Styles ───────────────────────────── */

.tool-intro,
.heal-intro {
  max-width: 640px;
  margin: 0 auto 2rem;
  text-align: center;
}

.tool-intro h1,
.heal-intro h1 {
  font-weight: 300;
  font-size: 2.2rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.tool-intro p,
.heal-intro p {
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.65;
}

.tool-wrap,
.heal-wrap,
.decode-wrap,
.filter-wrap {
  max-width: 640px;
  margin: 0 auto;
}

/* Textareas — bigger, more inviting */
#d-input, #h-input, #f-input {
  width: 100%;
  min-height: 180px;
  padding: 1.25rem;
  font-size: 1rem;
  line-height: 1.7;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: inherit;
  resize: vertical;
  display: block;
  margin-bottom: 1.25rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

#d-input:focus, #h-input:focus, #f-input:focus {
  outline: none;
  border-color: rgba(96,165,250,0.5);
  background: rgba(255,255,255,0.04);
}

#d-input::placeholder, #h-input::placeholder, #f-input::placeholder {
  opacity: 0.35;
  font-style: italic;
}

/* Primary action buttons — bigger, more visible */
.run-btn,
.heal-btn,
.decode-btn,
.filter-btn {
  padding: 0.85rem 2.2rem;
  background: rgba(96,165,250,0.12);
  border: 1px solid rgba(96,165,250,0.3);
  border-radius: 50px;
  color: #93c5fd;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.run-btn:hover,
.heal-btn:hover,
.decode-btn:hover,
.filter-btn:hover {
  background: rgba(96,165,250,0.22);
  border-color: rgba(96,165,250,0.5);
  color: #bfdbfe;
  transform: translateY(-1px);
}

.run-btn:active,
.heal-btn:active {
  transform: translateY(0);
}

.run-btn:disabled,
.heal-btn:disabled,
.decode-btn:disabled,
.filter-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Mode selector buttons (filter page) */
.mode-row,
.filter-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.mode-btn,
.fmode {
  padding: 0.5rem 1.1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50px;
  color: rgba(255,255,255,0.45);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.mode-btn.active,
.mode-btn:hover,
.fmode.active,
.fmode:hover {
  background: rgba(96,165,250,0.12);
  border-color: rgba(96,165,250,0.3);
  color: #93c5fd;
}

.mode-desc {
  font-size: 0.88rem;
  opacity: 0.45;
  margin-bottom: 1.25rem;
  font-style: italic;
  line-height: 1.6;
}

/* Output sections (decode) */
.section {
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  border-left: 3px solid rgba(96,165,250,0.3);
}

.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.4;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.section-content {
  font-size: 0.95rem;
  line-height: 1.75;
}

/* Output box (filter) */
.output-box {
  padding: 1.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.8;
  margin-top: 1rem;
}

/* Heal layers — bigger, clearer */
.layer-block {
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  border-left: 3px solid;
}

.layer-wound       { background: rgba(239,68,68,0.06);   border-color: rgba(239,68,68,0.35); }
.layer-adapted     { background: rgba(245,158,11,0.06);  border-color: rgba(245,158,11,0.35); }
.layer-social      { background: rgba(99,102,241,0.06);  border-color: rgba(99,102,241,0.35); }
.layer-environmental,
.layer-environment { background: rgba(16,185,129,0.06);  border-color: rgba(16,185,129,0.35); }
.layer-clear       { background: rgba(96,165,250,0.06);  border-color: rgba(96,165,250,0.35); }

.layer-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.layer-text {
  font-size: 0.95rem;
  line-height: 1.75;
}

.layer-note {
  font-size: 0.82rem;
  opacity: 0.5;
  margin-top: 0.5rem;
  font-style: italic;
}

.closing-text,
.closing-box p {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-style: italic;
  opacity: 0.65;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ── Shared Utility Classes ───────────────────────────────── */

.divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 2rem 0;
}

.small-note,
.footer-note {
  font-size: 0.82rem;
  opacity: 0.4;
  font-style: italic;
  line-height: 1.6;
}

.footer-note a {
  opacity: 0.7;
}

.spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Papers Page — Download Buttons ───────────────────────── */

/* Stand-alone download links */
.md-typeset a[href$=".pdf"]:not(table a) {
  text-decoration: none;
}

/* ── Navigation Improvements ──────────────────────────────── */

/* Reduce tab clutter */
.md-tabs__list {
  gap: 0;
}

.md-tabs__link {
  font-size: 0.78rem;
  padding: 0.6rem 0.9rem;
  opacity: 0.6;
}

.md-tabs__item--active .md-tabs__link {
  opacity: 1;
}

/* Sidebar */
.md-nav__link {
  font-size: 0.82rem;
}

/* ── Homepage / Index Improvements ────────────────────────── */

.md-content__inner > h1:first-child {
  font-weight: 200;
  font-size: 2.4rem;
  letter-spacing: -0.03em;
}

/* Status badges in nav */
.md-status {
  font-size: 0.65rem;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
  .tool-intro h1,
  .heal-intro h1 {
    font-size: 1.6rem;
  }

  #d-input, #h-input, #f-input {
    min-height: 140px;
    padding: 1rem;
    font-size: 0.95rem;
  }

  .run-btn, .heal-btn {
    padding: 0.75rem 1.8rem;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
  }

  .mode-row, .filter-modes {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }

  .mode-btn, .fmode {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .section {
    padding: 1rem 1.15rem;
  }

  .layer-block {
    padding: 1rem 1.15rem;
  }
}

/* ── MathJax / KaTeX spacing ──────────────────────────────── */

.md-typeset .arithmatex {
  margin: 1.5rem 0;
  overflow-x: auto;
}

/* ── Print ────────────────────────────────────────────────── */

@media print {
  .md-header, .md-tabs, .md-sidebar, .md-footer {
    display: none !important;
  }
  .md-content {
    margin: 0;
    padding: 0;
  }
}


/* Hide 'Made with Material for MkDocs' footer */
.md-footer-meta .md-copyright { display: none !important; }
