/* ============================================================
   FIAMBIOT — Federación Iberoamericana de Biotecnología
   style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&family=Nunito+Sans:wght@300;400;600;700&display=swap');

/* ─── Variables ─────────────────────────────────────────── */
:root {
  --teal:        #2BBCBC;
  --teal-dark:   #1A8C8C;
  --teal-light:  #D6F2F2;
  --copper:      #C07A35;
  --copper-light:#F5E6D3;
  --navy:        #0F2440;
  --dark:        #1C2B3A;
  --gray:        #5A6A7A;
  --light-gray:  #F4F7F9;
  --white:       #FFFFFF;
  --border:      #DDE5ED;

  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Nunito Sans', sans-serif;

  --max-width: 1100px;
  --section-gap: 90px;
  --nav-height: 54px;
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--dark);
  background: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
  padding-top: var(--nav-height);
}

section {
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

/* ─── Utility ───────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 28px;
}

.section-title span {
  color: var(--teal-dark);
}

.divider {
  width: 56px;
  height: 3px;
  background: linear-gradient(to right, var(--teal), var(--copper));
  border-radius: 2px;
  margin-bottom: 36px;
}

/* ─── Header / Hero ─────────────────────────────────────── */
header {
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

/* Decorative molecular pattern background */
header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(43,188,188,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(192,122,53,0.10) 0%, transparent 45%),
    radial-gradient(circle at 60% 80%, rgba(43,188,188,0.08) 0%, transparent 40%);
  pointer-events: none;
}

/* Subtle grid lines */
header::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(43,188,188,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43,188,188,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 64px 32px 60px;
}

.logo-wrapper {
  width: 340px;
  max-width: 90vw;
  margin-bottom: 28px;
  filter: drop-shadow(0 4px 24px rgba(43,188,188,0.35));
  animation: fadeDown 0.9s ease both;
}

.logo-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

.header-tagline {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--teal);
  animation: fadeUp 0.9s 0.3s ease both;
}

/* ─── Nav ───────────────────────────────────────────────── */
nav {
  background: rgba(15,36,64,0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,255,255,0.12);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 24px rgba(15,36,64,0.18);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

.nav-inner {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 0 32px;
  flex-wrap: wrap;
}

.nav-inner a {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  padding: 16px 18px;
  transition: color 0.2s, background 0.2s;
  border-bottom: 2px solid transparent;
}

.nav-inner a:hover {
  color: var(--white);
  background: rgba(43,188,188,0.16);
  border-bottom-color: var(--teal);
}

/* ─── Biotecnología Costa Rica ─────────────────────────── */
.cr-link-section {
  position: relative;
  overflow: hidden;
  padding: 64px 0;
  background:
    linear-gradient(120deg, rgba(11,91,74,0.96), rgba(24,136,104,0.94) 48%, rgba(43,188,188,0.88)),
    linear-gradient(90deg, #0F2440, #1A8C8C);
  color: var(--white);
}

.cr-link-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(120deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(30deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.38;
  pointer-events: none;
}

.cr-link-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  align-items: center;
  gap: 56px;
}

.cr-link-copy {
  max-width: 560px;
}

.cr-link-copy h2 {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.02;
  color: var(--white);
  margin-bottom: 18px;
}

.cr-link-copy p {
  max-width: 520px;
  color: rgba(255,255,255,0.84);
  font-size: 1.04rem;
  line-height: 1.75;
  margin-bottom: 26px;
}

.cr-link-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  color: #0B5B4A;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 4px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.16);
  transition: transform 0.2s, background 0.2s;
}

.cr-link-button:hover {
  background: #EAF8F0;
  transform: translateY(-2px);
}

.cr-link-button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.cr-link-graphic {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cr-event-logo {
  display: block;
  width: min(100%, 520px);
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,0.18));
}

/* ─── Historia Section ──────────────────────────────────── */
#historia {
  padding: var(--section-gap) 0;
  background: var(--white);
}

.historia-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  align-items: start;
}

.historia-sidebar {
  position: sticky;
  top: 80px;
}

.year-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 4px;
  margin-bottom: 24px;
}

.historia-sidebar .section-title {
  font-size: 2.4rem;
  margin-bottom: 20px;
}

.congreso-pill {
  display: inline-block;
  background: var(--copper-light);
  color: var(--copper);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 30px;
  margin: 4px 4px 4px 0;
}

.historia-body p {
  font-size: 1.05rem;
  color: var(--gray);
  margin-bottom: 20px;
  text-align: justify;
}

.historia-body p:last-child { margin-bottom: 0; }

/* Congress timeline */
.congress-timeline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.congress-item {
  background: var(--light-gray);
  border-left: 3px solid var(--teal);
  padding: 14px 18px;
  border-radius: 0 6px 6px 0;
}

.congress-item.upcoming {
  border-left-color: var(--copper);
  background: var(--copper-light);
}

.congress-item .ci-year {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1;
}

.congress-item.upcoming .ci-year { color: var(--copper); }

.congress-item .ci-city {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.congress-item .ci-tag {
  font-size: 0.7rem;
  color: var(--gray);
  margin-top: 4px;
}

.congress-item.upcoming .ci-tag { color: var(--copper); font-weight: 700; }

/* ─── Misión / Visión ───────────────────────────────────── */
#mision-vision {
  padding: var(--section-gap) 0;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

#mision-vision::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 0% 100%, rgba(43,188,188,0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 0%, rgba(192,122,53,0.10) 0%, transparent 55%);
  pointer-events: none;
}

.mv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  position: relative;
  z-index: 1;
}

.mv-card {
  padding: 56px 48px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(43,188,188,0.15);
  position: relative;
  overflow: hidden;
}

.mv-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.mv-card.mision::before { background: linear-gradient(to right, var(--teal), var(--teal-dark)); }
.mv-card.vision::before  { background: linear-gradient(to right, var(--copper), #E8A055); }

.mv-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 1.4rem;
}

.mv-card.mision .mv-icon { background: rgba(43,188,188,0.15); }
.mv-card.vision  .mv-icon { background: rgba(192,122,53,0.15); }

.mv-card .section-label {
  display: block;
  margin-bottom: 8px;
}

.mv-card.mision .section-label { color: var(--teal); }
.mv-card.vision  .section-label { color: #E8A055; }

.mv-card h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 20px;
}

.mv-card p {
  font-size: 1rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.8;
  text-align: justify;
}

/* ─── Objetivos ─────────────────────────────────────────── */
#objetivos {
  padding: var(--section-gap) 0;
  background: var(--light-gray);
}

.objetivos-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 60px;
}

.objetivos-header .divider {
  margin: 0 auto 36px;
}

.objetivos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.obj-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px 28px;
  position: relative;
  transition: transform 0.25s, box-shadow 0.25s;
}

.obj-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(43,188,188,0.12);
}

.obj-number {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--teal-light);
  line-height: 1;
  margin-bottom: 12px;
  display: block;
}

.obj-card p {
  font-size: 0.95rem;
  color: var(--gray);
  line-height: 1.7;
}

.obj-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--teal), var(--copper));
  border-radius: 0 0 8px 8px;
  opacity: 0;
  transition: opacity 0.25s;
}

.obj-card:hover::after { opacity: 1; }

/* ─── Estatutos ─────────────────────────────────────────── */
#estatutos {
  padding: var(--section-gap) 0;
  background: var(--white);
}

.estatutos-inner {
  display: flex;
  align-items: center;
  gap: 80px;
}

.estatutos-text { flex: 1; }

.estatutos-download {
  flex-shrink: 0;
  text-align: center;
}

.pdf-card {
  background: var(--light-gray);
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: border-color 0.25s, background 0.25s;
}

.pdf-card:hover {
  border-color: var(--teal);
  background: var(--teal-light);
}

.pdf-graphic {
  width: 150px;
  max-width: 100%;
  height: auto;
  display: block;
}

.pdf-filename {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray);
  letter-spacing: 0.04em;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--teal-dark);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 4px;
  transition: background 0.2s, transform 0.2s;
  white-space: nowrap;
}

.btn-download:hover {
  background: var(--navy);
  transform: translateY(-2px);
}

.btn-download svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ─── Mesa Directiva ────────────────────────────────────── */
#directiva {
  padding: var(--section-gap) 0 calc(var(--section-gap) + 20px);
  background: var(--light-gray);
}

.directiva-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 60px;
}

.directiva-header .section-title,
.directiva-header .section-title span {
  color: #000000;
}

.directiva-header .divider { margin: 0 auto 36px; }

.directiva-grid {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  max-width: 626px;
  margin: 0 auto;
}

.member-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  width: 190px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.07);
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
}

.member-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(43,188,188,0.15);
}

.member-card a {
  color: inherit;
  text-decoration: none;
}

.member-photo {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
  background: var(--teal-light);
}

/* Placeholder avatar if no image */
.member-photo-placeholder {
  width: 100%;
  aspect-ratio: 1/1;
  background: linear-gradient(135deg, var(--teal-light) 0%, var(--teal) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.member-photo-placeholder svg {
  width: 60%;
  height: 60%;
  opacity: 0.5;
  color: var(--white);
}

.member-info {
  padding: 18px 16px 22px;
}

.member-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 6px;
}

.member-institution {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--teal-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.4;
}

/* ─── Footer ────────────────────────────────────────────── */
footer {
  background: var(--navy);
  padding: 40px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--teal), var(--copper), var(--teal));
}

.footer-logo {
  width: 180px;
  opacity: 0.85;
  margin-bottom: 16px;
}

.footer-tagline {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.footer-copy {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
}

/* ─── Animations ────────────────────────────────────────── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* Scroll-reveal base */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  .cr-link-inner    { grid-template-columns: 1fr; gap: 34px; }
  .historia-grid    { grid-template-columns: 1fr; gap: 40px; }
  .historia-sidebar { position: static; }
  .mv-grid          { grid-template-columns: 1fr; }
  .objetivos-grid   { grid-template-columns: 1fr 1fr; }
  .estatutos-inner  { flex-direction: column; gap: 48px; }
}

@media (max-width: 600px) {
  :root {
    --section-gap: 60px;
    --nav-height: 92px;
  }
  .container { padding: 0 20px; }
  .cr-link-section { padding: 48px 0; }
  .objetivos-grid  { grid-template-columns: 1fr; }
  .mv-card         { padding: 36px 28px; }
  .congress-timeline { grid-template-columns: 1fr 1fr; }
  .nav-inner a     { padding: 12px 10px; font-size: 0.68rem; }
}
