/*
Theme Name: Ricardo Estévez
Theme URI: https://ricardoestevez.es/
Description: Tema de bloques propio para Ricardo Estévez, basado en Twenty Twenty-Five.
Author: Ricardo Estévez
Version: 0.3.3
Template: twentytwentyfive
Text Domain: ricardo-estevez
*/

:root {
  --re-red: #cc041c;
  --re-red-dark: #a80016;
  --re-green: #2f5d3a;
  --re-green-hover: #4f7f2d;
  --re-ink: #242424;
  --re-muted: #5d625f;
  --re-ivory: #f7f5f1;
  --re-white: #ffffff;
  --re-border: #e7e1dc;
  --re-shadow: 0 18px 45px rgba(36, 36, 36, 0.08);
}

html { scroll-behavior: smooth; }

body {
  color: var(--re-ink);
  background: var(--re-white);
}

.wp-site-blocks { overflow: clip; }

.re-shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.re-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(36, 36, 36, 0.08);
  backdrop-filter: blur(12px);
}

.admin-bar .re-site-header { top: 32px; }

.re-header-row {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.re-brand { gap: 26px; }

.re-logo {
  flex: 0 0 260px;
  width: 260px;
  margin: 0;
}

.re-logo img {
  width: 260px;
  height: auto;
  display: block;
}

/* Evita el recuadro al pulsar el logotipo con ratón sin ocultar el foco de teclado. */
.re-logo a:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

.re-logo a:focus-visible {
  outline: 3px solid var(--re-green-hover);
  outline-offset: 5px;
  border-radius: 4px;
}

.re-tagline {
  color: var(--re-green);
  font-size: 0.98rem;
  white-space: nowrap;
}

.re-nav {
  flex: 0 0 auto;
  font-size: 0.98rem;
}

.re-nav .wp-block-navigation__container {
  flex-wrap: nowrap;
}

.re-nav a { text-decoration: none; }
.re-nav a:hover,
.re-nav a:focus-visible { color: var(--re-green-hover); }

.re-nav .wp-block-navigation-item:last-child a {
  border: 1.5px solid var(--re-red);
  border-radius: 999px;
  color: var(--re-red);
  padding: 10px 24px;
}

.re-nav .wp-block-navigation-item:last-child a:hover,
.re-nav .wp-block-navigation-item:last-child a:focus-visible {
  background: var(--re-green-hover);
  border-color: var(--re-green-hover);
  color: var(--re-white);
}

.re-section { padding-block: clamp(64px, 8vw, 112px); }
.re-section-compact { padding-block: clamp(48px, 6vw, 82px); }
.re-soft { background: var(--re-ivory); }
.re-red-band { background: var(--re-red); color: var(--re-white); }

.re-hero {
  min-height: 620px;
  display: grid;
  align-items: center;
}

.re-hero-copy { padding-block: 68px; }

.re-eyebrow {
  color: var(--re-green);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.re-title {
  color: var(--re-green);
  font-size: clamp(2.4rem, 5vw, 4.75rem);
  line-height: 1.03;
  letter-spacing: -0.035em;
  max-width: 720px;
}

.re-lead {
  max-width: 660px;
  font-size: clamp(1.08rem, 1.7vw, 1.27rem);
  line-height: 1.75;
}

.re-prose p,
.re-prose li {
  text-align: justify;
  text-wrap: pretty;
  hyphens: auto;
}

.re-button .wp-block-button__link,
.re-button-outline .wp-block-button__link {
  min-width: 172px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.re-button .wp-block-button__link {
  background: var(--re-red);
  color: var(--re-white);
}

.re-button-outline .wp-block-button__link {
  color: var(--re-red);
  background: transparent;
  border: 1.5px solid var(--re-red);
}

.re-button .wp-block-button__link:hover,
.re-button .wp-block-button__link:focus-visible,
.re-button-outline .wp-block-button__link:hover,
.re-button-outline .wp-block-button__link:focus-visible {
  color: var(--re-white);
  background: var(--re-green-hover);
  border-color: var(--re-green-hover);
  transform: translateY(-2px);
}

/* Botón de Ideas Precocinadas en la página Pide cita. */
.page-id-202 .re-page-main .wp-block-buttons {
  justify-content: center;
}

.page-id-202 .re-page-main .wp-block-button__link {
  min-width: 260px;
  padding: 14px 28px;
  color: var(--re-white) !important;
  background: var(--re-red) !important;
  border: 1.5px solid var(--re-red) !important;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.page-id-202 .re-page-main .wp-block-button__link:hover,
.page-id-202 .re-page-main .wp-block-button__link:focus-visible {
  color: var(--re-white) !important;
  background: var(--re-green-hover) !important;
  border-color: var(--re-green-hover) !important;
  transform: translateY(-2px);
}

.re-portrait {
  margin: 0;
  height: min(640px, 67vw);
  min-height: 500px;
}

.re-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 18%;
  border-radius: 28px;
}

.re-section-title {
  color: var(--re-green);
  font-size: clamp(2rem, 3.7vw, 3.35rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.re-two-col { gap: clamp(40px, 7vw, 92px); align-items: center; }

.re-photo-card img {
  width: 100%;
  border-radius: 26px;
  box-shadow: var(--re-shadow);
}

.re-experience-photo {
  width: 100%;
  margin: 0;
}

.re-experience-photo img {
  width: 100%;
  height: 520px;
  display: block;
  object-fit: cover;
  object-position: 58% 50%;
  border-radius: 26px;
  box-shadow: var(--re-shadow);
}

.re-services { gap: 24px; align-items: stretch; }

.re-services > .wp-block-column {
  display: flex;
}

.re-card {
  width: 100%;
  height: 100%;
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
  background: var(--re-white);
  border: 1px solid var(--re-border);
  border-radius: 22px;
  box-shadow: 0 12px 34px rgba(36, 36, 36, 0.05);
}

.re-card img {
  width: 104px;
  height: 104px;
  display: block;
  object-fit: contain;
  margin-inline: auto;
}

.re-card figure {
  width: 100%;
  min-height: 104px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.re-card h3 {
  min-height: 2.7em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--re-green);
  text-align: center;
}
.re-card p { text-align: center; }

.re-logo-grid { gap: 22px; align-items: center; }

.re-logo-cell {
  min-height: 132px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--re-white);
  border: 1px solid var(--re-border);
  border-radius: 18px;
  overflow: hidden;
}

.re-logo-cell figure {
  width: 100%;
  height: 86px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.re-logo-cell img {
  max-width: 100%;
  max-height: 78px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  filter: none;
  opacity: 1;
}

.re-collaborations { background: var(--re-ivory); }

.re-collab-title { margin-bottom: 34px; }

.re-collab-title::after {
  content: "";
  width: 64px;
  height: 4px;
  margin: 18px auto 0;
  display: block;
  background: var(--re-green-hover);
  border-radius: 999px;
}

.re-client-grid,
.re-media-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.re-media-title { margin-top: clamp(58px, 7vw, 86px); }

.re-client-logo {
  min-width: 0;
  min-height: 130px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--re-white);
  border: 1px solid var(--re-border);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(36, 36, 36, 0.035);
}

.re-client-logo a {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.re-client-logo img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 82px;
  display: block;
  object-fit: contain;
}

.re-client-logo--portrait img { max-height: 92px; }

.re-cta { text-align: center; }
.re-cta p { max-width: 760px; margin-inline: auto; text-align: center; }
.re-cta .wp-block-buttons { justify-content: center; }
.re-red-band .re-section-title { color: var(--re-white); }
.re-red-band .re-button .wp-block-button__link { background: var(--re-white); color: var(--re-red); }
.re-red-band .re-button .wp-block-button__link:hover { background: var(--re-green-hover); color: var(--re-white); }

.re-blog-teaser {
  width: min(980px, 100%);
  margin-inline: auto;
  padding: clamp(40px, 6vw, 72px);
  border: 1px solid var(--re-border);
  border-radius: 28px;
  background: var(--re-white);
  box-shadow: var(--re-shadow);
}

.re-blog-teaser > .wp-block-group__inner-container { padding: 0; }
.re-blog-teaser .re-section-title { margin-top: 0; }
.re-blog-teaser > p { max-width: 760px; margin-inline: auto; }

.re-site-footer {
  padding-block: 34px;
  background: var(--re-ink);
  color: rgba(255,255,255,.82);
  font-size: .9rem;
}

.re-site-footer a { color: var(--re-white); text-decoration-thickness: 1px; }
.re-site-footer a:hover { color: #b8da9a; }

.re-footer-row { gap: 18px; }
.re-footer-links { gap: 18px; }

.re-page-main {
  width: min(900px, calc(100% - 40px));
  margin-inline: auto;
  padding-block: clamp(54px, 8vw, 100px);
}

.re-page-main .wp-block-post-title { color: var(--re-green); }
.re-page-main .wp-block-post-content p { text-align: justify; hyphens: auto; }
.re-page-main .wp-block-post-content :where(h2,h3,h4) { color: var(--re-green); }

.page-id-559 .re-page-main > .wp-block-post-featured-image {
  display: none;
}

.re-page-intro {
  max-width: 780px;
  margin: 0 auto clamp(42px, 6vw, 72px);
}

.re-native-grid {
  display: grid;
  gap: 24px;
}

.re-service-index {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
  margin-inline: calc(50% - 50vw);
  padding-inline: max(24px, calc((100vw - 1180px) / 2));
}

.re-service-index > .re-native-card {
  grid-column: span 2;
  height: 100%;
  margin-block-start: 0 !important;
}

.re-service-index > .re-native-card:nth-child(n+4) {
  grid-column: span 3;
}

.re-native-card,
.re-price-card {
  padding: clamp(26px, 3vw, 38px);
  border: 1px solid var(--re-border);
  border-radius: 22px;
  background: var(--re-white);
  box-shadow: 0 12px 34px rgba(36, 36, 36, 0.05);
}

.re-native-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.re-native-card > .wp-block-buttons { margin-top: auto; }

.re-native-card img {
  width: 108px;
  height: 108px;
  object-fit: contain;
  margin-inline: auto;
}

.re-native-card h2 {
  font-size: clamp(1.3rem, 2vw, 1.65rem);
}

.re-native-card p {
  text-align: center !important;
  hyphens: none !important;
}

.re-page-section-title {
  margin-top: clamp(64px, 9vw, 112px);
}

.re-pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  margin-top: 38px;
}

.re-price-card {
  display: flex;
  flex-direction: column;
}

.re-price-card .wp-block-buttons { margin-top: auto; }

.re-price {
  color: var(--re-red);
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  font-weight: 700;
  line-height: 1;
}

.re-price-card li::marker { color: var(--re-green-hover); }

.re-inline-cta {
  margin-top: clamp(58px, 8vw, 96px);
  padding: clamp(34px, 5vw, 60px);
  border-radius: 24px;
  background: var(--re-ivory);
  text-align: center;
}

.re-inline-cta p { text-align: center !important; }
.re-inline-cta .wp-block-buttons { justify-content: center; }

.re-team-intro,
.re-about-intro { align-items: center; }

.re-team-intro .re-photo-card img,
.re-about-intro .re-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 52% 15%;
}

.re-about-intro + .re-about-copy {
  margin-top: clamp(48px, 7vw, 78px);
}

.re-about-copy > p {
  max-width: 780px;
  margin-inline: auto;
}

.re-post-card {
  display: grid;
  grid-template-columns: minmax(210px, 32%) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 46px);
  align-items: center;
  padding-block: 34px;
  border-bottom: 1px solid var(--re-border);
}

.re-post-card:not(:has(.wp-block-post-featured-image img)) {
  grid-template-columns: 1fr;
}

.re-post-card .wp-block-post-featured-image {
  width: 100%;
  margin: 0;
}

.re-post-card .wp-block-post-featured-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 18px;
}

.re-post-card .wp-block-post-title { margin-top: 0; }
.re-post-card .wp-block-post-excerpt__excerpt { text-align: left; }

/* Los testimonios sanitarios antiguos no deben reaparecer al cambiar de tema. */
.page-id-131 .wp-block-post-content > .wp-block-paragraph:empty,
.page-id-131 .wp-block-post-content > .wp-block-spacer:last-of-type,
.page-id-131 .wp-block-post-content > h2:has(+ .wp-block-uagb-testimonial),
.page-id-131 .wp-block-post-content > .wp-block-uagb-testimonial {
  display: none !important;
}

@media (max-width: 960px) {
  .re-tagline { display: none; }
  .re-logo { flex-basis: 230px; width: 230px; }
  .re-logo img { width: 230px; }
  .re-experience-photo img { height: 460px; }
  .re-header-row { min-height: 74px; }
  .re-hero { min-height: 0; }
  .re-hero-copy { padding-block: 30px 8px; text-align: center; }
  .re-hero-copy .wp-block-buttons { justify-content: center; }
  .re-portrait { min-height: 420px; height: 500px; }
  .re-portrait img { object-position: 51% 12%; }
  .re-services { gap: 18px; }
  .re-client-grid,
  .re-media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .re-service-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .re-service-index > .re-native-card,
  .re-service-index > .re-native-card:nth-child(n+4) { grid-column: span 1; }
  .re-pricing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 782px) {
  .admin-bar .re-site-header { top: 46px; }
  .re-site-header {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 8px 24px rgba(36, 36, 36, 0.08);
  }
  .re-shell { width: min(100% - 28px, 680px); }
  .re-section { padding-block: 58px; }
  .re-section-compact { padding-block: 44px; }
  .re-header-row { gap: 14px; }
  .re-brand { gap: 0; }
  .re-logo { flex-basis: 196px; width: 196px; }
  .re-logo img { width: 196px; }
  .re-nav .wp-block-navigation__responsive-container-open,
  .re-nav .wp-block-navigation__responsive-container-close {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--re-green);
    background: var(--re-white);
    border: 1.5px solid var(--re-green);
    border-radius: 999px;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
  }
  .re-nav .wp-block-navigation__responsive-container-open:hover,
  .re-nav .wp-block-navigation__responsive-container-open:focus-visible,
  .re-nav .wp-block-navigation__responsive-container-close:hover,
  .re-nav .wp-block-navigation__responsive-container-close:focus-visible {
    color: var(--re-white);
    background: var(--re-green-hover);
    border-color: var(--re-green-hover);
  }
  .re-nav .wp-block-navigation__responsive-container.is-menu-open {
    padding: 72px 28px 32px;
    background: var(--re-ivory);
  }
  .re-nav .is-menu-open .wp-block-navigation__responsive-container-content,
  .re-nav .is-menu-open .wp-block-navigation__container,
  .re-nav .is-menu-open .wp-block-navigation-item {
    width: 100%;
  }
  .re-nav .is-menu-open .wp-block-navigation__container {
    gap: 10px;
    align-items: stretch;
  }
  .re-nav .is-menu-open .wp-block-navigation-item a {
    display: block;
    padding: 13px 16px;
    color: var(--re-green);
    background: var(--re-white);
    border-radius: 14px;
  }
  .re-nav .is-menu-open .wp-block-navigation-item:last-child a {
    color: var(--re-white);
    text-align: center;
    background: var(--re-red);
    border-color: var(--re-red);
  }
  .re-experience-photo img { height: auto; aspect-ratio: 4 / 3; }
  .re-title { font-size: clamp(2.35rem, 12vw, 3.65rem); }
  .re-lead { font-size: 1.05rem; line-height: 1.65; }
  .re-portrait { min-height: 0; height: 390px; }
  .re-portrait img { border-radius: 20px; object-position: 51% 10%; }
  .re-two-col { gap: 34px; }
  .re-prose p,
  .re-prose li,
  .re-page-main .wp-block-post-content p { text-align: left; hyphens: none; }
  .re-services .wp-block-column + .wp-block-column { margin-top: 0; }
  .re-client-grid,
  .re-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .re-client-logo { min-height: 108px; padding: 14px; }
  .re-client-logo img { max-height: 68px; }
  .re-client-logo--portrait img { max-height: 76px; }
  .re-logo-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .re-logo-grid .wp-block-column { width: auto !important; margin: 0 !important; }
  .re-logo-cell { min-height: 104px; padding: 14px; }
  .re-logo-cell figure { height: 68px; }
  .re-logo-cell img { max-width: 100%; max-height: 64px; }
  .re-footer-row { align-items: flex-start !important; }
  .re-footer-links { justify-content: flex-start; }
  .re-service-index {
    grid-template-columns: 1fr;
    margin-inline: 0;
    padding-inline: 0;
  }
  .re-native-card,
  .re-price-card { padding: 28px 22px; }
  .re-post-card { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 480px) {
  .re-shell { width: min(100% - 24px, 440px); }
  .re-logo { flex-basis: 182px; width: 182px; }
  .re-logo img { width: 182px; }
  .re-button .wp-block-button__link,
  .re-button-outline .wp-block-button__link { width: 100%; min-width: 0; }
  .re-hero-copy .wp-block-buttons { width: 100%; }
  .re-hero-copy .wp-block-button { flex: 1 1 100%; }
  .re-portrait { height: 325px; }
  .re-logo-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .re-site-footer { font-size: .84rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
