/* #shared styles for every page, linked from each html file */

/* #palette: change colors here and they update everywhere */
:root {
  --bg: #f5efe6;          /* #cream page background */
  --surface: #fffdf9;     /* #warm white cards */
  --espresso: #2b2118;    /* #near-black brown, header and dark buttons */
  --text: #1c1714;        /* #near-black body text */
  --heading: #5a3e2b;     /* #dark brown headings */
  --brown: #8b5e3c;       /* #links and dates */
  --tan: #d2b48c;         /* #dashed borders and accents */
  --sand: #e8dcc8;        /* #light tan dividers */
  --cream-text: #f5efe6;  /* #text on dark backgrounds */
  --muted: #6b5d50;       /* #secondary text */
  --radius: 16px;
}

* { box-sizing: border-box; }

/* #offset anchor jumps so headings don't hide under the sticky nav */
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Quicksand', system-ui, sans-serif;
  line-height: 1.6;
}

/* #links */
a {
  color: var(--brown);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover { color: var(--espresso); text-decoration-color: var(--tan); }
a:focus-visible, .button:focus-visible {
  outline: 2px solid var(--brown);
  outline-offset: 3px;
  border-radius: 6px;
}

/* #sticky nav, same on every page */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 239, 230, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 2px dashed var(--tan);
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.1rem;
  list-style: none;
  margin: 0 auto;
  padding: 0.6rem 16px;
  max-width: 960px;
}
.site-nav a { font-size: 0.95rem; white-space: nowrap; }

/* #current page gets an underline in the nav */
.site-nav a[aria-current="page"] {
  color: var(--espresso);
  text-decoration-color: var(--tan);
  text-decoration-thickness: 2px;
}

/* #page width */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* #hero on the home page: photo, name, affiliations, links */
.hero {
  background-color: var(--espresso);
  color: var(--cream-text);
  border-radius: 20px;
  padding: 32px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
}
.hero a:not(.button) { color: var(--tan); }
.hero a:not(.button):hover { color: var(--cream-text); text-decoration-color: var(--tan); }

/* #photo keeps its own 3874 x 3456 shape, no cropping, just rounded corners */
.profile-photo {
  display: block;
  width: clamp(200px, 30vw, 300px);
  height: auto;
  border: 6px dashed var(--tan);
  border-radius: 18px;
  padding: 8px;
  background-color: var(--espresso);
}
.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.15;
  color: var(--cream-text);
}
.affiliation { margin: 0 0 0.35rem; }
.affiliation strong { color: var(--tan); font-weight: 700; }
.contact { margin: 0.75rem 0 1.25rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* #smaller header for the inner pages */
.page-head {
  background-color: var(--espresso);
  color: var(--cream-text);
  border-radius: 20px;
  padding: 24px 32px;
}
.page-head .eyebrow { margin: 0 0 0.25rem; }
.page-head .eyebrow a { color: var(--tan); }
.page-head .eyebrow a:hover { color: var(--cream-text); }
.page-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  line-height: 1.2;
  color: var(--cream-text);
}

/* #pill buttons: outlined on dark, solid tan for the cv */
.button {
  display: inline-block;
  background-color: transparent;
  color: var(--cream-text);
  border: 2px solid var(--tan);
  border-radius: 30px;
  padding: 8px 20px;
  font-family: inherit;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.button:hover {
  background-color: var(--tan);
  color: var(--espresso);
  text-decoration: none;
  transform: scale(1.05);
}
.button.solid { background-color: var(--tan); color: var(--espresso); }
.button.solid:hover { background-color: var(--cream-text); border-color: var(--cream-text); }

/* #section cards */
h2, h3 { color: var(--heading); }
section {
  background-color: var(--surface);
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 2px dashed var(--tan);
  margin-top: 24px;
}
section h2 { margin: 0 0 0.75rem; font-size: 1.45rem; }
section h3 { margin: 1.25rem 0 0.5rem; font-size: 1.1rem; }
section strong { color: var(--espresso); }
section p:last-child { margin-bottom: 0; }

/* #heading emojis, keyed to each heading id */
#about-me::before { content: "🦔 "; }
#publications::before { content: "🐿️ "; }
#cv::before { content: "📄 "; }
#presentations::before { content: "🦫 "; }
#teaching::before { content: "🐭 "; }
#fieldwork::before { content: "🦴 "; }
#training-and-outreach::before { content: "🐀 "; }

/* #plain lists: interests, publications, presentations */
.stack { margin: 0; padding-left: 1.2rem; }
.stack li { margin-bottom: 0.9em; }
.stack li:last-child { margin-bottom: 0; }
.note { color: var(--muted); font-size: 0.9em; margin: 0 0 0.75rem; }

/* #timeline lists: date on the left, details on the right */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px dashed var(--sand);
}
.timeline li:first-child { border-top: 0; padding-top: 0; }
.when { color: var(--brown); font-weight: 700; }
.sub { display: block; color: var(--muted); font-size: 0.92em; }

/* #fieldwork slideshow: one per trip, swipe on phones, arrows and dots elsewhere */
.slideshow {
  position: relative;
  margin-top: 0.75rem;
  border-radius: 12px;
  background-color: var(--espresso);
  overflow: hidden;
}
.slideshow .slides {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.slideshow .slides::-webkit-scrollbar { display: none; }
.slideshow .slides:focus-visible { outline: 2px solid var(--tan); outline-offset: -2px; }
.slide {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: start;
}
/* #photos are shown whole (contain), never cropped, on a dark backdrop */
.slide img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background-color: var(--espresso);
}
.slide figcaption {
  color: var(--cream-text);
  font-size: 0.9em;
  padding: 0.5rem 1rem 2.4rem;
  text-align: center;
}
.slide figcaption:empty { padding: 0 0 2.4rem; }

/* #round arrow buttons over the photo */
.slideshow .prev,
.slideshow .next {
  position: absolute;
  top: calc(50% - 1.2rem);
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid var(--tan);
  background-color: rgba(43, 33, 24, 0.75);
  color: var(--cream-text);
  font: 700 1.4rem/1 'Quicksand', system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.slideshow .prev { left: 10px; }
.slideshow .next { right: 10px; }
.slideshow .prev:hover,
.slideshow .next:hover { background-color: var(--tan); color: var(--espresso); }
.slideshow .prev:focus-visible,
.slideshow .next:focus-visible { outline: 2px solid var(--cream-text); outline-offset: 2px; }

/* #dots along the bottom */
.slideshow .dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.slideshow .dots button {
  width: 0.7rem;
  height: 0.7rem;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--tan);
  background: transparent;
  cursor: pointer;
}
.slideshow .dots button[aria-current="true"] { background-color: var(--tan); }

/* #only one photo: hide the arrows and dots */
.slideshow.single .prev,
.slideshow.single .next,
.slideshow.single .dots { display: none; }
.slideshow.single .slide figcaption { padding-bottom: 0.75rem; }
.slideshow.single .slide figcaption:empty { padding: 0; }

/* #training photos: one thumbnail beside each item */
.timeline li.has-photo { grid-template-columns: 7rem 1fr 320px; align-items: start; }
.thumb { margin: 0; }
.thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--sand);
}

/* #footer */
.footer-note {
  text-align: center;
  font-size: 0.85em;
  font-style: italic;
  color: var(--muted);
  margin-top: 40px;
  padding-top: 12px;
  border-top: 2px dashed var(--sand);
}

/* #tablet and phone layout */
@media (max-width: 700px) {
  .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 24px 16px;
    gap: 20px;
  }
  .hero-links { justify-content: center; }
  .page-head { padding: 20px 16px; }
  section { padding: 18px 16px; }
  .site-nav ul {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
  }
}
@media (max-width: 560px) {
  .timeline li,
  .timeline li.has-photo { grid-template-columns: 1fr; gap: 0.1rem; }
  .thumb { margin-top: 0.5rem; max-width: 320px; }
}

/* #respect reduced-motion settings */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .button:hover { transform: none; }
}

/* #slideshow sits under each trip's text, capped so photos don't take over the page */
.timeline .slideshow { grid-column: 2; max-width: 640px; }
@media (max-width: 560px) {
  .timeline .slideshow { grid-column: 1; max-width: none; }
}
