/* ============================================================
   VINCI — Base styles compartidos por todas las páginas.
   Reset + tokens + navbar + footer + tipografía base + utilidades.
   Estilos específicos de página viven en su propio <style>.
   ============================================================ */

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

:root {
  --navy:        #0c1e3c;
  --navy-mid:    #152d55;
  --navy-light:  #1e3f72;
  --gold:        oklch(70% 0.13 82);
  --gold-light:  oklch(82% 0.10 82);
  --cream:       oklch(97% 0.008 85);
  --off-white:   oklch(95% 0.006 80);
  --text-dark:   #111827;
  --text-mid:    #374151;
  --text-muted:  #6b7280;
  --border:      rgba(12,30,60,0.10);
  --ff-serif:    'DM Sans', system-ui, sans-serif;
  --ff-sans:     'DM Sans', system-ui, sans-serif;
  --navbar-height: 80px;
  --sticky-offset: 148px;
  --content-prose: 1028px;
  --fs-ui-xxs: 0.62rem;
  --fs-ui-xs: 0.745rem;
  --fs-ui-sm: 0.845rem;
  --fs-ui-md: 0.925rem;
  --fs-body: 1.005rem;
  --fs-body-lg: 1.125rem;
  --fs-card-title: 1.05rem;
  --fs-card-title-lg: 1.22rem;
  --fs-person-card-title: 1.275rem;
  --fs-section-title: clamp(2rem, 4vw, 3.2rem);
  --fs-page-title: var(--fs-section-title);
  --fs-page-desc: 1.045rem;
  --fs-callout-title: clamp(1.12rem, 2vw, 1.45rem);
  --fs-featured-title: 1.1rem;
  --fs-featured-title-main: 1.9rem;
  --fs-stat: 2.4rem;
  --fs-stat-lg: 2.8rem;
  --lh-body: 1.75;
  --lh-card-title: 1.35;
  --lh-card-copy: 1.65;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--ff-sans);
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
}

/* Asegura que los custom elements ocupen su espacio antes del upgrade */
vinci-navbar {
  display: block;
  min-height: var(--navbar-height);
  position: sticky;
  top: 0;
  z-index: 300;
}
vinci-footer { display: block; }

/* ---------- NAVBAR ---------- */
.navbar {
  position: sticky;
  top: 0; z-index: 200;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  height: 80px;
}

vinci-navbar .navbar {
  position: relative;
  top: auto;
  z-index: auto;
}

body > .subnav {
  position: sticky;
  top: var(--navbar-height, 80px);
  z-index: 260;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.navbar-logo-img,
.navbar-logo {
  height: 62px;
  width: auto;
  display: block;
}

.navbar-nav {
  display: flex;
  list-style: none;
  gap: 0;
}

.navbar-nav a {
  display: block;
  padding: 0 1.1rem;
  height: 80px;
  line-height: 80px;
  font-size: var(--fs-ui-md);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(12,30,60,0.65);
  text-decoration: none;
  transition: color 0.2s, border-bottom 0.2s;
  border-bottom: 2px solid transparent;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

/* Dropdown opcional dentro del navbar */
.has-dropdown { position: relative; }
.has-dropdown > a::after { content: '\25BE'; font-size: 0.65em; opacity: 0.55; margin-left: 4px; }
.dropdown {
  position: absolute; top: 100%; left: 0;
  background: #fff; border: 1px solid var(--border);
  border-top: 2px solid var(--gold); border-radius: 0 0 4px 4px;
  min-width: 270px; box-shadow: 0 16px 40px rgba(12,30,60,0.13);
  opacity: 0; pointer-events: none; transform: translateY(6px);
  transition: opacity 0.18s, transform 0.18s; z-index: 300;
}
.has-dropdown:hover .dropdown { opacity: 1; pointer-events: auto; transform: translateY(0); }
.dropdown a {
  display: block !important; padding: 10px 18px !important;
  height: auto !important; line-height: 1.45 !important;
  font-size: var(--fs-ui-md) !important; font-weight: 400 !important;
  color: var(--text-mid) !important; text-transform: none !important;
  letter-spacing: 0.02em !important;
  border-bottom: 1px solid var(--border) !important;
  transition: background 0.15s, color 0.15s !important;
}
.dropdown a:last-child { border-bottom: none !important; }
.dropdown a:hover { background: var(--off-white) !important; color: var(--navy) !important; }

/* ---------- BOTONES ---------- */
.btn-primary {
  font-size: var(--fs-ui-md);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--gold);
  padding: 14px 32px;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.2s;
  display: inline-block;
}
.btn-primary:hover { background: var(--gold-light); }

.btn-ghost {
  font-size: var(--fs-ui-md);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 14px 32px;
  border-radius: 2px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  display: inline-block;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.7); color: #fff; }

/* ---------- ENCABEZADOS DE SECCIÓN ---------- */
.section-label {
  font-size: var(--fs-ui-sm);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
}

.section-title {
  font-family: var(--ff-serif);
  font-size: var(--fs-section-title);
  font-weight: 400;
  line-height: 1.12;
  color: var(--navy);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: var(--fs-body-lg);
  font-weight: 300;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.75;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 56px;
  gap: 32px;
  flex-wrap: wrap;
}

.link-all {
  font-size: var(--fs-ui-md);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid var(--navy);
  padding-bottom: 2px;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.link-all:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- PAGE HERO (interior de páginas) ---------- */
.page-hero,
.page-header {
  background: var(--navy);
  padding: 54px 4vw 47px;
  position: relative;
  overflow: hidden;
  min-height: 250px;
  display: flex;
  align-items: center;
}
.page-hero::after,
.page-header::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.page-hero-inner,
.page-header-inner { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; width: 100%; }

.page-eyebrow {
  font-size: var(--fs-ui-xs); font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.page-eyebrow::before {
  content: ''; display: block; width: 28px; height: 1px; background: var(--gold);
}
.page-title {
  font-family: var(--ff-serif);
  font-size: var(--fs-page-title);
  font-weight: 400;
  line-height: 1.12;
  color: #fff;
  max-width: 900px;
  margin-bottom: 10px;
}
.page-desc {
  font-size: var(--fs-page-desc);
  font-weight: 300;
  color: rgba(255,255,255,0.55);
  max-width: 900px;
  line-height: var(--lh-body);
}

/* ---------- MODULAR CONTENT ---------- */
[id] { scroll-margin-top: var(--sticky-offset, 148px); }

.content-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 52px 4vw 80px;
}

.content-panel { display: none; }
.content-panel.is-active {
  display: block;
  animation: panelFade 0.22s ease;
}
.content-panel[hidden] { display: none !important; }

@keyframes panelFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.modular-section,
.committee-layout {
  max-width: var(--content-prose);
}

.section-body,
.modular-prose {
  max-width: var(--content-prose);
  font-size: var(--fs-body);
  font-weight: 300;
  color: var(--text-mid);
  line-height: var(--lh-body);
  text-align: justify;
}

.modular-section .section-body,
.modular-section .section-list,
.modular-section .modular-prose,
.committee-layout .section-body,
.committee-layout .section-list,
.committee-layout .modular-prose {
  max-width: 100%;
}

.section-body p,
.modular-prose p {
  margin-bottom: 16px;
}
.section-body p:last-child,
.modular-prose p:last-child {
  margin-bottom: 0;
}

.section-list {
  margin-top: 18px;
  padding-left: 20px;
  max-width: var(--content-prose);
  color: var(--text-mid);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
.section-list li { margin-bottom: 8px; }

.modular-split,
.bioethics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 32px;
  margin-top: 28px;
  align-items: start;
}

.modular-split-main,
.bioethics-content {
  min-width: 0;
}

.bioethics-content p {
  font-size: var(--fs-body);
  color: var(--text-mid);
  line-height: 1.8;
  margin-bottom: 14px;
  text-align: justify;
}

.modular-prose h3,
.bioethics-content h3 {
  font-family: var(--ff-serif);
  font-size: var(--fs-card-title-lg);
  font-weight: 600;
  color: var(--navy);
  margin: 20px 0 8px;
}

.modular-callout,
.definition-panel {
  margin-top: 28px;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: 28px;
}

.definition-label {
  font-size: var(--fs-ui-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.definition-text {
  font-family: var(--ff-serif);
  font-size: var(--fs-callout-title);
  color: var(--navy);
  line-height: 1.55;
  font-weight: 400;
}

/* ---------- CARD TYPOGRAPHY ---------- */
.news-card-tag,
.news-tag,
.project-card-tag,
.project-tag,
.project-row-convoc,
.pub-kw-label,
.card-area-tag,
.conv-status,
.conv-objetivo,
.centro-sigla,
.video-tag,
.indicator-title,
.contact-card-title,
.directory-link,
.download-menu-title,
.program-card h4,
.cert-kicker,
.card-head {
  font-size: var(--fs-ui-xs);
}

.project-badge,
.pub-badge,
.pub-kw,
.conv-tag,
.tag,
.fondo-badge,
.meta-card-header,
.meta-label,
.project-row-year-label,
.active-filter-tag {
  font-size: var(--fs-ui-xxs);
}

.news-card-title,
.project-card-title,
.project-title,
.project-row-title,
.pub-title,
.pub-title-p,
.pub-modal-title,
.conv-title,
.centro-nombre,
.video-title,
.info-card-title,
.level-card h3,
.program-card h3,
.intl-country,
.solicitud-title,
.directory-title,
.closed-card h2 {
  font-size: var(--fs-card-title);
  line-height: var(--lh-card-title);
}

.news-card-excerpt,
.project-card-pi,
.project-pi,
.project-row-pi,
.pub-authors,
.pub-journal,
.pub-abstract,
.pub-modal-meta,
.pub-modal-abstract,
.ods-empty,
.conv-desc,
.video-desc,
.info-card p,
.level-card p,
.program-card p,
.program-list,
.contact-card p,
.contact-card a,
.directory-copy,
.indicator-desc,
.intl-inst,
.solicitud-desc,
.closed-card p,
.centro-card-no-web,
.state-msg,
.empty-state p {
  font-size: var(--fs-ui-md);
  line-height: var(--lh-card-copy);
}

.news-card-date,
.news-date,
.featured-card-date,
.card-title,
.card-dept,
.card-stat,
.committee-role,
.meta-value,
.conv-meta-row,
.conv-deadline,
.centro-web-link,
.doc-link-text strong,
.pub-toggle,
.pub-detail-btn,
.date-value {
  font-size: var(--fs-ui-sm);
}

.card-name {
  font-size: var(--fs-person-card-title);
}

.featured-card .featured-card-title {
  font-size: var(--fs-featured-title);
}

.featured-card-main .featured-card-title {
  font-size: var(--fs-featured-title-main);
}

@media (max-width: 1000px) {
  .modular-split,
  .bioethics-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .modular-callout,
  .definition-panel {
    padding: 22px;
  }
}

/* ---------- FOOTER ---------- */
footer {
  background: #08172c;
  color: rgba(255,255,255,0.6);
  padding: 80px 4vw 40px;
}

.footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 56px;
  margin-bottom: 48px;
}

.footer-logo-area { margin-bottom: 36px; }

.footer-logo-area img {
  max-width: 520px;
  width: 90%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.footer-vinci-name {
  font-family: var(--ff-serif);
  font-size: var(--fs-body-lg);
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 20px;
}

.footer-contact {
  display: flex;
  gap: 64px;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-contact-item { text-align: center; }

.footer-contact-label {
  font-size: var(--fs-ui-xs);
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.footer-contact-text {
  font-size: var(--fs-body);
  font-weight: 300;
  color: rgba(255,255,255,0.6);
  line-height: var(--lh-body);
}

.footer-contact-text a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}
.footer-contact-text a:hover { color: var(--gold-light); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: var(--fs-ui-sm);
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.04em;
}

.footer-nav-bottom {
  display: flex;
  gap: 28px;
  list-style: none;
}

.footer-nav-bottom a {
  font-size: var(--fs-ui-sm);
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}
.footer-nav-bottom a:hover { color: rgba(255,255,255,0.7); }

/* ---------- RESPONSIVE base ---------- */
@media (max-width: 900px) {
  .navbar-nav { display: none; }
  .footer-contact { gap: 36px; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; }
}
