
.blog-title {
  font-family: 'Silently', serif;
  font-size: 3rem;
  margin-top: 120px;
  animation: fadeSlideIn 1.6s ease-out forwards;
  opacity: 0;
  text-align: center;
}

.blog-container {
  padding: 2rem;
  max-width: clamp(300px, 90vw, 1200px);
  margin: 0 auto;
  width: 100%;
}
/* Este es el contenedor de las tarjetas */
.posts-container {
  display: grid;
  grid-template-areas:
    "a b"
    "c d";
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  padding: 2rem;
}

.slot-a { grid-area: a; }
.slot-b { grid-area: b; }
.slot-c { grid-area: c; }
.slot-d { grid-area: d; }

.blog-post {
  margin-bottom: 3rem;
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.1);
}

.blog-post h2 {
  font-size: 2rem;
  color: #222;
}

.read-more {
  background-color: #444;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 5px;
}

.read-more:hover {
  background-color: #0077cc;
}

.hidden {
  display: none;
}

@keyframes fadeSlideIn {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

main.blog-container {
    flex: 1; /* Hace que el main ocupe todo el espacio disponible */
}

.load-more-wrapper {
  text-align: center;
  margin: 20px auto;
}

.load-more {
  background-color: #444;
  color: white;
  padding: 10px 25px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}
.load-more:hover {
  background-color: #0077cc;
}

footer {
    font-family: Arial, sans-serif;
    font-size: 1rem;
    padding: 20px;
    background: #222;
    color: white;
    text-align: center;
}

.post-card {
  background-color: var(--bg-post, #fff);
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}


/* === Modal general === */
.modal {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh; /* mejora para Safari móvil */
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* scroll suave en iOS */
}

/* Cuando está oculto */
.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

/* === Contenido del modal === */
.modal-content {
  background: white;
  padding: 2rem;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: slideFadeIn 0.4s ease-out;
  -webkit-overflow-scrolling: touch; /* scroll suave dentro del modal */
}

/* === Botón de cierre === */
.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 3.4rem; /* más grande */
  font-weight: bold;
  color: #222; /* más oscuro = más contraste */
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
  z-index: 2;
}

.modal-close:hover {
  transform: scale(1.2);
  color: #000; /* más oscuro al pasar el ratón */
}

@media (max-width: 768px) {
  .modal-close {
    font-size: 3.0rem; /* más grande en móvil aún */
    top: 10px;
    right: 15px;
  }
}

body.modal-open #languageSelector {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
  transition: opacity 0.3s ease;
}


@keyframes slideFadeIn {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.pagination-wrapper {
  text-align: center;
  margin: 30px auto;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.pagination-btn {
  background-color: #444;
  color: white;
  padding: 10px 25px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

.pagination-btn:hover {
  background-color: #0077cc;
}

.pagination-btn:disabled {
  background-color: #aaa;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .posts-container {
    grid-template-areas:
      "a"
      "b"
      "c"
      "d";
    grid-template-columns: 1fr;
  }
}

.placeholder {
  visibility: hidden;
  height: auto;
  width: 100%;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: none;
}


.post-card {
  width: 100%;
  box-sizing: border-box;
}

.posts-container > * {
  max-width: 100%;
}

.blog-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh; /* mejor que 100vh para Safari */
  z-index: 9999;
  background-color: rgba(255, 255, 255, 0.95); /* o fondo oscuro para modo oscuro */
  backdrop-filter: blur(8px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1rem;
  transition: all 0.3s ease-in-out;
  -webkit-overflow-scrolling: touch; /* Safari iOS */
}

.blog-modal.hidden {
  display: none;
}

.modal-close {
  align-self: flex-end;
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 1rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .modal-content {
    width: 90vw;
    max-width: 95vw;
    max-height: 85vh;
    padding: 1.5rem;
    font-size: 1rem;
  }

  .modal-close {
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
  }
}
