/* ================================
   overrides.css  (load after main.css)
   ================================ */

/* ===== Design tokens ===== */
:root {
  --warmgrey: #f4f3f1;
}

/* ================================
   HERO: single image layer + overlay
   - Keep ::after overlay
   - Kill any duplicate bg layers
   ================================ */
.hero--with-bg,
.hero--with-bg::before {
  background: none !important;
  background-image: none !important;
}
.hero--with-bg::before { content: none !important; } /* we only use ::after */

.hero--with-bg {
  position: relative;
  overflow: hidden;
}
.hero--with-bg .hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block !important;
}
.hero--with-bg .hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Overlay ABOVE image, BELOW text */
.hero--with-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(0,0,0,0.42), rgba(0,0,0,0.42)) !important;
  pointer-events: none;
}

/* Ensure text sits above overlay */
.hero--with-bg .hero__inner { position: relative; z-index: 2; }
.hero--with-bg .hero__title,
.hero--with-bg .hero__sub {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* Mobile tuning: stronger overlay + focal shift + min height */
@media (max-width: 640px){
  .hero.hero--lite { min-height: 340px; }
  .hero--with-bg .hero-bg img { object-position: center 30%; }
  .hero--with-bg::after {
    background: linear-gradient(to bottom, rgba(0,0,0,0.68), rgba(0,0,0,0.68)) !important;
  }
}

/* ================================
   CALC SECTION BACKGROUND
   - Keep warm grey across breakpoints
   ================================ */
#calc.form-section { background: var(--warmgrey) !important; }
@media (max-width: 768px){
  .form-section.orange { background: var(--warmgrey) !important; }
}

/* ================================
   CARD GRID WRAPPERS
   - Show grey between cards (no white wrappers)
   ================================ */
#cardGrid,
#cardGrid .card-grid,
#cardGrid .cards,
#cardGrid .inner,
#cardGrid .panel,
#cardGrid .container {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Individual cards remain white */
#cardGrid .card { background: #fff !important; }

/* ================================
   BACK NAV: force left alignment in pre-results & results
   ================================ */
.report-wrap nav.back-nav,
.report-wrap .back-nav {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  text-align: left !important;
  width: 100%;
  margin-left: 14px !important; /* align with card padding */
  margin-right: 0 !important;
}
.report-wrap { text-align: left !important; }
.report-wrap .back-nav__btn,
.report-wrap .back-nav a,
.report-wrap .back-nav button {
  margin: 0 !important;
}
.report-wrap nav.back-nav.justify-center,
.report-wrap nav.back-nav[style*="justify-content"] {
  justify-content: flex-start !important;
}
.back-nav__label,
#preResults .back-nav__label,
.report-wrap .back-nav__label {
  display: inline-block !important;
  text-align: left !important;
  margin: 0 !important;
  width: auto !important;
}

/* If parent is a CSS grid that centers children, override self-alignment */
#preResults .back-nav,
.report-wrap .back-nav {
  justify-self: start !important;
  align-self: start !important;
}

/* Ensure button content is left-aligned */
#preResults .back-nav__btn,
.report-wrap .back-nav__btn {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  text-align: left !important;
  margin: 0 !important;
}

/* ================================
   QUICK STEP SPACING + TRUST PLEDGE
   ================================ */

/* Tighten the gap between the input card grid and the pledge card */
#cardGrid { margin-bottom: 8px !important; } /* grid’s own bottom margin */
#cardGrid + [data-trust-pledge] { margin-top: 10px !important; } /* exact gap */
[data-trust-pledge] .trust-pledge { margin-top: 0 !important; } /* kill inner top margin */

/* (If your layout uses generic grids, keep them tidy too) */
.cards-grid, .calc-grid, .step-grid { margin-bottom: 8px !important; }

/* Hide inline links in the pledge (we moved them to footer) */
.trust-pledge__links { display: none !important; }

/* Give more breathing room above the footer (below the Continue button) */
.step-router { padding-bottom: 56px !important; }

/* ================================
   FOOTER: spacing + links
   ================================ */
.page-footer {
  margin-top: 56px;   /* distance from content to footer */
  padding-top: 8px;
}
.page-footer .footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 6px;
}
.page-footer .footer-links a { text-decoration: underline; }
.page-footer p {
  text-align: center;
  margin: 6px 0 0;
}
