/* ===========================================================================
   eco-ui.css — Ecotoxicología UAM · framework-agnostic component layer
   ---------------------------------------------------------------------------
   Class-based versions of the design-system components. Works in ANY stack
   (plain HTML, Astro, WordPress/PHP, Vue, Svelte, etc.) — no JS, no build step.
   This file pulls in the tokens + fonts itself, so one <link> is enough:

       <link rel="stylesheet" href="kit/eco-ui.css">

   Prefer the React components in /components when you're in a React app;
   use these classes everywhere else. Both share the same tokens, so they look
   identical. Class prefix: .eco-
   =========================================================================== */
@import url('styles.css');

/* ---- Base / reset-ish ---------------------------------------------------- */
.eco-root, .eco-root * { box-sizing: border-box; }
.eco-root {
  font-family: var(--font-sans);
  color: var(--text-body);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  line-height: var(--lh-normal);
}
.eco-root img { max-width: 100%; display: block; }

/* ---- Layout -------------------------------------------------------------- */
.eco-container { max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }
.eco-container--narrow { max-width: var(--container-narrow); }
.eco-section { padding-block: var(--section-y); }
.eco-section--muted { background: var(--surface-muted); }
.eco-section--ink { background: var(--surface-inverse); color: var(--text-on-dark); }
.eco-grid { display: grid; gap: 24px; }
.eco-grid--2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.eco-grid--3 { grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); }
.eco-grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.eco-stack { display: flex; flex-direction: column; gap: 14px; }
.eco-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ---- Type ---------------------------------------------------------------- */
.eco-display { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: clamp(36px,6vw,64px); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); color: var(--text-strong); margin: 0; }
.eco-h1 { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-h1); line-height: var(--lh-snug); letter-spacing: var(--ls-tight); color: var(--text-strong); margin: 0; }
.eco-h2 { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: clamp(28px,4vw,36px); line-height: var(--lh-snug); letter-spacing: var(--ls-tight); color: var(--text-strong); margin: 0; }
.eco-h3 { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-h3); line-height: var(--lh-snug); color: var(--text-strong); margin: 0; }
.eco-lead { font-size: var(--fs-lead); line-height: var(--lh-snug); color: var(--text-muted); margin: 0; }
.eco-body { font-size: var(--fs-body); line-height: var(--lh-relaxed); color: var(--text-body); margin: 0; }
.eco-muted { color: var(--text-muted); }
.eco-mono { font-family: var(--font-mono); }
.eco-eyebrow { font-family: var(--font-sans); font-weight: var(--fw-semibold); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--ls-eyebrow); color: var(--accent-teal); margin: 0; }
.eco-on-ink { color: var(--text-on-dark); }
.eco-on-ink .eco-eyebrow { color: rgba(255,255,255,0.7); }
.eco-on-ink .eco-display, .eco-on-ink .eco-h1, .eco-on-ink .eco-h2, .eco-on-ink .eco-h3 { color: var(--text-on-dark); }
.eco-on-ink .eco-lead { color: var(--text-on-dark-muted); }

/* ---- Section header ------------------------------------------------------ */
.eco-section-header { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.eco-section-header--center { align-items: center; text-align: center; max-width: 720px; margin-inline: auto; }

/* ---- Buttons ------------------------------------------------------------- */
.eco-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-weight: var(--fw-semibold); font-size: 15px; line-height: 1;
  padding: 12px 22px; border-radius: var(--radius-pill); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-base) var(--ease-soft), box-shadow var(--dur-base) var(--ease-soft), transform var(--dur-fast) var(--ease-soft);
}
.eco-btn:active { transform: translateY(1px); }
.eco-btn svg, .eco-btn i { width: 16px; height: 16px; }
.eco-btn--sm { padding: 8px 16px; font-size: 14px; }
.eco-btn--lg { padding: 15px 28px; font-size: 16px; }
.eco-btn--primary { background: var(--action-primary); color: var(--action-primary-text); border-color: var(--action-primary); }
.eco-btn--primary:hover { background: var(--action-primary-hover); border-color: var(--action-primary-hover); }
.eco-btn--secondary { background: transparent; color: var(--accent-teal); border-color: var(--accent-teal); }
.eco-btn--secondary:hover { background: var(--eco-teal-050); }
.eco-btn--emphasis { background: var(--accent-emphasis); color: var(--eco-ink-800); border-color: var(--accent-emphasis); }
.eco-btn--emphasis:hover { background: #d99e00; border-color: #d99e00; }
.eco-btn--ghost { background: transparent; color: var(--text-strong); }
.eco-btn--ghost:hover { background: var(--eco-ice); }
.eco-btn[disabled], .eco-btn--disabled { opacity: .5; pointer-events: none; }
/* on dark backgrounds */
.eco-on-ink .eco-btn--secondary { color: #fff; border-color: rgba(255,255,255,0.4); }
.eco-on-ink .eco-btn--secondary:hover { background: rgba(255,255,255,0.08); }

/* ---- Badge / Tag --------------------------------------------------------- */
.eco-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-weight: var(--fw-semibold); font-size: 12px;
  letter-spacing: .04em; text-transform: uppercase; line-height: 1;
  padding: 6px 11px; border-radius: var(--radius-pill);
  color: var(--text-muted); background: var(--eco-ice); border: 1px solid var(--border-subtle);
}
.eco-badge--ocean { color: var(--eco-ocean-900); background: var(--eco-ocean-050); border-color: transparent; }
.eco-badge--teal  { color: #066; background: var(--eco-teal-050); border-color: transparent; }
.eco-badge--green { color: var(--eco-green-500); background: var(--eco-green-050); border-color: transparent; }
.eco-badge--cyan  { color: #007a8c; background: var(--eco-cyan-050); border-color: transparent; }
.eco-badge--amber { color: #8a6500; background: var(--eco-amber-050); border-color: transparent; }
.eco-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-sans); font-weight: var(--fw-medium); font-size: 13px; color: var(--text-body);
  background: var(--surface-page); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill);
  padding: 6px 13px;
}
.eco-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-teal); flex: none; }
.eco-tag--green::before { background: var(--accent-green); }
.eco-tag--cyan::before  { background: var(--accent-cyan); }
.eco-tag--ocean::before { background: var(--eco-ocean-900); }
.eco-tag--nodot::before { display: none; }

/* ---- Card ---------------------------------------------------------------- */
.eco-card {
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 28px;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
  text-decoration: none; color: inherit; display: block;
}
a.eco-card, .eco-card--hover { cursor: pointer; }
a.eco-card:hover, .eco-card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.eco-card--ink { background: linear-gradient(160deg, var(--eco-ocean-900), var(--eco-ocean-800)); border: none; color: #fff; }
.eco-card--flush { padding: 0; overflow: hidden; }

/* Research card (image → category → title → text → link) */
.eco-research { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.eco-research__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--eco-ocean-900); }
.eco-research__media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.82) contrast(1.08); transition: transform var(--dur-slow) var(--ease-out); }
a.eco-research:hover .eco-research__media img { transform: scale(1.05); }
.eco-research__media::after { content: ""; position: absolute; inset: 0; background: var(--overlay-photo); }
.eco-research__body { padding: 26px 28px 28px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.eco-research__link { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 6px; font-weight: var(--fw-semibold); font-size: 14px; color: var(--accent-teal); }

/* ---- Stat block ---------------------------------------------------------- */
.eco-stat__value { font-family: var(--font-mono); font-weight: var(--fw-semibold); font-size: clamp(34px,4vw,46px); line-height: 1; letter-spacing: -.01em; color: var(--eco-ocean-900); }
.eco-stat__label { font-size: 14px; line-height: 1.4; color: var(--text-muted); margin-top: 10px; }
.eco-on-ink .eco-stat__value { color: #fff; }
.eco-on-ink .eco-stat__label { color: var(--text-on-dark-muted); }

/* ---- Photo treatment ----------------------------------------------------- */
.eco-photo { position: relative; overflow: hidden; background: var(--eco-ocean-900); }
.eco-photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.82) contrast(1.08); }
.eco-photo--overlay::after { content: ""; position: absolute; inset: 0; background: var(--overlay-photo); }

/* ---- Form input ---------------------------------------------------------- */
.eco-field { display: flex; flex-direction: column; gap: 7px; }
.eco-label { font-weight: var(--fw-semibold); font-size: 13px; color: var(--text-strong); }
.eco-input, .eco-textarea {
  width: 100%; font-family: var(--font-sans); font-size: 15px; color: var(--text-body);
  background: var(--surface-page); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: 11px 14px; outline: none; transition: border-color var(--dur-base) var(--ease-soft), box-shadow var(--dur-base) var(--ease-soft);
}
.eco-textarea { min-height: 108px; resize: vertical; }
.eco-input:focus, .eco-textarea:focus { border-color: var(--accent-teal); box-shadow: 0 0 0 3px var(--eco-teal-050); }
.eco-help { font-size: 12px; color: var(--text-muted); }

/* ---- Header / nav -------------------------------------------------------- */
.eco-header { position: sticky; top: 0; z-index: 50; background: var(--surface-page); border-bottom: 1px solid var(--border-subtle); }
.eco-header__inner { max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.eco-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.eco-brand img { height: 40px; width: auto; }
.eco-brand__name { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: 15px; color: var(--text-strong); line-height: 1.1; }
.eco-brand__sub  { font-size: 11px; color: var(--text-muted); letter-spacing: .04em; }
.eco-nav { display: flex; align-items: center; gap: 26px; }
.eco-nav a { font-weight: var(--fw-medium); font-size: 14px; color: var(--text-body); text-decoration: none; white-space: nowrap; transition: color var(--dur-fast) var(--ease-soft); }
.eco-nav a:hover { color: var(--accent-teal); }

/* ---- Footer -------------------------------------------------------------- */
.eco-footer { background: var(--eco-ink-800); color: #fff; }
.eco-footer__inner { max-width: var(--container); margin: 0 auto; padding: 56px var(--gutter) 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 32px; align-items: start; }
.eco-footer a { color: rgba(255,255,255,0.78); text-decoration: none; font-size: 14px; }
.eco-footer__bar { border-top: 1px solid rgba(255,255,255,0.12); padding: 18px var(--gutter); text-align: center; font-family: var(--font-mono); font-size: 12px; color: rgba(255,255,255,0.5); }

/* ---- Hero ---------------------------------------------------------------- */
.eco-hero { position: relative; overflow: hidden; background: var(--eco-ocean-900); color: #fff; }
.eco-hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.7) contrast(1.1); }
.eco-hero__veil { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,59,92,0.92) 0%, rgba(15,76,92,0.82) 55%, rgba(7,52,69,0.9) 100%); }
.eco-hero__inner { position: relative; max-width: var(--container); margin: 0 auto; padding: clamp(72px,11vw,128px) var(--gutter) clamp(48px,7vw,84px); }

/* ---- Motion: discreet progressive reveal --------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .eco-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
  .eco-reveal.eco-in { opacity: 1; transform: none; }
}

/* ---- Responsive nav helper ---------------------------------------------- */
@media (max-width: 900px) { .eco-nav--desktop { display: none; } }
