/* Progressive desktop header: keep the critical actions visible while the
   lower-priority links make room before the full mobile drawer takes over. */
@media (min-width: 900px) and (max-width: 1600px) {
  .topbar .nav {
    display: flex !important;
    align-items: center !important;
    max-width: 1400px !important;
    gap: 14px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar .nav > a:first-child,
  .topbar .nav > .btn {
    width: max-content !important;
    flex: 0 0 auto !important;
  }

  .topbar .navlinks,
  .topbar .nav-links {
    display: flex !important;
    gap: 14px !important;
    min-width: 0;
  }

  /* First to go: editorial / recruiting links. */
  .topbar .navlinks > a[href*="blog"],
  .topbar .navlinks > a[href*="careers"],
  .topbar .nav-links > a[href*="blog"],
  .topbar .nav-links > a[href*="careers"] {
    display: none !important;
  }

  /* Keep the desktop header active through the compact laptop range. */
  .topbar .hamburger {
    display: none !important;
  }

  .topbar .nav-phone {
    display: inline-flex !important;
  }

  .topbar .mobile-header-call,
  .mob-sticky {
    display: none !important;
  }
}

@media (min-width: 900px) and (max-width: 1440px) {
  /* Next to go: non-critical home and market links. */
  .topbar .navlinks > a:first-child,
  .topbar .navlinks > a[href*="index"],
  .topbar .navlinks > a[href*="springfield"],
  .topbar .navlinks > a[href*="kansas-city"],
  .topbar .nav-links > a:first-child,
  .topbar .nav-links > a[href*="index"],
  .topbar .nav-links > a[href*="springfield"],
  .topbar .nav-links > a[href*="kansas-city"] {
    display: none !important;
  }
}

@media (min-width: 900px) and (max-width: 1180px) {
  /* The highlighted quote link yields to the critical contact actions next. */
  .topbar .navlinks > a[href*="instant-quote"],
  .topbar .nav-links > a[href*="instant-quote"] {
    display: none !important;
  }

  .topbar .navlinks,
  .topbar .nav-links {
    gap: 10px !important;
  }

  .topbar .nav-phone span {
    display: none !important;
  }

  .topbar .nav-phone {
    padding: 9px !important;
  }
}

/* At this point the logo, critical links, phone, and CTA no longer fit
   comfortably together, so the complete mobile drawer takes over. */
@media (min-width: 900px) and (max-width: 1050px) {
  .topbar .navlinks,
  .topbar .nav-links,
  .topbar .nav-phone,
  .topbar > .nav > .btn {
    display: none !important;
  }

  .topbar .hamburger {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
}

/* -----------------------------------------------------------------------
   Responsive spacing and priority corrections
   Keep these shared so every market page receives the same final cascade.
   ----------------------------------------------------------------------- */

/* Keep the two market links readable when they share one footer list item. */
.footer-col ul li > a + a {
  margin-left: 12px;
}

@media (max-width: 560px) {
  .footer-col ul li > a + a {
    margin-left: 8px;
  }
}

/* Desktop remains active until the critical actions can no longer fit.
   Lower-priority links are removed by the rules above before this drawer
   breakpoint is reached. */
@media (min-width:1051px) and (max-width:1279px) {
  .topbar .navlinks,
  .topbar .nav-links {
    display:flex !important;
    min-width:0 !important;
    flex:1 1 auto !important;
    gap:10px !important;
  }

  .topbar .nav-phone {
    display:inline-flex !important;
    flex:0 0 auto !important;
    padding:8px 12px !important;
  }

  .topbar .nav-phone span {
    display:inline !important;
  }

  .topbar > .nav > .btn {
    display:inline-flex !important;
    flex:0 0 auto !important;
    min-height:40px !important;
    padding:0 12px !important;
    font-size:10px !important;
  }

  .topbar .hamburger {
    display:none !important;
  }
}

@media (min-width:900px) and (max-width:1279px) {
  .topbar .nav {
    gap:10px !important;
    padding-left:12px !important;
    padding-right:12px !important;
  }

  .topbar .navlinks > a,
  .topbar .nav-links > a,
  .topbar .nav-drop > a {
    font-size:13px !important;
  }
}

/* The homepage had a late mobile override that created a large empty band
   below the hero. Keep the trust message in normal document flow. */
@media (max-width:899px) {
  .trust-strip {
    padding-top:18px !important;
  }

  .scene {
    min-height:0 !important;
  }

  body:not(:has(.scene)) .section:not([style*="padding-top:0"]) {
    padding-top:52px !important;
    padding-bottom:52px !important;
  }

  body:not(:has(.scene)) .cta-band {
    padding-top:52px !important;
    padding-bottom:52px !important;
  }

  body:not(:has(.scene)) .amp-footer {
    padding-top:40px !important;
  }

  body:not(:has(.scene)) .info-box {
    padding:20px !important;
  }

  body:not(:has(.scene)) .calc-wrap {
    padding:22px !important;
    gap:24px !important;
  }

  body:not(:has(.scene)) {
    padding-bottom:calc(72px + env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width:640px) {
  body:not(:has(.scene)) .section:not([style*="padding-top:0"]) {
    padding:48px 16px !important;
  }

  body:not(:has(.scene)) .cta-band {
    padding:44px 16px !important;
  }

  body:not(:has(.scene)) .amp-footer {
    padding:32px 16px 0 !important;
  }

  body:not(:has(.scene)) .info-box {
    padding:18px !important;
  }

  body:not(:has(.scene)) .calc-wrap {
    padding:20px !important;
    gap:20px !important;
  }

  body:not(:has(.scene)) .blog-card-img {
    height:160px !important;
    min-height:160px !important;
  }

  body:not(:has(.scene)) .blog-card.featured .blog-card-img {
    height:180px !important;
    min-height:180px !important;
  }

  body:not(:has(.scene)) .blog-card-body {
    padding:18px !important;
  }

  body:not(:has(.scene)) .blog-hero {
    padding-top:calc(var(--navh) + 24px) !important;
    padding-bottom:28px !important;
  }
}

@media (max-width:375px) {
  body:not(:has(.scene)) .calc-wrap {
    padding:18px !important;
  }
}

@media (max-height:700px) and (max-width:899px) {
  .scene {
    min-height:540px !important;
  }
}

/* -----------------------------------------------------------------------
   Footer balance pass
   The contact cards are the tallest footer content. Keep them in a compact
   three-up row on desktop so the brand and navigation columns do not leave a
   large empty field beside a long single-column contact stack.
   ----------------------------------------------------------------------- */
@media (min-width:900px) {
  .amp-footer {
    padding-top:32px !important;
  }

  .amp-footer .footer-inner {
    width:calc(100% - 40px) !important;
    max-width:1180px !important;
    padding:0 0 12px !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    column-gap:16px !important;
    row-gap:26px !important;
    align-items:start !important;
  }

  .amp-footer .footer-brand p {
    max-width:38ch !important;
    margin:12px 0 12px !important;
    line-height:1.5 !important;
  }

  .amp-footer .footer-badges {
    gap:16px !important;
    min-height:80px !important;
  }

  .amp-footer .footer-badges img {
    height:80px !important;
    transform:none !important;
    flex:0 0 auto !important;
  }

  .amp-footer .footer-col h5 {
    margin:0 0 14px !important;
  }

  .amp-footer .footer-col ul {
    gap:10px !important;
  }

  .amp-footer .footer-col ul li > a + a {
    margin-left:0 !important;
  }

  .amp-footer .footer-col ul li > a + a::before {
    content:"•";
    display:inline-block;
    margin:0 10px 0 8px;
    color:var(--green,#caff00);
  }

  .amp-footer .footer-col:last-child {
    grid-column:1 / -1 !important;
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    column-gap:16px !important;
    row-gap:10px !important;
    align-items:start !important;
  }

  .amp-footer .footer-col:last-child > h5 {
    grid-column:1 / -1 !important;
    margin:0 !important;
  }

  .amp-footer .footer-col:last-child > .f-card {
    height:100% !important;
    margin:0 !important;
    padding:13px 16px !important;
  }

  .amp-footer .footer-col:last-child > .f-card .f-loc {
    margin:0 0 8px !important;
  }

  .amp-footer .footer-col:last-child > .f-card .f-phone {
    margin-bottom:6px !important;
  }

  .amp-footer .footer-col:last-child > .f-card .f-addr {
    line-height:1.45 !important;
  }

  .amp-footer .footer-col:last-child > .f-card .f-note {
    margin:4px 0 0 !important;
  }

  .amp-footer .footer-col:last-child > .f-loc {
    grid-column:1 !important;
    grid-row:3 !important;
    margin:0 !important;
  }

  .amp-footer .footer-col:last-child > .f-hours {
    grid-column:1 !important;
    grid-row:4 !important;
    margin:0 !important;
    line-height:1.4 !important;
  }

  .amp-footer .footer-col:last-child > .footer-phone,
  .amp-footer .footer-col:last-child > .f-phone {
    grid-column:2 !important;
    grid-row:3 / span 2 !important;
    align-self:center !important;
    margin:0 !important;
  }

  .amp-footer .footer-col:last-child > .btn {
    grid-column:3 !important;
    grid-row:3 / span 2 !important;
    align-self:center !important;
    justify-self:start !important;
    margin:0 !important;
  }

  .amp-footer .footer-bar {
    width:calc(100% - 40px) !important;
    max-width:1180px !important;
    padding:12px 0 16px !important;
  }
}

@media (max-width:899px) {
  .amp-footer {
    padding:40px 16px 0 !important;
  }

  .amp-footer .footer-inner {
    width:100% !important;
    max-width:none !important;
    padding:0 0 22px !important;
  }

  .amp-footer .footer-brand {
    padding:0 0 22px !important;
  }

  .amp-footer .footer-badges {
    gap:12px !important;
    min-height:70px !important;
  }

  .amp-footer .footer-badges img {
    height:70px !important;
    transform:none !important;
    flex:0 0 auto !important;
  }

  .amp-footer .footer-col {
    padding:22px 0 0 !important;
  }

  .amp-footer .footer-col h5 {
    margin:0 0 16px !important;
  }

  .amp-footer .footer-col:last-child {
    display:block !important;
  }

  .amp-footer .footer-col:last-child > .f-card {
    height:auto !important;
    margin:0 0 10px !important;
    padding:14px 14px !important;
  }

  .amp-footer .footer-col:last-child > .f-loc {
    margin:20px 0 8px !important;
  }

  .amp-footer .footer-col:last-child > .f-hours {
    margin:0 0 10px !important;
  }

  .amp-footer .footer-col:last-child > .footer-phone,
  .amp-footer .footer-col:last-child > .f-phone,
  .amp-footer .footer-col:last-child > .btn {
    margin-top:8px !important;
  }

  .amp-footer .footer-bar {
    width:100% !important;
    max-width:none !important;
    padding:18px 0 calc(92px + env(safe-area-inset-bottom)) !important;
  }
}
