/* ============================================================
   Colección Historia UNMSM v2.0 · Estilos principales
   Design tokens de design-tokens.json + component-specs.md
   ============================================================ */

/* ---------- Custom Properties (Design Tokens) ---------- */
:root {
  /* Colores */
  --ch-primary:        #8B0000;
  --ch-primary-600:    #A31010;
  --ch-primary-50:     #FBEAEA;
  --ch-secondary:      #C19A6B;
  --ch-secondary-600:  #A87F4D;
  --ch-secondary-50:   #F6EDDD;
  --ch-white:          #FFFFFF;
  --ch-gray-dark:      #2C2C2C;
  --ch-gray-soft:      #6B6B6B;
  --ch-gray-light:     #F5F5F5;
  --ch-gray-bg:        #FAFAF8;
  --ch-border:         #E0E0E0;
  --ch-border-soft:    #EBEBEB;
  --ch-error:          #DC2626;
  --ch-success:        #16A34A;

  /* Tipografía */
  --ch-font-display: 'Playfair Display', Georgia, serif;
  --ch-font-body:    'Inter', -apple-system, system-ui, sans-serif;

  /* Sombras */
  --ch-shadow-sm:  0 2px 8px rgba(0,0,0,0.06);
  --ch-shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --ch-shadow-lg:  0 8px 24px rgba(0,0,0,0.12);
  --ch-shadow-xl:  0 20px 40px rgba(0,0,0,0.2);
  --ch-shadow-focus: 0 0 0 3px rgba(139, 0, 0, 0.18);

  /* Radii */
  --ch-radius-sm: 4px;
  --ch-radius-md: 8px;
  --ch-radius-lg: 12px;
  --ch-radius-xl: 16px;

  /* Layout */
  --ch-sidebar-w: 280px;
  --ch-max-w: 1280px;
}

/* ---------- Reset y base ---------- */
.chu-root *,
.chu-root *::before,
.chu-root *::after {
  box-sizing: border-box;
}

.chu-root {
  font-family: var(--ch-font-body);
  font-size: 16px;
  color: var(--ch-gray-dark);
  background: transparent;
  line-height: 1.5;
}

.chu-root img { max-width: 100%; height: auto; display: block; }

/* ---------- Foco visible (WCAG AA) ---------- */
.chu-root :focus { outline: none; }
.chu-root :focus-visible {
  outline: 2px solid var(--ch-primary);
  outline-offset: 2px;
  border-radius: var(--ch-radius-sm);
}

/* ---------- Eyebrow ---------- */
.chu-eyebrow {
  font-family: var(--ch-font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ch-gray-soft);
  margin: 0 0 6px;
}

/* ============================================================
   SITE HEADER (chrome=full)
   ============================================================ */
.chu-site-header {
  background: var(--ch-primary);
  padding: 16px 24px;
  margin-bottom: 24px;
}
.chu-site-header-inner {
  max-width: var(--ch-max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.chu-site-logo {
  width: 48px;
  height: 60px;
  flex-shrink: 0;
}
.chu-site-eyebrow {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.chu-site-title {
  font-family: var(--ch-font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--ch-white);
  margin: 2px 0 0;
}

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.chu-root {
  padding: 16px;
}

.chu-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: var(--ch-max-w);
  margin: 0 auto;
}

/* ============================================================
   MOBILE BAR
   ============================================================ */
.chu-mobile-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.chu-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 88%;
  max-width: 320px;
  height: 100vh;
  z-index: 40;
  background: var(--ch-white);
  box-shadow: var(--ch-shadow-xl);
  border-radius: 0;
  transform: translateX(-100%);
  overflow-y: auto;
  transition: transform 0.2s ease;
}

.chu-sidebar.is-open {
  transform: translateX(0);
}

.chu-sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 45;
  backdrop-filter: blur(2px);
  display: none;
}
.chu-sidebar-scrim.is-visible {
  display: block;
}

/* Sidebar header */
.chu-sidebar-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--ch-border);
}
.chu-sidebar-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.chu-sidebar-title {
  font-family: var(--ch-font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ch-primary);
  margin: 0;
  line-height: 1.2;
}
.chu-sidebar-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ch-gray-soft);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ch-radius-sm);
  flex-shrink: 0;
  transition: color 0.15s;
}
.chu-sidebar-close:hover { color: var(--ch-primary); }

/* Sidebar body */
.chu-sidebar-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Secciones de control */
.chu-control {
  display: flex;
  flex-direction: column;
}

/* ============================================================
   CHIPS DE TOMO
   ============================================================ */
.chu-tomo-chips {
  display: flex;
  gap: 6px;
}

.chu-tomo-chip {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px;
  border-radius: var(--ch-radius-md);
  border: 1px solid var(--ch-border);
  background: var(--ch-gray-light);
  font-family: var(--ch-font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ch-gray-dark);
  cursor: pointer;
  transition: all 0.15s ease;
  gap: 2px;
}
.chu-chip-label { font-weight: 600; font-size: 13px; }
.chu-tomo-chip .chu-cnt { font-size: 10.5px; opacity: 0.7; }
.chu-tomo-chip:hover {
  background: var(--ch-white);
  border-color: var(--ch-secondary);
}
.chu-tomo-chip.is-active {
  background: var(--ch-primary);
  border-color: var(--ch-primary);
  color: var(--ch-white);
}
.chu-tomo-chip.is-active .chu-cnt {
  color: var(--ch-secondary);
  opacity: 1;
}

.chu-tomo-period {
  font-family: var(--ch-font-display);
  font-style: italic;
  font-size: 12px;
  color: var(--ch-secondary-600);
  margin: 6px 0 0;
}

/* ============================================================
   FILTRO DE SECCIÓN
   ============================================================ */
.chu-seccion-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chu-seccion-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--ch-radius-md);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--ch-gray-dark);
  text-align: left;
  width: 100%;
  transition: background 0.12s;
}
.chu-seccion-row:hover { background: var(--ch-gray-bg); }
.chu-seccion-row.is-active {
  background: var(--ch-primary-50);
  color: var(--ch-primary);
  font-weight: 600;
}

/* Dot (radio visual) */
.chu-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--ch-border);
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.12s;
}
.chu-seccion-row.is-active .chu-dot {
  border-color: var(--ch-primary);
}
.chu-seccion-row.is-active .chu-dot::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--ch-primary);
}

.chu-seccion-label { flex: 1; font-size: 14px; line-height: 1.3; }

/* Conteo sección */
.chu-cnt-pill {
  font-size: 12px;
  color: var(--ch-gray-soft);
  background: var(--ch-gray-light);
  padding: 1px 8px;
  border-radius: 999px;
  flex-shrink: 0;
  transition: all 0.12s;
}
.chu-seccion-row.is-active .chu-cnt-pill {
  background: var(--ch-white);
  color: var(--ch-primary);
}

/* ============================================================
   BUSCADOR
   ============================================================ */
.chu-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.chu-input-icon {
  position: absolute;
  left: 10px;
  color: var(--ch-gray-soft);
  font-size: 14px;
  pointer-events: none;
}
.chu-input-wrap input[type="search"] {
  width: 100%;
  padding: 10px 36px;
  border: 1px solid var(--ch-border-soft);
  border-radius: var(--ch-radius-md);
  background: var(--ch-gray-bg);
  font-size: 14px;
  color: var(--ch-gray-dark);
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.chu-input-wrap input[type="search"]::placeholder { color: var(--ch-gray-soft); }
.chu-input-wrap input[type="search"]:focus {
  background: var(--ch-white);
  border-color: var(--ch-secondary);
  outline: none;
}
.chu-input-wrap input[type="search"]:focus-visible {
  outline: 2px solid var(--ch-primary);
  outline-offset: 2px;
}
.chu-input-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ch-gray-soft);
  font-size: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ch-radius-sm);
}
.chu-input-clear:hover { color: var(--ch-primary); }

/* ============================================================
   SELECT (ORDENAR)
   ============================================================ */
.chu-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.chu-select-wrap select {
  width: 100%;
  padding: 10px 36px 10px 36px;
  border: 1px solid var(--ch-border-soft);
  border-radius: var(--ch-radius-md);
  background: var(--ch-gray-bg);
  font-size: 14px;
  color: var(--ch-gray-dark);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.chu-select-wrap select:focus {
  background: var(--ch-white);
  border-color: var(--ch-secondary);
  outline: none;
}
.chu-select-caret {
  position: absolute;
  right: 10px;
  color: var(--ch-gray-soft);
  font-size: 12px;
  pointer-events: none;
}

/* ============================================================
   BOTONES
   ============================================================ */
.chu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--ch-radius-md);
  font-family: var(--ch-font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 44px;
}
.chu-btn:hover  { transform: scale(1.04); }
.chu-btn:active { transform: scale(0.98); }

.chu-btn-primary {
  background: var(--ch-primary);
  color: var(--ch-white);
  border-color: var(--ch-primary);
}
.chu-btn-primary:hover {
  background: var(--ch-primary-600);
  border-color: var(--ch-primary-600);
}

.chu-btn-secondary {
  background: var(--ch-secondary-50);
  color: var(--ch-secondary-600);
  border-color: rgba(193,154,107,0.3);
}
.chu-btn-secondary:hover {
  background: var(--ch-secondary);
  color: var(--ch-gray-dark);
}

.chu-btn-ghost {
  background: transparent;
  color: var(--ch-gray-soft);
  border-color: var(--ch-border);
}
.chu-btn-ghost:hover {
  color: var(--ch-primary);
  border-color: var(--ch-primary);
  background: var(--ch-primary-50);
}

.chu-btn-block { width: 100%; }

.chu-btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  min-height: 36px;
}

/* ============================================================
   MAIN GRID
   ============================================================ */
.chu-main { flex: 1; min-width: 0; }

/* Results header */
.chu-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.chu-section-title {
  font-family: var(--ch-font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ch-primary);
  margin: 0;
  line-height: 1.2;
}
.chu-tomo-label {
  font-size: 13px;
  color: var(--ch-gray-soft);
  margin: 4px 0 0;
  font-style: italic;
}
.chu-results-count {
  font-size: 14px;
  color: var(--ch-gray-soft);
  margin: 0;
  flex-shrink: 0;
  padding-top: 4px;
}
.chu-results-count b {
  color: var(--ch-primary);
  font-weight: 700;
  font-size: 18px;
}

/* Grid */
.chu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* ============================================================
   CARDS
   ============================================================ */
.chu-card {
  background: var(--ch-white);
  border-radius: var(--ch-radius-lg);
  border: 1px solid var(--ch-border-soft);
  box-shadow: var(--ch-shadow-sm);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  animation: chu-card-enter 0.2s ease-out both;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}
.chu-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ch-shadow-lg);
}
.chu-card:active { transform: translateY(-2px); box-shadow: var(--ch-shadow-md); }

/* Thumbnail */
.chu-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ch-gray-light);
}
.chu-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.18) saturate(0.9);
  transition: transform 0.3s ease, filter 0.3s ease;
}
.chu-card:hover .chu-card-thumb img {
  transform: scale(1.04);
  filter: sepia(0.06) saturate(1.0);
}

/* Badge de tomo */
.chu-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}
.chu-badge-tomo-I   { background: var(--ch-primary);   color: var(--ch-white); }
.chu-badge-tomo-II  { background: var(--ch-secondary);  color: var(--ch-gray-dark); }
.chu-badge-tomo-III { background: var(--ch-gray-dark);  color: var(--ch-white); }

/* Card body */
.chu-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.chu-card-title {
  font-family: var(--ch-font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ch-gray-dark);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chu-card-year {
  font-size: 14px;
  font-weight: 600;
  color: var(--ch-secondary-600);
  margin: 0;
}
.chu-card-meta {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ch-gray-soft);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card footer (Ver) */
.chu-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--ch-border-soft);
}
.chu-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--ch-primary);
  color: var(--ch-primary);
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  transition: all 0.15s ease;
}
.chu-card:hover .chu-card-cta {
  background: var(--ch-primary);
  color: var(--ch-white);
  transform: scale(1.05);
}

/* ============================================================
   SKELETON LOADER
   ============================================================ */
.chu-skeleton-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.chu-card-skeleton {
  background: var(--ch-white);
  border-radius: var(--ch-radius-lg);
  border: 1px solid var(--ch-border-soft);
  overflow: hidden;
}
.chu-skel-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: ch-shimmer 1.4s infinite;
}
.chu-skel-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chu-skel-line {
  border-radius: 4px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: ch-shimmer 1.4s infinite;
}
.chu-skel-title { height: 18px; width: 85%; }
.chu-skel-year  { height: 14px; width: 30%; }
.chu-skel-meta  { height: 12px; width: 60%; }

@keyframes ch-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.chu-empty {
  text-align: center;
  padding: 64px 20px;
  background: var(--ch-gray-bg);
  border: 1px dashed var(--ch-border);
  border-radius: var(--ch-radius-lg);
}
.chu-empty-icon {
  font-size: 42px;
  color: var(--ch-secondary);
  margin-bottom: 16px;
}
.chu-empty-title {
  font-family: var(--ch-font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ch-primary);
  margin: 0 0 8px;
}
.chu-empty-desc {
  color: var(--ch-gray-soft);
  font-size: 14px;
  margin: 0;
}

/* Scroll sentinel + spinner */
.chu-scroll-sentinel { height: 1px; margin-top: 24px; }
.chu-load-more-spinner {
  display: flex;
  justify-content: center;
  padding: 20px;
}

/* Spinner */
.chu-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--ch-border);
  border-top-color: var(--ch-primary);
  border-radius: 50%;
  animation: chu-spin 0.9s linear infinite;
}

/* ============================================================
   MODAL DETALLE
   ============================================================ */
.chu-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 12, 8, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.chu-modal-backdrop[aria-hidden="true"] {
  display: none;
}

.chu-modal {
  background: var(--ch-white);
  border-radius: var(--ch-radius-xl);
  box-shadow: var(--ch-shadow-xl);
  width: 100%;
  max-width: 1024px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  margin: auto;
}

/* Modal head */
.chu-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--ch-gray-bg);
  border-bottom: 1px solid var(--ch-border-soft);
  flex-shrink: 0;
}
.chu-modal-head .chu-eyebrow {
  color: var(--ch-secondary-600);
  margin: 0;
}
.chu-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ch-white);
  border: 1px solid var(--ch-border-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ch-gray-soft);
  font-size: 16px;
  transition: all 0.15s;
}
.chu-modal-close:hover { color: var(--ch-primary); border-color: var(--ch-primary); }

/* Modal body */
.chu-modal-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 20px 16px;
  overflow-y: auto;
  flex: 1;
}

/* Columna imagen */
.chu-detail-image-col { display: flex; flex-direction: column; gap: 12px; }
.chu-detail-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--ch-radius-lg);
  overflow: hidden;
  background: var(--ch-gray-light);
  cursor: zoom-in;
  border: none;
  padding: 0;
  display: block;
}
.chu-detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chu-img-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
  color: white;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 14px;
  font-weight: 600;
}
.chu-img-overlay i { font-size: 24px; }
.chu-detail-image-wrap:hover .chu-img-overlay { opacity: 1; }
.chu-detail-image-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Columna texto */
.chu-detail-text-col { display: flex; flex-direction: column; gap: 16px; }
.chu-detail-title {
  font-family: var(--ch-font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--ch-primary);
  margin: 0;
  line-height: 1.2;
}
.chu-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--ch-gray-soft);
  margin: 0;
}
.chu-detail-anio {
  color: var(--ch-secondary-600);
  font-weight: 600;
}
.chu-meta-sep { opacity: 0.5; }

.chu-detail-section { display: flex; flex-direction: column; gap: 6px; }
.chu-detail-section .chu-eyebrow {
  color: var(--ch-gray-soft);
  letter-spacing: 0.12em;
}
.chu-descfisica {
  font-family: var(--ch-font-display);
  font-style: italic;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ch-gray-dark);
  margin: 0;
}
.chu-detail-content {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ch-gray-dark);
  margin: 0;
}

/* Tags */
.chu-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chu-tag {
  display: inline-flex;
  align-items: center;
  background: var(--ch-secondary-50);
  color: var(--ch-secondary-600);
  border: 1px solid rgba(193,154,107,0.2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

/* ============================================================
   SHARE BUTTONS (CRÍTICO)
   ============================================================ */
.chu-share-section {
  padding: 20px 16px;
  border-top: 1px solid var(--ch-border-soft);
  flex-shrink: 0;
}
.chu-share-section .chu-eyebrow { margin-bottom: 12px; }

/* Mobile: grid 2x2 con etiquetas completas */
.chu-share-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  /* NUNCA overflow:hidden en este elemento */
}

.chu-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--ch-radius-md);
  background: var(--ch-gray-light);
  color: var(--ch-gray-dark);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}
.chu-share-btn:hover {
  background: var(--ch-white);
  border-color: var(--ch-border);
  transform: scale(1.04);
}
.chu-share-btn .lbl-short { display: none; }
.chu-share-btn .lbl-full  { display: inline; }

/* Estado copiado */
.chu-share-btn.copied {
  background: var(--ch-primary);
  color: var(--ch-white);
  border-color: var(--ch-primary);
}

/* Short URL */
.chu-short-url {
  margin: 12px 0 0;
  font-size: 0; /* evitar espacios */
}
.chu-short-url code {
  display: inline-block;
  background: var(--ch-gray-bg);
  border: 1px solid var(--ch-border-soft);
  padding: 8px 12px;
  border-radius: var(--ch-radius-md);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px;
  color: var(--ch-gray-dark);
}

/* Modal footer */
.chu-modal-foot {
  padding: 14px 24px;
  background: var(--ch-gray-bg);
  border-top: 1px solid var(--ch-border-soft);
  flex-shrink: 0;
}

/* ============================================================
   ZOOM MODAL
   ============================================================ */
.chu-zoom-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 5, 2, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.chu-zoom-backdrop[aria-hidden="true"] { display: none; }

.chu-zoom-img {
  max-width: 92vw;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  border-radius: var(--ch-radius-md);
  animation: chu-modal-open 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1) both;
}
.chu-zoom-caption {
  color: rgba(255,255,255,0.8);
  font-family: var(--ch-font-display);
  font-style: italic;
  font-size: 14px;
  max-width: 768px;
  text-align: center;
  margin-top: 16px;
}
.chu-zoom-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: background 0.2s;
}
.chu-zoom-close:hover { background: rgba(255,255,255,0.25); }

/* ============================================================
   ADMIN MODAL (inline frontend)
   ============================================================ */
.chu-admin-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 12, 8, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.chu-admin-backdrop[aria-hidden="true"] { display: none; }

.chu-admin-container {
  background: var(--ch-white);
  border-radius: var(--ch-radius-xl);
  box-shadow: var(--ch-shadow-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
  animation: chu-modal-open 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1) both;
}

.chu-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(to right, var(--ch-primary), var(--ch-primary-600));
  color: var(--ch-white);
  flex-shrink: 0;
}
.chu-admin-head .chu-eyebrow {
  color: rgba(255,255,255,0.8);
  margin-bottom: 4px;
}
.chu-admin-title {
  font-family: var(--ch-font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--ch-white);
  margin: 0;
}
.chu-admin-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.chu-admin-close:hover { background: rgba(255,255,255,0.3); }

.chu-admin-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.chu-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Campos del formulario */
.chu-field { display: flex; flex-direction: column; gap: 4px; }
.chu-field-full { grid-column: 1 / -1; }
.chu-field-label {
  font-family: var(--ch-font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ch-gray-dark);
}
.chu-required { color: var(--ch-error); }

.chu-field input[type="text"],
.chu-field input[type="number"],
.chu-field input[type="url"],
.chu-field select,
.chu-field textarea {
  padding: 8px 12px;
  border: 1px solid var(--ch-border-soft);
  border-radius: var(--ch-radius-md);
  background: var(--ch-gray-bg);
  font-family: var(--ch-font-body);
  font-size: 14px;
  color: var(--ch-gray-dark);
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.chu-field input:focus,
.chu-field select:focus,
.chu-field textarea:focus {
  outline: none;
  background: var(--ch-white);
  border-color: var(--ch-secondary);
}
.chu-field textarea { min-height: 110px; resize: vertical; line-height: 1.65; }
.chu-field-error {
  font-size: 12px;
  color: var(--ch-error);
  font-weight: 600;
  margin: 0;
}
.chu-field.error input,
.chu-field.error select,
.chu-field.error textarea {
  border-color: var(--ch-error);
  background: #FEF2F2;
}

/* Image tabs */
.chu-image-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.chu-img-tab {
  padding: 6px 12px;
  border-radius: var(--ch-radius-sm);
  background: var(--ch-gray-light);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ch-gray-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.chu-img-tab.is-active {
  background: var(--ch-white);
  border-color: var(--ch-border);
  color: var(--ch-primary);
}
.chu-img-panel { }

/* Dropzone */
.chu-dropzone {
  border: 2px dashed var(--ch-border);
  background: var(--ch-gray-bg);
  border-radius: var(--ch-radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.chu-dropzone:hover, .chu-dropzone.drag-over {
  border-color: var(--ch-secondary);
  background: var(--ch-white);
}
.chu-dropzone-icon {
  font-size: 28px;
  color: var(--ch-secondary);
  margin-bottom: 8px;
}
.chu-dropzone-title {
  font-family: var(--ch-font-display);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 4px;
}
.chu-dropzone-sub { font-size: 12px; color: var(--ch-gray-soft); margin: 0 0 12px; }

/* Image preview */
.chu-img-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--ch-gray-bg);
  border-radius: var(--ch-radius-md);
  border: 1px solid var(--ch-border-soft);
}
.chu-img-preview img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--ch-radius-sm);
  flex-shrink: 0;
}
.chu-img-preview-info { flex: 1; min-width: 0; }
.chu-img-preview-name {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Admin footer */
.chu-admin-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  background: var(--ch-gray-bg);
  border-top: 1px solid var(--ch-border-soft);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.chu-admin-note { font-size: 12px; color: var(--ch-gray-soft); margin: 0; display: flex; align-items: center; gap: 6px; }
.chu-admin-actions { display: flex; gap: 8px; }

/* ============================================================
   TOAST
   ============================================================ */
.chu-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  background: var(--ch-gray-dark);
  color: var(--ch-white);
  padding: 12px 20px;
  border-radius: var(--ch-radius-lg);
  box-shadow: var(--ch-shadow-xl);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.chu-toast:not([hidden]) {
  animation: chu-toast-in 0.3s cubic-bezier(0.2, 0.8, 0.4, 1) both;
}
.chu-toast.leaving {
  animation: chu-toast-out 0.2s ease-in both;
}
.chu-toast i { color: var(--ch-secondary); font-size: 16px; }

/* ============================================================
   RESPONSIVE — Tablet ≥768px
   ============================================================ */
@media (min-width: 768px) {
  html { font-size: 15px; }

  .chu-root { padding: 24px; }

  .chu-mobile-bar { display: none; }

  .chu-sidebar {
    position: sticky;
    top: 24px;
    width: var(--ch-sidebar-w);
    max-width: none;
    height: auto;
    transform: none !important;
    border-radius: var(--ch-radius-lg);
    border: 1px solid var(--ch-border);
    box-shadow: var(--ch-shadow-sm);
    overflow: visible;
    align-self: flex-start;
  }
  .chu-sidebar-scrim { display: none !important; }
  .chu-sidebar-close { display: none; }

  .chu-layout {
    grid-template-columns: var(--ch-sidebar-w) 1fr;
    gap: 28px;
  }

  .chu-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .chu-skeleton-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  /* Modal body: 2 columnas */
  .chu-modal-body {
    grid-template-columns: minmax(0, 360px) 1fr;
    padding: 28px 32px;
    gap: 32px;
  }
  .chu-detail-title { font-size: 28px; }
  .chu-share-section { padding: 20px 32px; }

  /* Share tablet: row con etiquetas cortas */
  .chu-share-group {
    display: flex;
    flex-direction: row;
    gap: 12px;
    grid-template-columns: none;
  }
  .chu-share-btn {
    min-width: auto;
    padding: 10px 14px;
  }
  .chu-share-btn .lbl-full  { display: none; }
  .chu-share-btn .lbl-short { display: inline; }

  /* Form grid 2 cols */
  .chu-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   RESPONSIVE — Desktop ≥1024px
   ============================================================ */
@media (min-width: 1024px) {
  html { font-size: 16px; }

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

  /* Share desktop: etiquetas completas */
  .chu-share-btn {
    min-width: 132px;
    padding: 10px 18px;
  }
  .chu-share-btn .lbl-full  { display: inline; }
  .chu-share-btn .lbl-short { display: none; }
}

/* ============================================================
   RESPONSIVE — Wide ≥1280px
   ============================================================ */
@media (min-width: 1280px) {
  .chu-root { padding: 32px 24px 64px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
  .chu-card:hover            { transform: none !important; }
  .chu-btn:hover, .chu-btn:active { transform: none !important; }
  .chu-card:hover .chu-card-thumb img { transform: none !important; }
  .chu-share-btn:hover       { transform: none !important; }
}

/* ============================================================
   ADMIN CSS (wp-admin)
   ============================================================ */
