/*
Theme Name: Historia en 5 min Child
Description: Tema hijo personalizado para Historia en 5 min
Author: Ortega Tech
Template: kadence
Version: 1.0.0
Text Domain: historia5min
*/

/* Variables de marca */
:root {
  --h5m-accent: #ffde59;
  --h5m-dark: #2c2c2c;
  --h5m-light: #faf8f4;

  --h5m-font-heading: "Bebas Neue", sans-serif;
  --h5m-font-interface: "Montserrat", sans-serif;
  --h5m-font-body: "Poppins", sans-serif;
}

.h5m-hero {
  box-sizing: border-box;
  min-height: auto !important;
  padding: clamp(64px, 6vw, 96px) 0;
}

.h5m-container > .wp-block-columns {
  margin-bottom: 0;
  align-items: center !important;
}

.h5m-container {
  width: min(1240px, calc(100% - 48px));
  margin-inline: auto;
}

.h5m-container > .wp-block-columns {
  margin-bottom: 0;
}

.h5m-socials--hero .wp-social-link {
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    margin: 0;
    border: 1px solid rgba(44, 44, 44, 0.3);
    border-radius: 50%;
    background: transparent !important;
    color: var(--h5m-dark) !important;
}

.h5m-socials--hero .wp-social-link a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 9px;
    color: inherit !important;
}

.h5m-socials--hero .wp-social-link:hover {
    border-color: var(--h5m-accent);
    background: var(--h5m-accent) !important;
    color: var(--h5m-dark) !important;
    transform: translateY(-2px);
}


/* Transición general de los botones del hero */
.h5m-hero .wp-block-button__link {
  font-family: var(--h5m-font-interface);
  font-weight: 700;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

/* Hover del botón principal */
.h5m-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
  background-color: var(--h5m-dark) !important;
  border-color: var(--h5m-dark) !important;
  color: var(--h5m-light) !important;
  transform: translateY(-2px);
}

/* Hover del botón secundario */
.h5m-hero .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background-color: var(--h5m-accent) !important;
  border-color: var(--h5m-accent) !important;
  color: var(--h5m-dark) !important;
  transform: translateY(-2px);
}

/* Navegación mediante teclado */
.h5m-hero .wp-block-button__link:focus-visible {
  outline: 3px solid var(--h5m-dark);
  outline-offset: 4px;
}

/* Fotografía del hero */
.h5m-hero .wp-block-image {
  position: relative;
  margin: 0;
}

/* Esquina superior izquierda */
.h5m-hero .wp-block-image::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  width: 72px;
  height: 72px;
  border-top: 4px solid var(--h5m-accent);
  border-left: 4px solid var(--h5m-accent);
  border-radius: 16px 0 0;
}

/* Esquina inferior derecha */
.h5m-hero .wp-block-image::after {
  content: "";
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 72px;
  height: 72px;
  border-right: 4px solid var(--h5m-accent);
  border-bottom: 4px solid var(--h5m-accent);
  border-radius: 0 0 16px;
}

.h5m-hero .wp-block-image img {
  position: relative;
  z-index: 1;
  display: block;
  border: 1px solid rgba(44, 44, 44, 0.12);
  border-radius: 14px;
}

/* Mismas dimensiones para ambos botones */
.h5m-hero .wp-block-button__link {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 205px;
  min-height: 50px;
  padding: 12px 22px;
  border: 2px solid transparent;
  line-height: 1.2;
}

/* Mantiene el borde del botón secundario */
.h5m-hero .wp-block-button.is-style-outline .wp-block-button__link {
  border-color: var(--h5m-dark);
}

/* En móvil, ambos ocupan exactamente el mismo ancho */
@media (max-width: 600px) {
  .h5m-hero .wp-block-buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .h5m-hero .wp-block-button,
  .h5m-hero .wp-block-button__link {
    width: 100%;
  }
}

/* Versión móvil */
@media (max-width: 781px) {
  .h5m-hero {
    min-height: auto !important;
    padding: 56px 0 64px;
  }

  .h5m-hero .wp-block-image::before,
  .h5m-hero .wp-block-image::after {
    width: 48px;
    height: 48px;
    border-width: 3px;
  }

  .h5m-hero .wp-block-image img {
    border-radius: 10px;
  }
}

/* ----
ABOUT ME
--- */
/* ========================================
   SOBRE MÍ — INICIO
   ======================================== */

.h5m-about {
  position: relative;
  padding: clamp(88px, 9vw, 144px) 0;
  overflow: hidden;
  background-color: var(--h5m-dark);
  color: var(--h5m-light);
}

.h5m-about__grid {
  width: min(1240px, calc(100% - 48px));
  margin-inline: auto;
  gap: clamp(48px, 7vw, 112px);
  align-items: flex-start;
}

/* Título editorial */
.h5m-about h2 {
  margin: 0;
  color: var(--h5m-light);
  font-size: clamp(4.5rem, 7vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
}

.h5m-about h2::after {
  content: "";
  display: block;
  width: 88px;
  height: 7px;
  margin-top: 28px;
  border-radius: 999px;
  background-color: var(--h5m-accent);
}

/* Textos */
.h5m-about p {
  max-width: 760px;
  margin-top: 0;
  margin-bottom: 24px;
  color: rgba(250, 248, 244, 0.78);
  line-height: 1.8;
}

.h5m-about .h5m-about__lead {
  margin-bottom: 28px;
  color: var(--h5m-light);
  font-size: clamp(1.25rem, 1.8vw, 1.65rem);
  line-height: 1.5;
}

/* Universidades */
.h5m-about .h5m-about__institutions {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(250, 248, 244, 0.18);
  color: var(--h5m-light);
  font-family: var(--h5m-font-interface);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.035em;
}

/* Botón */
.h5m-about .wp-block-buttons {
  margin-top: 36px;
}

.h5m-about .wp-block-button__link {
  box-sizing: border-box;
  min-height: 50px;
  padding: 12px 24px;
  border: 2px solid var(--h5m-accent);
  background-color: var(--h5m-accent) !important;
  color: var(--h5m-dark) !important;
  font-family: var(--h5m-font-interface);
  font-weight: 700;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease;
}

.h5m-about .wp-block-button__link:hover {
  border-color: var(--h5m-light);
  background-color: var(--h5m-light) !important;
  color: var(--h5m-dark) !important;
  transform: translateY(-2px);
}

.h5m-about .wp-block-button__link:focus-visible {
  outline: 3px solid var(--h5m-accent);
  outline-offset: 4px;
}

/* Responsive */
@media (max-width: 781px) {
  .h5m-about {
    padding: 72px 0;
  }

  .h5m-about__grid {
    width: calc(100% - 32px);
    gap: 48px;
  }

  .h5m-about h2 {
    font-size: clamp(4rem, 19vw, 5.5rem);
  }

  .h5m-about h2::after {
    width: 64px;
    height: 6px;
    margin-top: 20px;
  }

  .h5m-about .h5m-about__lead {
    font-size: 1.2rem;
  }

  .h5m-about .wp-block-button,
  .h5m-about .wp-block-button__link {
    width: 100%;
  }
}

/* ----
LIBROS 
---- */

/* ========================================
   LIBROS — INICIO
   ======================================== */

.h5m-books {
  padding: clamp(88px, 9vw, 144px) 0;
  overflow: hidden;
  background-color: var(--h5m-light);
  color: var(--h5m-dark);
}

.h5m-books__inner {
  width: min(1240px, calc(100% - 48px));
  margin-inline: auto;
}

/* Cabecera */
.h5m-books h2 {
  margin: 0;
  font-size: clamp(4.5rem, 7vw, 7.5rem);
  line-height: 0.9;
}

.h5m-books h2::after {
  content: "";
  display: block;
  width: 88px;
  height: 7px;
  margin-top: 26px;
  border-radius: 999px;
  background-color: var(--h5m-accent);
}

.h5m-books__intro {
  max-width: 780px;
  margin: 40px 0 0;
  font-size: clamp(1.15rem, 1.7vw, 1.45rem);
  line-height: 1.65;
}

/* Filas de libros */
.h5m-book {
  margin-top: clamp(72px, 8vw, 120px);
  gap: clamp(48px, 7vw, 104px);
  align-items: center !important;
}

.h5m-book + .h5m-book {
  padding-top: clamp(72px, 8vw, 120px);
  border-top: 1px solid rgba(44, 44, 44, 0.16);
}

/* Portadas */
.h5m-book .wp-block-image {
  box-sizing: border-box;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(44, 44, 44, 0.12);
  background-color: #fff;
  box-shadow: 0 14px 36px rgba(44, 44, 44, 0.08);
}

.h5m-book .wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Información */
.h5m-book h3 {
  margin: 0 0 12px;
  font-size: clamp(3rem, 5vw, 5.25rem);
  line-height: 0.95;
}

.h5m-book__subtitle {
  margin: 0 0 28px;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.4;
}

.h5m-book__description {
  max-width: 650px;
  margin: 0 0 28px;
  color: rgba(44, 44, 44, 0.78);
  line-height: 1.8;
}

.h5m-book__meta {
  margin: 0 0 32px;
  font-family: var(--h5m-font-interface);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Botones */
.h5m-book .wp-block-button__link {
  box-sizing: border-box;
  min-height: 50px;
  padding: 12px 24px;
  border: 2px solid var(--h5m-dark);
  background-color: transparent !important;
  color: var(--h5m-dark) !important;
  font-family: var(--h5m-font-interface);
  font-weight: 700;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

.h5m-book .wp-block-button__link:hover {
  border-color: var(--h5m-accent);
  background-color: var(--h5m-accent) !important;
  transform: translateY(-2px);
}

/* Publicaciones académicas */

/* Contenedor del enlace académico */
.h5m-books__academic {
  margin: clamp(104px, 10vw, 152px) 0 0 !important;
  text-align: center;
}

/* Enlace real situado dentro del párrafo */
.h5m-books__academic a {
  display: inline-block;
  padding-bottom: 5px;
  border-bottom: 3px solid var(--h5m-accent);
  box-shadow: none !important;
  color: var(--h5m-dark) !important;
  font-family: var(--h5m-font-interface);
  font-weight: 700;
  text-decoration: none !important;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.h5m-books__academic a:hover {
  border-color: var(--h5m-dark);
  color: var(--h5m-dark) !important;
  text-decoration: none !important;
}

.h5m-books__academic a:focus-visible {
  outline: 3px solid var(--h5m-accent);
  outline-offset: 5px;
}

/* Responsive */
@media (max-width: 781px) {
  .h5m-books {
    padding: 72px 0;
  }

  .h5m-books__inner {
    width: calc(100% - 32px);
  }

  .h5m-books h2 {
    font-size: clamp(4rem, 19vw, 5.5rem);
  }

  .h5m-book {
    gap: 42px;
  }

  /* En móvil, la portada de Osiris aparece antes que su texto */
  .h5m-book--osiris {
    flex-direction: column-reverse;
  }

  .h5m-book .wp-block-image {
    max-width: 320px;
  }

  .h5m-book h3 {
    font-size: clamp(3.25rem, 16vw, 4.5rem);
  }

  .h5m-book .wp-block-button,
  .h5m-book .wp-block-button__link {
    width: 100%;
  }

  .h5m-books__academic {
    width: fit-content;
    max-width: 100%;
    margin: 72px auto 0 !important;
    padding-top: 20px;
    border-top: 3px solid var(--h5m-accent);
    text-align: center;
  }
}

/* ---- 
EGIPCIO Y COPTO 
---- */

/* ========================================
   EGIPCIO CLÁSICO Y COPTO — INICIO
   ======================================== */

.h5m-languages {
    padding: clamp(88px, 9vw, 144px) 0;
    background-color: var(--h5m-accent);
    color: var(--h5m-dark);
}

.h5m-languages__inner {
    width: min(1240px, calc(100% - 48px));
    margin-inline: auto;
}

/* Cabecera */
.h5m-languages h2 {
    max-width: 900px;
    margin: 0;
    font-size: clamp(4.5rem, 7vw, 7.5rem);
    line-height: 0.9;
}

.h5m-languages h2::after {
    content: "";
    display: block;
    width: 88px;
    height: 7px;
    margin-top: 28px;
    border-radius: 999px;
    background-color: var(--h5m-dark);
}

.h5m-languages__intro {
    max-width: 900px;
    margin: 40px 0 0;
    font-size: clamp(1.2rem, 1.8vw, 1.5rem);
    line-height: 1.65;
}

/* Dos lenguas */
.h5m-languages__grid {
    margin-top: clamp(64px, 7vw, 96px);
    padding-top: clamp(48px, 5vw, 72px);
    border-top: 2px solid rgba(44, 44, 44, 0.28);
    gap: clamp(48px, 7vw, 96px);
    align-items: stretch !important;
}

.h5m-languages__grid > .wp-block-column + .wp-block-column {
    padding-left: clamp(48px, 6vw, 88px);
    border-left: 1px solid rgba(44, 44, 44, 0.28);
}

.h5m-languages__grid h3 {
    margin: 0 0 24px;
    font-size: clamp(3rem, 4.5vw, 4.75rem);
    line-height: 0.95;
}

.h5m-languages__grid p {
    margin: 0;
    line-height: 1.8;
}

/* Cierre de cursos */
.h5m-languages__cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
    margin-top: clamp(64px, 7vw, 96px);
    padding-top: clamp(40px, 5vw, 64px);
    border-top: 2px solid rgba(44, 44, 44, 0.28);
}

.h5m-languages__cta p {
    max-width: 760px;
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.75;
}

.h5m-languages__cta .wp-block-buttons {
    margin: 0;
}

.h5m-languages__cta .wp-block-button__link {
    box-sizing: border-box;
    min-height: 52px;
    padding: 13px 26px;
    border: 2px solid var(--h5m-dark);
    background-color: var(--h5m-dark) !important;
    color: var(--h5m-light) !important;
    font-family: var(--h5m-font-interface);
    font-weight: 700;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.h5m-languages__cta .wp-block-button__link:hover {
    background-color: transparent !important;
    color: var(--h5m-dark) !important;
    transform: translateY(-2px);
}

.h5m-languages__cta .wp-block-button__link:focus-visible {
    outline: 3px solid var(--h5m-dark);
    outline-offset: 4px;
}

/* Responsive */
@media (max-width: 781px) {
    .h5m-languages {
        padding: 72px 0;
    }

    .h5m-languages__inner {
        width: calc(100% - 32px);
    }

    .h5m-languages h2 {
        font-size: clamp(4rem, 18vw, 5.5rem);
    }

    .h5m-languages__grid {
        gap: 40px;
    }

    .h5m-languages__grid > .wp-block-column + .wp-block-column {
        margin-top: 8px;
        padding-top: 40px;
        padding-left: 0;
        border-top: 1px solid rgba(44, 44, 44, 0.28);
        border-left: 0;
    }

    .h5m-languages__grid h3 {
        font-size: clamp(3.25rem, 15vw, 4.5rem);
    }

    .h5m-languages__cta {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .h5m-languages__cta .wp-block-button,
    .h5m-languages__cta .wp-block-button__link {
        width: 100%;
    }
}

/* ----
VIAJES
---- */
/* ========================================
   VIAJES A EGIPTO — INICIO
   ======================================== */

.h5m-travel {
    padding: clamp(88px, 9vw, 144px) 0;
    overflow: hidden;
    background-color: var(--h5m-dark);
    color: var(--h5m-light);
}

.h5m-travel__inner {
    width: min(1240px, calc(100% - 48px));
    margin-inline: auto;
}

.h5m-travel__grid {
    gap: clamp(56px, 7vw, 104px);
    align-items: center !important;
}

/* Títulos */
.h5m-travel h2 {
    margin: 0 0 34px;
    color: var(--h5m-light);
    font-size: clamp(4.5rem, 7vw, 7.5rem);
    line-height: 0.9;
}

.h5m-travel h2::after {
    content: "";
    display: block;
    width: 88px;
    height: 7px;
    margin-top: 28px;
    border-radius: 999px;
    background-color: var(--h5m-accent);
}

.h5m-travel h3 {
    margin: 0 0 28px;
    color: var(--h5m-accent);
    font-size: clamp(2.5rem, 3.5vw, 3.75rem);
    line-height: 1;
}

/* Textos */
.h5m-travel p {
    margin-top: 0;
    margin-bottom: 24px;
    color: rgba(250, 248, 244, 0.78);
    line-height: 1.75;
}

.h5m-travel__route {
    margin: 34px 0 !important;
    padding: 22px 0;
    border-top: 1px solid rgba(250, 248, 244, 0.2);
    border-bottom: 1px solid rgba(250, 248, 244, 0.2);
    color: var(--h5m-light) !important;
    font-family: var(--h5m-font-interface);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.8 !important;
}

.h5m-travel__agency {
    margin-top: 32px !important;
    color: var(--h5m-light) !important;
    font-family: var(--h5m-font-interface);
    font-size: 0.88rem;
    font-weight: 700;
}

/* Botones */
.h5m-travel .wp-block-buttons {
    gap: 14px;
    margin-top: 38px;
}

.h5m-travel .wp-block-button__link {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 13px 24px;
    border: 2px solid transparent;
    font-family: var(--h5m-font-interface);
    font-weight: 700;
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

/* Itinerario */
.h5m-travel .wp-block-button:first-child .wp-block-button__link {
    border-color: var(--h5m-accent);
    background-color: var(--h5m-accent) !important;
    color: var(--h5m-dark) !important;
}

/* Solicitar información */
.h5m-travel .wp-block-button:nth-child(2) .wp-block-button__link {
    border-color: var(--h5m-light);
    background-color: transparent !important;
    color: var(--h5m-light) !important;
}

.h5m-travel .wp-block-button:first-child .wp-block-button__link:hover {
    border-color: var(--h5m-light);
    background-color: var(--h5m-light) !important;
    transform: translateY(-2px);
}

.h5m-travel .wp-block-button:nth-child(2) .wp-block-button__link:hover {
    border-color: var(--h5m-accent);
    background-color: var(--h5m-accent) !important;
    color: var(--h5m-dark) !important;
    transform: translateY(-2px);
}

.h5m-travel .wp-block-button__link:focus-visible {
    outline: 3px solid var(--h5m-accent);
    outline-offset: 4px;
}

/* Imagen */
.h5m-travel .wp-block-image {
    margin: 0;
}

.h5m-travel .wp-block-image img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid rgba(250, 248, 244, 0.16);
    border-radius: 16px;
}

/* Responsive */
@media (max-width: 781px) {
    .h5m-travel {
        padding: 72px 0;
    }

    .h5m-travel__inner {
        width: calc(100% - 32px);
    }

    .h5m-travel__grid {
        gap: 52px;
    }

    .h5m-travel h2 {
        font-size: clamp(4rem, 19vw, 5.5rem);
    }

    .h5m-travel h3 {
        font-size: clamp(2.75rem, 12vw, 3.75rem);
    }

    .h5m-travel__route {
        font-size: 0.84rem;
    }

    .h5m-travel .wp-block-buttons {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .h5m-travel .wp-block-button,
    .h5m-travel .wp-block-button__link {
        width: 100%;
    }

    .h5m-travel .wp-block-image img {
        border-radius: 12px;
    }
}

/* ========================================
   MÁRGENES ENTRE SECCIONES
   ======================================== */

/* Las separaciones internas se controlan con padding,
   no con márgenes automáticos de Gutenberg. */
.entry-content > .h5m-hero,
.entry-content > .h5m-about,
.entry-content > .h5m-books,
.entry-content > .h5m-languages,
.entry-content > .h5m-travel {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-block: 0 !important;
}

/* Elimina el espacio automático entre secciones consecutivas */
:is(
    .h5m-hero,
    .h5m-about,
    .h5m-books,
    .h5m-languages,
    .h5m-travel
) + :is(
    .h5m-hero,
    .h5m-about,
    .h5m-books,
    .h5m-languages,
    .h5m-travel
) {
    margin-block-start: 0 !important;
}

.navbar-logo {
  height: 48px;
  width: auto;
}

@media (max-width: 768px) {
  .navbar-logo {
    height: 40px;
  }
}

/* ========================================
   CRÉDITO ORTEGA TECH EN EL FOOTER
======================================== */

.h5m-footer-credit {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100%;
  gap: 10px !important;
}

.h5m-footer-credit p {
  flex: 0 0 auto !important;
  margin: 0 !important;
  white-space: nowrap !important;
  font-size: 18px;
  line-height: 1.2;
}

.h5m-footer-credit .wp-block-image {
  flex: 0 0 135px !important;
  width: 135px !important;
  max-width: 135px !important;
  margin: 0 !important;
}

.h5m-footer-credit .wp-block-image img {
  display: block;
  width: 100% !important;
  max-width: 135px !important;
  height: auto !important;
}

.h5m-footer-credit .wp-block-image a {
  display: block;
  width: 100%;
}


@media (max-width: 480px) {
  .h5m-footer-credit {
    gap: 8px !important;
  }

  .h5m-footer-credit p {
    font-size: 13px;
  }

  .h5m-footer-credit .wp-block-image {
    flex-basis: 95px !important;
    width: 95px !important;
    max-width: 95px !important;
  }

  .h5m-footer-credit .wp-block-image img {
    max-width: 95px !important;
  }
}

/* Logo de Historia en 5 minutos en el footer */
.h5m-footer-brand-logo {
  margin-top: -14px !important;
  margin-bottom: 0 !important;
}

.h5m-footer-brand-logo img {
  display: block;
  height: auto;
}

@media (max-width: 781px) {
  .h5m-footer-brand-logo {
    margin-top: -8px !important;
  }
}