/* ═══════════════════════════════════════════════════════════
   GLOBAL — applies to all pages via _site.yml
═══════════════════════════════════════════════════════════ */

/* Page title (h1.title) — shown on all pages except index,
   where it is hidden by an inline <style> tag */
h1.title {
  color: #2c3e50;
  font-weight: 700;
  font-size: 1.75rem !important;
  border-bottom: 3px solid #18bc9c;
  padding-bottom: 0.55rem;
  margin-bottom: 1.8rem !important;
}

/* Section headings inside page body (h1 that are NOT the page title
   and NOT the custom hero heading) */
.main-container h1:not(.title):not(.hero-name) {
  color: #2c3e50;
  font-size: 1.05rem !important;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 2px solid #18bc9c;
  padding-bottom: 0.35rem;
  margin-top: 2.4rem !important;
  margin-bottom: 1rem !important;
}

/* Publication / general list items */
.main-container ul li,
.pub-section ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 1rem;
  line-height: 1.68;
}

.main-container ul li:last-child,
.pub-section ul li:last-child {
  border-bottom: none;
}

/* Software page: bold package name looks monospace */
.main-container ul li > strong:first-child {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 1rem;
  color: #2c3e50;
}

/* Books page: horizontal rules as thin teal-tinted separators */
.main-container hr {
  border: none;
  border-top: 1px solid #d4ede8;
  margin: 1.4rem 0;
}

/* Books page: citation links — inherit colour, underline on hover */
.main-container p > a,
.main-container p > a:visited {
  color: #2c3e50;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.main-container p > a:hover {
  color: #18bc9c;
  border-bottom-color: #18bc9c;
  text-decoration: none;
}

/* Global link style refinement */
.main-container a {
  color: #18876e;
}

.main-container a:hover {
  color: #0f5c4a;
  text-decoration: underline;
}


/* ═══════════════════════════════════════════════════════════
   INDEX PAGE — HERO SECTION
═══════════════════════════════════════════════════════════ */

.hero-section {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 2.5rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 3px solid #18bc9c;
}

.hero-photo img {
  width: 185px;
  height: 185px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #18bc9c;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.hero-name {
  font-size: 2rem !important;
  font-weight: 700 !important;
  color: #2c3e50 !important;
  margin: 0 0 0.3rem !important;
  border: none !important;
  padding: 0 !important;
  line-height: 1.2 !important;
}

.hero-tagline {
  font-size: 1rem;
  color: #18bc9c;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hero-bio p {
  color: #4a4a4a;
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 0.45rem;
}

.hero-bio a {
  color: #2c3e50;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid #18bc9c;
  transition: color 0.2s;
}

.hero-bio a:hover {
  color: #18bc9c;
}

/* Index section headings (h2 inside .main-content) */
.main-content h2 {
  color: #2c3e50;
  font-size: 1.05rem !important;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 2px solid #18bc9c;
  padding-bottom: 0.4rem;
  margin-top: 2.2rem !important;
  margin-bottom: 1.2rem !important;
}

/* Professorships grid */
.prof-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0.5rem 0 1.5rem;
}

.prof-card {
  background: linear-gradient(145deg, #2c3e50 0%, #34627a 100%);
  color: #fff;
  border-radius: 12px;
  padding: 1.1rem 1.5rem;
  min-width: 150px;
  text-align: center;
  box-shadow: 0 3px 12px rgba(44, 62, 80, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.prof-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(44, 62, 80, 0.3);
}

.prof-year {
  font-size: 1.6rem;
  font-weight: 800;
  color: #18bc9c;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.prof-field {
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
  color: #d5e8ef;
}

/* Pandoc wraps bare text in <p> — strip its margin inside card divs */
.prof-year p,
.prof-field p {
  margin: 0;
}

/* Research interest chips */
.interests-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0.5rem 0 1.5rem;
}

.interest-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: #f4faf8;
  border: 1px solid #c8ece5;
  border-left: 4px solid #18bc9c;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 1rem;
  color: #2c3e50;
  font-weight: 500;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.interest-chip:hover {
  background: #e0f5ef;
  box-shadow: 0 2px 10px rgba(24, 188, 156, 0.18);
  transform: translateY(-1px);
}

.interest-chip i {
  color: #18bc9c;
  width: 1.1em;
  text-align: center;
  font-size: 1rem;
}

/* Scholar card */
.scholar-card {
  background: #f8f9fa;
  border: 1px solid #e4e9ed;
  border-radius: 12px;
  padding: 1.2rem 1.5rem 0.8rem;
  margin: 0.5rem 0 1.5rem;
}


/* ═══════════════════════════════════════════════════════════
   BOOKS PAGE
═══════════════════════════════════════════════════════════ */

.book-card {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  padding: 1rem 0.6rem;
  border-bottom: 1px solid #eaeaea;
  border-radius: 8px;
  transition: background 0.2s, box-shadow 0.2s;
  margin-bottom: 0.1rem;
}

.book-card:last-child {
  border-bottom: none;
}

.book-card:hover {
  background: #f4faf8;
  box-shadow: 0 2px 10px rgba(24, 188, 156, 0.1);
}

.book-cover {
  width: 72px;
  flex-shrink: 0;
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s;
}

.book-card:hover .book-cover {
  transform: scale(1.04) rotate(-1deg);
}

.book-info {
  flex: 1;
  padding-top: 0.15rem;
}

.book-citation {
  font-size: 1rem;
  color: #333;
  line-height: 1.65;
  margin: 0 0 0.4rem;
}

.book-link {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  text-decoration: none !important;
  color: inherit !important;
  width: 100%;
}

.book-link:hover {
  text-decoration: none !important;
  color: inherit !important;
}

.book-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  margin-right: 0.3rem;
}

.book-tag-new {
  background: #18bc9c;
  color: #fff;
}

.book-tag-forthcoming {
  background: #e67e22;
  color: #fff;
}

.book-covers-row {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}

.book-covers-row .book-cover {
  width: 58px;
}


/* ═══════════════════════════════════════════════════════════
   SOFTWARE PAGE
═══════════════════════════════════════════════════════════ */

.pkg-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 0.5rem 0 1.8rem;
}

.pkg-card {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-top: 3px solid #18bc9c;
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  flex: 1 1 200px;
  max-width: 265px;
  transition: box-shadow 0.2s, transform 0.15s;
}

.pkg-card:hover {
  box-shadow: 0 5px 16px rgba(24, 188, 156, 0.16);
  transform: translateY(-2px);
}

.pkg-card.stata-card {
  border-top-color: #2c3e50;
}

.pkg-name {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 1rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pkg-lang {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  background: #18bc9c;
  color: #fff;
  font-family: sans-serif;
}

.pkg-card.stata-card .pkg-lang {
  background: #2c3e50;
}

.pkg-desc {
  font-size: 1rem;
  color: #555;
  line-height: 1.48;
  margin: 0;
}


/* ═══════════════════════════════════════════════════════════
   TEACHING PAGE
═══════════════════════════════════════════════════════════ */

.teaching-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.5rem 0 1.5rem;
}

.teaching-card {
  background: #f4faf8;
  border: 1px solid #c8ece5;
  border-left: 4px solid #18bc9c;
  border-radius: 8px;
  padding: 1rem 1.4rem;
  transition: box-shadow 0.2s, background 0.2s;
}

.teaching-card:hover {
  background: #e8f7f2;
  box-shadow: 0 3px 14px rgba(24, 188, 156, 0.14);
}

.teaching-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #18bc9c;
  margin-bottom: 0.3rem;
}

.teaching-desc {
  font-size: 1rem;
  color: #2c3e50;
  line-height: 1.55;
  margin: 0;
}

.teaching-desc a {
  color: #2c3e50;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid #18bc9c;
  transition: color 0.2s;
}

.teaching-desc a:hover {
  color: #18bc9c;
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */

@media (max-width: 620px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
  }
  .hero-photo img {
    width: 150px;
    height: 150px;
  }
  .hero-name {
    font-size: 1.65rem !important;
  }
  .hero-tagline {
    font-size: 0.85rem;
  }
  .prof-grid,
  .interests-grid {
    justify-content: center;
  }
  .pkg-card {
    max-width: 100%;
  }
}
