/* Main Theme Styles */

:root {
  --archive-max-width: 1400px;
  --archive-gutter: clamp(16px, 3vw, 48px);

  /* Light (default) */
  /* Page background (outside the main container) */
  --outer-bg: #f4f1ea;
  /* Main container background */
  --surface-bg: #f4f1ea;
  /* Body text color */
  --text: #2b2b2b;
  --muted: rgba(0, 0, 0, 0.65);
  --border: rgba(0, 0, 0, 0.10);
  --shadow: rgba(0, 0, 0, 0.45);
  --scroll-thumb: rgba(0, 0, 0, 0.20);
}

html[data-theme="dark"] {
  /* Night mode (keep the *outside* background dark too) */
  --outer-bg: #0b0b0b;
  --surface-bg: #2b2b2b;
  --text: #f4f1ea;
  --muted: rgba(255, 255, 255, 0.70);
  --border: rgba(244, 241, 234, 0.18);
  --shadow: rgba(0, 0, 0, 0.25);
  --scroll-thumb: rgba(255, 255, 255, 0.25);
}

html,
body {
  background-color: var(--outer-bg);
}

body {
  color: var(--text);
  margin: 0;
  font-family: "EB Garamond", serif;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 4px;
}

/* Layout Utilities */
.wp-site-blocks {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main Container (replaces the old split "book" layout) */
.archive-container {
  width: min(var(--archive-max-width), calc(100vw - (2 * var(--archive-gutter))));
  margin: clamp(12px, 3vh, 32px) auto;
  background-color: var(--surface-bg);
  min-height: calc(100vh - 24px);
  border-radius: 10px;
  box-shadow: 0 0 50px var(--shadow);
  padding: clamp(18px, 3vw, 56px);
}

.archive-topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.archive-content {
  max-width: 980px;
}

.archive-meta {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* Landing Page (no "book" vibe, no animation) */
.landing-cover {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #111;
  background-image: url("https://www.transparenttextures.com/patterns/black-linen.png");
  color: #e0e0e0;
  text-align: center;
}

.archive-hero {
  width: min(720px, 92vw);
  padding: 48px 28px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.archive-hero a {
  color: #e0e0e0;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.archive-hero a:hover {
  border-bottom-color: rgba(255, 255, 255, 0.75);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Marginalia */
.marginalia-note {
  font-size: 0.875rem;
  font-style: italic;
  color: #8c8c8c;
  background: rgba(0, 0, 0, 0.03);
  padding: 1rem;
  margin: 1rem 0;
  border-left: 2px solid #8a3324;
}

@media (min-width: 1200px) {
  .marginalia-container {
    position: relative;
  }

  .marginalia-note {
    position: absolute;
    right: -160px;
    width: 140px;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 0.75rem;
  }
}


/* Theme toggle button */
.theme-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  line-height: 1;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.theme-toggle:hover {
  transform: translateY(-1px);
}
.theme-toggle:active {
  transform: translateY(0px);
}
.theme-toggle:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Links should remain readable in both modes */
a { color: var(--text); }
a:hover { text-decoration: underline; }
