/* ============================================ */
/* 🎯 HERO COMUNICADOS                         */
/* ============================================ */

.comunicados-hero {
  background: linear-gradient(135deg, #f0f4f8, #e6eef5);
  padding: 120px 20px 60px 20px;
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 📌 ENCABEZADO */
.comunicados-header {
  background: #ffffff;
  border-radius: 18px;
  padding: 40px 50px;
  max-width: 850px;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
}

.comunicados-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s ease;
  pointer-events: none;
}

.comunicados-header:hover {
  transform: translateY(-8px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.comunicados-header:hover::before {
  left: 100%;
}

/* Icono en el header */
.comunicados-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0f4f8, #e0e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.comunicados-header:hover .comunicados-icon {
  background: linear-gradient(135deg, #08306b, #0a427c);
  transform: rotate(360deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(8, 48, 107, 0.3);
}

.comunicados-icon img {
  width: 60%;
  height: 60%;
  object-fit: contain;
  transition: filter 0.3s ease;
}

.comunicados-header:hover .comunicados-icon img {
  filter: brightness(0) invert(1);
}

.comunicados-header h1 {
  font-size: 2.6rem;
  color: #08306b;
  margin-bottom: 18px;
  font-weight: 700;
  position: relative;
  padding-bottom: 15px;
}

.comunicados-header h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #FFD700, #08306b);
  border-radius: 2px;
}

.comunicados-header p {
  font-size: 1.15rem;
  color: #555;
  line-height: 1.7;
  max-width: 650px;
  margin: 0 auto;
}

/* ============================================ */
/* 📰 LISTA DE COMUNICADOS                     */
/* ============================================ */

.comunicados-lista {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 35px;
  padding: 60px 20px 80px 20px;
  max-width: 1250px;
  margin: 0 auto;
}

/* ============================================ */
/* 📦 TARJETA DE COMUNICADO                    */
/* ============================================ */

.comunicado-card {
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
}

.comunicado-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
  pointer-events: none;
  z-index: 1;
}

.comunicado-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.comunicado-card:hover::before {
  left: 100%;
}

/* 🖼️ IMAGEN */
.comunicado-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.3s ease;
}

.comunicado-card:hover .comunicado-img {
  transform: scale(1.08);
  filter: brightness(1.05);
}

/* 📝 CONTENIDO */
.comunicado-content {
  padding: 25px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.comunicado-content h2 {
  font-size: 1.5rem;
  color: #08306b;
  margin-bottom: 12px;
  font-weight: 600;
  line-height: 1.3;
}

/* 📅 FECHA */
.comunicado-content .fecha {
  font-size: 0.9rem;
  color: #777;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.fecha-icon {
  font-size: 1.1rem;
}

.comunicado-content p {
  font-size: 1rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* 🔗 BOTÓN */
.btn-leer {
  align-self: flex-start;
  background: linear-gradient(135deg, #08306b, #0a427c);
  color: #ffffff;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(8, 48, 107, 0.2);
}

.btn-leer:hover,
.btn-leer:focus {
  background: linear-gradient(135deg, #0a427c, #0c5298);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(8, 48, 107, 0.3);
  outline: none;
}

/* ============================================ */
/* 🪟 MODAL DE COMUNICADO                      */
/* ============================================ */

.comunicado-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.comunicado-modal.active {
  display: flex;
  animation: modalFadeIn 0.3s ease-out;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1;
}

.modal-container {
  position: relative;
  z-index: 2;
  background: white;
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.4s ease-out;
}

/* Botón cerrar */
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  color: #333;
  font-size: 30px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close:hover,
.modal-close:focus {
  background: #08306b;
  color: white;
  transform: rotate(90deg);
  outline: none;
}

/* Header del modal */
.modal-header {
  padding: 40px 40px 20px;
  border-bottom: 2px solid #f0f4f8;
}

.modal-header h2 {
  font-size: 2rem;
  color: #08306b;
  margin-bottom: 12px;
  font-weight: 700;
}

.modal-fecha {
  font-size: 0.95rem;
  color: #777;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Body del modal */
.modal-body {
  padding: 30px 40px 40px;
}

.modal-imagen {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.modal-contenido {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #444;
}

.modal-contenido h3 {
  font-size: 1.4rem;
  color: #08306b;
  margin: 25px 0 15px;
  font-weight: 600;
}

.modal-contenido p {
  margin-bottom: 20px;
}

.modal-contenido ul,
.modal-contenido ol {
  margin: 15px 0 20px 25px;
}

.modal-contenido li {
  margin-bottom: 10px;
  line-height: 1.6;
}

/* ============================================ */
/* 🎨 ANIMACIONES                              */
/* ============================================ */

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animación escalonada de tarjetas */
@media (prefers-reduced-motion: no-preference) {
  .comunicado-card {
    animation: fadeInUp 0.6s ease-out;
  }

  .comunicado-card:nth-child(1) {
    animation-delay: 0.1s;
  }

  .comunicado-card:nth-child(2) {
    animation-delay: 0.2s;
  }

  .comunicado-card:nth-child(3) {
    animation-delay: 0.3s;
  }
}

/* ============================================ */
/* 📱 DISEÑO RESPONSIVO                        */
/* ============================================ */

@media (max-width: 900px) {
  .comunicados-hero {
    padding: 100px 20px 40px;
  }

  .comunicados-header {
    padding: 35px 30px;
  }

  .comunicados-icon {
    width: 70px;
    height: 70px;
  }

  .comunicados-header h1 {
    font-size: 2.2rem;
  }

  .comunicados-header p {
    font-size: 1.05rem;
  }

  .comunicados-lista {
    gap: 25px;
    padding: 40px 15px 60px;
  }

  .modal-header {
    padding: 30px 25px 15px;
  }

  .modal-header h2 {
    font-size: 1.7rem;
  }

  .modal-body {
    padding: 20px 25px 30px;
  }

  .modal-close {
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    font-size: 26px;
  }
}

@media (max-width: 600px) {
  .comunicados-hero {
    padding: 90px 15px 30px;
  }

  .comunicados-header {
    padding: 30px 25px;
  }

  .comunicados-icon {
    width: 60px;
    height: 60px;
  }

  .comunicados-header h1 {
    font-size: 2rem;
  }

  .comunicados-header p {
    font-size: 1rem;
  }

  .comunicados-lista {
    grid-template-columns: 1fr;
  }

  .comunicado-content {
    padding: 20px 22px;
  }

  .comunicado-content h2 {
    font-size: 1.3rem;
  }

  .modal-header {
    padding: 25px 20px 12px;
  }

  .modal-header h2 {
    font-size: 1.5rem;
  }

  .modal-body {
    padding: 15px 20px 25px;
  }

  .modal-contenido {
    font-size: 1rem;
  }
}

/* ============================================ */
/* ♿ MEJORAS DE ACCESIBILIDAD                 */
/* ============================================ */

.comunicado-card:focus-within {
  outline: 3px solid #FFD700;
  outline-offset: 4px;
}

@media (prefers-contrast: high) {

  .comunicados-header h1,
  .comunicado-content h2,
  .modal-header h2 {
    color: #000;
  }

  .comunicados-header p,
  .comunicado-content p,
  .modal-contenido {
    color: #000;
  }
}

@media (prefers-reduced-motion: reduce) {

  .comunicados-header,
  .comunicados-icon,
  .comunicado-card,
  .comunicado-img,
  .btn-leer,
  .modal-close {
    transition: none;
  }

  .comunicados-header::before,
  .comunicado-card::before {
    display: none;
  }

  .comunicado-modal.active,
  .modal-container {
    animation: none;
  }
}

