/* ==========================================================
   Nate Korth, Ph.D. - personal academic website
   Colors live in :root below; change them there to re-theme.
   ========================================================== */

:root {
  --green-dark: #24482f;   /* header, headings */
  --green: #3a6b47;        /* links, buttons */
  --green-light: #e7efe8;  /* tinted panels */
  --soil: #8a5a2b;         /* accent rule, highlights */
  --bg: #fbfaf6;           /* page background */
  --card: #ffffff;
  --text: #22251f;
  --muted: #5d6358;
  --border: #dcdcd2;
  --max: 980px;
  --radius: 10px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.075rem;
  line-height: 1.65;
}

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

a { color: var(--green); text-underline-offset: 2px; }
a:hover { color: var(--green-dark); }

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--green-dark);
  line-height: 1.25;
}
h1 { font-size: 2rem; margin: 0 0 .5rem; }
h2 { font-size: 1.5rem; margin: 2.25rem 0 .75rem; }
h3 { font-size: 1.2rem; margin: 1.75rem 0 .5rem; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header and navigation ---------- */

.site-header {
  background: var(--green-dark);
  color: #fff;
  border-bottom: 4px solid var(--soil);
}
.site-header .wrap {
  padding-top: 1.4rem;
  padding-bottom: 1rem;
}
.site-title {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  display: inline-block;
}
.site-title:hover { color: #fff; }
.tagline {
  margin: .15rem 0 1rem;
  color: #d4e2d6;
  font-size: 1rem;
  letter-spacing: .02em;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.site-nav a {
  display: block;
  padding: .35rem .85rem;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-size: .95rem;
  white-space: nowrap;
}
.site-nav a:hover { background: rgba(255,255,255,.12); }
.site-nav a[aria-current="page"] {
  background: #fff;
  color: var(--green-dark);
  border-color: #fff;
  font-weight: 600;
}

/* ---------- Main content ---------- */

main { padding: 2rem 0 3rem; }

.lead { font-size: 1.15rem; color: var(--muted); margin-top: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin: 1rem 0;
}

.panel {
  background: var(--green-light);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

/* Home: photo beside bio */
.intro {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: start;
}
.intro h1 { margin-top: 0; }
.headshot {
  width: 240px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.headshot-placeholder {
  width: 240px;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  padding: 1rem;
}
.headshot-placeholder span {
  display: block;
  font-family: var(--serif);
  font-size: 3rem;
  color: var(--green);
}

.quick-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

.btn {
  display: inline-block;
  padding: .5rem 1.05rem;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}
.btn:hover { background: var(--green-dark); color: #fff; }
.btn.outline { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn.outline:hover { background: var(--green-light); }

.interests {
  list-style: none;
  padding: 0;
  margin: .5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .75rem;
}
.interests li {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--soil);
  border-radius: var(--radius);
  padding: .85rem 1rem;
}

/* Research figure */
figure {
  margin: 1.5rem 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.figure-row {
  display: grid;
  grid-template-columns: minmax(0, 340px) 1fr;
  gap: 1.25rem;
  align-items: center;
}
figure img { display: block; margin: 0 auto; border-radius: 6px; }
figcaption { font-size: .95rem; color: var(--muted); }
figcaption strong { color: var(--text); }

.aims { padding-left: 1.2rem; }
.aims li { margin-bottom: .5rem; }

/* Publications */
.pubs { padding-left: 1.4rem; }
.pubs li { margin-bottom: 1rem; }
.pubs .me { font-weight: 700; }
.pubs .journal { font-style: italic; }
.pubs .links a {
  font-size: .85rem;
  padding: .05rem .5rem;
  border: 1px solid var(--green);
  border-radius: 999px;
  text-decoration: none;
  margin-right: .25rem;
  white-space: nowrap;
}

/* Simple list rows with a date on the right */
.entries { list-style: none; padding: 0; margin: 0; }
.entries li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
}
.entries .when { color: var(--muted); white-space: nowrap; }
.entries .what small { display: block; color: var(--muted); }

/* LinkedIn embeds */
/* LinkedIn sizes each embed's height for a 504px-wide post, so posts are shown at that width */
.posts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.post {
  width: 100%;
  max-width: 504px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.post iframe {
  display: block;
  width: 100% !important;
  max-width: 100%;
  border: 0;
}
.post-placeholder {
  min-height: 220px;
  border: 2px dashed var(--border);
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  padding: 1rem;
  font-size: .95rem;
}

/* Contact */
.contact-list { list-style: none; padding: 0; }
.contact-list li { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.contact-list .label {
  display: inline-block;
  min-width: 8rem;
  font-weight: 600;
  color: var(--green-dark);
}

.todo {
  background: #fff6dc;
  border: 1px dashed #c9a43a;
  border-radius: 6px;
  padding: .1rem .4rem;
  font-size: .9rem;
}

/* Photos */
.banner {
  margin: 0 0 1.75rem;
  border-radius: var(--radius);
  overflow: hidden;
}
.banner img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
}
.photo { margin: 0; padding: 0; border: 0; background: none; }
.photo img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
}
.photo figcaption { margin-top: .4rem; font-size: .88rem; }

/* Text beside a photo; add class "flip" to put the photo on the left */
.split {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.75rem;
  align-items: start;
  margin: 1rem 0 2rem;
}
.split.flip { grid-template-columns: 300px 1fr; }
.split.flip .photo { order: -1; }
.split h2 { margin-top: 0; }
.photo.tall img { aspect-ratio: 3 / 4; }
.photo.wide img { aspect-ratio: 4 / 3; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .9rem;
  padding: 1.25rem 0 2rem;
}
.site-footer a { color: var(--muted); }

/* ---------- Phones ---------- */

@media (max-width: 700px) {
  body { font-size: 1rem; }
  h1 { font-size: 1.65rem; }
  .site-title { font-size: 1.55rem; }
  .site-nav a { padding: .3rem .7rem; font-size: .9rem; }
  .intro { grid-template-columns: 1fr; gap: 1.25rem; }
  .headshot, .headshot-placeholder { width: 180px; }
  .figure-row { grid-template-columns: 1fr; }
  .split, .split.flip { grid-template-columns: 1fr; gap: 1rem; }
  .split.flip .photo { order: 0; }
  .photo.tall img { aspect-ratio: 4 / 3; }
  .banner img { height: 170px; }
  .entries li { flex-direction: column; gap: .1rem; }
  .contact-list .label { display: block; }
}

/* Fallback link under each LinkedIn post, for browsers that block the embed */
.post-link {
  display: block;
  padding: .5rem .9rem;
  border-top: 1px solid var(--border);
  font-size: .9rem;
  text-decoration: none;
}
