/* ============================
   BOLETINES — BMH ABOGADOS
   Archivo: components-boletines.css
=============================== */

.section-newsletters {
  padding: 3rem 0 4rem;
  background: #121215; /* fondo oscuro tipo BMH */
}

.section-newsletters .container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Encabezado */
.newsletters-header {
  margin-bottom: 1.5rem;
}

.newsletters-header-main {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.newsletters-header h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin: 0;
}

.newsletters-tag {
  padding: 0.18rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #d1a855;
  color: #f5f2e6;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.newsletters-subtitle {
  margin: 0;
  color: #c2c2cb;
  max-width: 620px;
  line-height: 1.6;
}

/* Buscador */
.newsletters-search {
  margin-top: 1.3rem;
}

.newsletters-search input[type="search"] {
  width: 100%;
  max-width: 360px;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #3a3a44;
  background: #17171c;
  color: #f5f5f5;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.newsletters-search input[type="search"]::placeholder {
  color: #7f8089;
}

.newsletters-search input[type="search"]:focus {
  border-color: #d1a855;
  box-shadow: 0 0 0 1px rgba(209, 168, 85, 0.35);
  background: #191920;
}

/* Slider contenedor */
.newsletters-slider {
  position: relative;
  margin-top: 2.2rem;
}

.newsletters-track {
  display: flex;
  gap: 1.6rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.newsletters-track::-webkit-scrollbar {
  height: 6px;
}
.newsletters-track::-webkit-scrollbar-track {
  background: transparent;
}
.newsletters-track::-webkit-scrollbar-thumb {
  background: #44444f;
  border-radius: 999px;
}

/* Cada tarjeta ocupa ancho fijo para slider lineal */
.newsletter-card {
  position: relative;
  flex: 0 0 min(100%, 420px);
  background: radial-gradient(circle at top left, #262631 0, #111118 55%);
  border-radius: 20px;
  padding: 1.1rem 1.2rem 1.25rem;
  border: 1px solid #23232c;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  scroll-snap-align: start;
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    border-color 0.25s ease, background 0.25s ease;
}

.newsletter-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.75);
  border-color: #d1a855;
  background: radial-gradient(circle at top left, #343442 0, #111118 55%);
}

.newsletter-card.is-hidden {
  display: none;
}

/* Cintillo dorado fino arriba */
.nl-ribbon {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #d1a855, #f1d488);
}

/* Contenido interno */
.nl-inner {
  position: relative;
  z-index: 1;
}

.nl-category {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: #f6e3b4;
}

.nl-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.nl-meta {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: #a8a8b2;
}

.nl-excerpt {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #dadade;
}

/* Botón */
.nl-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  border: 1px solid #d1a855;
  background: transparent;
  color: #f5f5f5;
  font-size: 0.85rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease,
    box-shadow 0.15s ease;
}

.nl-button::after {
  content: "→";
  font-size: 0.95rem;
}

.nl-button:hover {
  background: #d1a855;
  color: #111118;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

/* Flechas del slider */
.nl-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #d1a855;
  background: rgba(12, 12, 16, 0.9);
  color: #f5f5f5;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.nl-arrow--left {
  left: -0.3rem;
}

.nl-arrow--right {
  right: -0.3rem;
}

.nl-arrow:hover {
  background: #d1a855;
  color: #111118;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  transform: translateY(-50%) scale(1.04);
}

/* En móviles ocultamos flechas si estorban y usamos solo scroll táctil */
@media (max-width: 640px) {
  .nl-arrow {
    display: none;
  }
}

/* ===== MODAL BOLETINES ===== */
body.modal-open {
  overflow: hidden;
}

.nl-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.nl-modal.is-open {
  display: block;
}

.nl-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.nl-modal-dialog {
  position: relative;
  z-index: 1;

  width: min(1100px, 94vw);
  height: min(88vh, 900px);

  margin: 6vh auto 0;
  background: #0c0c10;
  border: 1px solid rgba(209, 168, 85, 0.75);
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.85);

  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.nl-modal-close {
  position: absolute;
  right: 14px;
  top: 10px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(209, 168, 85, 0.7);
  background: rgba(12, 12, 16, 0.7);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.nl-modal-close:hover {
  background: #d1a855;
  color: #0c0c10;
}

.nl-modal-body {
  flex: 1;
  padding: 14px;
  padding-top: 54px; /* espacio para botón cerrar */
}

.nl-modal-body iframe,
.nl-modal-body img {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
  background: #111118;
}

/* imagen: que no se deforme */
.nl-modal-body img {
  object-fit: contain;
}

/* Responsive: en móvil ocupa más alto */
@media (max-width: 680px) {
  .nl-modal-dialog {
    width: 96vw;
    height: 90vh;
    margin-top: 4vh;
    border-radius: 16px;
  }
  .nl-modal-body {
    padding: 12px;
    padding-top: 52px;
  }
}

/* --- Ajuste: scroll interno SOLO si hace falta --- */
.nl-modal-body {
  flex: 1;
  padding: 14px;
  padding-top: 54px;
  overflow: auto; /* aquí vive el scroll (no en la página) */
}

/* PDF: ocupa todo el alto disponible */
.nl-modal-body iframe {
  width: 100%;
  height: calc(90vh - 110px); /* se adapta a pantalla */
  border: 0;
  border-radius: 12px;
  background: #111118;
}

/* Imagen: se ve grande y centrada, y si es alta permite scroll */
.nl-modal-body img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: #111118;
}
