/* Base Styles - Shared across all layouts */

:root {
  /* Colors */
  --color-primary: #1a2332;
  --color-secondary: #2a3f5f;
  --color-accent: #c9a961;
  --color-accent-bright: #d4b76a;
  --color-bg: #faf8f3;
  --color-bg-alt: #f0ede5;
  --color-text: #1a2332;
  --color-text-muted: #5a6a7a;
  --color-border: #d4cfc1;

  /* Typography */
  --font-display: 'Crimson Pro', 'Crimson Text', Georgia, serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Smooth layout transitions */
.site-main,
.right-panel-content {
  transition: opacity 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-primary);
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  margin-bottom: var(--space-sm);
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 500;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 1.5rem;
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-sm);
}

a {
  color: var(--color-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.25s ease;
}

a:hover {
  color: var(--color-accent-bright);
  border-bottom-color: var(--color-accent-bright);
}

/* About Me role titles — small caps in the sidebar's blue */
.role-title {
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-weight: 600;
  font-size: 1.1em;
  color: var(--color-secondary);
}

/* Lists */
ul, ol {
  margin-bottom: var(--space-md);
}

ul {
  list-style: none;
}

ol {
  list-style: decimal;
  list-style-position: outside;
}

ol li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

ul li::before {
  content: '▪';
  position: absolute;
  left: 0;
  top: 0.5em;
  color: var(--color-accent);
  font-size: 1.2rem;
  line-height: 1;
}

/* Common Components */
.highlight-box {
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-accent);
  padding: var(--space-md);
  margin: var(--space-md) 0;
  border-radius: 0 2px 2px 0;
}

.cv-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-secondary);
  color: var(--color-bg);
  border-radius: 2px;
  font-weight: 500;
  border: 2px solid var(--color-secondary);
  transition: all 0.3s ease;
  margin-top: var(--space-sm);
}

.cv-link:hover {
  background: transparent;
  color: var(--color-secondary);
  border-color: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 63, 95, 0.2);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-accent {
  color: var(--color-accent);
}

/* Timeline Lists */
.timeline-list li {
  position: relative;
  border-left: 2px solid var(--color-border);
  padding-left: var(--space-md);
  padding-bottom: var(--space-sm);
}

.timeline-list li::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 2px solid var(--color-bg);
}

/* Publications */
.publication-item {
  margin-bottom: 1.5rem;
  padding-left: 0.5rem;
}

.publication-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.publication-authors {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  margin-bottom: var(--space-xs);
  font-style: italic;
}

.publication-venue {
  color: var(--color-text);
  font-size: 0.9375rem;
  font-weight: 500;
}

/* Hero Image */
.hero-image-container {
  width: 100%;
  /* Keep the photo at its original position (3rem from top) now that
     .site-main top padding is --space-lg (4rem) instead of --space-xl (6rem). */
  margin: calc(-1 * var(--space-sm)) 0 var(--space-lg) 0;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero-image {
  width: 100%;
  height: auto;
  display: block;
  max-height: 400px;
  object-fit: cover;
  object-position: center top;
}

/* Research Grid */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin: var(--space-md) 0;
}

.research-item {
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
  padding: var(--space-md);
  border-radius: 2px;
  border-top: 3px solid var(--color-accent);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.research-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.research-item h3 {
  font-size: 1.125rem;
  margin: 0;
  color: var(--color-secondary);
}

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

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

/* Color Scheme Switcher - hidden by default, shown only in brutalist layout */
.color-scheme-switcher {
  display: none;
}

body.layout-brutal .color-scheme-switcher {
  display: flex;
}

/* Layout Switcher */
.layout-switcher {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  background: var(--color-primary);
  border-radius: 50px;
  padding: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  gap: 0.5rem;
}

.layout-btn {
  width: 50px;
  height: 50px;
  border: none;
  background: transparent;
  color: rgba(250, 248, 243, 0.6);
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.3s ease;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-accent-bright);
}

.layout-btn.active {
  background: var(--color-accent);
  color: var(--color-primary);
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --space-lg: 3rem;
    --space-xl: 4rem;
  }

  .layout-switcher {
    bottom: 1rem;
    right: 1rem;
    flex-direction: column;
  }

  .research-grid {
    grid-template-columns: 1fr;
  }

  .hero-image {
    max-height: 300px;
  }

  .hero-image-container {
    margin-top: calc(-1 * var(--space-md));
  }
}
