/* ============================================================
   Benjamin F. Henwood — Personal Academic Website
   Style: clean, minimal, professional (modeled after dennisculhane.com)
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cardinal:   #383838;
  --cardinal-dk:#1e1e1e;
  --text:       #1a1a1a;
  --muted:      #555;
  --light:      #f7f7f7;
  --border:     #ddd;
  --max:        860px;
  --serif:      Georgia, 'Times New Roman', serif;
  --sans:       'Helvetica Neue', Arial, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--text);
  background: #fff;
  line-height: 1.7;
}

a {
  color: var(--cardinal);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--cardinal-dk); text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ---- Layout ---- */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- NAV ---- */
#site-nav {
  background: #fff;
  border-bottom: 2px solid var(--cardinal);
  position: sticky;
  top: 0;
  z-index: 100;
}

#site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .75rem;
  padding-bottom: .75rem;
}

.nav-brand {
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-links a {
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: border-color .15s, color .15s;
}
.nav-links a:hover {
  color: var(--cardinal);
  border-bottom-color: var(--cardinal);
  text-decoration: none;
}

/* ---- HERO ---- */
#hero {
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: start;
}

.hero-text h1 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: .4rem;
}

.hero-text .title-line {
  font-size: 1rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: .15rem;
  line-height: 1.4;
}

.hero-text .institution {
  font-size: .95rem;
  font-weight: 600;
  color: var(--cardinal);
  margin-bottom: 1.1rem;
}

.hero-text .tagline {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.hero-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.hero-nav a {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  border: 1.5px solid var(--cardinal);
  color: var(--cardinal);
  padding: .35rem .75rem;
  border-radius: 3px;
  transition: background .15s, color .15s;
}
.hero-nav a:hover {
  background: var(--cardinal);
  color: #fff;
  text-decoration: none;
}

.headshot {
  width: 160px;
  height: 160px;
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
  border: 3px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}

/* ---- SECTIONS ---- */
section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type { border-bottom: none; }

section h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--cardinal);
  display: inline-block;
}

/* ---- STATS BAR ---- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}

.stat-item .stat-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--cardinal);
  font-family: var(--serif);
  line-height: 1.2;
}

.stat-item .stat-label {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .2rem;
  line-height: 1.3;
}

/* ---- BIO LINKS ---- */
.bio-links {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.25rem;
}
.bio-links a {
  font-size: .82rem;
  font-weight: 600;
  padding: .3rem .7rem;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--cardinal);
  transition: background .15s, color .15s;
}
.bio-links a:hover {
  background: var(--cardinal);
  color: #fff;
  text-decoration: none;
}

/* ---- PUBLICATIONS ---- */
details {
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: .75rem;
  overflow: hidden;
}

details[open] summary {
  background: var(--light);
}

summary {
  list-style: none;
  padding: .85rem 1rem;
  cursor: pointer;
  font-weight: 700;
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  user-select: none;
  background: #fff;
  transition: background .15s;
}
summary:hover { background: var(--light); }

summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--cardinal);
  flex-shrink: 0;
  transition: transform .2s;
}
details[open] summary::after {
  content: '−';
}

.cat-count {
  font-size: .78rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: .3rem;
}

.pub-list {
  padding: .5rem 1rem 1rem;
}

.pub-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
  font-size: .88rem;
  line-height: 1.55;
}
.pub-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.pub-item .pub-authors { color: var(--muted); }
.pub-item .pub-title { font-weight: 600; color: var(--text); }
.pub-item .pub-title a { color: var(--cardinal); text-decoration: underline; text-underline-offset: 2px; }
.pub-item .pub-title a:hover { color: var(--cardinal-dk); text-decoration: underline; }
.pub-item .pub-journal { color: var(--muted); font-style: italic; }
.pub-item .student-note {
  font-size: .75rem;
  color: var(--cardinal);
  font-style: italic;
  margin-left: .3rem;
}

/* Books & reports */
.book-item {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--light);
  border-left: 4px solid var(--cardinal);
  border-radius: 0 4px 4px 0;
  font-size: .9rem;
  line-height: 1.55;
}

.report-item {
  margin-bottom: .85rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
  line-height: 1.5;
}
.report-item:last-child { border-bottom: none; }

/* ---- POLICY & WRITING ---- */
.opeds-list { list-style: none; }
.opeds-list li {
  padding: .8rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  line-height: 1.5;
}
.opeds-list li:last-child { border-bottom: none; }
.oped-outlet {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--cardinal);
  margin-right: .4rem;
}
.oped-title { font-weight: 600; }
.oped-year { color: var(--muted); font-size: .82rem; }

/* ---- MEDIA ---- */
.media-list { list-style: none; }
.media-list li {
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  display: flex;
  gap: .75rem;
  align-items: baseline;
}
.media-list li:last-child { border-bottom: none; }
.media-outlet {
  font-weight: 700;
  color: var(--cardinal);
  min-width: 110px;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.media-note {
  font-size: .88rem;
  color: var(--muted);
  font-style: italic;
  margin-top: .75rem;
}

/* ---- CONTACT ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.contact-block h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .6rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-family: var(--sans);
}

.contact-block p {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: .3rem;
}

.contact-block a.email-link {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cardinal);
}

/* ---- FOOTER ---- */
#site-footer {
  background: var(--light);
  border-top: 2px solid var(--border);
  padding: 1.25rem 0;
  text-align: center;
  font-size: .8rem;
  color: var(--muted);
}
#site-footer a { color: var(--cardinal); }

/* ---- UTILITY ---- */
.section-intro {
  font-size: .95rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  max-width: 680px;
  line-height: 1.65;
}

p { margin-bottom: .9rem; }
p:last-child { margin-bottom: 0; }

/* ---- RESPONSIVE ---- */
@media (max-width: 680px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-img-wrap {
    order: -1;
    display: flex;
    justify-content: center;
  }
  .headshot {
    width: 130px;
    height: 130px;
  }
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  #site-nav .container {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
  }
  .nav-links {
    gap: .75rem;
  }
  section h2 { font-size: 1.25rem; }
  .hero-text h1 { font-size: 1.5rem; }
}

@media (max-width: 400px) {
  .stats-bar { grid-template-columns: 1fr 1fr; }
}

/* ---- PRINT ---- */
@media print {
  #site-nav, .hero-nav, .bio-links, #site-footer { display: none !important; }
  #hero { padding: 1rem 0; }
  body { font-size: 11pt; line-height: 1.5; }
  section { padding: 1rem 0; }
  details { border: none; }
  details[open] { display: block; }
  summary { font-size: 10pt; font-weight: bold; background: none; padding: .3rem 0; }
  summary::after { display: none; }
  .pub-item { font-size: 9.5pt; }
  a { color: var(--text); }
  @page { margin: 1.5cm 2cm; }
}

/* ---- External link indicators in hero nav ---- */
/* External links: filled solid style to distinguish from internal nav anchors */
.hero-nav a[target="_blank"] {
  background: var(--cardinal);
  color: #fff;
  border-color: var(--cardinal);
}
.hero-nav a[target="_blank"]:hover {
  background: var(--cardinal-dk);
  border-color: var(--cardinal-dk);
  color: #fff;
  text-decoration: none;
}
.hero-nav a[target="_blank"]::after {
  content: " ↗";
  font-size: .7em;
  opacity: .8;
}

/* Profile links in About: slightly smaller ↗ */
.profile-links a[target="_blank"]::after {
  content: " ↗";
  font-size: .65em;
  opacity: .55;
  vertical-align: super;
}

/* ---- Nav divider between internal/external groups ---- */
.nav-divider {
  color: var(--border);
  font-weight: 300;
  font-size: 1.1rem;
  line-height: 1;
  align-self: center;
  padding: 0 .15rem;
  pointer-events: none;
}

/* ---- Always-visible links in publication/report/media lists ---- */
.pub-item .pub-title a,
.pub-item a,
.report-item a,
.book-item a,
a.oped-title,
.media-list a,
details a {
  color: var(--cardinal) !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}
.pub-item .pub-title a:hover,
.pub-item a:hover,
.report-item a:hover,
.book-item a:hover,
a.oped-title:hover,
.media-list a:hover,
details a:hover {
  color: var(--cardinal-dk) !important;
  text-decoration: underline !important;
}

/* ── VISUAL ENHANCEMENTS ──────────────────────────────────────────────── */

/* Hero: subtle warm gradient background */
#hero {
  background: linear-gradient(135deg, #fafafa 0%, #f2f2f2 100%);
  border-bottom: 1px solid var(--border);
}

/* About section: light warm tint */
#about {
  background: #fafafa;
}

/* Alternating section backgrounds */
#research { background: #fff; }
#policy { background: #f7f7f5; }
#media { background: #fff; }
#contact { background: #f4f4f2; }

/* Book item: add cover thumbnail layout */
.book-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.book-cover {
  width: 90px;
  flex-shrink: 0;
  border-radius: 3px;
  box-shadow: 0 3px 10px rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.1);
  transition: transform .2s ease, box-shadow .2s ease;
}
.book-cover:hover {
  transform: scale(1.04) rotate(1deg);
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
}
.book-text { flex: 1; }

/* Stats bar: subtle card look */
.stat-item {
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: box-shadow .2s;
}
.stat-item:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,.1);
}

/* Section headings: subtle left accent bar */
section h2 {
  padding-left: .75rem;
  border-left: 4px solid var(--cardinal);
}

/* Details/summary: visual polish */
details {
  border-radius: 5px;
  overflow: hidden;
}
details summary {
  background: #f4f4f2;
  padding: .7rem 1rem;
}
details summary:hover {
  background: #ebebeb;
}
details[open] summary {
  background: var(--cardinal);
  color: #fff;
}
