/* ============================================================
   styles.css — Jonathan A. Libgober personal site
   ============================================================ */

/* --- Reset & base ----------------------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --text:        #1c1c1c;
  --text-light:  #555;
  --accent:      #990000;   /* USC Cardinal */
  --accent-hover:#7a0000;
  --gold:        #c9a000;   /* USC Gold, darkened slightly for legibility on light bg */
  --border:      #e8dada;   /* very faintly warm */
  --bg:          #fdf7f7;   /* near-white with the faintest cardinal blush */
  --bg-section:  #f5ecec;   /* slightly deeper for code blocks / alternates */
  --nav-height:  56px;
  --max-width:   820px;
  --font-sans:      -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif:     Georgia, "Times New Roman", serif;
  --font-garamond:  'EB Garamond', Georgia, serif;
  --font-newsreader:'Newsreader', Georgia, serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
  font-size: 16px;
}

body {
  font-family: var(--font-newsreader);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* --- Navigation ------------------------------------------- */

#site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

#site-nav .nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#site-nav .nav-name {
  font-family: var(--font-garamond);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: 0.01em;
}

#site-nav .nav-links {
  display: flex;
  gap: 0;
  list-style: none;
  flex-wrap: wrap;
}

#site-nav .nav-links li a {
  display: block;
  padding: 6px 10px;
  font-size: 0.88rem;
  color: var(--text-light);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}

#site-nav .nav-links li a:hover,
#site-nav .nav-links li a:focus {
  color: var(--accent);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 4px;
}

/* Hamburger — hidden on desktop */
#nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

#nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: 0.2s;
}

/* --- Layout ----------------------------------------------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
}

section:last-child {
  border-bottom: none;
}

/* --- Section headings ------------------------------------- */

.section-heading {
  font-family: var(--font-garamond);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

/* --- About / Home ----------------------------------------- */

.about-header {
  display: flex;
  align-items: flex-start;
  gap: 36px;
  margin-bottom: 0;
}

.headshot {
  width: 308px;
  height: 308px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.about-text {
  flex: 1;
  min-width: 0;
}

@media (max-width: 520px) {
  .about-header {
    flex-direction: column;
    gap: 20px;
  }
  .headshot {
    width: 150px;
    height: 150px;
    margin-top: 0;
  }
}



#about h1 {
  font-family: var(--font-garamond);
  font-size: 2.65rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-top: -0.25rem;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  text-align: center;
}

#about .affiliation {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 24px;
  text-align: center;
}

#about .affiliation a {
  color: var(--text-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

#about .bio {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  max-width: 680px;
  margin-bottom: 28px;
}

#about .bio p {
  margin-bottom: 12px;
}

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

.about-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.action-row-cv .btn {
  font-size: 1.1rem;
  padding: 12px 36px;
}

.btn {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--accent);
  color: #fff;
}

/* --- Paper list ------------------------------------------- */

.paper-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.paper-item {
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--border);
}

.paper-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.paper-title-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 5px;
}

.paper-number {
  font-size: 1.07rem;
  color: var(--text-light);
  font-weight: 500;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.paper-title {
  font-family: var(--font-garamond);
  font-size: 1.23rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.paper-authors {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 3px;
}

.paper-authors a {
  color: var(--text-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.paper-venue {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 8px;
}

.paper-venue .status {
  font-weight: 400;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.paper-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding: 2px 0;
  letter-spacing: 0.03em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.paper-link::before {
  content: "[";
  color: var(--text-light);
  font-weight: 400;
}

.paper-link::after {
  content: "]";
  color: var(--text-light);
  font-weight: 400;
}

.paper-link:hover,
.paper-link:focus {
  border-bottom-color: var(--accent);
}

/* --- Inline expand buttons (Short Description & BibTeX) --- */
/*
   Buttons sit in the same static flex row as [PDF] / [Publisher].
   Clicking one reveals content in a separate area below the row —
   the row itself never shifts or reflows.
*/

.paper-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.03em;
  padding: 2px 0;
  transition: opacity 0.15s;
}

.paper-expand-btn::before {
  content: "[";
  color: var(--text-light);
  font-weight: 400;
}

.paper-expand-btn::after {
  content: "]";
  color: var(--text-light);
  font-weight: 400;
}

.paper-expand-btn:hover,
.paper-expand-btn:focus {
  opacity: 0.72;
  outline: none;
}

.paper-expand-area {
  /* container for revealed content; appears below the link row */
}

.paper-expand-content {
  margin-top: 8px;
  color: var(--text-light);
  line-height: 1.7;
  font-size: 0.875rem;
  max-width: 640px;
}

.paper-expand-content.is-hidden {
  display: none;
}

.paper-bibtex {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-light);
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px 14px;
  overflow-x: auto;
  white-space: pre;
  max-width: 100%;
}

/* --- Working paper status note ---------------------------- */

.paper-status-note {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 6px;
  font-style: italic;
}

/* --- Teaching --------------------------------------------- */

.teaching-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.teaching-item .course-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.teaching-item .course-note {
  font-size: 0.88rem;
  color: var(--text-light);
}

/* --- Links section ---------------------------------------- */

.links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.links-list a {
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.links-list a:hover,
.links-list a:focus {
  border-bottom-color: var(--accent);
}

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

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px;
  font-size: 0.8rem;
  color: #aaa;
  text-align: left;
}

/* --- Utilities -------------------------------------------- */

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

/* Visible keyboard focus ring (does not affect mouse users) */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.noscript-note {
  margin: 24px 0;
  padding: 14px 18px;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--text);
}

.noscript-note a {
  color: var(--accent);
}

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

@media (max-width: 640px) {
  html { font-size: 15px; }

  #site-nav .nav-name { font-size: 0.9rem; }

  #nav-toggle {
    display: flex;
  }

  #site-nav .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 8px 0 12px;
  }

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

  #site-nav .nav-links li a {
    padding: 10px 24px;
    font-size: 0.9rem;
  }

  #about h1 { font-size: 1.6rem; }

  section { padding: 48px 0 36px; }

  .about-actions { gap: 8px; }
}

@media (max-width: 400px) {
  main { padding: 0 16px; }
  #site-nav .nav-inner { padding: 0 16px; }
  footer { padding: 24px 16px; }
}
