/* Oraciones y proclamaciones + modal Midrash (estilo BTV) */
.proclamaciones { padding-top: 2.5rem; }
.proc-head { margin-bottom: 1.25rem; }
.proc-head h2 {
  margin: 0.2rem 0 0.55rem;
  font-family: var(--display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  text-transform: uppercase;
  color: var(--azu-profundo);
}
.proc-lead {
  margin: 0;
  max-width: 40rem;
  color: var(--soft);
  font-size: 1.02rem;
  line-height: 1.5;
}
.proc-toolbar { margin: 0 0 1.1rem; }
.btn-proc-intro {
  background: var(--azu);
  color: var(--white);
}
.btn-proc-intro:hover { background: var(--azu-profundo); }
.proc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 0.85rem;
}
.proc-loading { margin: 0; color: var(--soft); }
.proc-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.95rem 1rem;
  border: 2px solid rgba(0, 56, 147, 0.18);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}
.proc-card:hover {
  border-color: var(--azu);
  background: linear-gradient(180deg, #fff, #f3f7ff);
  transform: translateY(-2px);
}
.proc-card-num {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--roj);
  line-height: 1;
}
.proc-card-year {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--azu);
  margin-bottom: 0.2rem;
}
.proc-card-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--azu-profundo);
}
.proc-card-cta {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--roj);
}
.proc-fuente {
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  color: var(--soft);
}

body.proc-modal-open { overflow: hidden; }

.midrash-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, 0.62);
  z-index: 12000;
  display: none;
  backdrop-filter: blur(4px);
}
.midrash-overlay.show { display: block; }

.midrash-modal {
  --midrash-font-size: 1rem;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, 94vw);
  height: min(88vh, 900px);
  max-height: 90vh;
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(0, 56, 147, 0.2);
  z-index: 12001;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.midrash-modal.show { display: flex; }
.midrash-modal.fullscreen {
  top: 0; left: 0; right: 0; bottom: 0;
  transform: none;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border: none;
}
body:has(.midrash-modal.fullscreen.show) .midrash-overlay { display: none !important; }

.midrash-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.1rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--azu) 0%, var(--azu-profundo) 100%);
  color: #fff;
}
.midrash-hd h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}
.midrash-hd h3 span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.midrash-hd h3 svg { width: 22px; height: 22px; flex-shrink: 0; }
.midrash-hd-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
}
.midrash-hd-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}
.midrash-hd-actions > button,
.midrash-hd-tools > button,
.midrash-font-controls button {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  font: inherit;
}
.midrash-hd-actions > button:hover,
.midrash-hd-tools > button:hover,
.midrash-font-controls button:hover { background: rgba(255, 255, 255, 0.2); }
.midrash-hd-tools svg { width: 20px; height: 20px; display: block; }
.midrash-font-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0.15rem;
  flex-shrink: 0;
}
.midrash-font-controls button {
  width: 32px;
  height: 32px;
  font-weight: 700;
  font-size: 0.95rem;
}
.midrash-font-controls .font-size-label {
  min-width: 2.4rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  user-select: none;
}
#proc-copy.is-ok { background: rgba(255, 205, 0, 0.35); }

.midrash-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1.1rem 1.25rem 1.5rem;
}
.midrash-verse-info {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--ama);
}
.midrash-verse-info strong {
  color: var(--azu);
  font-size: 1.15rem;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.midrash-preview {
  margin: 0.45rem 0 0;
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  align-items: center;
}
.proc-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  background: rgba(0, 56, 147, 0.1);
  color: var(--azu);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.proc-meta { font-size: 0.85rem; }
.midrash-body {
  font-size: var(--midrash-font-size) !important;
  line-height: 1.7 !important;
  font-family: var(--verse), var(--body) !important;
  color: var(--ink) !important;
  word-break: break-word;
}
.midrash-body p { margin: 0 0 0.85em !important; }
.midrash-body h4 {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-size: 0.95em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--azu);
}
.proc-contexto {
  margin-bottom: 1.25rem;
  padding: 0.95rem 1rem;
  background: #f5f8fc;
  border-left: 4px solid var(--azu);
}
.proc-oracion { margin-bottom: 1rem; padding: 0.2rem 0; }
.proc-oracion p {
  font-style: italic;
  font-size: 1.08em;
  color: var(--azu-profundo);
}
.proc-atribucion {
  margin-top: 1rem !important;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(11, 33, 74, 0.12);
  font-size: 0.92em !important;
  font-style: normal !important;
  color: var(--soft) !important;
  font-family: var(--body) !important;
}

@media (max-width: 900px) {
  .midrash-modal {
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: none;
    top: 0; left: 0;
    transform: none;
    border: none;
  }
  .midrash-hd {
    flex-wrap: wrap;
    padding: 0.75rem 0.8rem;
  }
  .midrash-hd h3 { font-size: 0.92rem; width: 100%; }
  .midrash-hd-actions { width: 100%; justify-content: space-between; }
  .midrash-scroll { padding: 1rem; }
  .proc-grid { grid-template-columns: 1fr; }
}
