/* Global CSS variables used by components */
:root {
  --line: #e5e7eb; /* neutral-200 border color */
  --radius: 16px; /* default rounded radius */
}
/* Remove focus outline from stat-card links after click */
a.stat-card:focus {
  outline: none !important;
  box-shadow: none !important;
}
/* Reduce vertical spacing between project card title and paragraph */
.project-card h3 {
  margin-bottom: 0.7rem;
}
#publication-filter-form input#publication-search {
  border-radius: 0.9rem !important;
}
@media (min-width: 1px) {
  nav a.nav-active[href="#contact"] {
    background-color: rgba(57, 106, 58, 0.051); /* brand/5 */
    border: 1px solid #b6d2b8; /* brand/30, approximate */
    border-radius: 9999px;
    font-weight: 600 !important;
  }
}
@media (max-width: 767px) {
  nav a.nav-active[href="#contact"] {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    font-weight: 600 !important;
  }
}
/* Hover states: mimic the active section style */
nav a:hover {
  font-weight: 500;
}
/* Make Contact look like active (pill) on hover for md+ */
@media (min-width: 768px) {
  nav a[href="#contact"]:hover {
    background-color: rgba(57, 106, 58, 0.051); /* brand/5 */
    border: 1px solid #b6d2b8; /* brand/30 approx */
    border-radius: 9999px;
    font-weight: 600 !important;
  }
}
/* Keep Contact simple on hover for small screens (match active rules) */
@media (max-width: 767px) {
  nav a[href="#contact"]:hover {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    font-weight: 600 !important;
  }
}
/* Ensure project card date never touches theme labels */
.project-card
  .flex.items-center.justify-between
  > span.text-xs.text-neutral-500 {
  margin-top: 8px;
  margin-bottom: 0.5rem;
  display: inline-block;
}
@media (max-width: 639px) {
  .project-list {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .project-card {
    max-width: calc(100vw - 2rem);
    width: calc(100vw - 2rem);
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    display: block;
  }
}
/* Publications filter UI styling */
#publication-filter-form {
  border-radius: 0.9rem;
  border: none;
  padding: 1rem 1.5rem;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: center;
  background: none;
}
@media (min-width: 640px) {
  #publication-filter-form {
    min-height: 56px;
  }
}
#publication-filter-form input {
  border-radius: 0.9rem !important;
  border: 1px solid #d1d5db;
  background: transparent;
  color: #6b7280; /* No change needed, already matches */
  padding: 0.5rem 1rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
  flex-shrink: 1;
}
#publication-filter-form input {
  border-radius: 0.9rem !important;
  border: 1px solid #d1d5db;
  background: transparent;
  color: #6b7280; /* No change needed, already matches */
  padding: 0.5rem 1rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
  flex-shrink: 1;
}
#publication-filter-form select {
  border-radius: 0.9rem !important;
  border: 1px solid #d1d5db;
  background: transparent;
  color: #6b7280;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
  flex-shrink: 1;
}
#publication-filter-form input:focus,
#publication-filter-form select:focus {
  border-color: #d1d5db;
}
#publication-filter-form option {
  color: #6b7280;
}
@media (max-width: 600px) {
  #publication-filter-form {
    padding: 0.5rem 0.2rem;
    gap: 0.2rem;
    flex-wrap: nowrap;
  }
  #publication-filter-form input,
  #publication-filter-form select {
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
    min-width: 0;
    flex-shrink: 1;
    max-width: 100%;
  }
}
@media (min-width: 734px) and (max-width: 1023px) {
  .intro-align-fix {
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }
  .intro-align-fix .section-header {
    margin-left: 0 !important;
    padding-left: 2rem !important;
    text-align: left !important;
  }
}
.section-header {
  text-align: left !important;
}
/* Force 40px margin above see-less-publications button */
#see-less-publications {
  margin-top: 40px !important;
}
/* Force 40px margin above show-more-publications button */
#show-more-publications {
  margin-top: 40px !important;
}
/* Responsive name for top left corner */
.name-short {
  display: inline-block;
}
.name-long {
  display: none;
}
@media (min-width: 600px) {
  .name-short {
    display: none !important;
  }
  .name-long {
    display: inline-block !important;
  }
}
/* Project card styles (reference) */
/* Project card exact spacing and margin fix */
.project-card {
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
  border-radius: 1rem !important;
  font-size: 0.8rem !important;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.13);
  border: 1px solid #e5e7eb;
  background-color: #fff;
  overflow: hidden;
  margin: 0 !important; /* Remove extra space below each card */
  min-height: 420px;
  position: relative;
  padding: 0; /* No outer padding, use inner for content */
}
.project-card > .p-5,
.project-card > .p-4,
.project-card > .p-3,
.project-card
  > div:not(.aspect-\[16\/10\]):not(.project-card-image):not(.aspect-ratio) {
  padding: 1.2rem !important;
  font-size: 0.8rem !important;
}
.project-card:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 7px 14px rgba(0, 0, 0, 0.11)) brightness(1.04);
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.16);
}
/* General container for sections */
.container {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (max-width: 639px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: 4rem;
  }
}
@media (min-width: 1024px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.section-about {
  margin-bottom: 80px;
  scroll-margin-top: 56px; /* was 80px; scroll sections 24px higher */
}
.section-publications,
.section-projects {
  scroll-margin-top: 56px; /* was 80px; scroll sections 24px higher */
}
.section-publications,
.section-projects,
.section-about,
.section-contact {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* Reduce bottom padding for publications section only */
.section-publications {
  padding-bottom: 3.5rem !important;
}
@media (min-width: 768px) {
  .section-publications,
  .section-projects,
  .section-about,
  .section-contact {
    padding-top: 6rem;
    padding-bottom: 2rem;
  }

  /* Reduce bottom padding for publications section only on md+ */
  .section-publications {
    padding-bottom: 3.5rem !important;
  }
}
.section-projects {
  background-color: #f5faf7; /* even lighter green tint */
}

.section-contact {
  padding-top: 2rem !important;
  scroll-margin-top: 56px; /* align with other sections */
}

/* Section header */
.section-header {
  max-width: 42rem;
  margin-left: 0;
  padding-left: 1rem;
}
@media (min-width: 640px) {
  .section-header {
    padding-left: 1.5rem;
  }
}
@media (min-width: 1024px) {
  .section-header {
    padding-left: 2rem;
  }
}

/* Publication list spacing */
.publication-list {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  max-width: none;
  padding-left: 0;
}

/* Project list grid */
.project-list {
  margin-top: 2.5rem;
  display: grid;
  gap: 24px 3.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .project-list {
    gap: 1.5rem;
  }
}
@media (min-width: 640px) {
  .project-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .project-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Project card styles (rebuilt) */
.project-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 8px 20px -8px #e8e8e8;
  border: 1px solid #e6ebe5;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  margin: 0 auto;
}
@media (max-width: 639px) {
  .project-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}
@media (min-width: 640px) {
  .project-card {
    transform: none;
    margin: 0;
  }
}
.project-card:hover {
  box-shadow: 0 16px 32px -8px #d6d6d691;
  transform: translateY(-2px) scale(1.02);
}
@media (max-width: 639px) {
  .project-card:hover {
    box-shadow: none;
    transform: none;
  }
}
.project-card-image {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #f5faf7;
}
.project-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
/* Remove all other .project-list media queries below to avoid conflicts */

/* About content grid */
.about-content {
  margin-top: 2.5rem;
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  /* Large screens: image column (fixed) + content column (fluid) */
  .about-content {
    grid-template-columns: 340px 1fr;
    align-items: start;
    gap: 3rem;
  }
  /* ensure the image container keeps its square aspect and fits the column */
  .about-content .aspect-square {
    width: 100%;
    height: auto;
    min-width: 0;
  }
}

/* Contact content grid */
.contact-content {
  margin-top: 2.5rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .contact-content {
    grid-template-columns: 2fr 1fr;
  }
}

/* About stats: hover background */
.stat-card {
  transition: background-color 0.2s ease;
}
.stat-card:hover {
  background-color: #e9f3ea;
}

/* Footer */
.site-footer {
  padding-top: 0.75rem;
  padding-bottom: calc(0.75rem + 8px);
  margin-top: 0 !important;
}
.footer-white {
  background: #f5faf7 !important;
}
.footer-content {
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}
.section-contact {
  background-color: #f5faf7; /* even lighter green tint */
}
@media (min-width: 640px) {
  .footer-content {
    flex-direction: row;
    gap: 1rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (min-width: 1024px) {
  .footer-content {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
/* Publication card styles extracted from Tailwind utility classes */
.publication-card {
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  background-color: #fff;
  padding: 1.2rem;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.13);
  transition: box-shadow 0.2s;
  font-size: 0.8rem;
}
@media (min-width: 768px) {
  .publication-card {
    padding: 1.4rem;
  }
}
.publication-card:hover {
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.16);
}
:focus-visible {
  outline: 2px solid #386939;
  outline-offset: 2px;
}
html:focus-within {
  scroll-behavior: smooth;
}

/* Footer icons: perfect bottom alignment and visual consistency */
.footer-icons {
  align-items: flex-end;
}
.footer-icons a {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  width: 28px;
  height: 28px;
}
.footer-icons a svg {
  display: block; /* remove baseline gaps */
  width: 22px;
  height: 22px;
}
/* Subtle per-icon optical nudges */
.footer-icons a[aria-label="Google Scholar"] svg {
  transform: translateY(0.5px);
}
.footer-icons a[aria-label="LinkedIn"] svg {
  transform: translateY(0.5px);
}
.footer-icons a[aria-label="YouTube"] svg {
  transform: translateY(0.5px);
}

/* Footer icons: normalize size and align to bottom visually */
.footer-icons a {
  display: inline-flex;
  align-items: flex-end;
  width: 28px; /* square hit area */
  height: 28px;
  justify-content: center;
}
.footer-icons a svg {
  display: block; /* prevent baseline gaps */
  width: 22px;
  height: 22px;
}
/* Optional tiny nudges for optical alignment */
.footer-icons a[aria-label="Google Scholar"] svg {
  transform: translateY(0.5px);
}
.footer-icons a[aria-label="LinkedIn"] svg {
  transform: translateY(0.5px);
}
.footer-icons a[aria-label="YouTube"] svg {
  transform: translateY(0.5px);
}
.project-card > *,
.project-card .p-5,
.project-card .p-4,
.project-card .p-3 {
  padding: initial !important;
  font-size: initial !important;
}
.project-card:hover {
  /* Grow 2%, add a drop shadow, and slightly lighten */
  filter: drop-shadow(0 7px 14px #c7c7c7) brightness(1.04);
}
.hero-media {
  position: relative;
  border: none;
  border-radius: var(--radius);
  /* Give the container an intrinsic size so absolutely-positioned images don't collapse it */
  width: 352px; /* +10% from 320 */
  height: 264px; /* 4:3 */
  min-width: 352px;
  min-height: 264px;
  flex: 0 0 auto;
  aspect-ratio: 4/3;
  background: #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
}
@media (min-width: 1024px) {
  .hero-media {
    width: 492px; /* +10% from 448 */
    height: 369px; /* 4:3 */
    min-width: 492px;
    min-height: 369px;
  }
}
.hover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease;
}
.hover-img--hover {
  opacity: 0;
}
.hero-media:hover .hover-img--hover {
  opacity: 1;
}
.hero-media:hover .hover-img--base {
  opacity: 0;
}
/* Footer icon color and hover effects */
.footer-icons-grey a,
.footer-icons-grey a svg,
.footer-icons-grey .brand-icon {
  color: #d1d5db !important; /* Tailwind's neutral-300 */
  fill: #d1d5db !important;
  transition: color 0.18s, fill 0.18s;
}
.footer-icons-grey a:hover,
.footer-icons-grey a:hover svg,
.footer-icons-grey a:hover .brand-icon {
  color: #2c4d2d !important;
  fill: #2c4d2d !important;
}
