/* ========================================
   PÁGINA LIBROS
======================================== */

/* ENCABEZADO */
.h5m-books-hero {
  margin: 0;
  padding: clamp(90px, 10vw, 160px) 24px;
  background-color: #2c2c2c;
  color: #faf8f4;
}

.h5m-books-hero__inner {
  width: min(100%, 1280px);
  margin-inline: auto;
}

.h5m-books-hero h1 {
  position: relative;
  margin: 0 0 52px;
  color: #faf8f4;
  font-size: clamp(72px, 10vw, 150px);
  line-height: 0.85;
}

.h5m-books-hero h1::after {
  content: "";
  position: absolute;
  bottom: -26px;
  left: 0;
  width: 86px;
  height: 5px;
  border-radius: 999px;
  background-color: #ffde59;
}

.h5m-books-hero p {
  max-width: 780px;
  margin: 0;
  color: #faf8f4;
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.75;
}


/* BLOQUES DE LIBROS */
.h5m-book {
  margin: 0;
  padding: clamp(90px, 10vw, 150px) 24px;
}

.h5m-book__inner {
  width: min(100%, 1280px);
  margin-inline: auto;
}

.h5m-book__grid {
  align-items: center !important;
  gap: clamp(55px, 8vw, 120px);
  margin-bottom: 0;
}

.h5m-book--cleopatra {
  background-color: #faf8f4;
  color: #2c2c2c;
}

.h5m-book--osiris {
  background-color: #ffde59;
  color: #2c2c2c;
}

.h5m-book__cover {
  margin: 0;
  text-align: center;
}

.h5m-book__cover img {
  display: block;
  width: min(100%, 430px);
  height: auto;
  margin-inline: auto;
  border: 1px solid rgba(44, 44, 44, 0.14);
  border-radius: 4px;
  box-shadow: 0 16px 38px rgba(44, 44, 44, 0.08);
}

.h5m-book__content h2 {
  margin: 0 0 12px;
  color: #2c2c2c;
  font-size: clamp(62px, 7vw, 104px);
  line-height: 0.9;
}

.h5m-book__content h3,
.h5m-book__subtitle {
  margin: 0 0 34px;
  color: #2c2c2c;
  font-family: "Poppins", sans-serif;
  font-size: clamp(21px, 2vw, 29px);
  font-weight: 500;
  line-height: 1.35;
}

.h5m-book__content p {
  max-width: 68ch;
  margin: 0;
  color: #2c2c2c;
  font-size: 17px;
  line-height: 1.85;
}

.h5m-book__content p + p {
  margin-top: 22px;
}

.h5m-book__content .wp-block-buttons {
  margin-top: 36px;
}

.h5m-book__content .wp-block-button__link {
  min-height: 52px;
  padding: 14px 26px;
  border: 2px solid #2c2c2c;
  border-radius: 10px;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  line-height: 20px;
  text-decoration: none;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.h5m-book--cleopatra .wp-block-button__link {
  background-color: #ffde59;
  color: #2c2c2c;
}

.h5m-book--osiris .wp-block-button__link {
  background-color: #2c2c2c;
  color: #faf8f4;
}

.h5m-book__content .wp-block-button__link:hover {
  transform: translateY(-2px);
}

.h5m-book--cleopatra .wp-block-button__link:hover {
  background-color: #2c2c2c;
  color: #faf8f4;
}

.h5m-book--osiris .wp-block-button__link:hover {
  background-color: #faf8f4;
  color: #2c2c2c;
}


/* PUBLICACIONES ACADÉMICAS */
.h5m-academic {
  margin: 0;
  padding: clamp(80px, 9vw, 130px) 24px;
  background-color: #faf8f4;
  color: #2c2c2c;
  border-top: 1px solid rgba(44, 44, 44, 0.18);
}

.h5m-academic__inner {
  width: min(100%, 900px);
  margin-inline: auto;
  text-align: center;
}

.h5m-academic h2 {
  margin: 0 0 28px;
  color: #2c2c2c;
  font-size: clamp(48px, 6vw, 82px);
  line-height: 0.95;
}

.h5m-academic p {
  max-width: 760px;
  margin: 0 auto;
  color: #2c2c2c;
  font-size: 17px;
  line-height: 1.8;
}

.h5m-academic .wp-block-buttons {
  justify-content: center;
  margin-top: 34px;
}

.h5m-academic .wp-block-button__link {
  min-height: 52px;
  padding: 14px 26px;
  border: 2px solid #2c2c2c;
  border-radius: 10px;
  background-color: transparent;
  color: #2c2c2c;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  line-height: 20px;
  text-decoration: none;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.h5m-academic .wp-block-button__link:hover {
  background-color: #2c2c2c;
  color: #faf8f4;
  transform: translateY(-2px);
}


/* TABLET Y MÓVIL */
@media (max-width: 781px) {
  .h5m-books-hero {
    padding: 78px 20px;
  }

  .h5m-books-hero h1 {
    margin-bottom: 46px;
    font-size: clamp(66px, 22vw, 96px);
  }

  .h5m-book {
    padding: 78px 20px;
  }

  .h5m-book__grid {
    flex-wrap: wrap !important;
    gap: 48px;
  }

  .h5m-book__grid > .wp-block-column {
    flex-basis: 100% !important;
  }

  .h5m-book__cover img {
    width: min(100%, 340px);
  }

  .h5m-book__content h2 {
    font-size: clamp(58px, 20vw, 84px);
  }

  .h5m-book__content h3,
  .h5m-book__subtitle {
    margin-bottom: 28px;
  }

  .h5m-book__content p {
    font-size: 16px;
    line-height: 1.8;
  }

  .h5m-academic {
    padding: 72px 20px;
  }
}

/* ========================================
   CORRECCIONES
======================================== */

/* Texto del botón de publicaciones académicas */
.h5m-academic .wp-block-button__link,
.h5m-academic .wp-block-button__link:visited {
  color: var(--global-palette3, #2c2c2c) !important;
}

.h5m-academic .wp-block-button__link:hover,
.h5m-academic .wp-block-button__link:focus {
  background-color: var(--global-palette3, #2c2c2c);
  color: #faf8f4 !important;
}


/* Eliminar huecos generados entre los grupos principales */
.entry-content.single-content > .wp-block-group {
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}

/* Ocultar posibles párrafos vacíos entre secciones */
.entry-content.single-content > p:empty {
  display: none;
}


/* ========================================
   PADDING LATERAL GLOBAL EN MÓVIL
======================================== */

@media (max-width: 781px) {
  .entry-content.single-content > .wp-block-group,
  .entry-content.single-content > .wp-block-columns {
    box-sizing: border-box;
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}