/* ==========================================================================
   Elite Home Saver — "Trusted Neighbor" design system
   --------------------------------------------------------------------------
   Positioning: the authority on connecting homeowners with contractors.
   Warm and human, not corporate-blue. Layered over Bootstrap 5's grid, so
   existing markup keeps working while everything visual is redefined here.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Ink — deep spruce rather than black. Warmer, less clinical. */
  --ehs-ink: #12291f;
  --ehs-ink-soft: #40564a;
  --ehs-ink-faint: #6d8175;

  /* Brand teal, carried over from the old site so the logo still belongs. */
  --ehs-teal: #00b0bc;
  --ehs-teal-deep: #00808a;
  --ehs-teal-wash: #e2f5f6;

  /* Terracotta drives action. One accent, used sparingly, so CTAs land. */
  --ehs-clay: #c25a35;
  --ehs-clay-deep: #a24525;
  --ehs-clay-wash: #fbeee7;

  /* Warm paper neutrals instead of white-on-white. */
  --ehs-sand: #f7f2e9;
  --ehs-sand-deep: #efe7d8;
  --ehs-cream: #fffdf8;
  --ehs-line: #e5dccb;

  --ehs-radius-sm: 8px;
  --ehs-radius: 14px;
  --ehs-radius-lg: 24px;
  --ehs-radius-pill: 999px;

  --ehs-shadow-sm: 0 1px 2px rgba(18, 41, 31, .06), 0 2px 8px rgba(18, 41, 31, .04);
  --ehs-shadow: 0 2px 6px rgba(18, 41, 31, .06), 0 12px 28px -12px rgba(18, 41, 31, .18);
  --ehs-shadow-lg: 0 8px 20px -8px rgba(18, 41, 31, .18), 0 32px 64px -32px rgba(18, 41, 31, .32);

  --ehs-display: "Fraunces", Georgia, "Times New Roman", serif;
  --ehs-body: "Karla", "Helvetica Neue", Arial, sans-serif;

  --ehs-ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Base ---------- */
body {
  background-color: var(--ehs-sand);
  color: var(--ehs-ink);
  font-family: var(--ehs-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain. Sits behind everything, costs one inline SVG, and is the
   difference between "warm" and "flat beige". */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}

main, header, footer { position: relative; z-index: 1; }

h1, h2, h3, h4, h5, h6, .ehs-display {
  font-family: var(--ehs-display);
  font-optical-sizing: auto;
  /* WONK 0: Fraunces' wonky ampersand reads as a ® at card-title sizes.
     The hero opts back in, where it has room to be characterful. */
  font-variation-settings: "SOFT" 40, "WONK" 0;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.015em;
  color: var(--ehs-ink);
}

a { color: var(--ehs-teal-deep); text-underline-offset: 3px; }
a:hover { color: var(--ehs-clay); }

::selection { background: var(--ehs-teal-wash); color: var(--ehs-ink); }

:focus-visible {
  outline: 2px solid var(--ehs-teal-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Type helpers ---------- */
.ehs-eyebrow {
  font-family: var(--ehs-body);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ehs-teal-deep);
  margin-bottom: .75rem;
}

.ehs-lead {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ehs-ink-soft);
}

.ehs-muted { color: var(--ehs-ink-soft); }

/* Hand-drawn emphasis under a word in a headline. */
.ehs-underline {
  background-image: linear-gradient(
    transparent 60%,
    rgba(0, 176, 188, .32) 60%,
    rgba(0, 176, 188, .32) 90%,
    transparent 90%
  );
  background-repeat: no-repeat;
  padding: 0 .06em;
}

/* ---------- Buttons ---------- */
.ehs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--ehs-radius-pill);
  font-family: var(--ehs-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s var(--ehs-ease), box-shadow .18s var(--ehs-ease),
              background-color .18s var(--ehs-ease), color .18s var(--ehs-ease);
}

.ehs-btn:hover { transform: translateY(-2px); }
.ehs-btn:active { transform: translateY(0); }

.ehs-btn-primary {
  background-color: var(--ehs-clay);
  color: #fff;
  box-shadow: 0 2px 0 var(--ehs-clay-deep), var(--ehs-shadow-sm);
}
.ehs-btn-primary:hover {
  background-color: var(--ehs-clay-deep);
  color: #fff;
  box-shadow: 0 4px 0 var(--ehs-clay-deep), var(--ehs-shadow);
}

.ehs-btn-secondary {
  background-color: transparent;
  color: var(--ehs-ink);
  border-color: var(--ehs-ink);
}
.ehs-btn-secondary:hover {
  background-color: var(--ehs-ink);
  color: var(--ehs-cream);
}

.ehs-btn-ghost { background: transparent; color: var(--ehs-ink); padding: .8rem 1rem; }
.ehs-btn-ghost:hover { color: var(--ehs-clay); }

.ehs-btn-lg { padding: 1rem 2rem; font-size: 1.0625rem; }

/* ---------- Navigation ---------- */
.ehs-nav {
  background-color: rgba(255, 253, 248, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--ehs-line);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.ehs-nav .navbar { padding-top: .65rem; padding-bottom: .65rem; }

.ehs-nav .navbar-brand img { height: 42px; width: auto; }

.ehs-nav .nav-link {
  font-family: var(--ehs-body);
  font-weight: 600;
  font-size: .975rem;
  letter-spacing: .005em;
  text-transform: none;      /* the old nav shouted in uppercase and wrapped */
  color: var(--ehs-ink) !important;
  padding: .5rem .9rem !important;
  border-radius: var(--ehs-radius-sm);
  white-space: nowrap;
  transition: color .16s var(--ehs-ease), background-color .16s var(--ehs-ease);
}

.ehs-nav .nav-link:hover,
.ehs-nav .nav-link:focus-visible {
  color: var(--ehs-teal-deep) !important;
  background-color: var(--ehs-teal-wash);
}

.ehs-nav .dropdown-menu {
  border: 1px solid var(--ehs-line);
  border-radius: var(--ehs-radius);
  box-shadow: var(--ehs-shadow);
  background-color: var(--ehs-cream);
  padding: .5rem;
  min-width: 16rem;
}

.ehs-nav .dropdown-item {
  border-radius: var(--ehs-radius-sm);
  padding: .6rem .8rem;
  font-weight: 600;
  color: var(--ehs-ink);
}
.ehs-nav .dropdown-item:hover {
  background-color: var(--ehs-teal-wash);
  color: var(--ehs-teal-deep);
}
.ehs-nav .dropdown-item small {
  display: block;
  font-weight: 400;
  color: var(--ehs-ink-faint);
}

.ehs-nav .navbar-toggler {
  border: 1px solid var(--ehs-line);
  border-radius: var(--ehs-radius-sm);
  padding: .4rem .6rem;
}
.ehs-nav .navbar-toggler:focus { box-shadow: none; }

/* ---------- Hero ---------- */
.ehs-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 88% 8%, rgba(0, 176, 188, .16) 0%, transparent 55%),
    radial-gradient(90% 80% at 6% 92%, rgba(194, 90, 53, .12) 0%, transparent 55%),
    var(--ehs-sand);
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem);
}

.ehs-hero h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.1rem);
  font-variation-settings: "SOFT" 50, "WONK" 1;  /* room to be characterful */
  margin-bottom: 1.25rem;
}

.ehs-hero .ehs-lead { max-width: 34rem; }

.ehs-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 2rem;
}

/* ---------- Trust strip ---------- */
.ehs-trust {
  border-top: 1px solid var(--ehs-line);
  border-bottom: 1px solid var(--ehs-line);
  background-color: var(--ehs-cream);
  padding: 1.4rem 0;
}

.ehs-trust-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .75rem 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ehs-trust-list li {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--ehs-ink-soft);
}

.ehs-trust-list svg { flex: none; color: var(--ehs-teal-deep); }

/* ---------- Sections ---------- */
.ehs-section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.ehs-section-cream { background-color: var(--ehs-cream); }
.ehs-section-ink { background-color: var(--ehs-ink); }
.ehs-section-ink h2, .ehs-section-ink h3 { color: var(--ehs-cream); }
.ehs-section-ink p { color: rgba(255, 253, 248, .78); }

.ehs-section-head { max-width: 42rem; margin-bottom: 2.75rem; }
.ehs-section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); margin-bottom: .85rem; }

/* ---------- Cards ---------- */
.ehs-card {
  background-color: var(--ehs-cream);
  border: 1px solid var(--ehs-line);
  border-radius: var(--ehs-radius-lg);
  padding: 1.85rem;
  height: 100%;
  transition: transform .22s var(--ehs-ease), box-shadow .22s var(--ehs-ease),
              border-color .22s var(--ehs-ease);
}

.ehs-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 176, 188, .45);
  box-shadow: var(--ehs-shadow);
}

.ehs-card h3 { font-size: 1.375rem; margin-bottom: .6rem; }
.ehs-card p { color: var(--ehs-ink-soft); margin-bottom: 0; }

/* Numbered step cards — the "how it works" spine. */
.ehs-step { position: relative; padding-top: 2.6rem; }

.ehs-step-num {
  position: absolute;
  top: 1.5rem;
  left: 1.85rem;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: var(--ehs-radius-pill);
  background-color: var(--ehs-teal-wash);
  color: var(--ehs-teal-deep);
  font-family: var(--ehs-display);
  font-weight: 700;
  font-size: 1.15rem;
}

.ehs-step h3 { margin-top: 2.2rem; }

/* Icon plate for value cards. */
.ehs-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: var(--ehs-radius);
  background-color: var(--ehs-teal-wash);
  color: var(--ehs-teal-deep);
  margin-bottom: 1.15rem;
}
.ehs-icon-clay { background-color: var(--ehs-clay-wash); color: var(--ehs-clay-deep); }

/* ---------- Signup band ---------- */
.ehs-cta {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(90% 140% at 12% 0%, rgba(0, 176, 188, .28) 0%, transparent 60%),
    var(--ehs-ink);
  border-radius: var(--ehs-radius-lg);
  padding: clamp(2.25rem, 5vw, 3.5rem);
  color: var(--ehs-cream);
}

.ehs-cta h2 { color: var(--ehs-cream); font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.ehs-cta p { color: rgba(255, 253, 248, .8); }

.ehs-cta-note { font-size: .875rem; color: rgba(255, 253, 248, .6); }

/* ---------- Footer ---------- */
.ehs-footer {
  background-color: var(--ehs-ink);
  color: rgba(255, 253, 248, .72);
  padding: 3.5rem 0 2rem;
}

.ehs-footer h4 {
  color: var(--ehs-cream);
  font-family: var(--ehs-body);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.ehs-footer a { color: rgba(255, 253, 248, .72); text-decoration: none; }
.ehs-footer a:hover { color: var(--ehs-teal); text-decoration: underline; }

.ehs-footer-links { list-style: none; padding: 0; margin: 0; }
.ehs-footer-links li { margin-bottom: .55rem; }

.ehs-footer-base {
  border-top: 1px solid rgba(255, 253, 248, .14);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  font-size: .875rem;
  color: rgba(255, 253, 248, .55);
}

/* ---------- Category cards (news.html verticals feed) ----------
   The feed's markup is fixed (shared across every tenant site) and
   verticals.js decorates it with Bootstrap utilities — p-4 gutters, a
   yellow border-warning on every thumbnail, and the title as an <h1>.
   Everything below reshapes that into a real card without touching the
   shared template. */

.vertical-placement {
  display: flex;
  padding: .75rem !important;   /* was p-4: 1.5rem, far too airy */
}

.vertical-placement-contents {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0 !important;        /* was p-3 */
  background-color: var(--ehs-cream);
  border: 1px solid var(--ehs-line);
  border-radius: var(--ehs-radius-lg);
  overflow: hidden;
  transition: transform .22s var(--ehs-ease), box-shadow .22s var(--ehs-ease),
              border-color .22s var(--ehs-ease);
}

.vertical-placement-contents:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 176, 188, .45);
  box-shadow: var(--ehs-shadow);
}

/* One <a> wraps thumbnail and title, so it carried the default underline. */
.vertical-placement-contents > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.vertical-placement-contents .vertical-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;        /* uniform rows regardless of source size */
  object-fit: cover;
  border: 0 !important;         /* kills verticals.js's border-warning */
  border-radius: 0 !important;
  margin-bottom: 0 !important;
  transition: transform .5s var(--ehs-ease);
}

.vertical-placement-contents:hover .vertical-image { transform: scale(1.04); }

/* Keep the zoom inside the rounded corners. */
.vertical-placement-contents > a > div:first-child { overflow: hidden; }

.vertical-placement-contents .vertical-name {
  font-size: 1.1875rem !important;
  margin: 0 !important;
  padding: 1.1rem 1.25rem .35rem;
  transition: color .16s var(--ehs-ease);
}

.vertical-placement-contents:hover .vertical-name { color: var(--ehs-teal-deep) !important; }

/* Affordance replacing the underline that used to signal "link". */
.vertical-placement-contents > a::after {
  content: "Browse guides →";
  margin-top: auto;
  padding: 0 1.25rem 1.15rem;
  font-family: var(--ehs-body);
  font-size: .875rem;
  font-weight: 700;
  color: var(--ehs-teal-deep);
}

/* ---------- Page header ---------- */
.ehs-page-head {
  background:
    radial-gradient(90% 120% at 85% 0%, rgba(0, 176, 188, .14) 0%, transparent 60%),
    var(--ehs-sand);
  border-bottom: 1px solid var(--ehs-line);
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
}

.ehs-page-head h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.1rem);
  margin-bottom: .9rem;
}

.ehs-page-head .ehs-lead { max-width: 40rem; }

/* ---------- Page-load reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .ehs-reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: ehs-rise .7s var(--ehs-ease) forwards;
  }
  .ehs-reveal-1 { animation-delay: .05s; }
  .ehs-reveal-2 { animation-delay: .15s; }
  .ehs-reveal-3 { animation-delay: .25s; }
  .ehs-reveal-4 { animation-delay: .35s; }
}

@keyframes ehs-rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Bootstrap overrides kept narrow and intentional ---------- */
.ehs-scope .btn-primary {
  background-color: var(--ehs-clay);
  border-color: var(--ehs-clay);
  border-radius: var(--ehs-radius-pill);
  font-weight: 700;
  padding: .75rem 1.5rem;
}
.ehs-scope .btn-primary:hover {
  background-color: var(--ehs-clay-deep);
  border-color: var(--ehs-clay-deep);
}

.ehs-scope .text-body-secondary { color: var(--ehs-ink-soft) !important; }
.ehs-scope .bg-light { background-color: var(--ehs-cream) !important; }
