
/* =========================================================
   PILATES MEDICINA FUNCIONAL — RESPONSIVE v1.1
   Optimizado para desktop, notebook, tablet, iPhone y Android
   ========================================================= */

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  overflow-x: clip;
  min-width: 320px;
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

.wp-site-blocks,
main {
  overflow-x: clip;
}

/* Evita que títulos o URLs largas rompan el ancho */
h1, h2, h3, h4, h5, h6,
p, a, span {
  overflow-wrap: break-word;
}

h1, h2, h3 {
  text-wrap: balance;
}

/* Ancho seguro para bloques wide */
:where(.alignwide) {
  width: min(calc(100% - 40px), 1180px);
  margin-inline: auto;
}

/* ---------- HEADER / MENÚ ---------- */
.pmf-shell {
  position: relative;
  z-index: 50;
  border-bottom: 1px solid rgba(32,52,45,.10);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.pmf-shell > .wp-block-group {
  min-width: 0;
}

.pmf-shell .wp-block-site-logo,
.pmf-shell .wp-block-site-title {
  flex-shrink: 0;
}

.pmf-shell .wp-block-site-title {
  line-height: 1.08;
}

/* ---------- TIPOGRAFÍA / BLOQUES ---------- */
.pmf-kicker {
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 800;
  font-size: clamp(.70rem, 1.6vw, .78rem);
}

.pmf-hero-title {
  letter-spacing: -.045em;
  max-width: 800px;
}

/* ---------- IMÁGENES ---------- */
.pmf-rounded,
.pmf-rounded img {
  border-radius: clamp(18px, 3vw, 28px) !important;
  overflow: hidden;
}

.pmf-image-tall {
  width: 100%;
}

.pmf-image-tall img {
  display: block;
  width: 100%;
  min-height: clamp(430px, 52vw, 580px);
  max-height: 680px;
  object-fit: cover;
  object-position: center;
}

/* ---------- TARJETAS ---------- */
.pmf-card {
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 1px solid rgba(32,52,45,.10);
  border-radius: clamp(18px, 2.5vw, 24px);
  box-shadow: 0 10px 32px rgba(32,52,45,.045);
  transition: transform .2s ease, box-shadow .2s ease;
}

@media (hover:hover) and (pointer:fine) {
  .pmf-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 48px rgba(32,52,45,.09);
  }
}

.pmf-feature-cover {
  width: 100%;
  min-height: clamp(290px, 35vw, 360px);
  border-radius: clamp(18px, 3vw, 26px);
  overflow: hidden;
}

.pmf-feature-cover img {
  transition: transform .6s ease;
}

@media (hover:hover) and (pointer:fine) {
  .pmf-feature-cover:hover img {
    transform: scale(1.025);
  }
}

/* ---------- BOTONES ---------- */
.wp-block-button__link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
}

.pmf-contact {
  width: 100%;
  border: 1px solid rgba(32,52,45,.10);
  border-radius: clamp(20px, 3vw, 30px);
  box-shadow: 0 18px 50px rgba(32,52,45,.08);
}

.pmf-footer {
  border-top: 1px solid rgba(32,52,45,.10);
}

/* =========================================================
   NOTEBOOK / TABLET HORIZONTAL
   ========================================================= */
@media (max-width: 1024px) {
  :where(.alignwide) {
    width: min(calc(100% - 36px), 940px);
  }

  /* Disminuye espacios amplios puestos inline desde Gutenberg */
  main > .wp-block-group.alignfull {
    padding-top: 68px !important;
    padding-bottom: 68px !important;
  }

  #inicio {
    padding-top: 56px !important;
    padding-bottom: 60px !important;
  }

  .pmf-image-tall img {
    min-height: 470px;
  }
}

/* =========================================================
   TABLET / TELÉFONOS GRANDES
   Forzamos layout apilado antes del breakpoint por defecto
   de Gutenberg para evitar columnas demasiado angostas.
   ========================================================= */
@media (max-width: 900px) {
  :where(.alignwide) {
    width: min(calc(100% - 34px), 760px);
  }

  /* Columnas principales: una debajo de otra */
  #inicio .wp-block-columns,
  #medicina-funcional .wp-block-columns,
  #longevidad .wp-block-columns,
  #contacto .wp-block-columns {
    flex-wrap: wrap !important;
  }

  #inicio .wp-block-column,
  #medicina-funcional .wp-block-column,
  #longevidad .wp-block-column,
  #contacto .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
    min-width: 0;
  }

  #inicio .wp-block-columns {
    gap: 30px !important;
  }

  #medicina-funcional .wp-block-columns,
  #longevidad .wp-block-columns,
  #contacto .wp-block-columns {
    gap: 24px !important;
  }

  .pmf-mobile-stack {
    gap: 30px !important;
  }

  .pmf-image-tall img {
    min-height: 0;
    height: clamp(360px, 60vw, 520px);
  }

  /* Las filas de tarjetas no quedan comprimidas en 3 columnas */
  #pilares > .wp-block-group > .wp-block-columns {
    flex-wrap: wrap !important;
    gap: 18px !important;
  }

  #pilares > .wp-block-group > .wp-block-columns > .wp-block-column {
    flex-basis: calc(50% - 9px) !important;
    min-width: 0;
  }

  #pilares .pmf-card {
    min-height: 100%;
  }

  /* Ejes visuales: mantienen 2 columnas en tablet */
  .pmf-feature-cover {
    min-height: 300px;
  }
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 680px) {
  :where(.alignwide) {
    width: calc(100% - 30px);
  }

  /* Header compacto y seguro */
  .pmf-shell > .wp-block-group.alignwide {
    width: calc(100% - 24px);
    padding-top: 11px !important;
    padding-bottom: 11px !important;
    gap: 8px !important;
  }

  .pmf-shell .wp-block-site-logo img {
    width: 40px !important;
    height: auto !important;
  }

  .pmf-shell .wp-block-site-title {
    font-size: clamp(13px, 4vw, 16px) !important;
    max-width: calc(100vw - 112px);
    white-space: normal;
  }

  /* Oculta la bajada del logo para ganar aire en teléfonos */
  .pmf-shell .wp-block-site-title + p {
    display: none;
  }

  main > .wp-block-group.alignfull {
    padding-top: 52px !important;
    padding-bottom: 52px !important;
  }

  #inicio {
    padding-top: 38px !important;
    padding-bottom: 48px !important;
  }

  .pmf-kicker {
    letter-spacing: .105em;
  }

  .pmf-hero-title {
    font-size: clamp(2.55rem, 12.4vw, 4rem) !important;
    line-height: .98 !important;
    letter-spacing: -.042em;
    margin-top: 14px !important;
    margin-bottom: 18px !important;
  }

  #inicio .has-medium-font-size,
  #medicina-funcional .has-medium-font-size,
  #longevidad .has-medium-font-size {
    font-size: 1.03rem !important;
    line-height: 1.62;
  }

  #inicio .wp-block-buttons {
    width: 100%;
    gap: 10px !important;
    margin-top: 24px !important;
  }

  #inicio .wp-block-button {
    width: 100%;
  }

  #inicio .wp-block-button__link {
    width: 100%;
    min-height: 50px;
    padding-inline: 18px !important;
  }

  .pmf-image-tall img {
    width: 100%;
    height: clamp(310px, 103vw, 440px);
    min-height: 0;
    object-position: center;
  }

  /* Todas las grillas pasan a una sola columna */
  #pilares > .wp-block-group > .wp-block-columns {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    margin-block: 14px !important;
  }

  #pilares > .wp-block-group > .wp-block-columns > .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
  }

  #pilares > .wp-block-group > .wp-block-columns > .wp-block-column:empty {
    display: none;
  }

  #pilares .pmf-card {
    min-height: 0;
    padding: 22px !important;
  }

  #pilares .pmf-card h3 {
    margin-top: 25px !important;
    margin-bottom: 9px !important;
    font-size: clamp(1.38rem, 6vw, 1.7rem) !important;
  }

  #pilares .pmf-card p {
    font-size: .98rem;
    line-height: 1.55;
  }

  /* Covers visuales */
  .wp-block-columns:has(.pmf-feature-cover) {
    gap: 14px !important;
  }

  .wp-block-columns:has(.pmf-feature-cover) > .wp-block-column {
    flex-basis: 100% !important;
  }

  .pmf-feature-cover {
    min-height: 280px !important;
    border-radius: 20px;
  }

  .pmf-feature-cover .wp-block-cover__inner-container {
    padding: 22px;
  }

  .pmf-feature-cover h3 {
    font-size: clamp(1.45rem, 7vw, 1.9rem) !important;
  }

  #longevidad .pmf-rounded img {
    max-height: 410px;
    width: 100%;
    object-fit: cover;
  }

  /* Contacto */
  .pmf-contact {
    padding: 26px !important;
  }

  .pmf-contact .wp-block-buttons,
  .pmf-contact .wp-block-button,
  .pmf-contact .wp-block-button__link {
    width: 100%;
  }

  .pmf-contact .wp-block-button__link {
    min-height: 50px;
  }

  .pmf-footer {
    padding-top: 28px !important;
    padding-bottom: 28px !important;
  }

  .pmf-footer .wp-block-group.alignwide {
    width: calc(100% - 30px);
    gap: 8px !important;
    align-items: flex-start !important;
  }

  .pmf-footer p {
    width: 100%;
    margin-block: 0;
  }
}

/* =========================================================
   MOBILE PEQUEÑO: 320–420 px
   ========================================================= */
@media (max-width: 420px) {
  :where(.alignwide) {
    width: calc(100% - 24px);
  }

  main > .wp-block-group.alignfull {
    padding-top: 44px !important;
    padding-bottom: 44px !important;
  }

  #inicio {
    padding-top: 30px !important;
  }

  .pmf-hero-title {
    font-size: clamp(2.35rem, 12.5vw, 3.15rem) !important;
  }

  #inicio .has-medium-font-size {
    font-size: 1rem !important;
  }

  .pmf-image-tall img {
    height: clamp(285px, 104vw, 390px);
    border-radius: 18px !important;
  }

  .pmf-feature-cover {
    min-height: 245px !important;
  }

  .pmf-contact {
    padding: 21px !important;
  }

  .wp-block-button__link {
    font-size: .95rem;
  }
}

/* =========================================================
   LANDSCAPE EN TELÉFONOS
   ========================================================= */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 950px) {
  #inicio {
    padding-top: 32px !important;
    padding-bottom: 36px !important;
  }

  .pmf-image-tall img {
    height: 320px;
    min-height: 0;
  }
}

/* Reduce animaciones si el usuario lo solicita en su dispositivo */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* =========================================================
   MENÚ v1.5 — VERSIÓN SIMPLE (enlaces HTML puros)
   Ya no se usa el bloque Navigation de WordPress: son <a>
   normales dentro de un bloque HTML personalizado. Así el
   menú no depende de ningún JavaScript ni de la lógica
   responsive del bloque core — es imposible que "no se vea",
   porque siempre es HTML y CSS simple.
   ========================================================= */

.pmf-simple-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 20px;
  margin-left: auto;
}

.pmf-simple-nav a {
  color: #20342D;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  padding: 6px 2px;
}

.pmf-simple-nav a:hover,
.pmf-simple-nav a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 900px) {
  .pmf-header-row {
    flex-wrap: wrap !important;
    row-gap: 12px !important;
  }

  .pmf-simple-nav {
    width: 100%;
    justify-content: center;
    gap: 10px 18px;
    margin-left: 0;
    padding-top: 10px;
    border-top: 1px solid rgba(32,52,45,.10);
  }

  .pmf-simple-nav a {
    font-size: 0.92rem;
    padding: 8px 4px;
  }
}

@media (max-width: 420px) {
  .pmf-simple-nav {
    gap: 8px 14px;
  }

  .pmf-simple-nav a {
    font-size: 0.88rem;
  }
}
