/* ============================================================
   THE MADSEN LAB — MAIN STYLESHEET
   ============================================================ */

/* --- Variables ------------------------------------------- */
:root {
  --navy:        #1a2744;
  --navy-light:  #243461;
  --teal:        #2a9d8f;
  --teal-light:  #3dbfb0;
  --teal-pale:   #e8f7f5;
  --gold:        #e9c46a;
  --text:        #2d2d2d;
  --text-muted:  #6c757d;
  --bg-light:    #f8f9fa;
  --white:       #ffffff;
  --border:      #dee2e6;
  --shadow-sm:   0 2px 8px rgba(26,39,68,0.08);
  --shadow-md:   0 6px 24px rgba(26,39,68,0.12);
  --shadow-lg:   0 12px 40px rgba(26,39,68,0.16);
  --radius:      0.5rem;
  --radius-lg:   1rem;
}

/* --- Base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
  background: var(--white);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--navy);
  line-height: 1.25;
  font-weight: 700;
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--navy); text-decoration: underline; }

img { max-width: 100%; height: auto; }

figure {
  margin: 2rem 0;
  text-align: center;
}

figure img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
}

figcaption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
}

p { margin-bottom: 1.25rem; }

/* --- Navbar ----------------------------------------------- */
#main-nav {
  background: var(--navy);
  padding: 0.75rem 0;
  box-shadow: var(--shadow-md);
  transition: background 0.3s ease;
}

#main-nav .navbar-brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.2;
}

.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.01em;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--teal-light);
  font-style: italic;
  letter-spacing: 0.03em;
  margin-top: 1px;
}

#main-nav .nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem !important;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
  text-transform: uppercase;
}

#main-nav .nav-link:hover,
#main-nav .nav-link.active {
  color: var(--teal-light) !important;
}

#main-nav .navbar-toggler {
  border-color: rgba(255,255,255,0.3);
}
#main-nav .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- Page Header ------------------------------------------ */
.page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  font-style: italic;
  margin-bottom: 0;
}

/* --- Page Content ----------------------------------------- */
.page-content {
  padding: 4rem 0;
}

.page-content h2 {
  font-size: 1.7rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--teal-pale);
  color: var(--navy);
}

.page-content h3 {
  font-size: 1.3rem;
  margin-top: 1.75rem;
  color: var(--navy-light);
}

.page-content blockquote {
  border-left: 4px solid var(--teal);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--teal-pale);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--navy);
}

/* --- Homepage Hero ---------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, #1e3a5f 100%);
  color: var(--white);
  padding: 6rem 0 5rem;
  position: relative;
  overflow: hidden;
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42,157,143,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--teal));
}

.hero-eyebrow {
  display: inline-block;
  background: var(--teal);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 2rem;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero h1 span {
  color: var(--teal-light);
}

.hero .lead {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.7;
  max-width: 540px;
  margin-bottom: 2rem;
}

.hero .btn-hero-primary {
  background: var(--teal);
  color: var(--white);
  border: none;
  padding: 0.85rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 2rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(42,157,143,0.4);
}
.hero .btn-hero-primary:hover {
  background: var(--teal-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(42,157,143,0.5);
  color: var(--white);
  text-decoration: none;
}

.hero .btn-hero-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.5);
  padding: 0.85rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 2rem;
  transition: all 0.25s ease;
  margin-left: 0.75rem;
}
.hero .btn-hero-outline:hover {
  border-color: var(--teal-light);
  color: var(--teal-light);
  text-decoration: none;
}

.hero-image-col {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-placeholder {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px dashed rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: rgba(255,255,255,0.4);
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem;
}
.hero-image-placeholder i {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}
.hero-image-placeholder a {
  color: var(--teal-light);
}

/* --- Stat / Highlight strips ----------------------------- */
.stats-strip {
  background: var(--teal-pale);
  padding: 2rem 0;
  border-top: 1px solid rgba(42,157,143,0.15);
  border-bottom: 1px solid rgba(42,157,143,0.15);
}

.stat-item {
  text-align: center;
  padding: 0.75rem;
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.stat-label {
  font-size: 0.825rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

/* --- Section Labels -------------------------------------- */
.section-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.section-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 620px;
}

/* --- Research Cards -------------------------------------- */
.section-research { padding: 5rem 0; background: var(--white); }

.research-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  height: 100%;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.research-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--teal);
  border-radius: var(--radius) 0 0 var(--radius);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s ease;
}

.research-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--teal);
}

.research-card:hover::before {
  transform: scaleY(1);
}

.research-icon {
  width: 52px;
  height: 52px;
  background: var(--teal-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--teal);
  font-size: 1.3rem;
}

.research-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--navy);
}

.research-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* --- News Section ---------------------------------------- */
.section-news { padding: 5rem 0; background: var(--bg-light); }

.news-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.news-card-body {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-date {
  font-size: 0.78rem;
  color: var(--teal);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.5rem;
}

.news-card h4 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  flex: 1;
}

.news-card h4 a {
  color: var(--navy);
}
.news-card h4 a:hover {
  color: var(--teal);
  text-decoration: none;
}

.news-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.news-card .read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  margin-top: auto;
}

/* --- People Cards --------------------------------------- */
.person-card {
  text-align: center;
  padding: 1.5rem;
}

.person-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--teal-pale);
  margin: 0 auto 1.25rem;
  display: block;
  transition: border-color 0.3s ease;
}

.person-photo-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--teal-pale);
  border: 4px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 2.5rem;
  color: var(--teal);
}

.person-card:hover .person-photo {
  border-color: var(--teal);
}

.person-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.person-role {
  font-size: 0.85rem;
  color: var(--teal);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.person-bio {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.person-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-light);
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0.2rem;
  transition: all 0.2s ease;
}
.person-links a:hover {
  background: var(--teal);
  color: var(--white);
  text-decoration: none;
}

/* --- Publications --------------------------------------- */
.publication-item {
  padding: 1.5rem;
  border-left: 3px solid var(--border);
  margin-bottom: 1.5rem;
  transition: border-color 0.2s ease;
}

.publication-item:hover {
  border-color: var(--teal);
}

.publication-item .pub-title {
  font-weight: 600;
  color: var(--navy);
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.publication-item .pub-authors {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.publication-item .pub-journal {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.publication-item .pub-badges .badge {
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  border-radius: 2rem;
  font-weight: 500;
}

.badge-preprint { background: #fff3cd; color: #856404; }
.badge-published { background: #d1e7dd; color: #0a3622; }
.badge-review { background: #cfe2ff; color: #084298; }

/* --- Open Science / Feature cards ----------------------- */
.feature-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: box-shadow 0.3s ease;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
}

.feature-card .feature-icon {
  font-size: 2rem;
  color: var(--teal);
  margin-bottom: 1rem;
}

.feature-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

/* --- Buttons -------------------------------------------- */
.btn-primary {
  background: var(--teal);
  border-color: var(--teal);
  font-weight: 600;
  border-radius: 2rem;
  padding: 0.6rem 1.5rem;
}
.btn-primary:hover {
  background: var(--navy);
  border-color: var(--navy);
}

.btn-outline-primary {
  color: var(--teal);
  border-color: var(--teal);
  font-weight: 600;
  border-radius: 2rem;
  padding: 0.6rem 1.5rem;
}
.btn-outline-primary:hover {
  background: var(--teal);
  border-color: var(--teal);
}

/* --- Post badges ---------------------------------------- */
.post-badge {
  background: var(--teal-pale);
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 2rem;
}

.post-meta {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
}

/* --- News archive --------------------------------------- */
.news-archive .news-list-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.news-archive .news-list-item:last-child {
  border-bottom: none;
}

/* --- Contact form --------------------------------------- */
.contact-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-info-icon {
  width: 44px;
  height: 44px;
  background: var(--teal-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  font-size: 1rem;
  flex-shrink: 0;
}

/* --- Awards / Badges ------------------------------------ */
.award-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white);
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.3rem;
}

.award-badge i {
  color: var(--gold);
}

/* --- Footer -------------------------------------------- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.8);
  padding: 4rem 0 0;
  margin-top: 0;
}

.footer-heading {
  color: var(--white);
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.footer-text {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
}

.footer-text a {
  color: var(--teal-light);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--teal-light);
  text-decoration: none;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.footer-social a:hover {
  background: var(--teal);
  color: var(--white);
  text-decoration: none;
  transform: translateY(-2px);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.5rem 0;
  margin-top: 3rem;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  margin: 0;
}

.footer-bottom a {
  color: rgba(255,255,255,0.6);
  transition: color 0.2s ease;
}

.footer-bottom a:hover {
  color: var(--teal-light);
  text-decoration: none;
}

/* --- Utilities ------------------------------------------ */
.bg-navy { background: var(--navy) !important; }
.bg-teal-pale { background: var(--teal-pale) !important; }
.text-teal { color: var(--teal) !important; }
.text-navy { color: var(--navy) !important; }

.divider-teal {
  border: none;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  width: 60px;
  margin: 0 auto 2rem;
  border-radius: 2px;
}
.divider-teal.left { margin-left: 0; }

/* --- Responsive ----------------------------------------- */
@media (max-width: 768px) {
  .hero { padding: 4rem 0 3rem; min-height: auto; }
  .page-content { padding: 2.5rem 0; }
  .page-header { padding: 2.5rem 0 2rem; }
  .section-research,
  .section-news { padding: 3rem 0; }
  .hero .btn-hero-outline { margin-left: 0; margin-top: 0.75rem; }
}
