/* ============================================================
   Jae Wook Jung — academic site
   Left sidebar with portrait, dark green accent.
   All colors live in :root. Change once, applies everywhere.
   ============================================================ */

:root {
  --ink:          #1d1d1a;
  --ink-soft:     #45463f;
  --mute:         #74756c;
  --paper:        #ffffff;
  --rule:         #e4e4dd;

  --olive:        #131a16;   /* dark green — the accent */
  --olive-dark:   #131a16;   /* hover: lighter, so the change is visible */
  --olive-wash:   #131a16;   /* pale tint behind the paper block */  /* pale tint behind the paper block */

  --measure:      38rem;
  --sidebar:      19rem;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --display: var(--sans);   /* headings use Inter too */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--olive); text-decoration: none; }
a:hover { color: var(--olive-dark); text-decoration: none; }
a:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Frame ---------- */

.page {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 2rem 3.5rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 3rem 2.5rem 6rem;
}

/* ---------- Top bar: name left, nav right ---------- */

.topbar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem 2rem;
}

.topbar__name a { color: #000; }
.topbar__name a:hover { color: #000; }

.topbar__name {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #000;
  margin: 0;
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: sticky;
  top: 2.5rem;
  align-self: start;
}

.sidebar__photo {
  margin: 0 0 1.25rem;
  width: 100%;
}
.sidebar__photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 3px;
  background: var(--olive-wash);
}

.sidebar__role {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 1rem;
}

/* Contact list with icons */

.meta {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.86rem;
}
.meta li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.32rem 0;
  color: var(--ink-soft);
  line-height: 1.4;
}
.meta svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  color: var(--olive);
}
.meta a { color: var(--ink-soft); }
.meta a:hover { color: var(--olive-dark); text-decoration: none; }

/* ---------- Main column ---------- */

.main { min-width: 0; }

/* Nav */

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.85rem;
  margin: 0 0 2.75rem;
}
.nav a {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #000;
  transition: color 130ms ease;
}
.nav a:hover {
  color: var(--olive-dark);
  text-decoration: none;
}
.nav a[aria-current="page"] {
  color: var(--olive);
}

/* Type */

h1.page-title {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}

h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.008em;
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--olive);
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.35rem;
}

p { margin: 0 0 1.1rem; max-width: var(--measure); }
.lead { font-size: 1.1rem; }

strong { font-weight: 600; }
em { color: var(--ink-soft); }

/* ---------- Job market paper block ---------- */

.jmp {
  background: var(--olive-wash);
  border-left: 4px solid var(--olive);
  padding: 1.35rem 1.5rem 1.15rem;
  margin: 2rem 0;
  max-width: var(--measure);
}
.jmp .eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--olive);
  margin: 0 0 0.5rem;
}
.jmp h3 { font-size: 1.12rem; margin-bottom: 0.6rem; }
.jmp p { margin-bottom: 0.85rem; }
.jmp .actions { font-size: 0.88rem; font-weight: 500; margin-bottom: 0; }
.jmp .actions a + a { margin-left: 1.25rem; }

/* ---------- Fields / simple two-column facts ---------- */

.facts { margin: 0 0 1rem; max-width: var(--measure); }
.facts div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}
.facts dt {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 0.18rem;
}
.facts dd { margin: 0; }

/* ---------- Papers ---------- */

.paper {
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--rule);
  max-width: var(--measure);
}
.paper:last-of-type { border-bottom: none; }
.paper .authors, .paper .outlet {
  color: var(--mute);
  font-size: 0.93rem;
  margin: 0 0 0.45rem;
}
.paper .links { font-size: 0.88rem; font-weight: 500; margin-bottom: 0; }
.paper .links a + a { margin-left: 1rem; }

details.abstract-toggle { margin: 0.5rem 0 0.7rem; max-width: var(--measure); }
details.abstract-toggle summary {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--olive);
  cursor: pointer;
  list-style: none;
}
details.abstract-toggle summary::-webkit-details-marker { display: none; }
details.abstract-toggle summary::before { content: "+ "; }
details.abstract-toggle[open] summary::before { content: "\2013 "; }
details.abstract-toggle p {
  margin-top: 0.6rem;
  font-size: 0.96rem;
  color: var(--ink-soft);
}

/* ---------- Courses ---------- */

.course {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
  max-width: var(--measure);
}
.course .code {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--olive);
  padding-top: 0.12rem;
  margin: 0;
}
.course .title { font-weight: 600; margin: 0 0 0.15rem; }
.course .detail { color: var(--mute); font-size: 0.92rem; margin: 0; }

/* ---------- Button ---------- */

.button {
  display: inline-block;
  padding: 0.68rem 1.4rem;
  background: var(--olive);
  color: #fff;
  border-radius: 2px;
  font-size: 0.9rem;
  font-weight: 500;
}
.button:hover { background: var(--olive-dark); text-decoration: none; }

.updated { font-size: 0.85rem; color: var(--mute); }

/* ---------- Pages with no sidebar (Research, CV, Teaching) ---------- */

.page--full {
  grid-template-columns: minmax(0, 1fr);
  max-width: 68rem;
}


/* ---------- Paper entries, Caicedo style ---------- */

.paper {
  padding: 0;
  border-bottom: none;
  margin: 0 0 2.25rem;
}
.paper h3 {
  font-size: 1.06rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.paper h3 a { color: var(--olive); }
.paper h3 a:hover { color: #33473c; }
.paper .authors {
  color: var(--mute);
  font-size: 0.93rem;
  margin: 0 0 0.55rem;
}
.paper .authors a { color: var(--mute); }
.paper .authors a:hover { color: var(--olive); }
.paper .abstract {
  font-size: 0.85rem;
  line-height: 1.62;
  color: var(--ink-soft);
  margin: 0;
}
.paper .links {
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0.5rem 0 0;
}
.paper .links a + a { margin-left: 1rem; }

.tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #fff;
  background: var(--olive);
  padding: 0.14rem 0.5rem;
  border-radius: 2px;
  vertical-align: 0.14em;
  margin-left: 0.45rem;
}

/* Work-in-progress entries: title and coauthors only */
.paper--wip { margin-bottom: 1.35rem; }

/* ---------- Mobile ---------- */

@media (max-width: 860px) {
  .page {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.35rem 4rem;
  }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 1.25rem;
    align-items: start;
  }
  .sidebar__photo { grid-row: span 3; margin-bottom: 0; }
  .sidebar__role { margin-bottom: 0.5rem; }
  .meta { grid-column: 2; }
  .topbar { align-items: flex-start; gap: 0.75rem; }
  .topbar__name { font-size: 1.4rem; }
  h1.page-title { font-size: 1.4rem; }
  .nav { gap: 1.15rem; margin-bottom: 2rem; justify-content: flex-end; }
  .nav a { font-size: 0.8rem; letter-spacing: 0.06em; }
  .facts div { grid-template-columns: 1fr; gap: 0.1rem; }
  .course { grid-template-columns: 1fr; gap: 0.15rem; }
}

@media (max-width: 520px) {
  .sidebar { grid-template-columns: 1fr; }
  .sidebar__photo { grid-row: auto; max-width: 12rem; }
  .meta { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}

@media print {
  .nav, .sidebar__photo { display: none; }
  .page { display: block; padding: 0; }
  a { color: var(--ink); }
}
