/* === DARK MODE (charcoal, refined) === */

body.dark-mode {
  --body-background-color: #2d2d2d;
  --body-text-color: #e0e0e0;
  --link-color: #7aa2ff;
  --border-color: #3a3a3a;
}

/* === FULL BACKGROUND UNIFICATION (FIXES PATCHINESS) === */

body.dark-mode,
body.dark-mode html,
body.dark-mode .page-wrap,
body.dark-mode .main,
body.dark-mode .main-content,
body.dark-mode .main-content-wrap {
  background-color: #2d2d2d !important;
}

/* Ensure text colour */
body.dark-mode .main-content {
  color: #e0e0e0;
}

/* Remove background blocks inside content */
body.dark-mode .main-content > * {
  background-color: transparent;
}

/* Sidebar */
body.dark-mode .side-bar {
  background-color: #252526;
}

/* Header */
body.dark-mode .site-header {
  background-color: #252526;
  border-bottom: 1px solid #3a3a3a;
}

/* Headings */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: #f5f5f5;
}

/* Links */
body.dark-mode a {
  color: #7aa2ff;
}

/* Code */
body.dark-mode pre,
body.dark-mode code {
  background-color: #2d2d2d;
  color: #dcdcdc;
}

/* Tables */
body.dark-mode table {
  background-color: #1a1a1a;
}

body.dark-mode th,
body.dark-mode td {
  border-color: #3a3a3a;
}

/* Ensure full page background */
html, body {
  background-color: var(--body-background-color);
}

/* === BASE CALLOUT === */

.callout {
  border-left: 4px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.03);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 6px;
}

/* Dark mode callout */
body.dark-mode .callout {
  background-color: rgba(255, 255, 255, 0.06);
}

/* Info callout */
.callout-info {
  border-left-color: #2f6fdf;
}

body.dark-mode .callout-info {
  border-left-color: #7aa2ff;
  color: var(--body-text-color);
}

/* === FOOTNOTE CALLOUT === */

.callout-footnote {
  font-size: 0.95rem;
  font-style: italic;
  opacity: 0.9;
  border-left-color: #6c757d;
}

body.dark-mode .callout-footnote {
  border-left-color: #8b949e;
}

/* Footnote reference numbers */

.footnote-ref {
  color: #4f8cff;
  font-size: 0.75em;
  font-weight: 600;
}

body.dark-mode .footnote-ref {
  color: #7aa2ff;
}


/* Neutral note */
.callout-note {
  border-left-color: var(--border-color);
}

/* Icon spacing */
.callout::before {
  margin-right: 0.5rem;
}

/* Info icon */
.callout-info::before {
  content: "ℹ️";
}

/* === DARK MODE TABLE FIX === */

body.dark-mode table {

  background-color: #2d2d2d;

  border-collapse: collapse;

}

/* Table headers */

body.dark-mode th {

  background-color: #3a3a3a;

  color: #ffffff;

  font-weight: 600;

}

/* Table cells */

body.dark-mode td {

  background-color: #2d2d2d;

  color: #e0e0e0;

}

/* Borders */

body.dark-mode th,

body.dark-mode td {

  border: 1px solid #3a3a3a;

  padding: 0.5rem;

}

/* Optional: zebra striping for readability */

body.dark-mode tr:nth-child(even) td {

  background-color: #262626;

}

/* === HEADER + NAV DARK MODE FIX === */

body.dark-mode .search-input {
  background-color: #2d2d2d !important;
  color: #e0e0e0;
  border-color: #3a3a3a;
}

body.dark-mode .search-input::placeholder {
  color: #aaaaaa;
}

/* Header links */
body.dark-mode .site-header a:not(.site-button) {
  color: #cccccc;
}

body.dark-mode .site-header a:not(.site-button):hover {
  color: #ffffff;
}

/* GitHub button */
body.dark-mode .site-header .site-button {
  background-color: #2d2d2d !important;
  color: #cccccc !important;
  border: 1px solid #3a3a3a !important;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
}

body.dark-mode .site-header .site-button:hover {
  background-color: #3a3a3a !important;
  color: #ffffff !important;
}

/* Fix header layout elements */
body.dark-mode .aux-nav,
body.dark-mode .search,
body.dark-mode .search-wrapper,
body.dark-mode .site-header > *,
body.dark-mode .aux-nav > * {
  background-color: #252526 !important;
}

/* === FINAL POLISH === */

body,
.main-content,
.side-bar,
.site-header {
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.dark-mode a:hover {
  text-decoration: underline;
}

a[href^="http"]:not([href*="paradisec-archive.github.io"])::after {
  content: " ↗";
  font-size: 0.8em;
  opacity: 0.7;
}
