/* ============================================
   kate-barnes.com — Main Stylesheet
   Fonts: Lora (headings) + Source Sans 3 (body)
   Primary: #500000  Secondary hover: #732f2f
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,500;0,700;1,500&family=Source+Sans+3:wght@400;600&display=swap');

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

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

body {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  color: #202020;
  background: #ffffff;
  line-height: 1.65;
}

a {
  color: #500000;
  text-decoration: none;
  font-weight: 600;
}
a:hover { text-decoration: underline; }

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

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Navigation --- */
#site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid #500000;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.0625rem;
  color: #202020;
  text-decoration: none;
  font-weight: 400;
  transition: color 0.15s;
}

.nav-links a.active {
  color: #500000;
  font-weight: 700;
}

.nav-links a:hover {
  font-weight: 700;
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #202020;
  transition: all 0.2s;
}

/* --- Page Header (used on inner pages) --- */
.page-header {
  padding: 52px 0 36px;
  margin-bottom: 52px;
}

.page-header--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.page-header--center {
  text-align: center;
  padding-bottom: 0;
  margin-bottom: 24px;
}

.page-header h1 {
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: 1.5625rem;
  color: #500000;
}

/* --- Home Page --- */
#home-content {
  padding: 52px 0 64px;
}

.home-inner {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 75px;
  align-items: stretch;
}

.home-greeting {
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: 1.5625rem;
  color: #500000;
  line-height: 1.1;
  margin-bottom: 24px;
}

.home-bio p:not(.home-greeting) {
  margin-bottom: 14px;
  font-size: 1.0625rem;
  line-height: 1.55;
}

.home-photo-col {
  text-align: center;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
}

.home-photo-col img {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 16px;
}

.home-name {
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: #202020;
  margin-bottom: 20px;
}

.home-pill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.home-pill-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #500000;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  padding: 7px 16px;
  text-decoration: none;
  transition: border-color 0.15s;
}

.home-pill-grid a:hover { border-color: #500000; text-decoration: none; }

/* --- Research & Media Page --- */
.page-header-blurb {
  margin-top: 12px;
  color: #555;
  font-size: 0.9375rem;
}

.research-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 48px;
  align-items: start;
}

.research-sidebar {
  position: sticky;
  top: 80px;
}

.filter-group {
  margin-bottom: 28px;
}

.filter-group-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #777;
  font-weight: 700;
  margin-bottom: 10px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #e8e8e8;
  background: transparent;
  color: #500000;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  line-height: 1.4;
}

.filter-pill:hover:not(.active) { border-color: #500000; }

.filter-pill.active {
  background: #500000;
  color: #ffffff;
  border-color: #500000;
}

.filter-misc-toggle {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px dashed #b8b8b8;
  background: transparent;
  color: #777;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.filter-misc-toggle:hover { border-color: #500000; color: #500000; }

.filter-misc-toggle .misc-caret {
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
}

.filter-misc-pills {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e8e8e8;
}

.filter-pills[hidden] { display: none; }

.pub-group { margin-bottom: 56px; }

.pub-group-title {
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: #500000;
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8e8e8;
}

.pub-group-blurb {
  font-size: 0.9375rem;
  color: #555;
  margin: 6px 0 20px;
}

.pub-group-blurb a { color: #500000; }

.pub-item {
  padding: 22px 0;
}

.pub-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 4px;
}

.pub-item-title {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #202020;
  line-height: 1.4;
  margin: 0;
  flex: 1;
}

.pub-item-title a {
  color: #202020;
  font-weight: 700;
}

.pub-item-title a:hover { color: #500000; text-decoration: none; }

.pub-item-year {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #777;
  white-space: nowrap;
  flex-shrink: 0;
}

.pub-item-venue {
  font-size: 0.9375rem;
  color: #555;
  margin-bottom: 4px;
}

.pub-item-venue em { font-style: italic; }

.pub-item-authors {
  font-size: 0.9375rem;
  color: #555;
  margin-bottom: 10px;
}

.pub-item-authors strong { color: #202020; font-weight: 700; }

.pub-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.pub-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: #500000;
  background: transparent;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  padding: 2px 10px;
  line-height: 1.6;
}

.pub-abstract { margin: 6px 0 12px; }

.pub-abstract summary {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #500000;
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pub-abstract summary::-webkit-details-marker { display: none; }

.pub-abstract summary::before {
  content: '\25B8';
  font-size: 0.7rem;
  transition: transform 0.2s;
  display: inline-block;
}

.pub-abstract[open] summary::before { transform: rotate(90deg); }

.pub-abstract-body {
  margin-top: 10px;
  padding: 14px 16px;
  background: rgba(80, 0, 0, 0.035);
  border: 1px solid rgba(80, 0, 0, 0.08);
  border-radius: 6px;
}

.pub-abstract-body p {
  font-size: 0.9375rem;
  color: #444;
  line-height: 1.6;
  margin: 0;
}

.pub-item-summary {
  font-size: 0.875rem;
  color: #555;
  line-height: 1.5;
  margin: 6px 0 10px;
}

.pub-item-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.pub-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 12px;
  border: 1px solid #500000;
  background: transparent;
  border-radius: 20px;
  color: #500000;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1.6;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.pub-btn:hover {
  background: #500000;
  color: #ffffff;
  text-decoration: none;
}

.pub-item--forthcoming { opacity: 0.6; }
.pub-item--forthcoming .pub-item-title { font-style: italic; font-weight: 600; }

/* --- CV Page --- */
.cv-actions {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-download {
  display: inline-block;
  padding: 9px 20px;
  background: #500000;
  color: #ffffff;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-download:hover {
  background: #732f2f;
  text-decoration: none;
}

.cv-embed-wrap {
  width: 100%;
  border: 1px solid #e8e8e8;
  border-radius: 3px;
  overflow: hidden;
}

.cv-embed-wrap iframe {
  display: block;
  width: 100%;
  height: 85vh;
  border: none;
}

.cv-placeholder {
  background: #f9f9f9;
  padding: 48px 32px;
  text-align: center;
  color: #777;
  font-size: 0.9375rem;
}

/* --- Portfolio Page --- */
.portfolio-intro {
  margin-bottom: 52px;
}

.portfolio-section {
  margin-bottom: 60px;
}

.portfolio-section h2 {
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: 1.5625rem;
  color: #500000;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8e8e8;
}

.portfolio-section .section-blurb {
  margin-bottom: 24px;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 24px;
  transition: border-color 0.15s;
}

.card:hover { border-color: #500000; }

.card-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #500000;
  margin-bottom: 8px;
}

.card h3 {
  font-family: 'Lora', serif;
  font-weight: 500;
  font-size: 1.0625rem;
  margin-bottom: 8px;
  color: #202020;
}

.card p {
  font-size: 0.9125rem;
  color: #555;
  margin-bottom: 14px;
}

.card-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: #500000;
}

.card-link:hover { text-decoration: underline; }

.card-img {
  width: 100%;
  border-radius: 2px;
  margin-bottom: 14px;
  object-fit: cover;
  max-height: 180px;
}

.card.pending {
  border-style: dashed;
  opacity: 0.7;
}

.card.pending .card-tag { color: #999; }

/* Illustrated abstracts carousel */
.carousel {
  position: relative;
  margin-top: 16px;
}

.carousel-track-container {
  overflow: hidden;
  border-radius: 3px;
}

.carousel-track {
  display: flex;
  transition: transform 0.35s ease;
}

.carousel-slide {
  min-width: 100%;
}

.carousel-slide img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #f9f9f9;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(80,0,0,0.75);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.carousel-btn:hover { background: #500000; }

.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.carousel-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ccc;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}

.carousel-dots .dot.active { background: #500000; }

/* --- Footer --- */
.site-footer {
  margin-top: 80px;
  padding: 24px 0;
  border-top: 1px solid #e8e8e8;
  font-size: 0.875rem;
  color: #777;
  text-align: center;
}

.site-footer a { color: #500000; }

/* --- Responsive --- */
@media (max-width: 767px) {
  .nav-toggle { display: flex; }

  .nav-inner { justify-content: space-between; gap: 0; }

  .nav-links {
    display: none;
    position: absolute;
    top: 63px;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 3px solid #500000;
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }

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

  .nav-links li { width: 100%; }

  .nav-links a {
    display: block;
    padding: 12px 24px;
    border-bottom: 1px solid #f0f0f0;
  }

  #site-nav { position: relative; }

  .home-inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .home-left { order: 1; }

  .card-grid { grid-template-columns: 1fr; }

  .page-header { padding: 36px 0 24px; margin-bottom: 36px; }

  .research-layout { grid-template-columns: 1fr; gap: 32px; }
  .research-sidebar { position: static; }
}

@media (max-width: 479px) {
  .nav-links { top: 63px; }
}
