/* ===========================================================
   Josiah Hester — site v2
   Clean, minimal, whitespace-forward academic theme.
   =========================================================== */

:root {
  --bg: #ffffff;
  --surface: #f7f6f4;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #e8e6e2;
  --accent: #b3402f;
  --accent-soft: #f1e3e0;
  --max-width: 1080px;
  --radius: 10px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #14130f;
  --surface: #1c1b16;
  --text: #ece9e2;
  --text-muted: #a39d8f;
  --border: #33312a;
  --accent: #e08a72;
  --accent-soft: #2a221d;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14130f;
    --surface: #1c1b16;
    --text: #ece9e2;
    --text-muted: #a39d8f;
    --border: #33312a;
    --accent: #e08a72;
    --accent-soft: #2a221d;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-weight: 700;
  font-size: 1.50rem;
  color: var(--text) !important;
  white-space: nowrap;
  text-decoration: none !important;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--text) !important;
  text-decoration: none !important;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent) !important;
  border-bottom-color: var(--accent);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
}

/* ---------- Sections / headings ---------- */
main { padding-top: 8px; }

.page-hero {
  padding: 56px 0 24px;
}

.page-hero h1 {
  font-size: 2.4rem;
  font-weight: 300;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.page-hero .kicker {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin: 0 0 10px;
}

.page-hero p.lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 62ch;
}

section.block { padding: 40px 0; }
section.block + section.block { border-top: 1px solid var(--border); }

h2.section-title {
  font-weight: 300;
  font-size: 1.7rem;
  margin: 0 0 22px;
  letter-spacing: -0.01em;
}

h3.sub-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 6px;
}

/* ---------- About page hero / sidebar layout ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
  padding: 48px 0 8px;
  align-items: start;
}

.about-main h1 {
  font-size: 2.6rem;
  font-weight: 300;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.about-titles p {
  margin: 2px 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.about-titles p a { color: var(--text-muted); }
.about-titles p a:hover { color: var(--accent); }

.about-bio { margin-top: 20px; }
.about-bio p { margin: 0 0 16px; }

.link-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 0.95rem;
}

.link-row a {
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--text) !important;
}
.link-row a:hover { border-color: var(--accent); color: var(--accent) !important; }
.link-row a.emph {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}
.link-row a.emph:hover { opacity: 0.88; }

/* Icon-only link row (About page profile links) */
.icon-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text) !important;
  background: var(--surface);
  text-decoration: none !important;
  transition: border-color .15s ease, color .15s ease, background .15s ease, transform .15s ease;
}
.icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
  transform: translateY(-1px);
}
.icon-btn.emph {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
}
.icon-btn.emph:hover { opacity: 0.88; color: #fff !important; }

/* Sidebar */
.about-side {
  position: sticky;
  top: 90px;
}

.about-side img.headshot {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  margin-bottom: 16px;
}

.side-name {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

.about-side .icon-row { margin-top: 0; margin-bottom: 24px; }

.side-block { margin-bottom: 28px; }
.side-block h4 {
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 10px;
  font-weight: 600;
}

.awards-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.86rem;
  line-height: 1.55;
}
.awards-list li {
  padding: 5px 0;
  border-bottom: 1px dotted var(--border);
  color: var(--text);
}
.awards-list li:last-child { border-bottom: none; }
.awards-list .yr {
  color: var(--accent);
  font-weight: 600;
  margin-right: 6px;
}

/* ---------- Project / research lists ---------- */
.project-collage {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  margin: 0 0 24px;
  border: 1px solid var(--border);
}

.project-list { margin: 0; padding: 0; list-style: none; }
.project-list li {
  padding: 14px 0;
  border-top: 1px solid var(--border);
  font-size: 0.98rem;
}
.project-list li:first-child { border-top: none; }
.project-list .icon { margin-right: 8px; }

/* ---------- News ---------- */
.news-blurb {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 32px;
  font-size: 0.98rem;
  color: var(--text);
}

.news-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.news-item:first-child { border-top: none; }
.news-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.news-media {
  margin-top: 10px;
  max-width: 560px;
}
.news-media iframe, .news-media img { width: 100%; border-radius: var(--radius); display: block; }

/* ---------- Cards (Research / Teaching) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}
.card .card-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.card p { margin: 0 0 10px; font-size: 0.94rem; color: var(--text); }
.card .impact {
  font-size: 0.86rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  margin-top: auto;
}
.card .impact strong { color: var(--accent); }
.card .card-link { font-size: 0.88rem; font-weight: 600; margin-top: 12px; }

/* Teaching cards - smaller, icon based */
.teach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.teach-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
}
.teach-card .teach-icon { font-size: 1.6rem; margin-bottom: 10px; display: block; }
.teach-card h3 { font-size: 1.05rem; margin: 0 0 10px; }
.teach-card p { font-size: 0.92rem; color: var(--text); line-height: 1.6; margin: 0; }
.teach-card a.card-link { font-size: 0.82rem; font-weight: 600; }

/* Teaching honors row */
.honor-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 32px;
}
.honor-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 16px 8px 10px;
  font-size: 0.88rem;
}
.honor-chip .honor-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.honor-chip b { font-weight: 600; }
.honor-chip span.honor-sub { color: var(--text-muted); }

.placeholder-note {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 5px;
  margin-bottom: 8px;
}

/* ---------- Alert banner ---------- */
.alert-banner {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  color: var(--text);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.94rem;
  margin-bottom: 28px;
}
.alert-banner a { font-weight: 600; }

/* ---------- Publications ---------- */
.pub-group { margin-bottom: 40px; }
.pub-entry {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.pub-entry:first-child { border-top: none; }
.pub-title { font-weight: 600; font-size: 1rem; margin: 0 0 4px; }
.pub-authors { font-size: 0.88rem; color: var(--text-muted); margin: 0 0 4px; }
.pub-venue { font-size: 0.86rem; }
.pub-venue .badge {
  color: var(--accent);
  font-weight: 600;
}
.pub-links { font-size: 0.82rem; margin-top: 4px; }
.pub-links a { margin-right: 12px; }

/* ---------- Writing entries ---------- */
.write-entry { padding: 16px 0; border-top: 1px solid var(--border); }
.write-entry:first-child { border-top: none; }
.write-kind {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.write-entry h3 { margin: 4px 0 4px; font-size: 1.08rem; }
.write-venue { font-size: 0.88rem; color: var(--text-muted); }

.write-media {
  margin-top: 14px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 560px;
}
.write-media img { width: 100%; display: block; }

.write-split {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.write-split .write-text { flex: 1 1 55%; min-width: 260px; }
.write-split .write-media {
  flex: 0 1 40%;
  margin-top: 4px;
  max-width: none;
}
@media (max-width: 640px) {
  .write-split .write-text, .write-split .write-media { flex-basis: 100%; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 32px 0 48px;
  color: var(--text-muted);
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer a { color: var(--text-muted); margin-left: 16px; }
.site-footer a:first-child { margin-left: 0; }
.site-footer a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-side { position: static; max-width: 360px; }
  .card-grid { grid-template-columns: 1fr; }
  .teach-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 28px;
    gap: 14px;
  }
  .site-nav.open { display: flex; }
  .news-item { grid-template-columns: 1fr; gap: 6px; }
  .teach-grid { grid-template-columns: 1fr; }
  .about-main h1, .page-hero h1 { font-size: 2rem; }
}
