/* ============================================================
   Daniel A. Rettl - academic site
   Typography modeled on Harshini Shanker's Quarto site
   (clean system sans-serif, centered single column,
    hairline rule dividers, blue links).
   Structure modeled on Malcolm Wardlaw's site
   (persistent top navigation bar linking to subpages).
   ============================================================ */

:root {
  --text:        #373a3c;   /* Quarto default body text */
  --muted:       #6c757d;
  --link:        #2761e3;   /* clean academic blue */
  --link-hover:  #1140a8;
  --rule:        #e3e3e3;
  --bg:          #ffffff;
  --nav-bg:      #ffffff;
  --maxw:        820px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
}

/* ---------- Top navigation (Malcolm-style) ---------- */
.site-nav {
  border-bottom: 1px solid var(--rule);
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-nav .nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.site-nav .brand {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.site-nav .brand:hover { color: var(--text); }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.site-nav a.nav-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.98rem;
}
.site-nav a.nav-link:hover { color: var(--link); }
.site-nav a.nav-link.active {
  color: var(--link);
  font-weight: 600;
}

/* ---------- Content column ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 4rem;
}

h1, h2, h3, h4 {
  color: var(--text);
  line-height: 1.25;
  font-weight: 600;
  margin: 1.8rem 0 0.6rem;
}
h1 { font-size: 2rem; margin-top: 0.5rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p { margin: 0.7rem 0; }

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

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

/* ---------- Header block (home) ---------- */
.intro-line {
  color: var(--muted);
  font-size: 1.02rem;
  margin-top: 0.2rem;
}
.intro-line a { color: var(--link); }

.headshot {
  float: right;
  width: 260px;
  max-width: 48%;
  border-radius: 4px;
  margin: 0.3rem 0 1rem 1.75rem;
}
.headshot-placeholder {
  float: right;
  width: 180px;
  max-width: 38%;
  aspect-ratio: 4 / 5;
  margin: 0.3rem 0 1rem 1.5rem;
  border: 1px dashed var(--rule);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.5rem;
}

/* ---------- Contact / address ---------- */
.address {
  color: var(--text);
  line-height: 1.5;
}
.address .label { color: var(--muted); }

/* ---------- Publication / paper lists ---------- */
.paper-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
.paper-list > li {
  margin: 0 0 1.4rem;
  padding: 0;
}
.paper-title { font-weight: 600; }
.paper-meta { color: var(--muted); font-size: 0.95rem; }
.paper-note {
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
}
.coming-soon {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ---------- Tabs (Working Papers) ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 2px solid var(--rule);
  margin: 1rem 0 1.5rem;
}
.tab-btn {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--link);
  border-bottom-color: var(--link);
}
.tab-btn:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.area-group {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.5rem 1.15rem 0.9rem;
  margin: 1.1rem 0;
}
.area-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: var(--muted);
  margin: 0.6rem 0 0.2rem;
}
.area-group .area-label { margin-top: 0.3rem; }
.area-group .paper-list > li:last-child { margin-bottom: 0; }

/* ---------- Teaching table ---------- */
.teaching-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}
.teaching-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.teaching-table td.course { width: 62%; }
.teaching-table td.term {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
  text-align: right;
}
.teaching-table .inst { color: var(--muted); font-style: italic; }

footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--rule);
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .headshot, .headshot-placeholder { float: none; margin: 0 auto 1rem; }
  .teaching-table td.term { white-space: normal; }
}
