/* ==========================================================================
   DEPARTMENT OF ENGLISH - SECTION SPECIFIC STYLES
   Hero illustration, bookplate cards, archival timeline, and repository grid
   ========================================================================== */

/* --- HERO SECTION --- */
.hero-editorial {
  padding: 5.5rem 0 4.5rem 0;
  border-bottom: 1px solid var(--rule-color);
  background: radial-gradient(circle at 85% 30%, rgba(163, 112, 54, 0.04) 0%, transparent 60%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-meta-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rule-accent);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.4rem, 4.5vw, 4.2rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin-bottom: 1.5rem;
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--rule-accent);
}

.hero-lead {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--ink-secondary);
  margin-bottom: 2.25rem;
  max-width: 620px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

/* Hero Graphic Vignette: Minimalist Bookplate / Arch */
.hero-vignette {
  border: 1px solid var(--rule-color);
  background-color: var(--bg-card);
  padding: 2.5rem 2rem;
  position: relative;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-vignette::before {
  content: "";
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 1px solid var(--rule-color);
  pointer-events: none;
}

.vignette-svg {
  width: 90px;
  height: 90px;
  color: var(--ink-primary);
  margin-bottom: 1.25rem;
  opacity: 0.85;
}

.vignette-caption {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-primary);
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.vignette-credit {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

/* --- STATS STRIP --- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--rule-color);
  background-color: var(--bg-surface);
}

.stat-item {
  display: flex;
  flex-direction: column;
  padding: 0 0.5rem;
  border-left: 2px solid var(--rule-color);
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--ink-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* --- FACULTY CARDS (Strict Alignment) --- */
.faculty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.75rem;
}

.faculty-card {
  border: 1px solid var(--rule-color);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
  position: relative;
}

.faculty-card:hover {
  border-color: var(--ink-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.faculty-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.faculty-crest-box {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  border: 1px solid var(--rule-color);
  background-color: var(--bg-surface);
  color: var(--ink-primary);
}

.faculty-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  line-height: 1.25;
}

.faculty-rank {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rule-accent);
  margin-bottom: 0.85rem;
}

.faculty-desc {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.faculty-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--rule-color);
  padding-top: 1rem;
  margin-top: auto;
}

/* --- CURRICULUM (Strict Alignment) --- */
.curriculum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.75rem;
}

.course-card {
  border: 1px solid var(--rule-color);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
}

.course-card:hover {
  border-color: var(--ink-primary);
}

.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.course-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.course-title {
  font-size: 1.22rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.course-desc {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.course-readings-box {
  background-color: var(--bg-surface);
  border-left: 2px solid var(--rule-accent);
  padding: 0.75rem;
  font-size: 0.82rem;
  color: var(--ink-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1.25rem;
}

.course-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--rule-color);
  padding-top: 1rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

/* --- LITERARY TIMELINE (Archival Line Work) --- */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  padding-left: 2.25rem;
  border-left: 1px solid var(--rule-color);
  max-width: 860px;
  margin: 0 auto;
}

.timeline-entry {
  position: relative;
  cursor: pointer;
  padding: 1.25rem 1.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--rule-color);
  border-radius: var(--radius);
  transition: var(--transition);
  box-shadow: var(--shadow-subtle);
}

.timeline-entry:hover {
  border-color: var(--ink-primary);
  transform: translateX(4px);
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -2.8rem;
  top: 1.75rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-body);
  border: 2px solid var(--ink-primary);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--rule-accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.timeline-name {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.timeline-summary {
  font-size: 0.9rem;
  color: var(--ink-secondary);
  line-height: 1.6;
}

/* --- GLOSSARY GRID --- */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.glossary-card {
  border: 1px solid var(--rule-color);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
}

.glossary-card:hover {
  border-color: var(--ink-primary);
}

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

.glossary-term {
  font-size: 1.1rem;
  font-weight: 600;
}

.glossary-cat {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.glossary-desc {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.55;
}

/* --- WORKING PAPERS (CHRONICLE) --- */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.article-row {
  border: 1px solid var(--rule-color);
  background-color: var(--bg-card);
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 2rem;
  align-items: center;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
}

.article-row:hover {
  border-color: var(--ink-primary);
}

.article-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.article-title {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
  line-height: 1.25;
}

.article-snippet {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* --- BOOK VAULT / ARCHIVE --- */
.vault-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule-color);
  padding-bottom: 1.5rem;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 1.75rem;
}

.book-item {
  border: 1px solid var(--rule-color);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
  position: relative;
}

.book-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--rule-accent);
  opacity: 0.6;
}

.book-item:hover {
  border-color: var(--ink-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.book-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.book-title {
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.book-author {
  font-size: 0.88rem;
  color: var(--rule-accent);
  font-family: var(--font-serif);
  font-style: italic;
  margin-bottom: 0.85rem;
}

.book-desc {
  font-size: 0.85rem;
  color: var(--ink-secondary);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.book-footer {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--rule-color);
  padding-top: 1rem;
}

/* --- IN-BROWSER READER VIEW --- */
.reader-view {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.85;
  color: var(--ink-primary);
}

.reader-header {
  border-bottom: 1px solid var(--rule-color);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.reader-body {
  max-height: 60vh;
  overflow-y: auto;
  white-space: pre-line;
  padding: 0 1rem;
}

/* Responsive adjustments & alignment refinements */
@media (max-width: 860px) {
  .hero-editorial {
    padding: 3.5rem 0 2.5rem 0;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .hero-lead {
    font-size: 1.05rem;
    line-height: 1.65;
    margin-bottom: 1.75rem;
  }
  .hero-actions {
    gap: 0.6rem;
  }
  .hero-actions .btn {
    flex: 1 1 auto;
  }
  .stats-strip {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.75rem 0;
  }
  .article-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 1.25rem;
  }
  .vault-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  .vault-controls > div:last-child {
    width: 100%;
    justify-content: space-between;
  }
  .vault-controls .search-wrapper {
    width: 100% !important;
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 2.2rem;
  }
  .timeline-list {
    padding-left: 1.5rem;
  }
  .timeline-entry {
    padding: 1rem 1.25rem;
  }
  .timeline-entry::before {
    left: -1.88rem;
    top: 1.5rem;
  }
  .curriculum-grid,
  .faculty-grid,
  .books-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .course-card,
  .faculty-card,
  .book-item {
    padding: 1.35rem;
  }
  .reader-view {
    font-size: 1.05rem;
    line-height: 1.75;
  }
  .reader-body {
    padding: 0;
  }
}

/* --- COMMENTS SECTION (CLOUDFLARE D1 READY) --- */
.comments-section {
  margin-top: 2.5rem;
  border-top: 1px solid var(--rule-color);
  padding-top: 2rem;
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.comments-title {
  font-size: 1.25rem;
  font-family: var(--font-serif);
  color: var(--ink-primary);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.comment-card {
  border: 1px solid var(--rule-color);
  background-color: var(--bg-surface);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  font-family: var(--font-sans);
}

.comment-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.comment-author-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-author-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink-primary);
}

.comment-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.comment-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-secondary);
}

.comment-form {
  border: 1px solid var(--rule-color);
  background-color: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* --- WRITING STUDIO & AUTH GATE (D1 & R2) --- */
.auth-gate-box {
  max-width: 480px;
  margin: 3rem auto;
  border: 1px solid var(--rule-color);
  background-color: var(--bg-card);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-subtle);
  text-align: center;
}

.auth-notice-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--rule-accent);
  background-color: var(--bg-surface);
  border: 1px solid var(--rule-color);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.studio-container {
  max-width: 860px;
  margin: 0 auto;
  border: 1px solid var(--rule-color);
  background-color: var(--bg-card);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-subtle);
}

.r2-upload-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--rule-accent);
  margin-top: 0.35rem;
}
