:root {
  --transition-speed: 0.3s;
}

/* ---------------- THEMES ---------------- */

/* Light Theme */
body[data-theme="light"] {
  --bg-color: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --accent-color: #2563eb;
  --ui-bg: #f3f4f6;
  --ui-border: #e5e7eb;
  --theme-btn-border: #d1d5db;
}

/* Dark Theme */
body[data-theme="dark"] {
  --bg-color: #121212;
  --text-primary: #e5e5e5;
  --text-secondary: #a3a3a3;
  --accent-color: #60a5fa;
  --ui-bg: #262626;
  --ui-border: #404040;
  --theme-btn-border: #525252;
}

/* Sepia Theme */
body[data-theme="sepia"] {
  --bg-color: #f4ecd8;
  --text-primary: #433422;
  --text-secondary: #7e6a52;
  --accent-color: #d97706;
  --ui-bg: #e6dac3;
  --ui-border: #d1c7b7;
  --theme-btn-border: #c2b5a3;
}

/* ---------------- BASE ---------------- */

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-speed),
    color var(--transition-speed);
}

/* Fonts */
.font-sans-system {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
}

.font-serif-times {
  font-family: "Times New Roman", Times, serif;
}

/* Typography */
h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

p {
  white-space: pre-line;
  margin-bottom: 1.5rem;
}

.meta-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ---------------- CONTROLS ---------------- */

.controls-wrapper {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 12px;
  z-index: 50;
}

.control-group {
  display: flex;
  align-items: center;
  background-color: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: 9999px;
  padding: 4px 8px;
  gap: 8px;
}

/* Font buttons */
.font-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1;
}

.font-btn:hover {
  color: var(--text-primary);
  background-color: rgba(125, 125, 125, 0.1);
}

.font-btn.active {
  color: var(--text-primary);
  font-weight: bold;
}

/* Theme buttons */
.theme-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--theme-btn-border);
  cursor: pointer;
  opacity: 0.4;
}

.theme-btn:hover {
  opacity: 0.7;
}

.theme-btn.active {
  opacity: 1;
  transform: scale(1.1);
}

.theme-btn-light {
  background-color: #ffffff;
}

.theme-btn-sepia {
  background-color: #f4ecd8;
}

.theme-btn-dark {
  background-color: #121212;
}

/* ---------------- LINKS ---------------- */

.read-more-link {
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  opacity: 0.7;
}

.read-more-link:hover {
  opacity: 1;
}

.read-more-arrow {
  margin-left: 6px;
  transition: transform 0.2s ease;
}

.read-more-link:hover .read-more-arrow {
  transform: translateX(4px);
}

/* ---------------- MOBILE ---------------- */

@media (max-width: 640px) {
  .controls-wrapper {
    position: absolute;
    top: 10px;
    right: 50%;
    transform: translateX(50%);
    width: max-content;
  }
}
