/* v0.82 — Noticias: editor rico visible, thumbnails relacionadas, tablas homologadas y galería limpia. */

/* Dropdown Más: cerrado al cargar; solo se despliega por interacción. */
.primary-nav .nav-more:not([open]) .nav-more-menu {
  display: none !important;
}
.primary-nav .nav-more[open] .nav-more-menu {
  display: grid !important;
}

/* Tablas admin homologadas con Eventos. */
.admin-news-console,
.admin-attendance-console,
.admin-users-console {
  overflow: hidden;
}
.admin-news-toolbar,
.admin-attendance-toolbar,
.admin-users-toolbar {
  grid-template-columns: minmax(280px, 1.55fr) minmax(190px, .75fr) minmax(120px, .45fr) minmax(180px, .7fr);
}
.admin-news-console table,
.admin-attendance-console table,
.admin-users-console table {
  table-layout: fixed;
}
.admin-news-console th:nth-child(1) { width: 34%; }
.admin-news-console th:nth-child(2) { width: 16%; }
.admin-news-console th:nth-child(3) { width: 20%; }
.admin-news-console th:nth-child(4) { width: 11%; }
.admin-news-console th:nth-child(5) { width: 10%; }
.admin-news-console th:nth-child(6) { width: 9%; }
.admin-attendance-console th:nth-child(1) { width: 34%; }
.admin-attendance-console th:nth-child(2) { width: 20%; }
.admin-attendance-console th:nth-child(3) { width: 15%; }
.admin-attendance-console th:nth-child(4) { width: 10%; }
.admin-attendance-console th:nth-child(5) { width: 13%; }
.admin-attendance-console th:nth-child(6) { width: 8%; }
.admin-users-console th:nth-child(1) { width: 28%; }
.admin-users-console th:nth-child(2) { width: 25%; }
.admin-users-console th:nth-child(3) { width: 15%; }
.admin-users-console th:nth-child(4) { width: 12%; }
.admin-users-console th:nth-child(5) { width: 12%; }
.admin-users-console th:nth-child(6) { width: 8%; }
.admin-news-console td,
.admin-attendance-console td,
.admin-users-console td {
  vertical-align: middle;
}
.admin-news-console td strong,
.admin-attendance-console td strong,
.admin-users-console td strong,
.admin-users-console td small,
.admin-news-console td small {
  display: block;
}
.admin-news-console td small,
.admin-users-console td small {
  margin-top: .25rem;
  color: #68758e;
  line-height: 1.35;
}
.role-cell {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.role-cell .chip {
  max-width: 100%;
  white-space: normal;
  line-height: 1.1;
}

/* Editor tipo Word: que siempre tenga presencia visual en Noticias. */
.news-rich-editor-label + .rich-editor,
.news-rich-editor-label .rich-editor,
.news-editor .rich-editor {
  margin-top: .45rem;
}
.news-editor .rich-editor-toolbar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
  padding: .55rem;
  border: 1px solid #dfe6f3;
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, #ffffff, #f7f8fd);
}
.news-editor .rich-editor-surface {
  min-height: 260px;
  border-radius: 0 0 16px 16px;
}
.news-editor .rich-editor-source {
  display: none !important;
}

/* Noticias relacionadas dentro del admin: cards con miniatura real/fallback. */
.news-related-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  max-height: 360px;
  overflow: auto;
  padding-right: .35rem;
}
.news-related-card {
  display: grid !important;
  grid-template-columns: auto 64px minmax(0, 1fr);
  align-items: center !important;
  gap: .55rem !important;
  min-height: 98px !important;
  padding: .6rem !important;
}
.news-related-card img,
.news-related-fallback {
  width: 64px;
  height: 58px;
  border-radius: 13px;
}
.news-related-card img {
  object-fit: cover;
}
.news-related-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #edf2fb, #f4f0ff);
  color: #534189;
  font-weight: 900;
}
.news-related-card strong {
  display: -webkit-box !important;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.08;
}
.news-related-card small {
  display: block;
  margin-top: .25rem;
  color: #00617d;
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
}

/* Galería pública de noticias: sin outline/borde raro y con grilla uniforme. */
.news-gallery-block .gallery-grid-wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}
.news-gallery-block .gallery-thumb {
  appearance: none;
  display: block;
  width: 100%;
  height: 174px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 12px 26px rgba(31,45,80,.10);
  cursor: zoom-in;
}
.news-gallery-block .gallery-thumb:focus-visible {
  outline: 3px solid rgba(83,65,137,.45);
  outline-offset: 3px;
}
.news-gallery-block .gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .22s ease;
}
.news-gallery-block .gallery-thumb:hover img {
  transform: scale(1.035);
}
.news-gallery-block .is-gallery-hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .admin-news-toolbar,
  .admin-attendance-toolbar,
  .admin-users-toolbar,
  .news-related-picker {
    grid-template-columns: 1fr;
  }
  .news-gallery-block .gallery-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .news-gallery-block .gallery-grid-wide {
    grid-template-columns: 1fr;
  }
}
