/* ==========================================================================
   Dr. Sumrin Kalia - Academic Portfolio Stylesheet
   Aesthetic: Prestigious, editorial, warm ivory & deep ink palette
   ========================================================================== */

:root {
  --bg-parchment: #FBF9F5;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-muted: #F4EFEA;
  --bg-accent-subtle: #F0EAE1;
  
  --text-main: #1C1E21;
  --text-muted: #555A64;
  --text-subtle: #7A808C;
  
  --border-subtle: #E8E2D9;
  --border-strong: #D5CCC0;
  
  --accent-burgundy: #8B2635;
  --accent-burgundy-hover: #721F2B;
  --accent-burgundy-light: #FBF0F1;
  
  --accent-navy: #1B365D;
  --accent-navy-hover: #132743;
  --accent-navy-light: #EEF4FB;

  --accent-forest: #2C5E43;
  --accent-forest-light: #EDF6F1;
  
  --accent-gold: #C28B38;
  --accent-gold-light: #FDF7EC;

  --shadow-sm: 0 1px 3px rgba(28, 30, 33, 0.04), 0 1px 2px rgba(28, 30, 33, 0.02);
  --shadow-md: 0 4px 12px rgba(28, 30, 33, 0.06), 0 1px 3px rgba(28, 30, 33, 0.03);
  --shadow-lg: 0 12px 30px rgba(28, 30, 33, 0.08), 0 4px 10px rgba(28, 30, 33, 0.04);
  --shadow-xl: 0 20px 40px rgba(28, 30, 33, 0.12), 0 8px 16px rgba(28, 30, 33, 0.06);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* Base resets & typography */
html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-parchment);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-parchment);
  color: var(--text-main);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography styles */
.font-serif {
  font-family: 'Playfair Display', Georgia, Cambria, 'Times New Roman', Times, serif;
}

.font-editorial {
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.font-sans {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Editorial line clamp & fine rules */
.editorial-rule {
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong) 0%, rgba(213, 204, 192, 0.2) 100%);
  margin: 1.5rem 0;
}

.editorial-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  border-radius: 9999px;
  background-color: var(--bg-muted);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.editorial-tag.burgundy {
  background-color: var(--accent-burgundy-light);
  color: var(--accent-burgundy);
  border-color: rgba(139, 38, 53, 0.2);
}

.editorial-tag.navy {
  background-color: var(--accent-navy-light);
  color: var(--accent-navy);
  border-color: rgba(27, 54, 93, 0.2);
}

.editorial-tag.forest {
  background-color: var(--accent-forest-light);
  color: var(--accent-forest);
  border-color: rgba(44, 94, 67, 0.2);
}

.editorial-tag.gold {
  background-color: var(--accent-gold-light);
  color: var(--accent-gold);
  border-color: rgba(194, 139, 56, 0.25);
}

/* Cards & containers */
.academic-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.academic-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-inset {
  background: var(--bg-parchment);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

/* Navigation active tab styles */
.nav-tab-btn {
  position: relative;
  transition: all 0.2s ease;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background-color: rgba(0, 0, 0, 0.03);
}

.nav-tab-btn.active {
  color: var(--accent-burgundy);
  font-weight: 600;
  background-color: var(--accent-burgundy-light);
}

.nav-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 20%;
  right: 20%;
  height: 2px;
  background-color: var(--accent-burgundy);
  border-radius: 2px;
}

/* Sub-tab pills for publications */
.subtab-pill {
  padding: 0.4rem 0.9rem;
  font-size: 0.825rem;
  font-weight: 500;
  border-radius: 9999px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.subtab-pill:hover {
  border-color: var(--text-muted);
  color: var(--text-main);
}

.subtab-pill.active {
  background-color: var(--text-main);
  border-color: var(--text-main);
  color: #FFFFFF;
}

/* Publication thumbnail image container */
.pub-cover-container {
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: #F8F5F0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

/* Fieldwork gallery tile */
.gallery-tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  background-color: #1a1a1a;
  aspect-ratio: 4 / 3;
}

.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.gallery-tile:hover img {
  transform: scale(1.05);
  opacity: 0.9;
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(20, 22, 25, 0.88) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  color: #FFFFFF;
  opacity: 0.95;
  transition: opacity 0.25s ease;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--accent-burgundy);
  color: #FFFFFF;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: var(--accent-burgundy-hover);
  box-shadow: 0 4px 10px rgba(139, 38, 53, 0.25);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid var(--border-strong);
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: var(--bg-muted);
  border-color: var(--text-muted);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ghost:hover {
  color: var(--accent-burgundy);
  background-color: var(--accent-burgundy-light);
  border-color: rgba(139, 38, 53, 0.15);
}

/* Lightbox Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 17, 20, 0.85);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #1C1E21;
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideInUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Timeline & Accordion */
.timeline-stem {
  position: relative;
  padding-left: 2rem;
}

.timeline-stem::before {
  content: '';
  position: absolute;
  left: 0.45rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background-color: var(--border-subtle);
}

.timeline-node {
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 2px solid var(--accent-burgundy);
}

/* Print styles for CV */
@media print {
  body {
    background-color: #FFFFFF !important;
    color: #000000 !important;
  }

  header, nav, footer, .no-print, .toast-container, #subtabs-bar, #search-filter-bar {
    display: none !important;
  }

  .tab-pane {
    display: none !important;
  }

  #tab-cv {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .academic-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  a {
    color: #000000 !important;
    text-decoration: none !important;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
