/* ===========================================================================
   site.css — Ecotoxicología UAM · capa de página
   ---------------------------------------------------------------------------
   Amplía kit/eco-ui.css con los patrones que las páginas interiores necesitan
   (encabezado móvil, hero de sección, línea de tiempo, pestañas, listas con
   viñeta-check, tira de logos, galería, CTA). REGLA: solo tokens var(--*),
   ningún hex suelto fuera de /tokens. Prefijo de clase: .eco-
   =========================================================================== */

/* ---- Accesibilidad: salto al contenido ---------------------------------- */
.eco-skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--eco-ocean-900); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-md); font-weight: var(--fw-semibold); font-size: 14px;
  text-decoration: none; transition: top var(--dur-base) var(--ease-soft);
}
.eco-skip:focus { top: 12px; }

/* Anillo de foco consistente en toda la interfaz */
.eco-root a:focus-visible,
.eco-root button:focus-visible,
.eco-input:focus-visible,
.eco-textarea:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Encabezado: estado activo + barra superior fina -------------------- */
.eco-header { backdrop-filter: saturate(1.1); }
.eco-topbar {
  background: var(--eco-ocean-900); color: var(--text-on-dark);
  font-size: 12.5px; font-family: var(--font-sans);
}
.eco-topbar__inner {
  max-width: var(--container); margin: 0 auto; padding: 7px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.eco-topbar a { color: rgba(255,255,255,.82); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.eco-topbar a:hover { color: #fff; }
.eco-topbar i { width: 14px; height: 14px; }
.eco-topbar__set { display: flex; gap: 22px; flex-wrap: wrap; }
@media (max-width: 720px) { .eco-topbar__hide { display: none; } }

.eco-nav a.is-active { color: var(--accent-teal); font-weight: var(--fw-semibold); }
/* El selector .eco-nav a (0,1,1) gana en especificidad sobre .eco-btn--* (0,1,0)
   y pinta el texto del botón con el color del nav. Restauramos el color correcto. */
.eco-nav a.eco-btn--primary  { color: var(--action-primary-text); }
.eco-nav a.eco-btn--secondary { color: var(--accent-teal); }
.eco-nav a.eco-btn--emphasis  { color: var(--eco-ink-800); }
.eco-nav a.eco-btn--ghost     { color: var(--text-strong); }
.eco-nav a { position: relative; }
.eco-nav--desktop a:not(.eco-btn).is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -26px; height: 2px;
  background: var(--accent-teal);
}

/* ---- Botón hamburguesa + cajón móvil ------------------------------------ */
.eco-burger {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); background: var(--surface-page);
  color: var(--text-strong); cursor: pointer;
}
.eco-burger i { width: 22px; height: 22px; }
.eco-drawer {
  position: fixed; inset: 0; z-index: 60; display: none;
}
.eco-drawer[open], .eco-drawer.is-open { display: block; }
.eco-drawer__scrim { position: absolute; inset: 0; background: rgba(0,59,92,.45); }
.eco-drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(86vw, 340px);
  background: var(--surface-page); box-shadow: var(--shadow-lg);
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
  transform: translateX(8px); transition: transform var(--dur-base) var(--ease-out);
}
.eco-drawer.is-open .eco-drawer__panel { transform: none; }
.eco-drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.eco-drawer a:not(.eco-btn) {
  font-family: var(--font-sans); font-weight: var(--fw-medium); font-size: 16px;
  color: var(--text-body); text-decoration: none; padding: 12px 10px;
  border-radius: var(--radius-md); border-bottom: 1px solid var(--border-subtle);
}
.eco-drawer a:not(.eco-btn).is-active { color: var(--accent-teal); }
.eco-drawer a:not(.eco-btn):hover { background: var(--eco-ice); }
.eco-drawer .eco-btn { margin-top: 14px; }
.eco-iconbtn {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  background: var(--surface-page); color: var(--text-strong); cursor: pointer;
}
@media (max-width: 900px) {
  .eco-burger { display: inline-flex; }
}

/* ---- Hero de sección (páginas interiores) ------------------------------- */
.eco-pagehead { position: relative; overflow: hidden; background: var(--eco-ocean-900); color: #fff; }
.eco-pagehead__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.6) contrast(1.1); }
.eco-pagehead__veil { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,59,92,.94) 0%, rgba(15,76,92,.86) 60%, rgba(7,52,69,.92) 100%); }
.eco-pagehead__inner { position: relative; max-width: var(--container); margin: 0 auto; padding: clamp(56px,8vw,96px) var(--gutter) clamp(40px,6vw,68px); }
.eco-pagehead .eco-lead { max-width: 680px; }

/* Migas de pan */
.eco-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.7); font-family: var(--font-sans); margin-bottom: 18px; flex-wrap: wrap; }
.eco-crumbs a { color: rgba(255,255,255,.7); text-decoration: none; }
.eco-crumbs a:hover { color: #fff; }
.eco-crumbs i { width: 13px; height: 13px; opacity: .6; }

/* ---- Prosa / texto largo ------------------------------------------------- */
.eco-prose { max-width: var(--container-narrow); }
.eco-prose > * + * { margin-top: 18px; }
.eco-prose p { font-size: var(--fs-body); line-height: var(--lh-relaxed); color: var(--text-body); }
.eco-prose strong { color: var(--text-strong); }

/* ---- Icon tile (tarjeta de categoría con icono) ------------------------- */
.eco-icontile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: var(--radius-md);
  background: var(--eco-teal-050); color: var(--accent-teal); margin-bottom: 4px;
}
.eco-icontile i { width: 26px; height: 26px; }
.eco-icontile--ocean { background: var(--eco-ocean-050); color: var(--eco-ocean-900); }
.eco-icontile--green { background: var(--eco-green-050); color: var(--accent-green); }
.eco-icontile--cyan  { background: var(--eco-cyan-050);  color: #007a8c; }
.eco-icontile--amber { background: var(--eco-amber-050); color: #8a6500; }

/* ---- Lista con viñeta-check --------------------------------------------- */
.eco-featlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.eco-featlist li { position: relative; padding-left: 30px; font-size: 15px; line-height: 1.5; color: var(--text-body); }
.eco-featlist li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--eco-teal-050);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300A6A6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
.eco-featlist--two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 11px 28px; }

/* ---- Línea de tiempo ----------------------------------------------------- */
.eco-timeline { position: relative; display: grid; gap: 30px; padding-left: 28px; }
.eco-timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border-subtle); }
.eco-tl { position: relative; }
.eco-tl::before {
  content: ""; position: absolute; left: -28px; top: 4px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--surface-page); border: 3px solid var(--accent-teal);
}
.eco-tl__year { font-family: var(--font-mono); font-weight: var(--fw-semibold); font-size: 14px; color: var(--accent-teal); letter-spacing: .02em; }
.eco-tl__title { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: 18px; color: var(--text-strong); margin: 4px 0 6px; }
.eco-tl__text { font-size: 15px; line-height: 1.55; color: var(--text-muted); }
.eco-on-ink .eco-timeline::before { background: rgba(255,255,255,.18); }
.eco-on-ink .eco-tl::before { background: var(--eco-ocean-900); }
.eco-on-ink .eco-tl__title { color: #fff; }
.eco-on-ink .eco-tl__text { color: var(--text-on-dark-muted); }

/* ---- Pestañas ------------------------------------------------------------ */
.eco-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.eco-tab {
  font-family: var(--font-sans); font-weight: var(--fw-semibold); font-size: 14px;
  padding: 10px 18px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle); background: var(--surface-page);
  color: var(--text-muted); cursor: pointer; white-space: nowrap;
  transition: background var(--dur-base) var(--ease-soft), color var(--dur-base) var(--ease-soft), border-color var(--dur-base) var(--ease-soft);
}
.eco-tab:hover { color: var(--text-strong); border-color: var(--border-strong); }
.eco-tab[aria-selected="true"] { background: var(--eco-ocean-900); color: #fff; border-color: var(--eco-ocean-900); }
.eco-tab__count { font-family: var(--font-mono); font-size: 12px; opacity: .7; margin-left: 6px; }
.eco-tabpanel[hidden] { display: none; }

/* ---- Tarjeta de publicación --------------------------------------------- */
.eco-pub { display: grid; grid-template-columns: 64px 1fr; gap: 18px; align-items: start; }
.eco-pub__year { font-family: var(--font-mono); font-weight: var(--fw-semibold); font-size: 15px; color: var(--eco-ocean-900); padding-top: 2px; }
.eco-pub__title { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: 17px; line-height: 1.3; color: var(--text-strong); margin: 0 0 5px; }
.eco-pub__title em { font-style: italic; }
.eco-pub__journal-line { font-size: 13.5px; font-style: italic; color: var(--accent-teal); font-weight: var(--fw-medium); line-height: 1.4; margin: 0 0 10px; }
/* Cita APA con sangría francesa */
.eco-pub__apa { font-size: 13.5px; line-height: 1.6; color: var(--text-body); margin: 0; padding-left: 1.6em; text-indent: -1.6em; }
.eco-pub__apa em { font-style: italic; }
.pub-doi { color: var(--text-link); text-decoration: none; word-break: break-word; }
.pub-doi:hover { text-decoration: underline; }
@media (max-width: 560px) { .eco-pub { grid-template-columns: 1fr; gap: 6px; } .eco-pub__apa { padding-left: 0; text-indent: 0; } }

/* ---- Tira de logos / red institucional ---------------------------------- */
.eco-logos { display: flex; flex-wrap: wrap; gap: 12px; }
.eco-logochip {
  font-family: var(--font-sans); font-weight: var(--fw-semibold); font-size: 13.5px;
  color: var(--text-body); background: var(--surface-page);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: 12px 18px; line-height: 1.3; display: inline-flex; flex-direction: column;
}
.eco-logochip small { font-weight: var(--fw-medium); font-size: 12px; color: var(--text-muted); }
.eco-on-ink .eco-logochip { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: #fff; }
.eco-on-ink .eco-logochip small { color: var(--text-on-dark-muted); }

/* ---- Tira de logos institucionales --------------------------------------- */
.eco-logostrip {
  background: #fff; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: 26px clamp(16px, 3vw, 36px); overflow-x: auto;
}
.eco-logostrip img { display: block; margin: 0 auto; width: 100%; min-width: 680px; max-width: 940px; height: auto; }
.eco-logostrip__cap { font-size: 13px; color: var(--text-muted); text-align: center; margin: 14px 0 0; }

/* ---- Galería ------------------------------------------------------------- */
.eco-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.eco-gallery figure { margin: 0; }
.eco-gallery .eco-photo { aspect-ratio: 4/3; border-radius: var(--radius-card); }
.eco-gallery .eco-photo img { transition: transform var(--dur-slow) var(--ease-out); }
.eco-gallery .eco-photo:hover img { transform: scale(1.05); }
.eco-gallery figcaption { font-size: 13px; color: var(--text-muted); margin-top: 8px; line-height: 1.4; }
.eco-gallery .eco-span2 { grid-column: span 2; }
@media (max-width: 520px) { .eco-gallery .eco-span2 { grid-column: span 1; } }

/* ---- Banda CTA ----------------------------------------------------------- */
.eco-cta {
  border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(150deg, var(--eco-ocean-900), var(--eco-ocean-800));
  color: #fff; padding: clamp(36px,5vw,64px);
}
.eco-cta .eco-h2, .eco-cta .eco-lead { color: #fff; }
.eco-cta .eco-lead { color: var(--text-on-dark-muted); }

/* ---- Reproductor de audio ------------------------------------------------ */
.eco-audio { width: 100%; margin-top: 14px; border-radius: var(--radius-pill); }

/* ---- Mapa / iframe embebido --------------------------------------------- */
.eco-embed { position: relative; border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--border-subtle); aspect-ratio: 16/10; }
.eco-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- Utilidades ---------------------------------------------------------- */
.eco-mt-2 { margin-top: 8px; } .eco-mt-4 { margin-top: 16px; } .eco-mt-6 { margin-top: 32px; } .eco-mt-8 { margin-top: 48px; }
.eco-divider { height: 1px; background: var(--border-subtle); border: 0; }
.eco-kicker { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.eco-meta-row { display: flex; gap: 10px 18px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-muted); }
.eco-meta-row span { display: inline-flex; align-items: center; gap: 6px; }
.eco-meta-row i { width: 15px; height: 15px; color: var(--accent-teal); }

/* Sticky aside para layouts de dos columnas */
@media (min-width: 901px) {
  .eco-sticky { position: sticky; top: 96px; }
}

/* La cuadrícula 2-col vuelve a una sola columna en móvil (refuerzo) */
@media (max-width: 760px) {
  .eco-grid--2.eco-grid--split { grid-template-columns: 1fr; }
}
