/* ===========================================================================
   Featured (non-GitHub) research projects — hero cards at the top
   =========================================================================== */

/* Match the GitHub project-grid sizing so featured cards aren't out
   of proportion with the cards beneath. */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  margin: 0.5rem 0 2.5rem;
}

.featured-card {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid #E8E2D4;
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none !important;
  background-image: none !important;
  color: inherit;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.featured-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(26, 26, 26, 0.08);
  border-color: #D8D0BD;
}

.featured-image-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #E8E2D4;
}
.featured-image-wrap.featured-image-photo {
  background: #1A1A1A;
}
.featured-image-wrap.featured-image-photo .featured-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 280ms ease;
}
.featured-card:hover .featured-image-photo .featured-image {
  transform: scale(1.03);
}

/* Logo variant: contain the SVG with breathing room, no zoom on hover */
.featured-image-wrap.featured-image-logo {
  background: #F7F4ED;
  padding: 1.1rem;
}
.featured-image-wrap.featured-image-logo .featured-image {
  max-width: 80%;
  max-height: 100%;
  object-fit: contain;
}

.featured-body {
  padding: 1.1rem 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.featured-title {
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "opsz" 80, "SOFT" 40;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-size: 1.15rem;
  line-height: 1.25;
  margin: 0 0 0.5rem 0;
  color: #111;
}
.featured-desc {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #4a4a4a;
  margin: 0 0 0.85rem 0;
  flex: 1;
}
.featured-cta {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #C2542D;
  border-top: 1px solid #F2EEE3;
  padding-top: 0.5rem;
  margin-top: auto;
}
.featured-card:hover .featured-cta {
  color: #A8421F;
}

/* GitHub Projects subhead under the featured row */
.github-projects-heading {
  margin-top: 2rem;
}
.github-projects-subtitle {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-variation-settings: "opsz" 30, "SOFT" 50;
  font-weight: 300;
  color: #5e5e5e;
  font-size: 1.05rem;
  margin-top: -0.25rem;
  margin-bottom: 1.5rem;
}

/* Dark mode */
[data-bs-theme="dark"] .featured-card {
  background: #1F1B16;
  border-color: #2A2620;
}
[data-bs-theme="dark"] .featured-card:hover {
  border-color: #3A342B;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
[data-bs-theme="dark"] .featured-image-wrap {
  border-bottom-color: #2A2620;
}
[data-bs-theme="dark"] .featured-image-wrap.featured-image-logo {
  background: #14110D;
}
[data-bs-theme="dark"] .featured-title { color: #F0EDE5; }
[data-bs-theme="dark"] .featured-desc { color: #B5AE9F; }
[data-bs-theme="dark"] .featured-cta {
  color: #E8784F;
  border-top-color: #2A2620;
}
[data-bs-theme="dark"] .featured-card:hover .featured-cta { color: #F08C66; }
[data-bs-theme="dark"] .github-projects-subtitle { color: #B5AE9F; }


/* ===========================================================================
   Project gallery — matches the editorial paper aesthetic from theme.scss
   =========================================================================== */

.project-summary {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 300;
  color: #5E5E5E;
  font-size: 1.1rem;
  margin: 0.5rem 0 2rem 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.project-card {
  border: 1px solid #E8E2D4;
  border-radius: 4px;
  background: #FFFFFF;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Image sits above the body in cards that have one */
.project-card.with-image .project-image-link {
  display: block;
  background: #F2EEE3;
  border-bottom: 1px solid #E8E2D4;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.project-card.with-image .project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 280ms ease, opacity 280ms ease;
}
.project-card.with-image:hover .project-image {
  transform: scale(1.03);
}

/* A subtle terracotta sliver on the left, revealed on hover */
.project-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #C2542D;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 200ms ease;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(26, 26, 26, 0.08);
  border-color: #D8D0BD;
}
.project-card:hover::before { transform: scaleY(1); }

.project-card-body {
  padding: 1.1rem 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.project-title {
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "opsz" 80, "SOFT" 40;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 0.5rem 0;
}

.project-title a {
  text-decoration: none;
  color: #111111;
  background-image: none !important;
}
.project-title a:hover { color: #C2542D; }

.project-desc {
  font-size: 0.92rem;
  color: #4a4a4a;
  line-height: 1.5;
  margin: 0 0 0.85rem 0;
  flex-grow: 1;
}
.project-desc-empty { color: #999; font-style: italic; }

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.badge {
  font-family: "JetBrains Mono", Menlo, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-weight: 500;
  border: 1px solid transparent;
  text-transform: uppercase;
}
.badge.lang   { background: #F2EEE3; color: #5E5E5E; border-color: #E8E2D4; }
.badge.date   { background: transparent; color: #6E6862; border-color: #E8E2D4; }
.badge.stars  { background: rgba(194, 84, 45, 0.08); color: #8B3A24; border-color: rgba(194, 84, 45, 0.25); }
.badge.fork   { background: transparent; color: #6E6862; border-color: #E8E2D4; }

.project-links {
  font-size: 0.85rem;
  display: flex;
  gap: 1.1rem;
  margin-top: auto;
  padding-top: 0.4rem;
  border-top: 1px solid #F2EEE3;
}

.project-links a {
  text-decoration: none;
  color: #1A1A1A;
  font-weight: 500;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 180ms ease, color 180ms ease;
}
.project-links a:hover {
  color: #C2542D;
  background-size: 100% 1px;
}

/* =================================== Dark mode =================================== */
[data-bs-theme="dark"] .project-summary { color: #B5AE9F; }

[data-bs-theme="dark"] .project-card {
  background: #1F1B16;
  border-color: #2A2620;
}
[data-bs-theme="dark"] .project-card.with-image .project-image-link {
  background: #2A2620;
  border-bottom-color: #2A2620;
}
[data-bs-theme="dark"] .project-card::before { background: #E8784F; }
[data-bs-theme="dark"] .project-card:hover {
  border-color: #3A342B;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .project-title a { color: #F0EDE5; }
[data-bs-theme="dark"] .project-title a:hover { color: #E8784F; }
[data-bs-theme="dark"] .project-desc { color: #B5AE9F; }
[data-bs-theme="dark"] .project-desc-empty { color: #6E6862; }

[data-bs-theme="dark"] .badge.lang   { background: #2A2620; color: #B5AE9F; border-color: #3A342B; }
[data-bs-theme="dark"] .badge.date   { background: transparent; color: #9A9387; border-color: #3A342B; }
[data-bs-theme="dark"] .badge.stars  { background: rgba(232, 120, 79, 0.12); color: #F0AB8B; border-color: rgba(232, 120, 79, 0.3); }
[data-bs-theme="dark"] .badge.fork   { background: transparent; color: #9A9387; border-color: #3A342B; }

[data-bs-theme="dark"] .project-links { border-top-color: #2A2620; }
[data-bs-theme="dark"] .project-links a { color: #E8E5DC; }
[data-bs-theme="dark"] .project-links a:hover { color: #E8784F; }


/* ===========================================================================
   Publications page
   =========================================================================== */

.pub-year-group { margin-bottom: 2.2rem; }

.pub-entry {
  padding: 1rem 0;
  border-bottom: 1px solid #F2EEE3;
}
.pub-entry:last-child { border-bottom: none; }

.pub-title {
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "opsz" 60, "SOFT" 40;
  font-weight: 500;
  font-size: 1.08rem;
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: #111;
}
.pub-title a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 180ms ease, color 180ms ease;
}
.pub-title a:hover {
  color: #C2542D;
  background-size: 100% 1px;
}

.pub-meta {
  font-size: 0.9rem;
  color: #4a4a4a;
  margin: 0.3rem 0 0 0;
  line-height: 1.45;
}
.pub-authors { font-weight: 400; }
.pub-journal {
  font-style: italic;
  color: #5e5e5e;
}

.pub-doi {
  font-family: "JetBrains Mono", Menlo, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: #6E6862;
  margin: 0.4rem 0 0 0;
  text-transform: lowercase;
}
.pub-doi a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted #C5BFB1;
}
.pub-doi a:hover {
  color: #C2542D;
  border-bottom-color: #C2542D;
}

/* Dark-mode publications */
[data-bs-theme="dark"] .pub-entry { border-bottom-color: #2A2620; }
[data-bs-theme="dark"] .pub-title { color: #F0EDE5; }
[data-bs-theme="dark"] .pub-title a:hover { color: #E8784F; }
[data-bs-theme="dark"] .pub-meta { color: #B5AE9F; }
[data-bs-theme="dark"] .pub-journal { color: #9A9387; }
[data-bs-theme="dark"] .pub-doi { color: #9A9387; }
[data-bs-theme="dark"] .pub-doi a { border-bottom-color: #4A443B; }
[data-bs-theme="dark"] .pub-doi a:hover {
  color: #E8784F;
  border-bottom-color: #E8784F;
}
