/* pages.css — estilos adicionales para las páginas de contenido de DolarBeta.
   Complementa styles.css: aquí sólo va lo que no existe en la hoja principal. */

/* ---------- Cabecera con navegación ---------- */
.info-toggle,
.theme-toggle {
  background: none;
  border: none;
  border-radius: 0;
  width: auto;
  height: auto;
  box-shadow: none;
  padding: 0.25em 0.5em;
  font-size: 1.3rem;
  transition: none;
}

.info-toggle:hover,
.theme-toggle:hover {
  transform: none;
  box-shadow: none;
}

.theme-icon {
  font-size: 1.3rem;
}

/* ---------- Migas de pan ---------- */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 0.4rem;
  opacity: 0.5;
}

/* ---------- Contenedor de contenido ---------- */
.page-body {
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
}

.page-hero {
  text-align: left;
  margin-bottom: 2rem;
}

.page-hero .hero-title {
  font-size: clamp(1.75rem, 4.5vw, 2.6rem);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.page-lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 62ch;
}

/* ---------- Panel de tasas en vivo ---------- */
.live-panel {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.live-panel-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
  flex: 0 0 auto;
}

.live-figure {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.live-value {
  font-size: clamp(2.5rem, 9vw, 3.75rem);
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.live-unit {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.live-meta {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.live-secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-value small {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 0.2rem;
}

.stat-note {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.loading-skeleton.compact {
  min-width: 4.5rem;
}

/* ---------- Artículo ---------- */
.article {
  margin-top: 3rem;
}

.article section {
  margin-bottom: 2.5rem;
}

.article h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  line-height: 1.25;
}

.article h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.5rem 0 0.6rem;
}

.article p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  max-width: 72ch;
}

.article ul,
.article ol {
  color: var(--text-secondary);
  margin: 0 0 1.15rem 0;
  padding-left: 1.35rem;
  max-width: 72ch;
}

.article li {
  margin-bottom: 0.5rem;
}

.article strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.article a:hover {
  text-decoration-thickness: 2px;
}

.article code {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Tablas ---------- */
.table-scroll {
  overflow-x: auto;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-primary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 460px;
}

.data-table caption {
  caption-side: bottom;
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table td.num,
.data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- Cajas destacadas ---------- */
.callout {
  border-left: 4px solid var(--accent-primary);
  background: var(--bg-primary);
  border-radius: 0 14px 14px 0;
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

/* ---------- Calculadora ---------- */
.converter {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}

.converter-rates {
  display: flex;
  gap: 0.4rem;
  background: var(--bg-secondary);
  padding: 0.3rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.rate-option {
  flex: 1 1 120px;
  background: transparent;
  border: none;
  border-radius: 9px;
  padding: 0.6rem 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  text-align: center;
  line-height: 1.25;
}

.rate-option:hover {
  color: var(--text-primary);
  background: var(--bg-primary);
}

.rate-option.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: var(--shadow);
}

.rate-option .rate-option-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
}

.rate-option .rate-option-value {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.converter-fields {
  display: flex;
  flex-direction: column;
}

.converter-fields.reversed {
  flex-direction: column-reverse;
}

.converter-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.converter-field label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.converter-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
}

.converter-input:focus-within {
  border-color: var(--accent-primary);
}

.converter-input input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.converter-input input::-webkit-outer-spin-button,
.converter-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.converter-input .converter-currency {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex: 0 0 auto;
}

.converter-swap {
  display: flex;
  justify-content: center;
  margin: 0.85rem 0;
}

.swap-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.swap-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.converter-result {
  margin-top: 1.4rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.converter-result strong {
  color: var(--text-primary);
}

.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.quick-amounts button {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.quick-amounts button:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* ---------- Enlaces internos ---------- */
.related {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.related-card {
  display: block;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

.related-card-title {
  display: block;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.3rem;
}

.related-card-text {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.25rem;
  margin-bottom: 1rem;
}

.footer-nav a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.footer-nav a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* ---------- Gráficos ---------- */
.chart-section + .chart-section {
  margin-top: -2rem;
}

.chart-caption {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-top: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .live-panel,
  .converter {
    padding: 1.25rem;
  }

  .converter-input input {
    font-size: 1.35rem;
  }

  .article {
    margin-top: 2rem;
  }
}
