/* Text Viewer Widget — CSS */

.tv-widget {
  display: block;
  width: 100%;
}

/* ── Texto clicable ─── */
.tv-trigger {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-block;
  max-width: 100%;
  font-family: inherit;
  font-size: inherit;
  text-align: inherit;
  color: #2B579A;
  text-decoration: underline;
  transition: color 0.15s, opacity 0.15s;
  line-height: inherit;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
.tv-trigger:hover,
.tv-trigger:focus,
.tv-trigger:active {
  color: #1a3d6b;        /* default hover color — overridden by Elementor when user sets one */
  opacity: 1;            /* let color change be visible, not faded */
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  outline: none;
}

/* ── Panel inline ─── */
.tv-inline-panel {
  display: none;
  width: 100%;
  margin-top: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

/* ── Modal overlay ─── */
.tv-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.tv-modal-overlay.is-open { display: flex; }

.tv-modal {
  background: #fff;
  border-radius: 12px;
  width: min(760px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: tvIn 0.18s ease;
  overflow: hidden;
}
@keyframes tvIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Toolbar compartida ─── */
.tv-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  flex-shrink: 0;
  background: #f5f7fa;
  border-bottom: 1px solid #e0e0e0;
}

.tv-viewer-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 12px;
}

.tv-btn-close {
  font-size: 12px;
  padding: 5px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  color: #444;
  flex-shrink: 0;
  transition: background 0.12s;
}
.tv-btn-close:hover { background: #f0f0f0; }

/* ── Contenido del visor ─── */
.tv-viewer-content {
  padding: 2rem 2.5rem;
  overflow-y: auto;
  flex: 1;
  font-size: 15px;
  line-height: 1.8;
  color: #222;
  background: #fff;
}
.tv-viewer-content p  { margin: 0 0 0.9rem; }
.tv-viewer-content h1 { font-size: 22px; font-weight: 700; margin: 0 0 1rem; }
.tv-viewer-content h2 { font-size: 18px; font-weight: 700; margin: 1.5rem 0 0.75rem; }
.tv-viewer-content h3 { font-size: 16px; font-weight: 600; margin: 1.25rem 0 0.5rem; }
.tv-viewer-content ul,
.tv-viewer-content ol { padding-left: 1.5rem; margin: 0.5rem 0 0.9rem; }
.tv-viewer-content li { margin-bottom: 4px; }
.tv-viewer-content a  { color: #2B579A; }
.tv-viewer-content strong { font-weight: 700; }
.tv-viewer-content em     { font-style: italic; }

@media (max-width: 600px) {
  .tv-viewer-content { padding: 1.2rem; }
  .tv-modal { max-height: 92vh; }
}
