/* Iuris Tantum · Repaso de teoría: acceso desde la configuración, pantalla de fichas y ventana desde una pregunta */

/* Acceso: una tarjeta propia, separada de las pestañas de práctica */
.study-entry {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-align: left;
  padding: 0.95rem 1.1rem;
  margin-bottom: 1.1rem;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(180, 83, 9, 0.06) 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-md);
  color: var(--text-high);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.study-entry:hover,
.study-entry:focus-visible {
  border-color: var(--gold-primary);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.16) 0%, rgba(180, 83, 9, 0.1) 100%);
  outline: none;
}

.study-entry:active { transform: scale(0.99); }
.study-entry-icon { font-size: 1.6rem; line-height: 1; }
.study-entry-text { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.study-entry-text strong { font-size: 0.98rem; font-weight: 900; color: var(--gold-primary); }
.study-entry-text span { font-size: 0.8rem; color: #d1d5db; line-height: 1.4; }
.study-entry-text span strong { font-size: inherit; color: var(--gold-bright); font-weight: 800; }
.study-entry-arrow { color: var(--gold-primary); flex: none; }

/* Pantalla de repaso */
.study-intro { font-size: 0.82rem; color: var(--text-mid); margin-bottom: 0.75rem; }

.study-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}

.study-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-bright);
  background: var(--bg-inset);
  color: var(--text-mid);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.study-chip .semaphore-light { width: 8px; height: 8px; box-shadow: none; }
.study-chip:hover { color: var(--text-high); border-color: var(--gold-primary); }
.study-chip[aria-selected="true"] { color: #07080a; background: var(--gold-primary); border-color: var(--gold-primary); }

/* Ficha */
.study-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #e5e7eb;
}

.study-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.study-head h3 { font-size: 1.3rem; font-weight: 900; color: var(--text-high); }
.study-arts { font-size: 0.74rem; color: var(--text-low); font-family: 'JetBrains Mono', monospace; }

.study-perf {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-mid);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  max-width: 100%;
}

.study-perf .semaphore-light { flex: none; width: 8px; height: 8px; box-shadow: none; }

.study-frase {
  background: rgba(251, 191, 36, 0.08);
  border-left: 3px solid var(--gold-primary);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 0.95rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-high);
}

.study-frase span {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-primary);
  margin-bottom: 0.2rem;
}

.study-section h4 {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-primary);
  margin-bottom: 0.55rem;
}

.study-keys { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; padding: 0; margin: 0; }

.study-keys li {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
}

.study-keys strong { color: var(--text-high); }

.art-chip {
  margin-top: 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold-primary);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}

.art-chip::after { content: "▾"; font-size: 0.65rem; }
.art-chip[aria-expanded="true"]::after { content: "▴"; }
.art-chip:hover { border-color: var(--gold-primary); }

.art-text {
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-left: 2px solid var(--border-bright);
  font-size: 0.8rem;
  color: #d1d5db;
  line-height: 1.5;
}

.art-text strong { color: var(--gold-bright); }

.study-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem;
}

.study-number {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}

.study-number-label { font-size: 0.75rem; color: var(--text-mid); line-height: 1.35; }
.study-number strong { font-size: 1rem; color: var(--text-high); line-height: 1.3; }
.study-number-art { font-size: 0.68rem; color: var(--text-low); font-family: 'JetBrains Mono', monospace; }

.study-example {
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.95rem;
  color: #d1fae5;
}

.study-traps { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; padding: 0; margin: 0; }

.study-traps li {
  position: relative;
  padding: 0.55rem 0.8rem 0.55rem 2rem;
  background: var(--bg-inset);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
}

.study-traps li::before { content: "⚠️"; position: absolute; left: 0.6rem; top: 0.5rem; font-size: 0.8rem; }

.study-practice { margin-top: 0.25rem; }

/* Acceso desde una pregunta ya respondida */
.study-from-question { display: inline-flex; margin: 0.25rem 0 0.75rem; color: var(--gold-primary); border-color: rgba(251, 191, 36, 0.45); }

@media (max-width: 768px) {
  .study-entry { padding: 0.8rem 0.9rem; margin-bottom: 0.85rem; }
  .study-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -1rem 1rem; padding: 0 1rem; }
  .study-chips::-webkit-scrollbar { display: none; }
  .study-chip { flex: none; }
  .study-head h3 { font-size: 1.15rem; }
  .study-card { font-size: 0.88rem; }
  body[data-screen="study"] main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 1.5rem); }
}
