/* Base Styling & Theme */
:root {
  --bg-color: #fcfbfa;
  --text-color: #1a1a1a;
  --accent-color: #8b5a2b;
  --font-serif: 'Georgia', serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Fluid typography for perfect mobile and 4K reading scales */
  font-size: clamp(16px, 1.2vw + 12px, 24px);
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-serif);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

h1, h2, h3, nav, button, .category-badge {
  font-family: var(--font-sans);
}

/* Header Layout */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(252, 251, 250, 0.95);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid #e5e5e5;
  z-index: 100;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-color);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.menu-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
}

/* Layout Optimizer - Updated for global layout centering */
.container {
  max-width: 70ch;
  margin: 100px auto 120px auto;
  padding: 0 1.5rem;
  text-align: center; /* Centers all inline-text globally */
}

/* Typography Customizations */
article h1 {
  font-size: 2.2rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

/* Added explicit text alignment rules for smaller internal subheadings */
h2, h3 {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.category-badge {
  display: inline-block;
  background-color: #f0ebe4;
  color: var(--accent-color);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

article img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

article p {
  margin-bottom: 1.5rem;
}

/* Globally format the Blockquotes (Your Quotes) */
blockquote {
  font-style: italic; /* Makes quote fonts automatically italicized */
  font-size: 1rem;
  line-height: 1.6;
  margin: 2rem auto 0.5rem auto;
  padding: 0 1rem;
  max-width: 60ch;
  border: none; /* Strips browser quote borders */
}

/* Automatically formats author text directly following any quote block */
blockquote + p {
  font-weight: 600;
  color: #555;
  margin-top: 0;
  margin-bottom: 2rem;
}

/* Options Sidebar Drawer */
.sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 260px;
  height: 100%;
  background: #ffffff;
  box-shadow: -5px 0 15px rgba(0,0,0,0.05);
  transition: right 0.3s ease;
  z-index: 200;
  padding: 2rem 1.5rem;
  box-sizing: border-box;
}

.sidebar.open {
  right: 0;
}

.sidebar h2 {
  margin-top: 0;
  font-size: 1.3rem;
  border-bottom: 2px solid #f0ebe4;
  padding-bottom: 0.5rem;
  text-align: left; /* Keep sidebar text left-aligned */
}

.category-option {
  display: flex;
  align-items: center;
  margin: 1rem 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left; /* Keep preferences left-aligned */
}

.category-option input {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1rem;
  color: #777;
  cursor: pointer;
  margin-bottom: 1.5rem;
  display: block;
  text-align: left;
}

/* Overlay Sticky Next Button */
.floating-next-container {
  position: fixed;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 90;
  pointer-events: none;
}

.next-btn {
  pointer-events: auto;
  background-color: var(--text-color);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, background-color 0.2s;
}

.next-btn:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
}
