/* ==========================================================================
   Global Styles - Vincent Pauline Website
   ========================================================================== */

/* ==========================================================================
   1. CSS Variables & Color Palette
   ========================================================================== */
:root {
  /* Primary colors */
  --color-text: #F5F5FA;
  --color-text-light: #FFFFFF;
  --color-text-muted: #c8c8d8;
  --color-text-subtle: #a0a0b0;
  --color-text-dim: #888899;

  /* Accent colors */
  --color-accent: #9D9DFF;
  --color-accent-light: #D9D9FF;
  --color-accent-blue: #476EB4;

  /* Background colors */
  --color-bg-0: #0a0a12;
  --color-bg-1: #12121a;
  --color-bg-2: #1a1a24;
  --color-bg-3: #2a2a3a;

  /* Spacing */
  --container-max-width: 900px;
  --container-padding: 2rem 1.5rem;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
}

/* ==========================================================================
   2. Quarto Title Block Styling (Unified)
   ========================================================================== */
#title-block-header,
#title-block-header.quarto-title-block,
.quarto-title-block,
header#title-block-header {
  background: transparent !important;
  background-color: transparent !important;
  padding: 2rem 0 1rem 0;
  margin-bottom: 1rem;
}

#title-block-header .quarto-title,
.quarto-title-block .quarto-title,
.quarto-title {
  background: transparent !important;
  background-color: transparent !important;
}

#title-block-header h1.title,
.quarto-title-block h1.title,
h1.title {
  color: var(--color-text) !important;
  font-size: 1.75rem;
  font-weight: 500;
  margin: 0;
  background: transparent !important;
}

#title-block-header .quarto-title-meta,
.quarto-title-block .quarto-title-meta {
  color: var(--color-text-muted);
}

#title-block-header p.subtitle,
.quarto-title-block p.subtitle,
p.subtitle {
  color: var(--color-text-muted) !important;
  font-size: 1.1rem;
  margin-top: 0.5rem;
  background: transparent !important;
}

/* ==========================================================================
   3. Base Typography & Links
   ========================================================================== */
body {
  color: var(--color-text);
  background-color: var(--color-bg-0);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-light);
}

strong {
  color: var(--color-text);
  font-weight: 500;
}

/* ==========================================================================
   3. Page Container (Unified for all pages)
   ========================================================================== */
.page-container,
.landing-container,
.research-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: var(--container-padding);
}

/* ==========================================================================
   4. Section Headers
   ========================================================================== */
.page-container h2,
.landing-container h2,
.research-container h2 {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   5. Section Divider
   ========================================================================== */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-bg-3), transparent);
  margin: 2rem 0;
}

hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-bg-3), transparent);
  margin: 3rem 0;
}

/* ==========================================================================
   6. Hero Section (Landing Page)
   ========================================================================== */
.hero-section {
  margin-bottom: 2rem;
}

.hero-content {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.hero-left {
  flex-shrink: 0;
}

.profile-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-bg-2);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: smooth;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-right {
  flex-grow: 1;
}

.hero-right h1 {
  font-size: 2.2rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--color-accent);
  margin-bottom: 0.4rem;
  font-weight: 400;
}

.hero-affiliation {
  font-size: 0.95rem;
  color: var(--color-text-dim);
  margin-bottom: 1rem;
}

.hero-icons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.icon-link {
  color: var(--color-text-dim);
  font-size: 1.3rem;
  transition: color var(--transition-fast), transform var(--transition-fast);
  text-decoration: none;
}

.icon-link:hover {
  color: var(--color-accent);
  transform: translateY(-2px);
}

/* ==========================================================================
   7. About Section
   ========================================================================== */
.about-section {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--color-text-muted);
}

.about-section a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
}

.about-section a:hover {
  border-bottom-color: var(--color-accent);
}

.about-section strong {
  color: var(--color-text);
  font-weight: 500;
}

/* ==========================================================================
   8. Cards (Unified - News, Research, etc.)
   ========================================================================== */
.news-grid,
.research-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.news-card,
.research-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem;
  background: var(--color-bg-1);
  border-radius: 10px;
  border: 1px solid var(--color-bg-2);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.news-card:hover,
.research-card:hover {
  border-color: var(--color-bg-3);
  transform: translateX(4px);
}

.news-image,
.research-image {
  flex-shrink: 0;
  width: 140px;
  height: 100px;
  overflow: hidden;
  border-radius: 6px;
}

.news-image img,
.research-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-content,
.research-content {
  flex-grow: 1;
}

.news-date {
  font-size: 0.8rem;
  color: var(--color-accent);
  margin-bottom: 0.4rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.news-content h3,
.research-content h3 {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 0 0 0.4rem 0;
  line-height: 1.3;
}

.news-content p,
.research-content p {
  font-size: 0.9rem;
  color: var(--color-text-subtle);
  margin: 0.5rem 0;
  line-height: 1.5;
}

.news-content em,
.research-content em {
  font-size: 0.85rem;
  color: var(--color-text-dim);
}

.news-link,
.research-link {
  font-size: 0.85rem;
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.news-link:hover,
.research-link:hover {
  color: var(--color-accent-light);
}

/* ==========================================================================
   9. Tags
   ========================================================================== */
.research-tags,
.book-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75em;
  font-weight: 500;
  color: var(--color-accent);
  background: transparent;
  border: 1px solid var(--color-accent);
  border-radius: 20px;
  transition: all var(--transition-fast);
}

.tag:hover {
  background: var(--color-accent);
  color: var(--color-bg-0);
}

/* ==========================================================================
   10. Research Interests Grid
   ========================================================================== */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.interest-item {
  padding: 1rem 1.25rem;
  background: var(--color-bg-1);
  border-radius: 8px;
  border-left: 3px solid var(--color-accent);
  font-size: 0.88rem;
  color: var(--color-text-subtle);
  line-height: 1.5;
}

.interest-item strong {
  display: block;
  color: var(--color-text);
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

/* ==========================================================================
   11. Timeline
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--color-accent) 0%, var(--color-bg-3) 100%);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.3rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-bg-1);
  border: 3px solid var(--color-accent);
  z-index: 1;
}

.timeline-marker.current {
  background: var(--color-accent);
  box-shadow: 0 0 12px rgba(157, 157, 255, 0.4);
}

.timeline-marker.education {
  border-color: var(--color-accent-blue);
}

.timeline-marker.education.current {
  background: var(--color-accent-blue);
}

.timeline-content {
  padding-left: 0.5rem;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timeline-content h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 0 0 0.25rem 0;
}

.timeline-content strong {
  font-size: 0.9rem;
  color: var(--color-text-dim);
  font-weight: 400;
}

.timeline-content p {
  font-size: 0.9rem;
  color: var(--color-text-subtle);
  margin: 0.5rem 0 0 0;
  line-height: 1.5;
}

/* ==========================================================================
   12. Reading Page Styles
   ========================================================================== */
.reading-intro {
  font-size: 1.05em;
  line-height: 1.8;
  color: #a0a0b0;
  max-width: 640px;
  margin: 0 auto 2.5rem auto;
  padding: 0;
  font-style: italic;
  text-align: center;
  letter-spacing: 0.01em;
}

/* Book Grid */
.book-grid {
  display: grid;
  gap: 1.5rem;
  margin: 1.5rem 0 2.5rem 0;
}

.top-shelf-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.recent-grid,
.category-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.current-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.current-grid .book-card {
  font-size: 0.9em;
}

.current-grid .cover-img {
  max-height: 180px;
}

/* Book Cards */
.book-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-1);
  border-radius: 10px;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.book-card .book-cover {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1.5rem 0.5rem 1.5rem;
  background: linear-gradient(180deg, var(--color-bg-0) 0%, var(--color-bg-1) 100%);
}

.book-card .cover-img {
  width: 120px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-medium);
}

.book-card:hover .cover-img {
  transform: scale(1.03);
}

.book-card .book-info {
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.book-card .book-info h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1em;
  color: var(--color-text);
  line-height: 1.3;
}

.book-card .book-info p:first-of-type {
  margin: 0 0 0.75rem 0;
  color: var(--color-accent);
  font-size: 0.9em;
  font-weight: 500;
}

.book-card .book-info p {
  font-size: 0.9em;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

/* Book Tags */
.book-tags {
  margin-top: auto;
  padding-top: 0.75rem;
}

/* Post Card variant - for blog posts with diagrams/images */
.book-card.post-card .book-cover {
  padding: 0;
  background: transparent;
}

.book-card.post-card .cover-img {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 6px;
  box-shadow: none;
}

.book-card.post-card .book-info {
  padding: 1rem 1.5rem;
}

/* Currently Reading Featured */
.now-reading .book-card.featured {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  background: linear-gradient(135deg, var(--color-bg-1) 0%, var(--color-bg-0) 100%);
  border: 1px solid var(--color-bg-2);
  border-radius: 12px;
  padding: 2rem;
  max-width: 720px;
  margin: 0 auto;
}

/* Top Shelf Books - Highlighted */
.top-shelf-grid .book-card {
  border: 1px solid var(--color-accent);
}

.now-reading .book-cover {
  flex-shrink: 0;
}

.now-reading .cover-img {
  width: 140px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform var(--transition-medium);
}

.now-reading .cover-img:hover {
  transform: scale(1.02);
}

.now-reading .book-info h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  font-size: 1.4em;
  color: var(--color-text);
}

.now-reading .book-info p:first-of-type {
  margin-top: 0;
  color: var(--color-accent);
  font-weight: 500;
}

/* Book List (Categories) */
.book-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0 2rem 0;
}

.book-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-bg-1);
  border-radius: 8px;
  transition: transform var(--transition-fast);
}

.book-row:hover {
  transform: translateX(4px);
}

.book-cover-small {
  flex-shrink: 0;
}

.book-cover-small .cover-img {
  width: 60px;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.book-info-compact {
  flex-grow: 1;
  font-size: 0.9em;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.book-info-compact strong {
  color: var(--color-text);
  font-size: 1em;
}

/* Bridge Section */
.bridge-section {
  background: var(--color-bg-1);
  padding: 2rem;
  border-radius: 10px;
  margin-top: 2rem;
}

.bridge-section ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
}

.bridge-section li {
  margin-bottom: 0.75rem;
}

.bridge-section a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.bridge-section a:hover {
  color: var(--color-accent-light);
  text-decoration: underline;
}

/* ==========================================================================
   13. Footer Note
   ========================================================================== */
.footer-note {
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-text-dim);
  padding: 1rem 0;
}

.footer-note a {
  color: var(--color-accent);
  text-decoration: none;
}

.footer-note a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   14. TOC Styling
   ========================================================================== */
#TOC {
  font-size: 0.9em;
}

#TOC a {
  color: var(--color-accent);
}

#TOC a:hover {
  color: var(--color-accent-light);
}

/* Section Headers with Border */
.content h2 {
  margin-top: 3rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent);
}

/* Category Section Headers */
#categories h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
  margin-top: 2rem;
}

#categories h3::before {
  content: '';
  width: 4px;
  height: 1.2em;
  background: var(--color-accent);
  border-radius: 2px;
}

/* ==========================================================================
   15. Animations
   ========================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-section {
  animation: fadeIn 0.5s ease-out;
}

.about-section {
  animation: fadeIn 0.5s ease-out 0.1s both;
}

.news-card,
.research-card {
  animation: fadeIn 0.4s ease-out both;
}

.news-card:nth-child(1),
.research-card:nth-child(1) { animation-delay: 0.15s; }
.news-card:nth-child(2),
.research-card:nth-child(2) { animation-delay: 0.25s; }
.news-card:nth-child(3),
.research-card:nth-child(3) { animation-delay: 0.35s; }

.timeline-item {
  animation: fadeIn 0.4s ease-out both;
}

.timeline-item:nth-child(1) { animation-delay: 0.2s; }
.timeline-item:nth-child(2) { animation-delay: 0.3s; }
.timeline-item:nth-child(3) { animation-delay: 0.4s; }
.timeline-item:nth-child(4) { animation-delay: 0.5s; }
.timeline-item:nth-child(5) { animation-delay: 0.6s; }
.timeline-item:nth-child(6) { animation-delay: 0.7s; }

.book-card {
  animation: fadeInUp 0.4s ease-out both;
}

.book-grid .book-card:nth-child(1) { animation-delay: 0.05s; }
.book-grid .book-card:nth-child(2) { animation-delay: 0.1s; }
.book-grid .book-card:nth-child(3) { animation-delay: 0.15s; }
.book-grid .book-card:nth-child(4) { animation-delay: 0.2s; }
.book-grid .book-card:nth-child(5) { animation-delay: 0.25s; }
.book-grid .book-card:nth-child(6) { animation-delay: 0.3s; }

/* ==========================================================================
   16. Responsive Design
   ========================================================================== */
@media screen and (max-width: 768px) {
  :root {
    --container-padding: 1.5rem 1rem;
  }

  /* Hero */
  .hero-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-icons {
    justify-content: center;
  }

  .profile-img {
    width: 140px;
    height: 140px;
  }

  .hero-right h1 {
    font-size: 1.8rem;
  }

  /* Cards */
  .news-card,
  .research-card {
    flex-direction: column;
  }

  .news-image,
  .research-image {
    width: 100%;
    height: 160px;
  }

  .research-tags {
    justify-content: center;
  }

  /* Interests */
  .interests-grid {
    grid-template-columns: 1fr;
  }

  /* Reading */
  .now-reading .book-card.featured {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .now-reading .cover-img {
    width: 120px;
  }

  .top-shelf-grid,
  .recent-grid,
  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .current-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .book-card .cover-img {
    width: 100px;
  }

  .book-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .reading-intro {
    font-size: 1em;
    padding: 0 1rem;
  }
}

@media screen and (max-width: 480px) {
  .hero-right h1 {
    font-size: 1.5rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .profile-img {
    width: 120px;
    height: 120px;
  }

  .top-shelf-grid,
  .recent-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .current-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .book-tags {
    justify-content: center;
  }
}
