/* ================================================
   Computational Theology Lab - Yale Divinity Library
   ================================================ */

/* CSS Custom Properties */
:root {
  /* Yale Colors - modernized */
  --yale-blue: #00356b;
  --yale-blue-light: #286dc0;
  --yale-blue-dark: #001f3f;
  --cream: #f9f7f3;
  --warm-white: #fdfcfa;
  --gold-accent: #bd9b60;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #6b6b6b;
  --border-light: #e5e2dc;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

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

  /* Layout */
  --max-width: 1200px;
  --content-width: 800px;
}

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

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

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--warm-white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--yale-blue-dark);
}

h1 {
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2.25rem;
  margin-bottom: var(--space-md);
}

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

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

a {
  color: var(--yale-blue-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--yale-blue);
}

/* Layout Utilities */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.content-narrow {
  max-width: var(--content-width);
}

/* ================================================
   Header & Navigation
   ================================================ */
.site-header {
  background: var(--yale-blue-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sponsor-link {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sponsor-link:hover {
  color: white;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
}

.site-title {
  display: flex;
  flex-direction: column;
}

.site-title a {
  color: white;
  text-decoration: none;
}

.site-title .lab-name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: 0.75rem;
}

.site-title .institution {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
}

.main-nav a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-xs) 0;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold-accent);
  transition: width 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: white;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

/* Mobile Navigation */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  margin: 5px 0;
  transition: 0.3s;
}

/* ================================================
   Hero Section
   ================================================ */
.hero {
  background: linear-gradient(135deg, var(--yale-blue-dark) 0%, var(--yale-blue) 100%);
  color: white;
  padding: var(--space-2xl) 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(189, 155, 96, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--content-width);
}

.hero h1 {
  color: white;
  font-size: 3.5rem;
  margin-bottom: var(--space-md);
  font-weight: 400;
}

.hero .tagline {
  font-size: 2.5rem;
  line-height: 1.2;
  color: white;
  font-weight: 500;
  font-family: var(--font-display);
  font-style: italic;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-width: 90%;
}

.hero-flex {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  justify-content: space-between;
}

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

.hero-logo img {
  width: 220px;
  max-width: 100%;
  height: auto;
  display: block;
}

/* ================================================
   Page Headers
   ================================================ */
.page-header {
  background: var(--cream);
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--border-light);
}

.page-header h1 {
  margin-bottom: var(--space-xs);
}

.page-header .subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-style: italic;
}

/* ================================================
   Main Content Sections
   ================================================ */
.section {
  padding: var(--space-2xl) 0;
}

.section--alt {
  background: var(--cream);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--gold-accent);
  margin: var(--space-sm) auto 0;
}

/* ================================================
   About Page - Mission Block
   ================================================ */
.mission-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.mission-text {
  font-size: 1.1rem;
}

.mission-text p:first-of-type {
  font-size: 1.25rem;
  font-family: var(--font-display);
  color: var(--yale-blue-dark);
  line-height: 1.5;
}

.mission-highlights {
  background: var(--yale-blue-dark);
  color: white;
  padding: var(--space-lg);
  border-radius: 4px;
}

.mission-highlights h3 {
  color: var(--gold-accent);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.mission-highlights ul {
  list-style: none;
}

.mission-highlights li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.95rem;
}

.mission-highlights li:last-child {
  border-bottom: none;
}

.founded-badge {
  display: inline-block;
  background: var(--gold-accent);
  color: var(--yale-blue-dark);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 2px;
  margin-bottom: var(--space-md);
}

/* ================================================
   Projects
   ================================================ */
.projects-grid {
  display: grid;
  gap: var(--space-xl);
}

.project-card {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-lg);
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.project-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.project-image {
  background: var(--cream);
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-image--placeholder {
  background: linear-gradient(135deg, var(--yale-blue) 0%, var(--yale-blue-dark) 100%);
  color: white;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.project-content {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.75rem;
  border-radius: 2px;
  margin-bottom: var(--space-sm);
  width: fit-content;
}

.project-status--active {
  background: #e8f5e9;
  color: #2e7d32;
}

.project-status--development {
  background: #fff3e0;
  color: #e65100;
}

.project-card h3 {
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
}

.project-card h3 a {
  color: var(--yale-blue-dark);
}

.project-card h3 a:hover {
  color: var(--yale-blue-light);
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.project-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-top: var(--space-sm);
}

.project-link::after {
  content: '→';
  transition: transform 0.2s ease;
}

.project-link:hover::after {
  transform: translateX(4px);
}

/* ================================================
   Members
   ================================================ */
.members-section {
  margin-bottom: var(--space-2xl);
}

.members-section h2 {
  font-size: 1.75rem;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--yale-blue);
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.member-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.member-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.member-photo {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  /* Creates 1:1 aspect ratio */
  position: relative;
  background: var(--cream);
  overflow: hidden;
}

.member-photo img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.member-photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--yale-blue-light) 0%, var(--yale-blue) 100%);
  color: white;
  font-family: var(--font-display);
  font-size: 3rem;
}

.member-info {
  padding: var(--space-md);
}

.member-info h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.member-role {
  color: var(--yale-blue-light);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.member-years {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.member-bio {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Former Members */
.members-section--former .members-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.members-section--former .member-card {
  opacity: 0.9;
}

.members-section--former .member-photo {
  aspect-ratio: 4/3;
}

/* Placeholder for future members */
.future-placeholder {
  background: var(--cream);
  border: 2px dashed var(--border-light);
  border-radius: 4px;
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-muted);
}

.future-placeholder p {
  font-style: italic;
  margin: 0;
}

/* ================================================
   Footer
   ================================================ */
.site-footer {
  background: var(--yale-blue-dark);
  color: white;
  padding: var(--space-xl) 0 var(--space-lg);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-about .footer-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.footer-about p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer-links h4,
.footer-contact h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-accent);
  margin-bottom: var(--space-sm);
}

.footer-links ul {
  list-style: none;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  display: block;
  padding: 0.25rem 0;
}

.footer-links a:hover {
  color: white;
}

.footer-contact a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer-contact a:hover {
  color: white;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.5);
}

.footer-bottom a:hover {
  color: white;
}

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

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-lg);
  }

  .hero-logo img {
    width: 180px;
  }

  .mission-block {
    grid-template-columns: 1fr;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-image {
    min-height: 200px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 var(--space-md);
  }

  .header-main {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .main-nav ul {
    gap: var(--space-md);
  }

  .main-nav a {
    font-size: 0.8rem;
  }

  .hero {
    padding: var(--space-xl) 0;
  }

  .hero h1 {
    font-size: 2rem;
  }

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

  .hero-logo img {
    width: 110px;
  }

  .section {
    padding: var(--space-xl) 0;
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 {
  animation-delay: 0.1s;
}

.animate-delay-2 {
  animation-delay: 0.2s;
}

.animate-delay-3 {
  animation-delay: 0.3s;
}

/* ================================================
   Internal Links Box
   ================================================ */
.internal-links-box {
  background: var(--cream);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: var(--space-md);
  margin-top: var(--space-lg);
  max-width: 400px;
}

.internal-links-box h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--yale-blue-dark);
  margin-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: var(--space-xs);
}

.internal-links-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.internal-links-box a {
  display: block;
  font-size: 0.95rem;
  color: var(--yale-blue-light);
  transition: padding-left 0.2s ease;
}

.internal-links-box a:hover {
  color: var(--yale-blue);
  padding-left: 4px;
}