/* ══════════════════════════════════════════════════════════════════
   GINNOA · /unidad-vt/ — Unidad de Vigilancia Tecnológica
   Hero con imagen velada · banda intro teal · pestañas · grid de tarjetas
   Paleta oficial: teal #00665c · azul #005477 · amarillo #ffcc00 (acento)
   ══════════════════════════════════════════════════════════════════ */

/* ── Hero ──────────────────────────────────────────────────────── */

.page-hero.vt-hero {
  padding-block: clamp(104px, 10vw, 144px) clamp(48px, 6vw, 72px);
  text-align: center;
  background:
    linear-gradient(180deg, rgba(0, 27, 28, 0.82) 0%, rgba(0, 44, 45, 0.70) 45%, rgba(0, 62, 63, 0.80) 100%),
    var(--color-teal-800);
  background-size: cover;
  background-position: center;
}
/* Con imagen de fondo (inyectada server-side como custom property) */
.page-hero.vt-hero--image {
  background-image:
    linear-gradient(180deg, rgba(0, 20, 21, 0.72) 0%, rgba(0, 40, 41, 0.70) 45%, rgba(0, 27, 28, 0.86) 100%),
    var(--vt-hero-image);
}
/* Las figuras flotantes del page-hero compiten con el título (y con la foto):
   se bajan de intensidad solo en este hero. */
.page-hero.vt-hero .page-hero__shapes { opacity: 0.45; }
.vt-hero__inner {
  position: relative;
  z-index: 3;
  max-width: 880px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}
.vt-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 204, 0, 0.14);
  border: 1px solid rgba(255, 204, 0, 0.36);
  color: var(--color-amber-300);
  font-size: 0.72rem;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.vt-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 5.25rem);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-none);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 4px 28px rgba(0, 20, 21, 0.55);
  overflow-wrap: anywhere;
}
.vt-hero__lead {
  max-width: 58ch;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 12px rgba(0, 20, 21, 0.45);
}

/* ── Banda intro (teal) ────────────────────────────────────────── */

.vt-intro {
  position: relative;
  background: var(--color-teal-500);
  color: var(--text-on-brand);
  padding-block: clamp(var(--space-8), 4vw, var(--space-12));
}
.vt-intro__inner {
  max-width: 74ch;
  margin-inline: auto;
  text-align: center;
  position: relative;
}
.vt-intro__text {
  font-size: clamp(1.02rem, 2.1vw, 1.25rem);
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.96);
}

/* ── Pestañas ──────────────────────────────────────────────────── */

.vt-content {
  padding-block: clamp(var(--space-8), 4vw, var(--space-12)) clamp(var(--space-12), 6vw, var(--space-20));
}
.vt-tabs {
  display: flex;
  justify-content: safe center;
  gap: clamp(var(--space-4), 4vw, var(--space-12));
  padding-inline: var(--space-4);
  scroll-padding-inline: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.vt-tabs::-webkit-scrollbar { display: none; }
.vt-tab {
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  padding: var(--space-3) var(--space-2) var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  position: relative;
  transition: color var(--duration-base) var(--ease-default);
}
.vt-tab i { font-size: 0.95em; }
.vt-tab:hover { color: var(--text-brand); }
.vt-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--brand-accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--duration-base) var(--ease-out);
}
.vt-tab[aria-selected="true"] {
  color: var(--color-blue-500);
  font-weight: var(--weight-bold);
}
.vt-tab[aria-selected="true"]::after { transform: scaleX(1); }
.vt-tab:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: -3px;
  box-shadow: none;
  border-radius: var(--radius-md);
}

/* ── Cabecera de sección + panel ───────────────────────────────── */

.vt-panel { padding-top: clamp(var(--space-8), 5vw, var(--space-12)); }
.vt-panel:focus-visible { outline: none; }
.vt-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.vt-panel__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: var(--weight-bold);
  color: var(--color-blue-500);
  line-height: var(--leading-tight);
}
.vt-panel__count {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.vt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 275px), 1fr));
  gap: var(--space-6);
}

/* ── Tarjeta ───────────────────────────────────────────────────── */

.vt-card {
  --vt-veil-a: rgba(0, 102, 92, 0.72);
  --vt-veil-b: rgba(0, 34, 30, 0.92);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  min-height: 232px;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  color: #fff;
  background: var(--color-teal-700);
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}
.vt-card:nth-child(4n + 2) { --vt-veil-a: rgba(0, 84, 119, 0.72); --vt-veil-b: rgba(0, 27, 39, 0.92); }
.vt-card:nth-child(4n + 3) { --vt-veil-a: rgba(0, 124, 152, 0.80); --vt-veil-b: rgba(0, 55, 79, 0.92); }
.vt-card:nth-child(4n + 4) { --vt-veil-a: rgba(46, 124, 112, 0.82); --vt-veil-b: rgba(0, 51, 45, 0.92); }
.vt-card--cover { min-height: 300px; }

.vt-card__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  transition: transform var(--duration-slow) var(--ease-out);
}
.vt-card__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(165deg, var(--vt-veil-a) 0%, var(--vt-veil-b) 100%);
}
/* Con foto: velo más translúcido arriba (se ve la imagen) y opaco al pie,
   donde viven el título y el botón — así el texto siempre se lee. */
/* Con foto: velo NEUTRO arriba (la imagen se ve) y color de marca al pie.
   El 0.55 del primer stop es el suelo de luminancia: incluso sobre una foto
   blanca el eyebrow queda por encima de 4.5:1, y el text-shadow lo asegura. */
.vt-card--cover .vt-card__veil {
  background: linear-gradient(180deg,
    rgba(0, 20, 21, 0.55) 0%,
    rgba(0, 20, 21, 0.66) 45%,
    var(--vt-veil-b) 100%);
}
.vt-card--cover .vt-card__eyebrow,
.vt-card--cover .vt-card__title { text-shadow: 0 1px 8px rgba(0, 20, 21, 0.75); }
.vt-card__eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
}
.vt-card__title {
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  color: #fff;
  overflow-wrap: anywhere;
}
/* Empuja título + CTA al pie de la tarjeta (eyebrow arriba) */
.vt-card__spacer { flex: 1 1 auto; min-height: var(--space-6); }
.vt-card--cover .vt-card__spacer { min-height: var(--space-8); }
/* Sin foto, el icono del tipo llena el hueco (decorativo) */
.vt-card__ghost {
  position: absolute;
  z-index: -1;
  right: var(--space-5);
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.25rem;
  color: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}
.vt-card__cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-xl);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  background: transparent;
  transition: var(--transition-color);
}
/* Toda la tarjeta es clicable (stretched link) */
.vt-card__cta::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.vt-card:has(.vt-card__cta):hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }
.vt-card:hover .vt-card__img { transform: scale(1.06); }
.vt-card:hover .vt-card__cta { background: #fff; color: var(--color-teal-700); }
.vt-card__cta:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 3px; }

/* ── Estado vacío ──────────────────────────────────────────────── */

.vt-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
  padding: var(--space-12) var(--space-6);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-2xl);
  background: var(--surface-subtle);
  color: var(--text-secondary);
}
.vt-empty i { font-size: 2rem; color: var(--color-teal-300); }
.vt-empty__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-semibold);
  color: var(--text-brand);
}
.vt-empty__link i { font-size: 0.9rem; color: inherit; }
.vt-empty__link:hover { color: var(--color-blue-500); }

/* ── CTA de cierre ─────────────────────────────────────────────── */

.vt-cta { padding-bottom: clamp(var(--space-16), 8vw, var(--space-24)); }
.vt-cta__banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-6);
  padding: clamp(var(--space-8), 5vw, var(--space-12));
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg, var(--color-blue-500) 0%, var(--color-teal-500) 100%);
  color: #fff;
}
.vt-cta__banner h2 {
  color: #fff;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
}
.vt-cta__banner p { color: rgba(255, 255, 255, 0.86); margin-top: var(--space-2); font-size: var(--text-base); }

/* ══════════════════════════════════════════════════════════════════
   Afordancias de administración
   El servidor SOLO emite este marcado cuando el usuario es admin;
   un visitante anónimo no recibe ninguno de estos nodos.
   ══════════════════════════════════════════════════════════════════ */

.vt-edit {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 27, 28, 0.72);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: var(--transition-base);
}
.vt-edit:hover { background: var(--brand-accent); color: var(--text-on-accent); border-color: var(--brand-accent); }
.vt-edit:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; }

.vt-edit--hero  { right: var(--space-5); bottom: var(--space-5); }
.vt-edit--intro { right: var(--space-4); top: var(--space-4); }

.vt-card__admin {
  position: absolute;
  z-index: 4;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  gap: var(--space-2);
  opacity: 0.85;
  transition: opacity var(--duration-fast) var(--ease-default);
}
.vt-card:hover .vt-card__admin,
.vt-card:focus-within .vt-card__admin { opacity: 1; }
.vt-card__admin .vt-edit { position: static; padding: 0; width: 34px; height: 34px; justify-content: center; }
.vt-card__admin .vt-edit--danger:hover { background: var(--color-danger-500); color: #fff; border-color: var(--color-danger-500); }

/* Tarjeta oculta (status inactive) — solo visible para administradores */
.vt-card--inactive { opacity: 0.62; }
.vt-card__flag {
  position: absolute;
  z-index: 4;
  top: var(--space-3);
  left: var(--space-3);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--brand-accent);
  color: var(--text-on-accent);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.vt-add {
  grid-column: auto;
  min-height: 300px;
  border-radius: var(--radius-2xl);
  border: 2px dashed var(--border-strong);
  background: var(--surface-subtle);
  color: var(--text-brand);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  transition: var(--transition-base);
}
.vt-add i { font-size: 1.6rem; }
.vt-add:hover { border-color: var(--brand-primary); background: var(--brand-primary-subtle); }
.vt-add:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; }

/* Campos extra del modal (reutiliza .hero-modal de components.css) */
.vt-field { display: flex; flex-direction: column; gap: var(--space-2); }
.vt-field > span { font-size: var(--label-size); font-weight: var(--weight-semibold); }
.vt-field input[type="text"],
.vt-field input[type="url"],
.vt-field select,
.vt-field textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  background: var(--surface-page);
  color: var(--text-primary);
}
.vt-field textarea { min-height: 120px; resize: vertical; line-height: var(--leading-relaxed); }
.vt-field input:focus,
.vt-field select:focus,
.vt-field textarea:focus { outline: none; border-color: var(--brand-primary); box-shadow: var(--ring-brand); }
.vt-field__hint { font-size: var(--text-xs); color: var(--text-muted); }
.vt-modal__body { display: flex; flex-direction: column; gap: var(--space-4); overflow-y: auto; max-height: 60vh; padding-right: var(--space-1); }
.vt-preview {
  max-height: 130px;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .vt-tabs { justify-content: flex-start; gap: clamp(var(--space-3), 3vw, var(--space-6)); }
  .vt-card { min-height: 200px; padding: var(--space-5); }
  .vt-card--cover { min-height: 260px; }
  .vt-card__ghost { font-size: 2.75rem; }
  .vt-add { min-height: 200px; }
  .vt-cta__banner { flex-direction: column; align-items: flex-start; text-align: left; }
  .vt-edit--hero { right: var(--space-3); bottom: var(--space-3); }
}
@media (max-width: 420px) {
  .vt-grid { grid-template-columns: 1fr; }
  .vt-tab span { font-size: 0.9rem; }
  /* Las tres pestañas caben hasta 320px sin scroll horizontal */
  .vt-tabs { padding-inline: var(--space-2); gap: var(--space-3); }
  .vt-tab { padding-inline: var(--space-1); gap: var(--space-1); }
}

@media (prefers-reduced-motion: reduce) {
  .vt-card,
  .vt-card__img,
  .vt-tab::after { transition: none; }
  .vt-card:has(.vt-card__cta):hover { transform: none; }
  .vt-card:hover .vt-card__img { transform: none; }
}
