/**
 * WhelkMail documentation theme for docmd.
 * Brand color: #c5221f (WhelkMail red).
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== Light Theme ===== */
:root {
  --bg-color: #ffffff;
  --text-color: #1f1c1b;
  --text-muted: #6f6864;
  --text-heading: #1f1c1b;
  --link-color: #c5221f;
  --link-color-hover: #a81b19;
  --border-color: #f0e7e4;
  --border-color-codeblock: rgba(197, 34, 31, 0.12);
  --border-color-hover: #e3d5d1;
  --header-bg: rgba(255, 255, 255, 0.85);
  --header-border: #f0e7e4;
  --sidebar-bg: #fff9f7;
  --sidebar-text: #443f3c;
  --sidebar-link-active-bg: rgba(197, 34, 31, 0.08);
  --sidebar-link-active-text: #c5221f;
  --code-bg: #fff9f7;
  --code-text: #2b2725;
  --sponsor-red: #c5221f;
  --glow-color: rgba(197, 34, 31, 0.10);
  --glow-color-strong: rgba(197, 34, 31, 0.18);
  --halo-soft: 0 0 0 4px rgba(197, 34, 31, 0.10);
  --scrollbar-thumb: #f0e7e4;
  --scrollbar-thumb-hover: #c9b8b2;
  --sidebar-group-bg: rgba(197, 34, 31, 0.05);
  --sidebar-group-border: transparent;
}

/* ===== Dark Theme ===== */
:root[data-theme=dark] {
  --bg-color: #121011;
  --text-color: #eee7e4;
  --text-muted: #a89f9a;
  --text-heading: #ffffff;
  --link-color: #ff8a80;
  --link-color-hover: #ffb3aa;
  --border-color: rgba(255, 255, 255, 0.10);
  --border-color-codeblock: rgba(255, 138, 128, 0.16);
  --header-bg: rgba(18, 16, 17, 0.85);
  --header-border: rgba(255, 255, 255, 0.10);
  --sidebar-bg: #1b1718;
  --sidebar-text: #d9d2ce;
  --sidebar-link-active-bg: rgba(255, 138, 128, 0.14);
  --sidebar-link-active-text: #ff8a80;
  --code-bg: #1b1718;
  --code-text: #e8e2df;
  --sponsor-red: #ff8a80;
  --glow-color: rgba(255, 138, 128, 0.16);
  --glow-color-strong: rgba(255, 138, 128, 0.26);
  --halo-soft: 0 0 0 4px rgba(255, 138, 128, 0.16);
  --scrollbar-thumb: rgba(255, 255, 255, 0.15);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.3);
  --sidebar-group-bg: rgba(255, 138, 128, 0.08);
  --sidebar-group-border: transparent;
}

/* ===== Typography ===== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

pre, code, kbd, samp {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ===== Header ===== */
.header {
  backdrop-filter: blur(12px);
}

/* ===== Links ===== */
a {
  color: var(--link-color);
}

a:hover {
  color: var(--link-color-hover);
}

/* ===== Sidebar ===== */
.sidebar a {
  font-weight: 500;
}

.sidebar a.active {
  font-weight: 700;
  color: var(--link-color);
}

/* ===== Code blocks ===== */
pre {
  border: 1px solid var(--border-color-codeblock);
  border-radius: 8px;
}

code {
  background: rgba(197, 34, 31, 0.08);
  color: #a81b19;
  border: none;
  padding: 2px 6px;
  border-radius: 4px;
}

:root[data-theme=dark] code {
  background: rgba(255, 138, 128, 0.14);
  color: #ffb3aa;
}

/* ===== Footer ===== */
.footer-complete,
.page-footer {
  background: #fff9f7;
  color: #6f6864;
  border-top: 1px solid #f0e7e4;
}

.footer-complete .footer-column-title,
.footer-complete .footer-title {
  color: #1f1c1b;
}

.footer-complete a,
.page-footer a {
  color: #6f6864;
}

.footer-complete a:hover,
.page-footer a:hover {
  color: #c5221f;
}

:root[data-theme=dark] .footer-complete,
:root[data-theme=dark] .page-footer {
  background: #1b1718;
  color: #a89f9a;
  border-top-color: rgba(255, 255, 255, 0.10);
}

:root[data-theme=dark] .footer-complete .footer-column-title,
:root[data-theme=dark] .footer-complete .footer-title {
  color: #ffffff;
}

:root[data-theme=dark] .footer-complete a,
:root[data-theme=dark] .page-footer a {
  color: #a89f9a;
}

:root[data-theme=dark] .footer-complete a:hover,
:root[data-theme=dark] .page-footer a:hover {
  color: #ff8a80;
}

/* ===== Buttons ===== */
.docmd-button {
  background: linear-gradient(135deg, #c5221f, #e04b45);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(197, 34, 31, 0.3);
  font-weight: 600;
  border: none;
  border-radius: 6px;
}

.docmd-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(197, 34, 31, 0.4);
  color: #ffffff;
}

/* ===== Callouts ===== */
.callout {
  border-left: 4px solid var(--link-color);
}

/* ===== Tables ===== */
.table-wrapper table th {
  background: var(--sidebar-bg);
  color: var(--text-heading);
  font-weight: 700;
}

/* ===== Search ===== */
.docmd-search-input:focus {
  border-color: var(--link-color);
  box-shadow: 0 0 0 3px var(--halo-soft);
}

/* ===== Screenshots ===== */
.docmd-content img {
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}
