/* ============================================
   Juliana Pinillos — Academic Website
   Dark Cartography theme — spatial data design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&display=swap');

:root {
  --bg-primary: #171716;
  --bg-secondary: #1d1d1b;
  --bg-card: #232321;
  --text-primary: #f0eee9;
  --text-secondary: #b9b3aa;
  --accent: #9bb5aa;
  --accent-strong: #c6d7cf;
  --accent-light: rgba(155, 181, 170, 0.14);
  --accent-glow: rgba(155, 181, 170, 0.07);
  --border: rgba(240, 238, 233, 0.12);
  --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: underline;
  transition: opacity 0.2s;
}

a:hover { opacity: 0.8; }

img { max-width: 100%; height: auto; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================
   Header & Navigation
   ============================================ */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-sep {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  user-select: none;
}

.nav-link {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-strong);
  opacity: 1;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  transition: all 0.3s;
}

/* ============================================
   Hero Banner — Night Lights World Map
   ============================================ */
.hero-banner {
  position: relative;
  width: 100%;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('/images/hero-bg.jpg') center center / cover no-repeat;
  overflow: hidden;
}

/* Subtle dark overlay for text readability */
.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.24));
  pointer-events: none;
}

.hero-banner-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-name {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 500;
  font-size: 4.25rem;
  color: #ffffff;
  letter-spacing: 0;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.66);
}

/* ============================================
   About Section (below hero)
   ============================================ */
.about-section {
  background: var(--bg-primary);
  padding: 4.5rem 0;
}

.about-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.about-photo {
  flex-shrink: 0;
  width: 280px;
}

.about-photo img {
  width: 100%;
  display: block;
}

/* Contact info under photo */
.contact-info {
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.contact-info p {
  margin-bottom: 0.15rem;
}

.contact-links {
  margin-top: 0.75rem;
  display: flex;
  gap: 1rem;
}

.contact-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.contact-links a:hover {
  text-decoration: underline;
}

.about-text {
  flex: 1;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.about-text h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.about-text p {
  margin-bottom: 1.2rem;
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.8;
}

.about-text .bio-paragraph {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.about-text a {
  color: var(--accent);
  text-decoration: underline;
}

/* ============================================
   Inner Pages (Research, CV)
   ============================================ */
.page-content {
  padding: 4rem 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.page-content h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.page-content h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.page-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.page-content ul, .page-content ol {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.page-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.page-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Paper entries */
.paper {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0 1.35rem;
  margin-bottom: 0;
}

.paper h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
}

.paper .authors {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  margin-top: 0.15rem;
}

.paper .venue {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 0.25rem;
}

.paper .abstract {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.paper .paper-links {
  margin-top: 0.5rem;
}

.paper .paper-links a {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: underline;
}

/* Inline authors (same line as stage badge) */
.authors-inline {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.venue-inline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Paper draft link */
.paper-draft-link {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
  padding: 0.2rem 0.7rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-primary);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.2s;
}

.paper-draft-link:hover {
  background: rgba(255, 255, 255, 0.095);
  opacity: 1;
}

/* Paper stage badges */
.paper-stage {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
  padding: 0.2rem 0.7rem;
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

.stage-pilot {
  background: rgba(151, 131, 158, 0.16);
  color: #d1c2d8;
  border: 1px solid rgba(151, 131, 158, 0.34);
}

.stage-exploring {
  background: rgba(112, 139, 164, 0.17);
  color: #bfd0df;
  border: 1px solid rgba(112, 139, 164, 0.34);
}

.stage-scale-up {
  background: rgba(173, 144, 91, 0.18);
  color: #e1c68c;
  border: 1px solid rgba(173, 144, 91, 0.38);
}

.stage-fieldwork {
  background: rgba(155, 181, 170, 0.15);
  color: var(--accent-strong);
  border: 1px solid rgba(155, 181, 170, 0.36);
}

.stage-analysis {
  background: var(--accent-light);
  color: var(--accent-strong);
  border: 1px solid rgba(155, 181, 170, 0.36);
}

/* Clickable abstract (details/summary) */
.paper-abstract {
  margin-top: 0.75rem;
}

.paper-abstract summary {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-strong);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: opacity 0.2s;
}

.paper-abstract summary::-webkit-details-marker {
  display: none;
}

.paper-abstract summary::before {
  content: '+ ';
  font-weight: 600;
}

.paper-abstract[open] summary::before {
  content: '− ';
}

.paper-abstract summary:hover {
  opacity: 0.8;
}

.paper-abstract p {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Social links on homepage */
.social-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.social-links a:hover {
  text-decoration: underline;
}

/* Course entries (Teaching page) */
.course {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0 1.35rem;
  margin-bottom: 0;
}

.course-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.course-header h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-primary);
}

.course-term {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.course-institution {
  font-size: 0.9rem;
  color: var(--accent);
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.course-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.course-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.course-materials a {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: background 0.2s;
}

.course-materials a:hover {
  background: var(--accent-light);
  opacity: 1;
}

/* Slides dropdown */
.slides-dropdown {
  display: inline;
}

.slides-dropdown summary {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  list-style: none;
  user-select: none;
  transition: background 0.2s;
}

.slides-dropdown summary::-webkit-details-marker {
  display: none;
}

.slides-dropdown summary:hover {
  background: var(--accent-light);
}

.slides-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.slides-list a {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: background 0.2s;
}

.slides-list a:hover {
  background: var(--accent-light);
  opacity: 1;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.25s;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid rgba(155, 181, 170, 0.45);
}

.btn-primary:hover {
  background: var(--accent-light);
  color: var(--text-primary);
  opacity: 1;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent-strong);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    flex-direction: column;
    padding: 1rem 2rem;
    border: 1px solid var(--border);
  }

  .site-nav.open {
    display: flex;
  }

  .nav-sep {
    display: none;
  }

  .hero-name {
    font-size: 2.6rem;
    letter-spacing: 0;
  }

  .hero-banner {
    min-height: 350px;
  }

  .about-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-photo {
    width: 220px;
  }

  .footer-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

}
