/* V9.1.5 Edge Mortgage Hub final layout fix
   Loaded after the main styles to avoid Edge / Windows grid auto-sizing differences. */

@media (min-width: 901px) {
  .home-page .v8-home-hub-wrap {
    display: grid !important;
    grid-template-columns: minmax(300px, 0.82fr) minmax(560px, 1.18fr) !important;
    gap: clamp(40px, 5vw, 72px) !important;
    align-items: center !important;
  }

  .home-page .v8-home-tool-grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 18px !important;
    width: 100% !important;
    max-width: 740px !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    overflow: visible !important;
  }

  .home-page .v8-tool-card {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) 44px !important;
    grid-template-rows: auto auto auto !important;
    grid-template-areas:
      "icon tag arrow"
      "icon title arrow"
      "icon desc arrow" !important;
    column-gap: 20px !important;
    row-gap: 8px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 148px !important;
    padding: 24px 28px !important;
    border-radius: 28px !important;
    box-sizing: border-box !important;
  }

  .home-page .v8-tool-card::before {
    content: "" !important;
    position: static !important;
    grid-area: icon !important;
    width: 58px !important;
    height: 58px !important;
    border-radius: 18px !important;
    transform: none !important;
    align-self: center !important;
    justify-self: center !important;
    background: linear-gradient(145deg, rgba(217,182,109,.28), rgba(255,255,255,.10)) !important;
    border: 1px solid rgba(255,255,255,.16) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22) !important;
  }

  .home-page .v8-tool-card::after {
    pointer-events: none !important;
  }

  .home-page .v8-tool-card .hub-tool-tag,
  .home-page .hub-tool-tag {
    grid-area: tag !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: max-content !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 7px 13px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  .home-page .v8-tool-card h3 {
    grid-area: title !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    font-size: clamp(1.42rem, 1.55vw, 1.78rem) !important;
    line-height: 1.12 !important;
    letter-spacing: -0.025em !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
  }

  .home-page .v8-tool-card p {
    grid-area: desc !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 620px !important;
    font-size: 1rem !important;
    line-height: 1.55 !important;
    color: rgba(255,255,255,.78) !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;
  }

  .home-page .v8-tool-card strong {
    grid-area: arrow !important;
    position: static !important;
    transform: none !important;
    justify-self: end !important;
    align-self: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    margin: 0 !important;
    background: rgba(217,182,109,.18) !important;
    color: var(--hyf-champagne) !important;
    font-size: 1.45rem !important;
    line-height: 1 !important;
  }

  html.is-edge .home-page .v8-tool-card,
  html.is-edge .home-page .v8-tool-card:hover {
    backface-visibility: hidden !important;
    transform: translateZ(0) !important;
  }

  html.is-edge .home-page .v8-tool-card:hover {
    transform: translateY(-3px) translateZ(0) !important;
  }
}

@media (min-width: 901px) and (max-width: 1120px) {
  .home-page .v8-home-hub-wrap {
    grid-template-columns: 1fr !important;
    gap: 34px !important;
  }
  .home-page .v8-home-hub-copy,
  .home-page .v8-home-hub-copy .section-title,
  .home-page .v8-home-hub-copy .lead {
    max-width: 860px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }
  .home-page .v8-home-tool-grid {
    max-width: 760px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media (max-width: 900px) {
  .home-page .v8-home-tool-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .home-page .v8-tool-card {
    min-height: auto !important;
  }
}

/* ================================
   V9.1.6 Edge dynamic class final override
   Issue: Edge initially renders the Chrome layout, then hyf-components adds html.is-edge.
   Earlier html.is-edge rules were more specific and changed the cards back to narrow vertical cards.
   These highest-specificity rules are loaded last and keep the Chrome-style stacked layout.
   ================================ */
@media (min-width: 901px) {
  html.is-edge body.home-page section.v8-home-hub-section .v8-home-hub-wrap {
    display: grid !important;
    grid-template-columns: minmax(300px, 0.82fr) minmax(560px, 1.18fr) !important;
    gap: clamp(40px, 5vw, 72px) !important;
    align-items: center !important;
  }

  html.is-edge body.home-page section.v8-home-hub-section .v8-home-hub-copy,
  html.is-edge body.home-page section.v8-home-hub-section .v8-home-hub-copy .section-title,
  html.is-edge body.home-page section.v8-home-hub-section .v8-home-hub-copy .lead {
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  html.is-edge body.home-page section.v8-home-hub-section .v8-home-tool-grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 18px !important;
    width: 100% !important;
    max-width: 740px !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    overflow: visible !important;
  }

  html.is-edge body.home-page section.v8-home-hub-section .v8-tool-card {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) 44px !important;
    grid-template-rows: auto auto auto !important;
    grid-template-areas:
      "icon tag arrow"
      "icon title arrow"
      "icon desc arrow" !important;
    column-gap: 20px !important;
    row-gap: 8px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 148px !important;
    height: auto !important;
    padding: 24px 28px !important;
    border-radius: 28px !important;
    box-sizing: border-box !important;
    flex: none !important;
    transform: translateZ(0) !important;
    overflow: hidden !important;
  }

  html.is-edge body.home-page section.v8-home-hub-section .v8-tool-card::before {
    content: "" !important;
    position: static !important;
    grid-area: icon !important;
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    min-height: 58px !important;
    border-radius: 18px !important;
    transform: none !important;
    align-self: center !important;
    justify-self: center !important;
  }

  html.is-edge body.home-page section.v8-home-hub-section .v8-tool-card .hub-tool-tag {
    grid-area: tag !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: fit-content !important;
    max-width: max-content !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 7px 13px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  html.is-edge body.home-page section.v8-home-hub-section .v8-tool-card h3 {
    grid-area: title !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    font-size: clamp(1.42rem, 1.55vw, 1.78rem) !important;
    line-height: 1.12 !important;
    letter-spacing: -0.025em !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
  }

  html.is-edge body.home-page section.v8-home-hub-section .v8-tool-card p {
    grid-area: desc !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 620px !important;
    font-size: 1rem !important;
    line-height: 1.55 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
  }

  html.is-edge body.home-page section.v8-home-hub-section .v8-tool-card strong {
    grid-area: arrow !important;
    position: static !important;
    transform: none !important;
    justify-self: end !important;
    align-self: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 50% !important;
    margin: 0 !important;
    font-size: 1.45rem !important;
    line-height: 1 !important;
  }

  html.is-edge body.home-page section.v8-home-hub-section .v8-tool-card:hover {
    transform: translateY(-3px) translateZ(0) !important;
  }
}

@media (min-width: 901px) and (max-width: 1120px) {
  html.is-edge body.home-page section.v8-home-hub-section .v8-home-hub-wrap {
    grid-template-columns: 1fr !important;
    gap: 34px !important;
  }
  html.is-edge body.home-page section.v8-home-hub-section .v8-home-hub-copy,
  html.is-edge body.home-page section.v8-home-hub-section .v8-home-hub-copy .section-title,
  html.is-edge body.home-page section.v8-home-hub-section .v8-home-hub-copy .lead {
    max-width: 860px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }
  html.is-edge body.home-page section.v8-home-hub-section .v8-home-tool-grid {
    max-width: 760px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
