/* Kwan Woo Kim — academic site.
   Layout and typography modeled on mivich.com (Michelle Jackson).
   Geometric sans headings (Jost ≈ futura-pt), humanist sans body (Open Sans ≈ proxima-nova). */

:root {
  --ink: #222222;          /* page title */
  --ink-head: #484747;     /* section headings */
  --ink-body: #575757;     /* body copy */
  --ink-link: #111111;     /* linked titles */
  --rule: #d5d5d3;
  --paper: #f1f1f1;
  --maxw: 1200px;
  --pad: 75px;
  --figcol: 200px;         /* figure gutter column */
  --figbox: 152px;         /* uniform thumbnail height */
  --figgap: 50px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-body);
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 27px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--ink-link); }
a:hover { opacity: 0.6; }

/* ---- Header / nav ---- */

header.site {
  padding: 56px 0 0;
}

header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 30px;
}

.site-name {
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  text-decoration: none;
  color: var(--ink);
}

nav.primary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 30px;
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1.15px;
}

nav.primary a {
  color: var(--ink-body);
  text-decoration: none;
}

nav.primary a:hover,
nav.primary a[aria-current="page"] {
  color: var(--ink);
  opacity: 1;
}

/* ---- Research dropdown ---- */

.nav-item {
  position: relative;
  /* invisible bridge so the cursor can travel from label to menu */
  padding-bottom: 16px;
  margin-bottom: -16px;
}

.dropdown {
  position: absolute;
  top: 100%;
  right: -18px;
  z-index: 50;
  min-width: 300px;
  margin: 0;
  padding: 9px 0;
  list-style: none;
  background: #fdfdfd;
  border: 1px solid var(--rule);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown li { margin: 0; }

.dropdown a {
  display: block;
  padding: 7px 18px;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  color: var(--ink-body);
}

.dropdown a:hover,
.dropdown a[aria-current="page"] {
  color: var(--ink);
  background: #f0f0ee;
  opacity: 1;
}

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

main.wrap { padding: 115px var(--pad) 40px; }

h1 {
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-size: 38px;
  line-height: 52px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 2.2px;
  color: var(--ink);
  text-align: center;
  margin: 0 0 54px;
}

h2 {
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--ink-head);
  margin: 58px 0 30px;
}

h3 {
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--ink-head);
  margin: 28px 0 8px;
}

p { margin: 0 0 15px; }

em { font-style: italic; }

/* ---- Indented text column (aligns with entry text, past the figure gutter) ---- */

.indent { padding-left: calc(var(--figcol) + var(--figgap)); }

/* Flush-left prose with a readable measure (pages without a figure gutter) */
.measure { max-width: 860px; }

/* ---- Publication entry: figure gutter + text ---- */

.entry {
  display: grid;
  grid-template-columns: var(--figcol) 1fr;
  column-gap: var(--figgap);
  margin: 0 0 46px;
}

/* Every thumbnail occupies an identical white tile; the figure is scaled to fit
   inside it (never cropped), so aspect ratios differ without the sizes differing. */
.entry-fig a {
  display: block;
  height: var(--figbox);
  padding: 6px;
  background: #fff;
  border: 1px solid var(--rule);
}

.entry-fig a:hover { border-color: #b4b4b0; }

.entry-fig img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* two or more figures stacked in the gutter */
.entry-fig-stack a + a { margin-top: 14px; }

.cite {
  font-weight: 700;
  color: var(--ink-body);
  margin: 0 0 15px;
}

.cite a {
  font-weight: 400;
  color: var(--ink-link);
  text-decoration: none;
}

.cite a:hover { text-decoration: underline; }

.abstract { margin: 0 0 12px; }

.status {
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: #8c8c8c;
  margin-left: 8px;
  white-space: nowrap;
}

.links-row {
  font-size: 13.5px;
  line-height: 24px;
  margin: 0;
}

.links-row a { margin-right: 16px; white-space: nowrap; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Lightbox (figures open in an overlay; falls back to a plain link if JS is off) ---- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 46px;
  background: rgba(26, 26, 24, 0.9);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: #fff;
  padding: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: none;
  color: #f1f1f1;
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover { color: #fff; }
.lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

body.lightbox-open { overflow: hidden; }

@media (max-width: 720px) {
  .lightbox { padding: 20px; }
  .lightbox img { padding: 8px; }
}

/* ---- Home page: photo | bio | contact panel ---- */

/* Home is sized to fit one screen: narrower photo and contact panel so the bio
   column runs wide and wraps to fewer lines. */
main.wrap.home { padding: 36px var(--pad) 14px; }
main.home ~ footer.site { margin-top:16px; padding:16px 0 22px; }

.home-grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 222px;
  column-gap: 30px;
  align-items: start;
  margin-bottom: 0;
}

.portrait { margin: 0; }
.portrait img { display: block; width: 100%; height: auto; }

.home-bio p:last-child { margin-bottom: 0; }

.panel p { margin: 0 0 15px; }
.panel p:last-child { margin-bottom: 0; }

.panel a {
  color: var(--ink-link);
  text-decoration: none;
  border-bottom: 1px solid #b3b3b3;
}

.panel a:hover { border-bottom-color: var(--ink-link); opacity: 1; }

.panel .addr { color: var(--ink-body); }

/* ---- Theme index list ---- */

.theme-list { list-style: none; margin: 0; padding: 0; }

.theme-list > li {
  border-top: 1px solid var(--rule);
  padding: 26px 0 28px;
}

.theme-list > li:last-child { border-bottom: 1px solid var(--rule); }

.theme-list a.theme-title {
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-size: 21px;
  line-height: 28px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.25px;
  text-decoration: none;
  color: var(--ink-head);
  display: inline-block;
}

.theme-list a.theme-title:hover { color: var(--ink); opacity: 1; }

.theme-list > li > p { margin: 8px 0 0; max-width: 860px; }

/* Papers listed under each research theme */

.paper-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  max-width: 880px;
}

.paper-list li {
  position: relative;
  padding-left: 20px;
  margin: 0 0 11px;
  font-size: 15px;
  line-height: 25px;
  color: var(--ink-body);
}

.paper-list li:last-child { margin-bottom: 0; }

.paper-list li::before {
  content: "\2014";
  position: absolute;
  left: 0;
  color: #a9a9a9;
}

.paper-list a {
  color: var(--ink-link);
  text-decoration: none;
  border-bottom: 1px solid #c4c4c4;
}

.paper-list a:hover { border-bottom-color: var(--ink-link); opacity: 1; }

.paper-list { max-width: 900px; }

/* ---- CV page ---- */

.cv-download {
  display: inline-block;
  margin: 0 0 34px;
  padding: 9px 20px;
  border: 1px solid var(--ink-head);
  text-decoration: none;
  color: var(--ink-head);
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 1.15px;
}

.cv-download:hover { background: var(--ink-head); color: var(--paper); opacity: 1; }

dl.entry-list { margin: 0 0 10px; }
dl.entry-list dt { font-weight: 700; margin-top: 18px; }
dl.entry-list dd { margin: 2px 0 0; }

ul.plain { margin: 0 0 15px; padding-left: 18px; }
ul.plain li { margin-bottom: 4px; }

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

footer.site {
  border-top: 1px solid var(--rule);
  margin-top: 40px;
  padding: 22px 0 60px;
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.back-link {
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 1.15px;
  margin-top: 50px;
}

.back-link a { text-decoration: none; }

/* ---- Responsive ---- */

@media (max-width: 1000px) {
  :root { --pad: 40px; --figcol: 160px; --figgap: 34px; }
  .home-grid { grid-template-columns: 220px minmax(0, 1fr); row-gap: 30px; }
  .panel { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  :root { --pad: 24px; }
  /* hover menus don't work on touch — Research links straight to the index */
  .dropdown { display: none; }
  .nav-item { padding-bottom: 0; margin-bottom: 0; }
  .entry { grid-template-columns: 1fr; }
  .entry-fig { max-width: 220px; margin-bottom: 16px; }
  .indent { padding-left: 0; }
  .home-grid { grid-template-columns: 1fr; row-gap: 26px; }
  .portrait { max-width: 210px; }
  h1 { font-size: 24px; line-height: 34px; margin-bottom: 36px; }
  h2 { font-size: 17px; }
  main.wrap { padding: 44px var(--pad) 20px; }
  header.site { padding-top: 36px; }
}


/* CV publication lists */
.cv-pubs { max-width: 860px; margin-top: 4px; }
.cv-pubs li { margin-bottom: 14px; }
.pub-media {
  display: block;
  font-size: 13.5px;
  line-height: 22px;
  color: #8a8a8a;
  margin-top: 3px;
}
.pub-media a { color: #6f6f6f; border-bottom-color: #d2d2d2; }


/* landscape-photo home variant */
.home-land { grid-template-columns: 545px minmax(0, 1fr); column-gap: 62px; }
@media (max-width: 1000px){ .home-land { grid-template-columns: minmax(0,1fr); row-gap: 28px; } }

/* Teaching page */
.teach-role {
  font-weight: 700;
  color: var(--ink-head);
  margin: 0 0 2px;
}
.teach-note {
  font-size: 15px;
  color: var(--ink-body);
  opacity: .8;
  margin: 14px 0 0;
  max-width: 860px;
}
dl.entry-list dd { line-height: 1.75; }
