/* Victorian Book/Magazine Aesthetic */

/* Font imports */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* CSS Reset and Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors */
  --bg-cream: #F5F0E6;
  --bg-paper: #F8F4EC;
  --text-sepia: #2C1810;
  --text-muted: #5C4A3D;
  --accent-burgundy: #722F37;
  --accent-green: #2D4A3E;
  --border-light: #D4C9B8;
  --border-dark: #8B7355;

  /* Typography */
  --font-body: 'EB Garamond', Georgia, serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Spacing */
  --content-width: 720px;
  --reading-width: 680px;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-sepia);
  background-color: var(--bg-cream);
  /* Optional paper texture - add paper-texture.png to images/textures/ */
  /* background-image: url('../images/textures/paper-texture.png'); */
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.4rem;
}

p {
  margin-bottom: 1em;
  text-align: justify;
  hyphens: auto;
}

a {
  color: var(--accent-burgundy);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-green);
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.reading-container {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Header / Masthead */
.masthead {
  text-align: center;
  padding: 3rem 1rem 2rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 2rem;
}

.masthead-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  color: var(--text-sepia);
}

.masthead-subtitle {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.masthead-anniversary {
  font-size: 0.9rem;
  color: var(--accent-burgundy);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Ornamental Dividers */
.ornament {
  text-align: center;
  margin: 2rem 0;
  color: var(--border-dark);
  font-size: 1.5rem;
  letter-spacing: 0.5em;
}

.ornament::before {
  content: "❧ ❧ ❧";
}

.divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 2rem 0;
  position: relative;
}

.divider-ornate {
  border: none;
  height: 20px;
  margin: 2.5rem 0;
  background: transparent;
  position: relative;
}

.divider-ornate::before {
  content: "§";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  color: var(--border-dark);
  background: var(--bg-cream);
  padding: 0 1rem;
}

.divider-ornate::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  border-top: 1px solid var(--border-light);
  z-index: -1;
}

/* Navigation */
.nav-main {
  text-align: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-paper);
}

.nav-main a {
  display: inline-block;
  margin: 0 1rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Introduction Section */
.intro {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
  font-style: italic;
  color: var(--text-muted);
}

/* Parts Grid */
.parts-list {
  display: grid;
  gap: 1.5rem;
}

.part-card {
  background: var(--bg-paper);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.part-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.1);
}

.part-card.locked {
  opacity: 0.7;
}

.part-card.locked:hover {
  transform: none;
  box-shadow: none;
}

.part-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.part-number {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
}

.part-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.part-chapters {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.part-status {
  font-size: 0.85rem;
  font-weight: 500;
}

.part-status.available {
  color: var(--accent-green);
}

.part-status.locked {
  color: var(--accent-burgundy);
}

.part-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.part-link:hover {
  text-decoration: none;
}

.part-link:hover .part-number {
  color: var(--accent-burgundy);
}

/* Countdown */
.countdown {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Reading Page Styles */
.chapter-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-light);
}

.chapter-part {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.chapter-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.chapter-subtitle {
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.5;
  max-width: 500px;
  margin: 0 auto;
}

.publication-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* Drop Caps */
.drop-cap {
  float: left;
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 0.8;
  padding-right: 0.1em;
  padding-top: 0.1em;
  color: var(--accent-burgundy);
  font-weight: 600;
}

/* Chapter Text */
.chapter-text {
  margin-bottom: 3rem;
}

.chapter-text p {
  text-indent: 1.5em;
}

.chapter-text p:first-of-type {
  text-indent: 0;
}

.chapter-text p + p {
  margin-top: 0;
}

/* Illustrations */
.illustration {
  margin: 2rem auto;
  text-align: center;
  max-width: 100%;
}

.illustration img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 8px rgba(44, 24, 16, 0.1);
}

.illustration-caption {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* Part Navigation */
.part-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-light);
  margin-top: 3rem;
}

.part-nav a {
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.part-nav-prev::before {
  content: "← ";
}

.part-nav-next::after {
  content: " →";
}

.part-nav-contents {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
}

/* About Page */
.about-section {
  margin-bottom: 3rem;
}

.about-section h2 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer p {
  text-align: center;
  margin-bottom: 0.5rem;
}

/* Locked Content Overlay */
.locked-overlay {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-paper);
  border: 1px solid var(--border-light);
  margin: 2rem 0;
}

.locked-overlay h2 {
  margin-bottom: 1rem;
}

.locked-overlay p {
  text-align: center;
  color: var(--text-muted);
}

/* Reading Progress */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent-burgundy);
  z-index: 1000;
  transition: width 0.1s ease;
}

/* Preview Mode Banner */
.preview-banner {
  background: var(--accent-burgundy);
  color: #fff;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.85rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
}

body.preview-mode {
  padding-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .masthead-title {
    font-size: 2rem;
  }

  .container,
  .reading-container {
    padding: 1.5rem 1rem;
  }

  .part-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .part-date {
    margin-top: 0.25rem;
  }

  .part-nav {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .drop-cap {
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  .masthead-title {
    font-size: 1.6rem;
  }

  .nav-main a {
    display: block;
    margin: 0.5rem 0;
  }

  .chapter-title {
    font-size: 1.4rem;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .nav-main,
  .part-nav,
  .reading-progress,
  .preview-banner {
    display: none;
  }

  .container,
  .reading-container {
    max-width: 100%;
  }
}
