/* consulta-articulo.css — vista del artículo (breadcrumb, cabecera, cuerpo, fracciones, notas de reforma, navegación) y panel de resultados de búsqueda. */

body {
  overflow-x: hidden;
}

/* ============== MAIN ============== */
main {
  padding: 3rem 4rem 6rem;
  max-width: 940px;
  min-height: calc(100vh - 71px);
}

/* ============== BREADCRUMB ============== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.breadcrumb-item {
  color: var(--ink-dim);
}

.breadcrumb-item.is-current {
  color: var(--royal);
  font-weight: 500;
}

.breadcrumb-sep {
  color: var(--ink-faint);
  user-select: none;
}

/* ============== CABECERA DEL ARTÍCULO ============== */
.art-header {
  border-bottom: 2px solid var(--navy);
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
  position: relative;
}

.art-eyebrow {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--royal);
  margin-bottom: 0.4rem;
}

.art-number {
  font-family: var(--display);
  font-weight: 800;
  font-size: 4rem;
  line-height: 0.95;
  color: var(--navy);
  letter-spacing: -0.04em;
}

.art-location {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-top: 1rem;
  font-family: var(--body);
  font-style: italic;
  line-height: 1.5;
  max-width: 70ch;
}

/* ============== CUERPO DEL ARTÍCULO ============== */
.art-body {
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
  max-width: 70ch;
}

.art-body p {
  margin-bottom: 1.1rem;
}

.art-body p:first-child::first-letter {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.4em;
  float: left;
  line-height: 0.9;
  margin: 0.1em 0.1em 0 0;
  color: var(--royal);
}

/* Fracciones romanas y literales */
.art-body .frac {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.7rem;
  margin: 0.6rem 0 0.6rem 0.5rem;
  padding: 0.1rem 0;
}

.art-body .frac-num {
  font-family: var(--display);
  font-weight: 700;
  color: var(--royal);
  font-size: 0.95em;
  text-align: right;
}

.art-body .frac-body {
  color: var(--ink-soft);
}

/* Notas de reforma */
.art-body .reform-note {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--royal);
  font-style: normal;
  margin: 1rem 0;
  padding: 0.5rem 0.8rem;
  background: var(--royal-tint);
  border-left: 3px solid var(--royal);
  border-radius: 0 5px 5px 0;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* Highlight de búsqueda dentro del artículo */
.art-body mark.search-hit {
  background: var(--highlight);
  color: var(--ink);
  font-weight: 700;
  padding: 0 3px;
  border-radius: 3px;
}

/* ============== NAVEGACIÓN ENTRE ARTÍCULOS ============== */
.art-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.nav-btn {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 1rem 1.3rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  color: var(--ink);
  font-family: var(--body);
}

.nav-btn:hover:not(:disabled) {
  border-color: var(--royal);
  box-shadow: 0 4px 16px rgba(0, 69, 142, 0.1);
  transform: translateY(-2px);
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  display: block;
  margin-bottom: 0.35rem;
}

.nav-target {
  font-family: var(--display);
  font-weight: 700;
  color: var(--navy);
  font-size: 1.05rem;
}

.nav-btn:hover:not(:disabled) .nav-target {
  color: var(--royal);
}

.nav-btn:nth-child(2) {
  text-align: right;
}

/* ============== SEARCH RESULTS ============== */
.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 3, 40, 0.25);
  max-height: 60vh;
  overflow-y: auto;
  display: none;
  z-index: 100;
}

.search-results.active { display: block; }

.search-results-header {
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--paper-soft);
  position: sticky;
  top: 0;
}

.search-result {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--rule-soft);
  cursor: pointer;
  transition: background 0.12s ease;
}

.search-result:hover { background: var(--paper-soft); }
.search-result:last-child { border-bottom: none; }

.sr-top {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}

.sr-art {
  font-family: var(--display);
  font-weight: 700;
  color: var(--navy);
  font-size: 0.92rem;
}

.sr-art-num {
  color: var(--royal);
}

.sr-loc {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sr-snippet {
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.55;
}

.sr-snippet mark {
  background: var(--highlight);
  color: var(--ink);
  font-weight: 700;
  padding: 0 3px;
  border-radius: 2px;
}

.search-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--ink-dim);
  font-style: italic;
  font-size: 0.88rem;
}

/* ============== ANIMATIONS ============== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ============== RESPONSIVE ============== */
@media (max-width: 980px) {
  main { padding: 2rem 1.25rem 4rem; }
  .art-number { font-size: 2.8rem; }
  .art-body { font-size: 1rem; }
  .art-nav { grid-template-columns: 1fr; }
}

/* ============== PRINT ============== */
@media print {
  header, aside.index, .art-nav { display: none; }
  main { padding: 0; max-width: 100%; }
  body { background: white; color: black; }
  .art-number { color: black; }
}
