/*
Theme Name: Gallego-Bartolome Lab
Theme URI: https://epigenetic.webs.upv.es/
Author: Gallego-Bartolome Lab
Description: Custom single-page WordPress theme for the Epigenetic Regulation of Gene Expression Lab at IBMCP (UPV-CSIC).
Version: 1.17.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: gallego-lab
*/

:root {
  --ink: #26343a;
  --forest: #69727a;
  --forest-deep: #343a3f;
  --sage: #c8d1cf;
  --mint: #edf0ef;
  --cream: #f1eee8;
  --paper: #faf9f6;
  --coral: #b76f5e;
  --gold: #c7a46b;
  --line: rgba(38, 52, 58, .14);
  --sans: "DM Sans", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --max: 1220px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 82px; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
.container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 999; left: 16px; top: -80px; padding: 10px 14px; background: white; color: var(--ink); transition: top .2s; }
.skip-link:focus { top: 16px; }

.site-header { position: fixed; z-index: 50; top: 0; left: 0; right: 0; color: var(--ink); border-bottom: 1px solid var(--line); transition: background .25s, color .25s, box-shadow .25s; }
.site-header.scrolled { color: var(--ink); background: rgba(250,249,246,.94); backdrop-filter: blur(14px); box-shadow: 0 8px 28px rgba(38,52,58,.07); border-color: var(--line); }
.nav-wrap { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; line-height: 1.05; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 5px; opacity: .65; font-size: 10px; font-weight: 500; letter-spacing: .11em; text-transform: uppercase; }
.brand-mark { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; color: var(--forest); background: var(--gold); border-radius: 50%; font-size: 21px; }
.brand-mark svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.site-nav { display: flex; align-items: center; gap: 16px; font-size: 12px; font-weight: 600; }
.site-nav a { position: relative; text-decoration: none; }
.site-nav a:not(.nav-cta)::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -7px; height: 1px; background: currentColor; transition: right .2s; }
.site-nav a:hover::after, .site-nav a:focus-visible::after { right: 0; }
.nav-cta { padding: 9px 15px; color: var(--forest-deep); background: var(--gold); border-radius: 999px; }
.menu-toggle { display: none; border: 0; background: transparent; color: inherit; }

.hero { position: relative; min-height: 610px; overflow: hidden; color: var(--ink); background: var(--paper); }
.hero::after { display: none; }
.hero-grid { display: none; }
.hero-layout { position: relative; z-index: 2; min-height: 590px; padding-top: 125px; display: grid; grid-template-columns: minmax(0, .88fr) minmax(480px, 1.12fr); align-items: center; gap: 58px; }
.hero-copy { max-width: 780px; }
.eyebrow { margin: 0 0 20px; color: var(--coral); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.hero .eyebrow { color: var(--coral); }
.join .eyebrow { color: rgba(255,255,255,.7); }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.035em; line-height: .98; }
h1 { margin-bottom: 28px; font-size: clamp(48px, 5.8vw, 78px); }
h1 em { color: var(--sage); font-weight: 400; }
h2 { margin-bottom: 24px; font-size: clamp(46px, 5vw, 76px); }
.hero-intro { max-width: 720px; margin-bottom: 34px; color: rgba(38,52,58,.72); font-size: 18px; line-height: 1.6; }
.hero-recruitment { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; margin: -6px 0 28px; padding: 13px 15px; color: #fff; background: var(--forest); border-radius: 7px; box-shadow: 0 10px 25px rgba(38,52,58,.12); text-decoration: none; transition: transform .2s, background .2s; }
.hero-recruitment:hover { transform: translateY(-2px); background: var(--forest-deep); }
.hero-recruitment-label { padding: 5px 8px; color: var(--forest-deep); background: #f2e8d8; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .08em; line-height: 1.2; text-transform: uppercase; white-space: nowrap; }
.hero-recruitment strong { font-size: 12px; line-height: 1.35; }
.hero-recruitment-arrow { font-size: 20px; line-height: 1; }
.hero-actions { display: flex; align-items: center; gap: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 28px; padding: 14px 20px; border: 1px solid transparent; border-radius: 999px; font-size: 13px; font-weight: 700; text-decoration: none; transition: transform .2s, background .2s, color .2s; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--forest-deep); background: var(--gold); }
.button-light { background: var(--cream); color: var(--forest-deep); }
.text-link { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.text-link.light { color: white; }
.conceptual-figure { width: 100%; margin: 0; justify-self: end; }
.conceptual-figure img { display: block; width: 100%; height: auto; }
.hero-meta { position: relative; z-index: 3; padding: 22px 0 28px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: rgba(38,52,58,.58); font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }

.section { padding: 96px 0; }
.section-heading { max-width: 760px; margin-bottom: 48px; }
.section-heading > p:last-child { max-width: 650px; color: rgba(38,52,58,.7); font-size: 18px; }
.section-heading.split { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.section-heading.split h2 { margin-bottom: 0; }
.research { background: var(--cream); }
.research-list { border-top: 1px solid var(--line); }
.research-card { position: relative; display: grid; grid-template-columns: 55px minmax(0,1.3fr) minmax(260px,.7fr); align-items: center; gap: 22px 34px; min-height: 225px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.card-number { align-self: start; padding-top: 8px; color: var(--coral); font-size: 12px; font-weight: 700; }
.research-card h3 { max-width: 720px; margin-bottom: 13px; font-family: var(--serif); font-size: clamp(28px,3vw,42px); font-weight: 500; line-height: 1.1; }
.research-card p { max-width: 720px; margin-bottom: 0; color: rgba(38,52,58,.68); }
.research-visual { display: block; width: 100%; height: 175px; overflow: hidden; border-radius: 10px; background: rgba(250,249,246,.62); }
.card-symbol { display: none; }

.publications { background: var(--paper); }
.publication-list { border-top: 1px solid var(--line); }
.publication { display: grid; grid-template-columns: 100px 1fr 40px; gap: 24px; padding: 34px 0; border-bottom: 1px solid var(--line); transition: padding .25s, background .25s; }
.publication:hover { background: var(--mint); }
.pub-year { padding-top: 4px; color: var(--coral); font-size: 13px; font-weight: 700; }
.pub-journal { margin-bottom: 6px; color: rgba(38,52,58,.55); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.publication h3 { max-width: 900px; margin-bottom: 8px; font-family: var(--serif); font-size: clamp(24px,2.5vw,34px); font-weight: 500; line-height: 1.16; }
.publication h3 a { text-decoration: none; }
.publication h3 a:hover { text-decoration: underline; text-underline-offset: 5px; }
.pub-body > p:last-child { margin-bottom: 0; color: rgba(38,52,58,.58); font-size: 13px; }
.pub-arrow { align-self: center; font-size: 22px; }

.team { color: var(--ink); background: var(--paper); }
.team .section-heading > p:last-child { color: rgba(38,52,58,.7); }
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; align-items: start; }
.person { padding: 20px; color: var(--ink); background: var(--cream); }
.person img { width: 100%; height: 210px; margin-bottom: 20px; object-fit: cover; object-position: 50% 20%; filter: saturate(.82); }
.person h3 { margin-bottom: 9px; font-family: var(--serif); font-size: 25px; font-weight: 500; line-height: 1.1; }
.person p:last-child { color: rgba(38,52,58,.68); font-size: 13px; }
.person-role { margin-bottom: 8px; color: var(--coral); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.person-lead { color: var(--ink); background: var(--cream); }
.person-lead img { height: 210px; }
.person-copy { padding: 0; }
.person-lead h3 { font-size: 25px; }
.person-lead p:last-of-type { color: rgba(38,52,58,.68); font-size: 13px; }
.person-lead .text-link.light { color: var(--ink); }
.alumni { margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.alumni summary { display: flex; justify-content: space-between; padding: 24px 0; cursor: pointer; font-family: var(--serif); font-size: 27px; list-style: none; }
.alumni summary::-webkit-details-marker { display: none; }
.alumni[open] summary span { transform: rotate(45deg); }
.alumni-columns { padding: 0 0 28px; display: grid; grid-template-columns: repeat(3,1fr); gap: 32px; color: rgba(38,52,58,.68); }
.alumni-columns h3 { color: var(--ink); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.alumni-columns h3:not(:first-child) { margin-top: 28px; }
.alumni-columns ul { margin: 0; padding: 0; list-style: none; }
.alumni-columns li { padding: 12px 0; border-top: 1px solid var(--line); }
.alumni-columns strong, .alumni-columns small { display: block; }
.alumni-columns strong { color: var(--ink); font-family: var(--serif); font-size: 18px; font-weight: 500; }
.alumni-columns small { margin-top: 4px; color: rgba(38,52,58,.64); font-size: 12px; line-height: 1.55; }

.gallery { background: var(--cream); }
.gallery-subtitle { margin: 58px 0 20px; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--serif); font-size: 30px; font-weight: 500; }
.gallery-subtitle:first-of-type { margin-top: 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery-item { position: relative; min-width: 0; margin: 0; overflow: hidden; background: var(--paper); border: 1px solid var(--line); }
.gallery-link { display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; cursor: zoom-in; background: var(--forest-deep); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.gallery-item:hover img { transform: scale(1.025); }
.gallery-item figcaption { min-height: 62px; padding: 12px 14px; color: var(--ink); background: var(--paper); font-size: 12px; line-height: 1.5; }

.image-lightbox { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 32px; visibility: hidden; opacity: 0; background: rgba(25,34,38,.92); transition: opacity .2s, visibility .2s; }
.image-lightbox.open { visibility: visible; opacity: 1; }
.image-lightbox-inner { position: relative; display: grid; justify-items: center; max-width: min(1100px, 94vw); max-height: 92vh; }
.image-lightbox img { max-width: 100%; max-height: 82vh; width: auto; height: auto; object-fit: contain; box-shadow: 0 18px 70px rgba(0,0,0,.35); }
.image-lightbox p { margin: 12px 0 0; color: rgba(255,255,255,.78); font-size: 13px; }
.lightbox-close { position: absolute; z-index: 2; top: -18px; right: -18px; display: grid; width: 42px; height: 42px; place-items: center; border: 0; border-radius: 50%; color: var(--ink); background: white; cursor: pointer; font-size: 24px; line-height: 1; }

.news { background: var(--paper); }
.news-layout { display: grid; grid-template-columns: .72fr 1.28fr; gap: 9vw; }
.news-list { border-top: 1px solid var(--line); }
.news-item { position: relative; padding: 26px 0 26px 145px; border-bottom: 1px solid var(--line); }
.news-item time { position: absolute; top: 28px; left: 0; color: var(--coral); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.news-item p { margin: 0; }
.news-item a { color: #a94331; font-weight: 700; text-underline-offset: 4px; }

.funding { background: var(--cream); }
.funding-layout { display: grid; grid-template-columns: .7fr 1.3fr; gap: 9vw; }
.funding-list { border-top: 1px solid var(--line); }
.funding-item { padding: 27px 0; border-bottom: 1px solid var(--line); }
.funding-item span, .funding-item small { color: rgba(38,52,58,.56); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.funding-item h3 { margin: 8px 0 5px; font-family: var(--serif); font-size: 29px; font-weight: 500; }
.funding-item p { margin-bottom: 12px; }

.resources { padding-block: 76px; color: white; background: var(--forest-deep); }
.resources-layout { display: flex; align-items: center; justify-content: space-between; gap: 50px; }
.resources h2 { margin-bottom: 16px; font-size: clamp(38px,4vw,58px); }
.resources p:not(.eyebrow) { max-width: 710px; margin-bottom: 0; color: rgba(255,255,255,.68); }

.join { color: white; background: #68727a; }
.join-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 9vw; }
.join-copy > p:not(.eyebrow) { max-width: 610px; margin-bottom: 32px; color: rgba(255,255,255,.78); font-size: 18px; }
.join-details > div { padding: 26px 0; border-top: 1px solid rgba(255,255,255,.3); }
.join-details span { font-size: 11px; font-weight: 700; opacity: .65; }
.join-details .open-call { position: relative; padding-right: 145px; }
.join-details .open-call-featured { margin: 10px 0 18px; padding: 28px 145px 28px 24px; border: 1px solid rgba(255,255,255,.38); border-radius: 8px; background: rgba(255,255,255,.11); box-shadow: 0 12px 30px rgba(25,34,38,.13); }
.join-details .open-call-featured + .open-call-featured { border-top: 1px solid rgba(255,255,255,.38); }
.call-status { position: absolute; top: 22px; right: 0; padding: 6px 10px; border: 1px solid rgba(255,255,255,.38); border-radius: 999px; background: rgba(255,255,255,.1); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.open-call-featured .call-status { top: 22px; right: 20px; color: #354047; background: #f2e8d8; border-color: #f2e8d8; opacity: 1; }
.join-details h3 { margin: 8px 0; font-family: var(--serif); font-size: 28px; font-weight: 500; }
.join-details p { color: rgba(255,255,255,.75); font-size: 14px; }
.call-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; padding-bottom: 3px; border-bottom: 1px solid rgba(255,255,255,.55); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
.join-details .call-link span { font-size: inherit; opacity: 1; }
.call-link:hover { border-color: #fff; }

.contact { background: var(--paper); }
.contact-card { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; padding: 58px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contact-card h2 { margin-bottom: 0; }
.contact-details { align-self: center; }
.contact-details > a:first-child { display: flex; justify-content: space-between; padding-bottom: 17px; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: clamp(24px,3vw,36px); text-decoration: none; }
.contact-details p { margin: 24px 0; color: rgba(38,52,58,.68); }
.contact-details > a:last-child { font-weight: 700; }

.site-footer { padding: 46px 0; color: rgba(255,255,255,.6); background: var(--forest-deep); font-size: 11px; }
.footer-layout { display: grid; grid-template-columns: 1fr auto auto; gap: 50px; align-items: end; }
.footer-brand { color: white; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { text-decoration: none; }
.site-footer p { margin: 0; }

/* Standard WordPress pages (including the existing Tools page). */
.admin-bar .site-header { top: 32px; }
.page-shell { min-height: 70vh; padding: 150px 0 100px; background: var(--paper); }
.page-shell .page-header { max-width: 850px; margin-bottom: 48px; }
.page-shell h1 { color: var(--ink); font-size: clamp(52px, 7vw, 88px); }
.page-content { max-width: 900px; font-size: 17px; }
.page-content > * + * { margin-top: 1.35em; }
.page-content h2 { margin-top: 1.35em; font-size: clamp(38px, 5vw, 60px); }
.page-content h3 { margin-top: 1.5em; font-family: var(--serif); font-size: 30px; }
.page-content a { color: #a94331; text-underline-offset: 4px; }
.page-content .wp-block-file { padding: 20px; background: var(--cream); border: 1px solid var(--line); }
.page-content .wp-block-file__button { display: inline-block; margin-left: 12px; padding: 9px 15px; color: white; background: var(--forest); border-radius: 999px; text-decoration: none; }
.page-content img { height: auto; }
.alignwide { width: min(1100px, 100%); max-width: none; }
.alignfull { width: 100vw; max-width: none; margin-left: calc(50% - 50vw); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.reveal { opacity: 1; transform: none; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .nav-wrap { min-height: 72px; }
  .menu-toggle { position: relative; z-index: 2; display: grid; width: 42px; height: 42px; place-content: center; gap: 5px; cursor: pointer; }
  .menu-toggle span:not(.sr-only) { width: 22px; height: 1px; background: currentColor; }
  .site-nav { position: fixed; inset: 0; padding: 120px 30px 40px; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; color: white; background: var(--forest-deep); font-family: var(--serif); font-size: 38px; transform: translateX(100%); transition: transform .3s; }
  .site-nav.open { transform: none; }
  .site-header:has(.site-nav.open) { color: white; }
  .nav-cta { font-family: var(--sans); font-size: 15px; }
  .hero { min-height: 640px; }
  .hero-layout { padding-top: 145px; padding-bottom: 50px; grid-template-columns: 1fr; gap: 35px; }
  .hero-copy { padding-top: 0; }
  .conceptual-figure { width: min(100%, 500px); justify-self: start; }
  .hero-meta { gap: 18px; flex-wrap: wrap; }
  .research-card { grid-template-columns: 36px minmax(0,1fr) minmax(220px,.7fr); gap: 18px; }
  .team-grid { grid-template-columns: repeat(2,1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .funding-layout, .news-layout, .join-layout { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 620px) {
  .container { width: min(calc(100% - 28px), var(--max)); }
  .join-details .open-call { padding-right: 0; }
  .join-details .open-call-featured { padding: 24px 20px; }
  .call-status { position: static; display: inline-block; margin: 8px 0 4px; }
  .brand { font-size: 14px; }
  .brand small { font-size: 8px; }
  .section { padding: 82px 0; }
  .section-heading { margin-bottom: 40px; }
  .hero { min-height: 650px; }
  .hero-layout { min-height: 570px; }
  h1 { font-size: 54px; }
  .hero-intro { font-size: 17px; }
  .hero-recruitment { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .hero-recruitment-label { width: max-content; grid-column: 1 / -1; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 18px; }
  .conceptual-figure { margin-top: 10px; }
  .hero-meta span { width: 46%; }
  .section-heading.split { align-items: flex-start; flex-direction: column; }
  .research-card { grid-template-columns: 36px 1fr; gap: 16px; }
  .research-visual { height: 165px; grid-column: 2; margin-top: 4px; }
  .card-symbol { display: none; }
  .publication { grid-template-columns: 52px 1fr 20px; gap: 12px; }
  .publication:hover { padding-inline: 7px; }
  .team-grid { grid-template-columns: 1fr; }
  .person img, .person-lead img { height: min(92vw, 330px); }
  .alumni-columns { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .image-lightbox { padding: 18px; }
  .lightbox-close { top: -12px; right: -8px; }
  .news-item { padding-left: 0; padding-top: 54px; }
  .news-item time { top: 25px; }
  .resources-layout { align-items: flex-start; flex-direction: column; }
  .contact-card { grid-template-columns: 1fr; padding: 32px 24px; gap: 28px; }
  .contact-details > a:first-child { font-size: 23px; overflow-wrap: anywhere; }
  .footer-layout { grid-template-columns: 1fr; gap: 25px; }
  .page-shell { padding: 120px 0 75px; }
}

@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
