/* =========================================================
   DOCTOR AT HOME MÉXICO
   HOME DESIGN SYSTEM

   MOBILE FIRST
   Versión 1.5
   - Header optimizado
   - Hero
   - CTAs centrados
   - Imágenes Card
   - Servicios Card
   ========================================================= */

/* La imagen sale de .entry-content al construir el hero.
   Conservar su proporción sin depender de las reglas del tema. */
body:is(.home, .front-page) .dah-home-hero__visual {
  min-width: 0;
  width: 100%;
}

body:is(.home, .front-page) .dah-home-hero__visual figure {
  margin: 0;
  width: 100%;
}

body:is(.home, .front-page) .dah-home-hero__visual img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}


/* =========================================================
   1. VARIABLES
   ========================================================= */

body:is(.home, .front-page) {

  --dah-home-navy: #0b283b;
  --dah-home-navy-soft: #12344a;

  --dah-home-teal: #257d7a;
  --dah-home-teal-light: #eef8f7;

  --dah-home-blue-dark: #2349a7;
  --dah-home-blue: #2563eb;

  --dah-home-cream: #fbfaf5;

  --dah-home-text: #3e515e;
  --dah-home-muted: #687983;

  --dah-home-white: #ffffff;
  --dah-home-border: #dce8e7;
}


/* =========================================================
   2. HEADER MÓVIL
   ========================================================= */

@media (max-width: 699px) {

  body:is(.home, .front-page)
  .header-image {

    position: relative;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;

    min-height: 0 !important;
    height: 145px !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;

    background: #ffffff !important;

    border-bottom:
      1px solid rgba(18, 52, 74, 0.08);

    box-sizing: border-box;
  }


  body:is(.home, .front-page)
  .header-image img {

    display: block !important;

    width: 155% !important;
    max-width: none !important;

    height: auto !important;
    max-height: none !important;

    margin: 0 auto !important;

    object-fit: contain !important;

    transform: scale(1.12);

    transform-origin: center center;
  }


  body:is(.home, .front-page)
  .header-image {

    background-size:
      155% auto !important;

    background-position:
      center center !important;

    background-repeat:
      no-repeat !important;
  }


  body:is(.home, .front-page)
  .header-image a {

    display: flex !important;

    width: 100% !important;
    height: 100% !important;

    align-items: center !important;
    justify-content: center !important;

    overflow: hidden !important;
  }


  body:is(.home, .front-page)
  .site-header {

    margin: 0 !important;

    background:
      rgba(255, 255, 255, 0.98) !important;

    border-bottom:
      1px solid rgba(18, 52, 74, 0.10) !important;

    box-shadow:
      0 4px 14px rgba(18, 52, 74, 0.05);
  }


  body:is(.home, .front-page)
  .site-header nav {

    display: flex !important;

    min-height: 54px !important;

    align-items: center !important;

    padding:
      5px 16px !important;
  }


  body:is(.home, .front-page)
  .menu-toggle {

    margin-left: auto !important;

    padding:
      5px 8px !important;

    color:
      var(--dah-home-navy) !important;

    border-radius: 9px;
  }

}


/* =========================================================
   3. HERO
   ========================================================= */

body:is(.home, .front-page)
.dah-home-hero {

  position: relative;

  overflow: hidden;

  margin: 0;

  padding:
    30px 18px
    44px;

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  background:

    radial-gradient(
      circle at 100% 0%,
      rgba(37, 125, 122, 0.14),
      transparent 40%
    ),

    linear-gradient(
      180deg,
      #fbfaf5 0%,
      #ffffff 100%
    );
}


body:is(.home, .front-page)
.dah-home-hero::before {

  content: "";

  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 4px;

  background:
    linear-gradient(
      90deg,
      var(--dah-home-teal),
      var(--dah-home-blue)
    );
}


/* =========================================================
   4. ESTRUCTURA HERO
   ========================================================= */

body:is(.home, .front-page)
.dah-home-hero__inner {

  width: 100%;
  max-width: 1160px;

  margin: 0 auto;

  display: flex;
  flex-direction: column;
}


body:is(.home, .front-page)
.dah-home-hero__content {

  display: contents;
}


/* =========================================================
   5. ORDEN MÓVIL HERO
   ========================================================= */

body:is(.home, .front-page)
.dah-home-hero__title {
  order: 1;
}

body:is(.home, .front-page)
.dah-home-hero__text--primary {
  order: 2;
}

body:is(.home, .front-page)
.dah-home-hero__cta {
  order: 3;
}

body:is(.home, .front-page)
.dah-home-hero__visual {
  order: 4;
}

body:is(.home, .front-page)
.dah-home-hero__text--secondary {
  order: 5;
}

body:is(.home, .front-page)
.dah-home-hero__note {
  order: 6;
}


/* =========================================================
   6. H1
   ========================================================= */

body:is(.home, .front-page)
.dah-home-hero h1 {

  margin:
    0 0
    17px;

  max-width: 720px;

  color:
    var(--dah-home-navy);

  font-size:
    clamp(
      30px,
      8vw,
      36px
    );

  line-height: 1.06;

  letter-spacing: -0.03em;

  font-weight: 800;
}


/* =========================================================
   7. TEXTO HERO
   ========================================================= */

body:is(.home, .front-page)
.dah-home-hero__text {

  color:
    var(--dah-home-text);

  font-size: 16px;

  line-height: 1.62;
}


body:is(.home, .front-page)
.dah-home-hero__text--primary {

  margin:
    0 0
    22px !important;

  font-size: 17px;

  font-weight: 500;
}


body:is(.home, .front-page)
.dah-home-hero__text--secondary {

  margin:
    26px 0
    0 !important;
}


/* =========================================================
   8. TODOS LOS CTAs
   ========================================================= */

body:is(.home, .front-page)
.dah-cta-container {

  display: flex !important;

  width: 100% !important;

  justify-content: center !important;
  align-items: center !important;

  margin:
    28px auto
    36px !important;

  padding: 0 !important;

  text-align: center !important;
}


body:is(.home, .front-page)
.dah-cta {

  display: inline-flex !important;

  width:
    min(100%, 320px) !important;

  min-height: 54px;

  align-items: center;
  justify-content: center;

  box-sizing: border-box;

  padding:
    14px 22px !important;

  background:
    linear-gradient(
      90deg,
      var(--dah-home-blue-dark),
      var(--dah-home-blue)
    ) !important;

  color: #ffffff !important;

  border: 0 !important;

  border-radius:
    12px !important;

  text-decoration: none !important;

  text-align: center;

  font-size:
    17px !important;

  font-weight:
    700 !important;

  line-height:
    1.2 !important;

  box-shadow:
    0 9px 22px
    rgba(37, 99, 235, 0.24) !important;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}


body:is(.home, .front-page)
.dah-home-hero__cta {

  display: flex !important;

  width: 100% !important;

  justify-content: center !important;

  margin:
    0 0
    30px !important;

  padding: 0 !important;
}


body:is(.home, .front-page)
.dah-home-hero__button {

  width:
    min(100%, 320px) !important;

  min-height: 58px;
}


/* =========================================================
   9. IMÁGENES HOME
   ========================================================= */

body:is(.home, .front-page)
.entry-content
.wp-block-image {

  width:
    calc(100% - 16px) !important;

  max-width: 720px;

  margin:
    38px auto
    52px !important;

  padding:
    10px !important;

  box-sizing: border-box;

  background:
    #ffffff !important;

  border:
    1px solid
    rgba(18, 52, 74, 0.09) !important;

  border-radius:
    24px !important;

  box-shadow:
    0 20px 48px
    rgba(18, 52, 74, 0.17) !important;
}


body:is(.home, .front-page)
.entry-content
.wp-block-image
> figure {

  width: 100% !important;

  max-width: none !important;

  margin: 0 !important;

  padding: 0 !important;

  overflow: hidden !important;

  border-radius:
    16px !important;

  line-height: 0;
}


body:is(.home, .front-page)
.entry-content
.wp-block-image
> figure
> img {

  display: block !important;

  width: 100% !important;

  max-width: none !important;

  height: auto !important;

  margin: 0 !important;

  border-radius:
    16px !important;

  box-shadow:
    none !important;
}


/* =========================================================
   10. NOTA HERO
   ========================================================= */

body:is(.home, .front-page)
.dah-home-hero__note {

  position: relative;

  margin:
    22px 0
    0 !important;

  padding:
    12px 14px
    12px 38px;

  background:
    rgba(37, 125, 122, 0.07);

  border:
    1px solid
    rgba(37, 125, 122, 0.13);

  border-radius: 12px;

  color:
    var(--dah-home-muted);

  font-size: 14px;

  line-height: 1.45;
}


body:is(.home, .front-page)
.dah-home-hero__note::before {

  content: "✓";

  position: absolute;

  left: 14px;
  top: 11px;

  color:
    var(--dah-home-teal);

  font-weight: 800;
}


/* =========================================================
   11. H2 HOME
   ========================================================= */

body:is(.home, .front-page)
.entry-content h2 {

  margin:
    58px 0
    22px;

  color:
    var(--dah-home-navy);

  font-size: 30px;

  line-height: 1.12;

  letter-spacing: -0.025em;

  font-weight: 800;
}


/* =========================================================
   12. TARJETAS DE SERVICIOS
   La Home actual usa:
   H3 + párrafo
   ========================================================= */


/*
   PARTE SUPERIOR DE LA CARD:
   H3
*/

body:is(.home, .front-page)
.entry-content h3 {

  position: relative;

  margin:
    18px 0
    0 !important;

  padding:
    20px 48px
    8px 22px;

  box-sizing: border-box;

  background:
    linear-gradient(
      145deg,
      #ffffff 0%,
      #fbfdfd 100%
    );

  border-top:
    1px solid
    var(--dah-home-border);

  border-right:
    1px solid
    var(--dah-home-border);

  border-left:
    4px solid
    var(--dah-home-teal);

  border-bottom: 0;

  border-radius:
    18px 18px
    0 0;

  color:
    var(--dah-home-teal);

  font-size: 24px;

  line-height: 1.2;

  font-weight: 800;
}


/*
   Flecha visual.
   No modifica enlaces ni contenido.
*/

body:is(.home, .front-page)
.entry-content h3::after {

  content: "›";

  position: absolute;

  top: 50%;
  right: 18px;

  transform:
    translateY(-35%);

  color:
    var(--dah-home-teal);

  font-size: 32px;

  line-height: 1;

  font-weight: 500;

  opacity: 0.9;
}


/*
   PARTE INFERIOR DE LA CARD:
   párrafo inmediatamente posterior al H3
*/

body:is(.home, .front-page)
.entry-content h3 + p {

  margin:
    0 0
    18px !important;

  padding:
    2px 48px
    20px 22px;

  box-sizing: border-box;

  background:
    linear-gradient(
      145deg,
      #ffffff 0%,
      #fbfdfd 100%
    );

  border-right:
    1px solid
    var(--dah-home-border);

  border-bottom:
    1px solid
    var(--dah-home-border);

  border-left:
    4px solid
    var(--dah-home-teal);

  border-top: 0;

  border-radius:
    0 0
    18px 18px;

  color:
    var(--dah-home-text);

  font-size: 16px;

  line-height: 1.55;

  box-shadow:
    0 10px 24px
    rgba(18, 52, 74, 0.08);
}


/*
   Efecto de profundidad ligera.
   En móvil no depende del hover.
*/

body:is(.home, .front-page)
.entry-content h3,
body:is(.home, .front-page)
.entry-content h3 + p {

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}


/* =========================================================
   13. MOBILE PEQUEÑO
   ========================================================= */

@media (max-width: 380px) {

  body:is(.home, .front-page)
  .header-image {

    height:
      132px !important;
  }


  body:is(.home, .front-page)
  .header-image img {

    width:
      165% !important;

    transform:
      scale(1.15);
  }


  body:is(.home, .front-page)
  .dah-home-hero {

    padding-left: 16px;
    padding-right: 16px;
  }


  body:is(.home, .front-page)
  .dah-home-hero h1 {

    font-size: 29px;
  }


  body:is(.home, .front-page)
  .dah-cta {

    width:
      100% !important;
  }


  body:is(.home, .front-page)
  .entry-content h3 {

    padding:
      18px 42px
      7px 18px;

    font-size:
      22px;
  }


  body:is(.home, .front-page)
  .entry-content h3 + p {

    padding:
      2px 42px
      18px 18px;

    font-size:
      15px;
  }

}


/* =========================================================
   14. TABLET
   ========================================================= */

@media (min-width: 700px) {

  body:is(.home, .front-page)
  .dah-home-hero {

    padding:
      50px 40px
      58px;
  }


  body:is(.home, .front-page)
  .dah-home-hero__content {

    display: flex;

    flex-direction: column;

    align-items: flex-start;
  }


  body:is(.home, .front-page)
  .dah-home-hero__title,

  body:is(.home, .front-page)
  .dah-home-hero__text--primary,

  body:is(.home, .front-page)
  .dah-home-hero__text--secondary,

  body:is(.home, .front-page)
  .dah-home-hero__cta,

  body:is(.home, .front-page)
  .dah-home-hero__visual,

  body:is(.home, .front-page)
  .dah-home-hero__note {

    order: initial;
  }


  body:is(.home, .front-page)
  .dah-home-hero h1 {

    font-size:
      clamp(
        42px,
        5.8vw,
        56px
      );
  }


  body:is(.home, .front-page)
  .dah-home-hero__text {

    font-size: 17px;
  }


  body:is(.home, .front-page)
  .entry-content h3 {

    padding:
      23px 58px
      8px 26px;

    font-size:
      25px;
  }


  body:is(.home, .front-page)
  .entry-content h3 + p {

    padding:
      3px 58px
      23px 26px;

    font-size:
      17px;
  }

}


/* =========================================================
   15. ESCRITORIO
   ========================================================= */

@media (min-width: 960px) {

  body:is(.home, .front-page)
  .dah-home-hero {

    padding:
      68px 44px
      70px;
  }


  body:is(.home, .front-page)
  .dah-home-hero--with-image
  .dah-home-hero__inner {

    display: grid;

    grid-template-columns:
      minmax(0, 1.02fr)
      minmax(420px, 0.98fr);

    gap: 68px;

    align-items: center;
  }


  body:is(.home, .front-page)
  .dah-home-hero h1 {

    font-size:
      clamp(
        48px,
        4.2vw,
        62px
      );
  }


  body:is(.home, .front-page)
  .dah-home-hero__text--primary {

    font-size: 18px;
  }


  body:is(.home, .front-page)
  .dah-cta:hover,
  body:is(.home, .front-page)
  .dah-home-hero__button:hover {

    transform:
      translateY(-2px);

    filter:
      brightness(1.04);

    box-shadow:
      0 14px 30px
      rgba(37, 99, 235, 0.32) !important;
  }


  /*
     Hover de tarjetas:
     solo escritorio.
  */

  body:is(.home, .front-page)
  .entry-content h3:hover {

    border-color:
      rgba(37, 125, 122, 0.35);
  }

}
