/* ========== ESTILOS GLOBALES ========== */
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  color: #333;
  background-color: #ffffff;
}

body.locked {
  overflow: hidden;
}

/* Ocultar contenido cuando está bloqueado */
body.locked #noticias-div {
  display: none;
}

/* ========== OVERLAY DE ACCESO ========== */
#access-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("imagenes/spiderman-tiled.jpeg");
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  z-index: 999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  box-sizing: border-box;
}

#access-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#access-box {
  background: white;
  padding: 2rem;
  border-radius: 0.75rem;
  max-width: 25rem;
  width: 90%;
  text-align: center;
  box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.3);
}

#access-box p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: #333;
}

#code-input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1.2rem;
  text-align: center;
  border: 0.125rem solid #ddd;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  letter-spacing: 0.2em;
}

#code-input:focus {
  outline: none;
  border-color: #b1001d;
}

#access-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 1.1rem;
  background: #b1001d;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

#access-btn:hover {
  background: #0056b3;
}

#error-msg {
  margin-top: 1rem;
  color: #d32f2f;
  font-weight: bold;
  min-height: 1.5rem;
}

/* ========== CABECERA ========== */
#cabecera {
  background-color: #ffffff;
}

#logo-cabecera {
  display: block;
  margin: auto;
  width: 50%;
}

/* ========== SECCIÓN DE NOTICIAS ========== */
#noticias-div {
  max-width: 900px;
  margin: 2.5rem auto;
  padding: 0 1.5rem 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ========== TARJETA ========== */
.tarjeta {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.tarjeta:hover {
  /* box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.2); */
  transform: translateY(-3px);
}

/* Imagen a la derecha cuando se añade la clase "tarjeta-invertida" */
.tarjeta-invertida {
  flex-direction: row-reverse;
}

/* Columna de la imagen */
.tarjeta-imagen {
  flex: 0 0 40%;
  max-width: 40%;
  overflow: hidden;
}

.tarjeta-imagen img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s ease;
}

.tarjeta:hover .tarjeta-imagen img {
  transform: scale(1.04);
}

/* Columna del texto */
.tarjeta-contenido {
  flex: 1;
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
}

.tarjeta-titulo {
  font-family: 'Impact';
  font-size: 30px;
  /* font-weight: 700; */
  color: #b1001d;
  margin: 0;
  line-height: 1.3;
}

.tarjeta-descripcion {
  font-family: 'Segoe UI', sans-serif;
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: #444;
  line-height: 1.7;
  margin: 0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
  .tarjeta,
  .tarjeta-invertida {
    flex-direction: column;
  }

  .tarjeta-imagen {
    flex: 0 0 auto;
    max-width: 100%;
    height: 200px;
  }

  .tarjeta-contenido {
    padding: 1.25rem 1.25rem;
  }
}