/*
 * Roofing Services grid -- plain code, not Elementor (see
 * jr_services_grid_shortcode() in functions.php for why + what changed).
 *
 * Card structure follows hhds-web-library's card-blog component
 * (components/card-blog/card-blog.css) -- adopted 2026-08-19 after the
 * owner pointed at it directly: a permanent gradient (not hover-gated)
 * plus a frosted glass panel gives the description/CTA text a real,
 * controlled-contrast surface instead of fighting whatever's in that
 * card's specific photo. Ported to this project's own class names +
 * --jr-* tokens (via the --lib-color-blog-card-* bridge in
 * tokens-brand-bridge.css) rather than loading the library's CSS file
 * directly, matching how every other component here has been ported.
 */
.jr-services {
  padding: clamp(48px, 6vw, 88px) 40px;
  background: var(--jr-color-graphite);
}

/* Same Elementor default-widget-margin gap as the hero
   (.elementor-element-jrhero1 in hero.css) -- the wrapper div Elementor
   generates around this Shortcode widget carries its own 20px bottom
   margin that this section never accounted for. */
.elementor-element-jrservices1 {
  margin-bottom: 0 !important;
}

.jr-services__header {
  position: relative;
  max-width: 1400px;
  margin: 0 auto 40px;
}

.jr-services__eyebrow {
  margin: 0 0 8px;
  font-family: var(--jr-font-action);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--jr-color-primary);
}

.jr-services__title {
  margin: 0;
  max-width: 640px;
  font-family: var(--jr-font-heading);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--jr-color-text-inverse);
}

.jr-services__mascot {
  position: absolute;
  top: -12px;
  right: 0;
  width: 220px;
  height: auto;
  opacity: 0.9;
  pointer-events: none;
}

.jr-services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  max-width: 1400px;
  margin: 0 auto;
}

.jr-services__card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 320px;
  overflow: hidden;
  text-decoration: none;
}

.jr-services__card-media {
  position: absolute;
  inset: 0;
  background-image: var(--jr-card-bg-url, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Permanent, not hover-gated -- top stays almost untouched (photo reads
   clearly), bottom darkens enough for the glass panel below to sit on a
   surface that's already trending dark, not a hard seam. */
.jr-services__card-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    var(--lib-color-blog-card-overlay-top) 0%,
    var(--lib-color-blog-card-overlay-mid) 55%,
    var(--lib-color-blog-card-overlay-bottom) 100%
  );
  pointer-events: none;
}

/* The frosted panel -- always visible, this is the actual fix for the
   contrast problem (not a darker photo). Description + button sit on
   this controlled surface regardless of what's in the photo behind it. */
.jr-services__card-panel {
  position: relative;
  z-index: 2;
  margin: 16px;
  padding: 18px;
  border: 1px solid var(--lib-color-surface-glass-border, rgba(255, 255, 255, 0.15));
  border-radius: var(--jr-radius-lg);
  background-color: var(--lib-color-blog-card-panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.jr-services__card-text {
  margin: 0 0 14px;
  font-family: var(--jr-font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--jr-color-text-inverse);
}

.jr-services__card-btn {
  display: block;
  width: 100%;
  text-align: center;
}

@media (max-width: 1023px) {
  .jr-services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .jr-services__mascot {
    display: none;
  }
}

@media (max-width: 640px) {
  .jr-services {
    padding: 40px 20px;
  }

  .jr-services__grid {
    grid-template-columns: 1fr;
  }

  .jr-services__title {
    font-size: 26px;
  }
}
