/* ==========================================================================
   BioDE Lab — University of Patras
   ========================================================================== */

:root {
  --maroon: #6f1c2b;
  --maroon-dark: #4f1420;
  --green: #7cb342;
  --blue: #4a72b8;
  --coral: #d9534f;
  --ink: #1c1c1c;
  --bg: #ffffff;
  --bg-alt: #f7f6f3;
  --text: #2b2b2b;
  --text-light: #6b6b6b;
  --border: #e5e3df;
  --shadow: 0 10px 30px rgba(28, 28, 28, 0.08);
  --radius: 10px;
  --header-h: 84px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

a { color: var(--maroon); text-decoration: none; }
a:hover { color: var(--coral); }

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

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }
.section-sm { padding: 56px 0; }

.eyebrow {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 14px;
}

.section-head {
  max-width: 640px;
  margin: 0 0 48px;
}

.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.section-head h2 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); }
.section-head p { color: var(--text-light); font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-dark); color: #fff; box-shadow: 0 10px 24px rgba(111, 28, 43, 0.35); }

.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.btn-outline:hover { background: rgba(255,255,255,0.12); color: #fff; }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transition: background 0.3s ease, box-shadow 0.3s ease, height 0.3s ease;
}
.site-header.is-scrolled {
  --header-h: 70px;
  height: var(--header-h);
}

/* Transparent, white-text header only on the homepage hero, before scrolling */
body.home .site-header:not(.is-scrolled) {
  background: transparent;
  box-shadow: none;
}
body.home .site-header:not(.is-scrolled) .main-nav a { color: #fff; }
body.home .site-header:not(.is-scrolled) .main-nav a:hover,
body.home .site-header:not(.is-scrolled) .main-nav a.active { background: rgba(255,255,255,0.15); color: #fff; }
body.home .site-header:not(.is-scrolled) .nav-toggle span { background: #fff; }

.header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand img {
  height: 64px; width: auto;
  background: #fff; border-radius: 50%; padding: 4px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.15);
  transition: height 0.3s ease;
}
.site-header.is-scrolled .brand img { height: 52px; }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}
.main-nav a:hover, .main-nav a.active { background: var(--bg-alt); color: var(--maroon); }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: none; background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); display: block; transition: 0.25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero Slider ---------- */
.hero {
  position: relative;
  height: 92vh;
  min-height: 560px;
  width: 100%;
  overflow: hidden;
  background: var(--ink);
}
.hero .swiper { height: 100%; }
.hero .swiper-slide {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1);
  transition: transform 7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.swiper-slide-active .slide-bg { transform: scale(1.14); }

.slide-tint {
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply;
  opacity: 0.55;
}
.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10,10,12,0.78) 0%, rgba(10,10,12,0.45) 48%, rgba(10,10,12,0.25) 100%);
}
.slide-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-repeat: repeat;
  background-size: 420px auto;
  mix-blend-mode: screen;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  color: #fff;
}
.hero-content-inner { max-width: 640px; }

.slide-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  margin-bottom: 22px;
}
.slide-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.hero-content h1, .hero-content h2 {
  color: #fff;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.hero-content p {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: rgba(255,255,255,0.88);
  max-width: 520px;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero .swiper-pagination {
  bottom: 34px !important;
  left: 24px !important;
  width: auto !important;
  display: flex;
  gap: 8px;
}
.hero .swiper-pagination-bullet {
  width: 34px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.4);
  opacity: 1;
  transition: background 0.25s ease;
}
.hero .swiper-pagination-bullet-active { background: #fff; }

.hero .swiper-button-prev,
.hero .swiper-button-next {
  color: #fff;
  width: 46px; height: 46px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  transition: background 0.2s ease;
}
.hero .swiper-button-prev:hover,
.hero .swiper-button-next:hover { background: rgba(255,255,255,0.25); }
.hero .swiper-button-prev::after,
.hero .swiper-button-next::after { font-size: 16px; font-weight: 700; }

.scroll-cue {
  position: absolute;
  bottom: 34px; right: 40px;
  z-index: 3;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.75);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}
.scroll-cue::after {
  content: "";
  writing-mode: horizontal-tb;
  width: 1px; height: 48px;
  background: linear-gradient(rgba(255,255,255,0.8), transparent);
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  position: relative;
  padding: calc(var(--header-h) + 64px) 0 72px;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
}
.page-hero .slide-bg { position: absolute; inset: 0; transform: none; }
.page-hero .slide-overlay { background: linear-gradient(120deg, rgba(79,20,32,0.92), rgba(28,28,28,0.86)); }
.page-hero .container { position: relative; z-index: 2; }
.page-hero .eyebrow { color: var(--green); }
.page-hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.7rem); }
.page-hero p { color: rgba(255,255,255,0.85); max-width: 600px; }
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.65); margin-bottom: 18px; }
.breadcrumb a { color: rgba(255,255,255,0.8); }
.breadcrumb a:hover { color: #fff; }

/* ---------- Mission / About ---------- */
.mission {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}
.mission-visual {
  position: relative;
  background: var(--bg-alt);
  border-radius: var(--radius);
  aspect-ratio: 4/3.2;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
}
.mission-visual svg { width: 74%; height: 74%; }
.mission h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.mission-stats { display: flex; gap: 40px; margin-top: 32px; flex-wrap: wrap; }
.stat b { display: block; font-family: 'Poppins', sans-serif; font-size: 1.9rem; color: var(--maroon); }
.stat span { color: var(--text-light); font-size: 0.9rem; }

/* ---------- Research cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.research-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 30px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.research-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.card-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
}
.card-icon svg { width: 28px; height: 28px; }
.icon-maroon { background: rgba(111,28,43,0.1); color: var(--maroon); }
.icon-green { background: rgba(124,179,66,0.14); color: var(--green); }
.icon-blue { background: rgba(74,114,184,0.12); color: var(--blue); }
.icon-coral { background: rgba(217,83,79,0.12); color: var(--coral); }

.research-card h3 { font-size: 1.15rem; }
.research-card p { color: var(--text-light); font-size: 0.96rem; margin-bottom: 18px; }
.card-link { font-family: 'Poppins', sans-serif; font-weight: 500; font-size: 0.88rem; }
.card-link::after { content: "→"; margin-left: 6px; transition: margin-left 0.2s ease; }
.card-link:hover::after { margin-left: 10px; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--maroon), var(--maroon-dark));
  color: #fff;
  padding: 64px 0;
  text-align: center;
}
.cta-band h2 { color: #fff; margin-bottom: 14px; }
.cta-band p { color: rgba(255,255,255,0.85); max-width: 520px; margin: 0 auto 28px; }

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.news-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.25s ease, transform 0.25s ease; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.news-thumb { aspect-ratio: 16/10; }
.news-body { padding: 22px 24px 26px; }
.news-date { font-size: 0.78rem; color: var(--blue); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 8px; }
.news-body h3 { font-size: 1.05rem; }
.news-body p { color: var(--text-light); font-size: 0.92rem; }

/* ---------- People ---------- */
.people-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.person-card { text-align: center; display: block; color: inherit; text-decoration: none; transition: transform 0.2s ease; }
.person-card:hover { transform: translateY(-4px); }
.person-card:hover .avatar { border-color: var(--maroon); }
.avatar {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  overflow: hidden;
  width: 132px;
}
.avatar svg { width: 56%; height: 56%; color: var(--text-light); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-card h3 { font-size: 1rem; margin-bottom: 2px; }
.person-role { font-size: 0.85rem; color: var(--maroon); font-weight: 500; margin-bottom: 6px; }
.person-card p.bio { font-size: 0.85rem; color: var(--text-light); }

.pi-feature {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 44px;
  align-items: start;
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 56px;
}
.pi-feature .avatar { width: 100%; aspect-ratio: 1; border-radius: 14px; margin-bottom: 0; }
.pi-feature h2 { margin-bottom: 4px; }

.group-title { font-family: 'Poppins', sans-serif; font-size: 1.15rem; margin: 56px 0 26px; padding-bottom: 12px; border-bottom: 2px solid var(--border); }

/* ---------- CV profile ---------- */
.cv-section { max-width: 900px; }
.cv-section .group-title { margin-top: 48px; }
.cv-section .group-title:first-of-type { margin-top: 0; }
.cv-section p.bio { font-size: 0.98rem; line-height: 1.7; margin-bottom: 16px; }
.cv-entry { padding: 18px 0; border-bottom: 1px solid var(--border); }
.cv-entry:last-child { border-bottom: none; }
.cv-entry .cv-dates { font-size: 0.82rem; color: var(--maroon); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 4px; }
.cv-entry h4 { font-size: 1rem; margin-bottom: 2px; }
.cv-entry .cv-org { font-size: 0.9rem; color: var(--text-light); margin-bottom: 8px; }
.cv-entry p { font-size: 0.92rem; color: var(--text); }
.cv-entry ul { margin: 8px 0 0 18px; padding: 0; }
.cv-entry li { font-size: 0.9rem; margin-bottom: 8px; color: var(--text); }
.cv-note { font-size: 0.85rem; color: var(--text-light); font-style: italic; margin-top: 20px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.skill-tag { font-size: 0.82rem; background: var(--bg-alt); border: 1px solid var(--border); color: var(--text); padding: 6px 14px; border-radius: 20px; }
.cv-meta-row { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 24px 0 8px; }
.cv-meta-row div h5 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-light); margin-bottom: 4px; }
.cv-meta-row div p { font-size: 0.9rem; }
.group-title:first-of-type { margin-top: 0; }

/* ---------- Publications ---------- */
.pub-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.pub-filters button {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem; font-weight: 500;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pub-filters button.active, .pub-filters button:hover { background: var(--maroon); color: #fff; border-color: var(--maroon); }

.pub-year { font-family: 'Poppins', sans-serif; font-size: 1.4rem; color: var(--maroon); margin: 44px 0 20px; }
.pub-year:first-of-type { margin-top: 0; }
.pub-item {
  display: flex; gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.pub-item .pub-badge {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 10px;
  background: var(--bg-alt); display: flex; align-items: center; justify-content: center;
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 0.75rem; color: var(--maroon);
}
.pub-item h3 { font-size: 1rem; margin-bottom: 6px; }
.pub-item .pub-meta { font-size: 0.87rem; color: var(--text-light); }
.pub-item .pub-journal { font-style: italic; color: var(--text); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; }
.contact-info-item { display: flex; gap: 16px; margin-bottom: 26px; }
.contact-info-item .ci-icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  background: rgba(111,28,43,0.08); color: var(--maroon);
  display: flex; align-items: center; justify-content: center;
}
.contact-info-item .ci-icon svg { width: 20px; height: 20px; }
.contact-info-item h4 { font-size: 0.95rem; margin-bottom: 3px; }
.contact-info-item p { color: var(--text-light); font-size: 0.92rem; margin: 0; }

.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-top: 10px; }
.map-frame iframe { width: 100%; height: 260px; border: 0; display: block; }

.contact-form { background: var(--bg-alt); border-radius: var(--radius); padding: 40px; border: 1px solid var(--border); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 7px; font-family: 'Poppins', sans-serif; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.2s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--maroon); }
.field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.82rem; color: var(--text-light); margin-top: 14px; }
.form-note.is-error { color: #b3261e; }
.form-note.is-success { color: #2e7d32; }
.hidden-field { display: none; }

/* ---------- Funding logos ---------- */
.funders { display: flex; align-items: center; justify-content: center; gap: 56px; flex-wrap: wrap; opacity: 0.75; }
.funder-badge {
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 0.95rem;
  color: var(--text-light);
  border: 1px solid var(--border);
  padding: 14px 26px; border-radius: 8px;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.75); padding: 72px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 0.8fr 0.9fr 1fr; gap: 40px; padding-bottom: 56px; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.footer-brand img { height: 110px; background: #fff; border-radius: 50%; padding: 6px; }
.footer-brand span { font-family: 'Poppins', sans-serif; color: #fff; font-weight: 600; font-size: 1.02rem; }
.site-footer p { color: rgba(255,255,255,0.55); font-size: 0.9rem; }
.site-footer h4 { color: #fff; font-size: 0.92rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 18px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 11px; }
.footer-links a { color: rgba(255,255,255,0.65); font-size: 0.92rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 22px 0;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}
.footer-bottom a { color: rgba(255,255,255,0.75); }
.footer-bottom a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .card-grid, .news-grid { grid-template-columns: repeat(2, 1fr); }
  .people-grid { grid-template-columns: repeat(3, 1fr); }
  .mission { grid-template-columns: 1fr; }
  .mission-visual { order: -1; max-width: 420px; margin: 0 auto; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .pi-feature { grid-template-columns: 180px 1fr; padding: 28px; }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }

  /* Lock the page behind the open menu (prevents the menu sliding with the page) */
  body.nav-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
  }

  body.nav-open .site-header,
  body.home.nav-open .site-header {
    background: #fff;
    transition: none;
  }

  body.nav-open .main-nav {
    display: flex;
    position: fixed;
    top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
    z-index: 480;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  body.nav-open .main-nav a { padding: 16px; border-bottom: 1px solid var(--border); border-radius: 0; color: var(--ink) !important; }
  .card-grid, .news-grid { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: repeat(2, 1fr); }
  .pi-feature { grid-template-columns: 1fr; }
  .pi-feature .avatar { max-width: 200px; margin: 0 auto; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero { height: 100vh; }
  .hero-content p { max-width: 100%; }
  .scroll-cue { display: none; }
}
