/* =========================================================
   Simoes Lab — site styles
   Colours and fonts match the original Squarespace design.
   ========================================================= */

:root {
  --navy: #404d67;
  --blue: #3662c9;
  --yellow: #f5f374;
  --beige: #f4f3e8;
  --white: #ffffff;
  --rule: #ded9c6;
  --muted: #6e7a92;

  --font-body: "Raleway", system-ui, sans-serif;
  --font-head: "Space Grotesk", system-ui, sans-serif;

  --page-pad: clamp(1.25rem, 4vw, 3.2rem);
  --max: 1200px;
  --radius: 9px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1rem, 0.85rem + 0.4vw, 1.19rem);
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--navy);
  background: var(--white);
}
body.bg-beige { background: var(--beige); }

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

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
  font-family: var(--font-head);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.1;
  margin: 0 0 0.5em;
}
h1, .h1 { font-size: clamp(2.4rem, 1.6rem + 3vw, 3.9rem); }
h2, .h2 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); }
h3, .h3 { font-size: clamp(1.7rem, 1.25rem + 1.5vw, 2.55rem); }
h4, .h4 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.96rem); }

p { margin: 0 0 1em; }
.small { font-size: 0.85em; }
.large { font-size: 1.1em; }
.accent { color: var(--blue); }
.center { text-align: center; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--page-pad); }
.narrow { max-width: 760px; }
.section { padding: clamp(2.5rem, 5vw, 4.5rem) 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--navy); color: var(--white); padding: 0.5em 1em; z-index: 100; }
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 3.2rem; padding: 0.6em 1.2em;
  background: var(--navy); color: var(--yellow);
  font-family: var(--font-head); font-weight: 500; font-size: 1rem;
  letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none;
  border: 0; border-radius: 0; cursor: pointer;
  transition: opacity 0.15s ease;
}
.button:hover { opacity: 0.85; text-decoration: none; }

/* ---------- Header ---------- */
.site-header { background: var(--yellow); position: relative; z-index: 20; }
.header-inner {
  max-width: none; margin: 0 auto; padding: 0.35rem var(--page-pad);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.site-title {
  font-family: var(--font-head); font-weight: 500; letter-spacing: -0.05em;
  font-size: clamp(1.4rem, 1rem + 1.2vw, 1.96rem); text-decoration: none;
}
.site-nav ul { list-style: none; display: flex; gap: 1.6rem; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; padding: 0.1em 0; background: linear-gradient(var(--navy), var(--navy)) 0 100% / 0 1px no-repeat; transition: background-size 0.2s ease; }
.site-nav a:hover, .site-nav a.is-active { background-size: 100% 1px; }

.menu-toggle { display: none; background: none; border: 0; padding: 0.6rem; cursor: pointer; color: var(--navy); }
.menu-toggle-bar { display: block; width: 26px; height: 2px; background: currentColor; margin: 6px 0; transition: transform 0.2s ease; }

@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--yellow); padding: 1rem var(--page-pad) 2rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 1rem; font-size: 1.4rem; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bar:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--beige); padding: clamp(2.5rem, 5vw, 4rem) 0; }
.bg-beige .site-footer { border-top: 1px solid var(--rule); }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-about { max-width: 22rem; }
.footer-contact { max-width: 15rem; }
.footer-title { font-size: clamp(1.3rem, 1rem + 0.8vw, 1.6rem); letter-spacing: -0.03em; }
.footer-heading { font-size: clamp(1.7rem, 1.25rem + 1.5vw, 2.55rem); }

/* ---------- Home: hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--yellow); min-height: clamp(30rem, 44vw, 36rem); display: flex; align-items: center; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-inner { position: relative; padding-top: 2.5rem; padding-bottom: 2.5rem; }
.hero-title { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.4rem); max-width: 13.5em; color: var(--navy); }
.hero-title mark {
  background: none; color: var(--navy);
  text-decoration: underline; text-decoration-thickness: 0.07em; text-underline-offset: 0.12em;
}
.hero-text { max-width: 36rem; text-align: justify; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 1.2rem 8rem; margin-top: 1.5rem; padding-left: 1.5rem; }
.hero-buttons .button { width: 12rem; }

@media (max-width: 700px) {
  /* soften the video behind the text so it stays readable on phones */
  .hero::after { content: ""; position: absolute; inset: 0; background: rgba(245, 243, 116, 0.55); }
  .hero-inner { z-index: 1; }
  .hero-text { text-align: left; }
  .hero-buttons { gap: 1rem; padding-left: 0; }
  .hero-buttons .button { width: auto; flex: 1 1 10rem; }
}

/* ---------- Home: strip under the hero ---------- */
.strip { background: var(--beige); }
.strip-inner { display: flex; justify-content: space-between; gap: 0.5rem 2rem; flex-wrap: wrap; padding-top: 0.25rem; padding-bottom: 0.25rem; }
.strip-inner p { margin: 0; }

/* ---------- Home: research themes ---------- */
.eyebrow { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.05em; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.96rem); text-align: center; margin-bottom: 0.4em; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 7vw, 6rem); margin: 2.5rem auto 0; max-width: 1070px; }
.card { background: var(--white); border: 2px solid var(--blue); border-radius: var(--radius); padding: 1.6rem clamp(1.25rem, 3vw, 3rem) 2rem; }
.card-beige { background: var(--beige); }
.card img { width: 48px; height: 48px; object-fit: contain; margin-bottom: 1.5rem; }
.theme-grid .card { min-height: 25rem; }
.theme-grid .card p { max-width: 12rem; }
@media (max-width: 860px) {
  .theme-grid { grid-template-columns: 1fr; max-width: 28rem; }
  .theme-grid .card { min-height: 0; }
  .theme-grid .card p { max-width: none; }
}

/* ---------- Home: stats band ---------- */
.stats { background: var(--yellow); padding: 2.2rem 0; }
.stats-inner { display: flex; justify-content: space-between; gap: 2rem; }
.stat { text-align: center; padding: 0 clamp(0rem, 3vw, 3rem); }
.stat-value { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.05em; line-height: 1.1; font-size: clamp(2rem, 1.4rem + 2vw, 3rem); margin: 0; }
.stat-label { margin: 0; }

/* ---------- Home: latest news + team card ---------- */
.news-team { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2rem, 7vw, 6rem); align-items: start; }
.mini-news { list-style: none; margin: 0 0 1rem; padding: 0; }
.mini-news li { display: flex; gap: 1rem; align-items: flex-start; padding: 0.7rem 0; }
.mini-news-thumb { flex: 0 0 auto; }
.mini-news-thumb img { width: 48px; height: 48px; object-fit: cover; }
.mini-news-title { display: block; text-decoration: none; line-height: 1.3; }
.mini-news-title:hover { text-decoration: underline; }
.mini-news-date { display: block; font-size: 0.65em; margin-top: 0.2em; }
.team-card { padding: 1.5rem 2.6rem 1.8rem; }
.mini-team { list-style: none; margin: 0 0 1.2rem; padding: 0; }
.mini-team li { display: flex; align-items: center; gap: 1rem; padding: 0.55rem 0; }
.mini-team li > a { flex: 0 0 48px; }
.mini-team .avatar { width: 48px; height: 48px; max-width: none; }
.mini-team div { display: flex; flex-direction: column; align-items: center; text-align: center; flex: 1; }
@media (max-width: 860px) { .news-team { grid-template-columns: 1fr; } }

/* ---------- Home: join the lab ---------- */
.join { padding-left: 0; padding-right: 0; }
.join-box { background: var(--yellow); border-radius: 10px; padding: clamp(2.5rem, 4vw, 3.2rem) var(--page-pad); text-align: center; }
.join-box h2 { margin-bottom: 0.6em; }
.join-box p { max-width: 62rem; margin: 0 auto 1.8rem; font-size: 0.85em; }
.join-box .button { min-width: 12rem; }

/* ---------- Avatars ---------- */
.avatar { border-radius: 50%; object-fit: cover; aspect-ratio: 1; width: 100%; }
.avatar-md { width: clamp(10rem, 18vw, 14rem); margin: 0 auto 0.8rem; }
.avatar-lg { width: clamp(12rem, 22vw, 18rem); margin: 0 auto 1.5rem; }

/* ---------- Team page ---------- */
.banner { background: var(--yellow); text-align: center; padding: 1.1rem var(--page-pad); }
.banner h1, .banner h2 { margin: 0; font-weight: 700; font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.5rem); }
.team-group { padding-top: 2rem; padding-bottom: 2rem; }
.team-group .h3 { max-width: 12em; margin-left: auto; margin-right: auto; }
.member-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem clamp(2rem, 8vw, 7rem); }
.member { text-align: center; }
.member p { margin: 0 0 0.4rem; }
.rule { border: 0; border-top: 1px solid var(--muted); width: calc(100% - 2 * var(--page-pad)); max-width: calc(var(--max) - 2 * var(--page-pad)); padding: 0; }

.social-links { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 0.8rem; margin: 0.4rem 0 0; padding: 0; }
.social-links img { width: 24px; height: 24px; object-fit: contain; }
.social-links a:hover { opacity: 0.7; }

/* ---------- Person profile ---------- */
.person { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr); gap: clamp(2rem, 5vw, 4.5rem); padding-top: clamp(2.5rem, 5vw, 4rem); padding-bottom: clamp(3rem, 6vw, 5rem); }
.person-card { text-align: left; }
.person-card .avatar-lg { margin-left: 0; margin-right: 0; }
.person-name { font-size: clamp(1.9rem, 1.4rem + 1.5vw, 2.6rem); margin-bottom: 0.1em; }
.person-role { font-size: 1.1em; margin: 0 0 0.3rem; }
.person-inst { font-size: 0.75em; margin-bottom: 1rem; }
.person-card .social-links { justify-content: flex-start; }
.person-body .prose { margin-bottom: 2rem; }
.person-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2.5rem; }
.icon-list { list-style: none; margin: 0 0 2rem; padding: 0; font-size: 0.8em; }
.icon-list li { display: flex; gap: 0.9rem; align-items: flex-start; margin-bottom: 1.1rem; }
.icon-list img { width: 26px; height: 26px; object-fit: contain; flex: 0 0 26px; margin-top: 0.1em; }
@media (max-width: 860px) {
  .person { grid-template-columns: 1fr; }
  .person-card { text-align: center; }
  .person-card .avatar-lg { margin: 0 auto 1.5rem; }
  .person-card .social-links { justify-content: center; }
}
@media (max-width: 560px) { .person-lists { grid-template-columns: 1fr; } }

/* ---------- Prose (Markdown content) ---------- */
.prose img { margin: 1.5rem 0; }
.prose a { text-decoration-color: currentColor; }
.prose > *:last-child { margin-bottom: 0; }

/* ---------- Projects ---------- */
.project-grid-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 2.5rem 1.4rem; max-width: 1050px; }
.project-grid-list a { text-decoration: none; display: block; }
.project-grid-list img { width: 100%; aspect-ratio: 1; object-fit: cover; margin-bottom: 0.9rem; }
.project-card-title { font-size: clamp(1.2rem, 1rem + 0.5vw, 1.45rem); letter-spacing: -0.03em; line-height: 1.25; }
.project-grid-list a:hover .project-card-title { text-decoration: underline; }

.project { padding-top: clamp(2.5rem, 5vw, 4rem); padding-bottom: 3rem; }
.project-title { text-align: center; max-width: 22em; margin: 0 auto 2.5rem; }
.project-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.project-member { text-align: center; }
.project-image { margin-top: 0 !important; border-radius: 2px; }
@media (max-width: 860px) { .project-grid { grid-template-columns: 1fr; } }

/* ---------- Previous / next links ---------- */
.pager { display: flex; justify-content: space-between; gap: 2rem; margin-top: clamp(3rem, 7vw, 6rem); }
.pager a { font-family: var(--font-head); font-weight: 500; letter-spacing: -0.05em; line-height: 1.1; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.96rem); text-decoration: none; max-width: 22rem; }
.pager a:hover { text-decoration: underline; }
.pager-next { text-align: right; margin-left: auto; }

/* ---------- News ---------- */
.news-list { list-style: none; margin: 0; padding: 0; max-width: 1050px; }
.news-item { display: grid; grid-template-columns: clamp(6rem, 18vw, 9.5rem) 1fr; gap: clamp(1rem, 3vw, 2rem); align-items: center; margin-bottom: 1.8rem; }
.news-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.news-title { font-size: clamp(1.4rem, 1rem + 1.4vw, 2.2rem); letter-spacing: -0.04em; line-height: 1.25; margin-bottom: 0.6em; }
.news-title a { text-decoration: none; }
.news-title a:hover { text-decoration: underline; }
.read-more { font-size: 0.65em; }

.post { max-width: 1050px; padding-top: clamp(1.5rem, 3vw, 2.5rem); padding-bottom: 2rem; }
.post-date { font-size: 0.6em; margin-bottom: 1.5rem; }
.post-title { max-width: 11em; margin-bottom: 1.2em; }
.post .prose { max-width: 34rem; }

/* ---------- Publications ---------- */
.pubs { max-width: calc(820px + 2 * var(--page-pad)); line-height: 1.55; }
.pub-year { font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; letter-spacing: 0.04em; margin: 1.8rem 0 0.6rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--muted); }
.pub { padding: 0.75rem 0; border-bottom: 1px solid var(--rule); font-size: 0.85em; }
.pub:last-child { border-bottom: 0; }
.pub-authors { color: #5a647a; }
.pub-title { font-weight: 700; }
.pub-journal { color: var(--muted); font-style: italic; }
.pub-link {
  display: inline-flex; align-items: center; gap: 0.3em; margin-top: 0.6rem;
  font-size: 0.85em; font-weight: 700; letter-spacing: 0.02em; text-decoration: none; white-space: nowrap;
  padding: 0.35em 0.95em; border: 1.6px solid var(--muted); border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pub-link:hover { background: var(--navy); border-color: var(--navy); color: var(--beige); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.contact h1 { max-width: 7em; }
.contact-map iframe { width: 100%; aspect-ratio: 3 / 4; border: 0; }
.contact-form { max-width: 28rem; margin-top: 1.5rem; }
.contact-form fieldset { border: 0; margin: 0; padding: 0; }
.contact-form legend { padding: 0; margin-bottom: 0.4rem; }
.contact-form label { display: block; margin-bottom: 1rem; font-size: 0.9em; }
.contact-form .req { font-size: 0.8em; opacity: 0.7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-form input, .contact-form textarea {
  display: block; width: 100%; margin-top: 0.3rem; padding: 0.7rem 0.8rem;
  font: inherit; font-size: 1rem; color: var(--navy);
  background: var(--white); border: 1px solid #a9adb8; border-radius: 10px;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
@media (max-width: 860px) {
  .contact { grid-template-columns: 1fr; }
  .contact-map iframe { aspect-ratio: 4 / 3; }
}
