/* Calculadora Alicia — estilos propios (complementan Tailwind CDN) */
:root {
  --indigo: #312E81;
  --indigo-soft: #4338CA;
  --mint: #10B981;
  --mint-dark: #059669;
  --paper: #FAFAF9;
  --ink: #1C1917;
}

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body { background: var(--paper); color: var(--ink); }

:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; border-radius: 4px; }

/* ---------- Teclado de la calculadora ---------- */
.keypad button {
  font-variant-numeric: tabular-nums;
  transition: transform .06s ease, box-shadow .06s ease;
}
.keypad button:active { transform: scale(.96); }

.calc-display {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

/* ---------- Galera (división tradicional española) ---------- */
.galera-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.galera {
  display: inline-grid;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.05rem, 2.5vw, 1.4rem);
  line-height: 1;
}
.galera .cell {
  width: 1.7ch;
  min-width: 1.7ch;
  height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.galera .divisor-box { border-left: 3px solid var(--indigo); padding-left: .5ch; }
.galera .divisor-line { border-bottom: 3px solid var(--indigo); }
.galera .cell.hl { background: #D1FAE5; color: var(--mint-dark); font-weight: 700; }
.galera .cell.hl-now { background: var(--mint); color: #fff; font-weight: 700; }
.galera .cell.dim { color: #A8A29E; }
.galera .cell.minus { color: #DC2626; }

/* ---------- Cuerpo del artículo ---------- */
.article-body { font-size: 1.075rem; line-height: 1.8; color: #292524; }
.article-body h2 {
  font-size: 1.75rem; font-weight: 800; color: var(--indigo);
  margin: 2.75rem 0 1rem; line-height: 1.25; scroll-margin-top: 5rem;
}
.article-body h3 {
  font-size: 1.3rem; font-weight: 700; color: #3730A3;
  margin: 2rem 0 .75rem; scroll-margin-top: 5rem;
}
.article-body p { margin: 0 0 1.15rem; }
.article-body ul, .article-body ol { margin: 0 0 1.25rem 1.5rem; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: .5rem; }
.article-body li::marker { color: var(--mint-dark); font-weight: 700; }
.article-body a { color: var(--indigo-soft); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.article-body a:hover { color: var(--mint-dark); }
.article-body strong { color: var(--indigo); }
.article-body blockquote {
  border-left: 4px solid var(--mint); background: #ECFDF5;
  padding: 1rem 1.25rem; border-radius: 0 .75rem .75rem 0; margin: 1.5rem 0;
  font-style: italic; color: #065F46;
}
.article-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem; }
.article-body th { background: var(--indigo); color: #fff; padding: .6rem .8rem; text-align: left; }
.article-body td { border: 1px solid #E7E5E4; padding: .6rem .8rem; }
.article-body tr:nth-child(even) td { background: #F5F5F4; }
.article-body figure { margin: 2rem 0; }
.article-body figcaption { text-align: center; font-size: .875rem; color: #78716C; margin-top: .5rem; }

/* Marcador de imagen pendiente de generar */
.img-placeholder {
  aspect-ratio: 16 / 9; width: 100%;
  border: 2px dashed #C7D2FE; border-radius: 1rem;
  background: linear-gradient(135deg, #EEF2FF 0%, #ECFDF5 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4rem; color: #4338CA; font-size: .875rem; font-weight: 600; text-align: center; padding: 1rem;
}

/* Tabla de contenidos: enlace activo */
#toc a.active { color: var(--mint-dark); font-weight: 700; }

/* FAQ accordion */
details.faq summary { cursor: pointer; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary .chev { transition: transform .2s ease; }
details.faq[open] summary .chev { transform: rotate(180deg); }

/* Impresión */
@media print {
  header, footer, nav, .keypad, .no-print, #toc { display: none !important; }
  body { background: #fff; }
  .galera-wrap { overflow: visible; }
}
