/* ==========================================================================
   PAGE ASSETS -> CSS
   post: "Do You Really Need a Dental Implant? 5 Questions to Ask Before
   Replacing a Missing Tooth"
   Site Assets Manager -> edit the post -> "Page Assets" -> CSS

   Loads on this post only. It adds nothing that Blog CSS already provides
   (quick-summary-box, faq-section, cta-band, green-link and the base
   typography all come from Blog CSS) and only styles what this article
   introduces: a single before/after comparison slider, a 2-up static photo
   grid (digital planning photos), and a 2-card before/after gallery grid.

   This post intentionally matches the plain baseline pattern used by every
   prior post in this series (Sep-28 implant-planning, Oct-12/19 child
   braces age, Oct-25 diabetic implants) -- drag only, no hover-lift, no
   scroll-entrance-reveal. The hover/entrance treatment on the Oct-3 ortho
   post was a one-off enhancement requested specifically for that post;
   this post asked to match the existing posts' style, so it is not
   repeated here.

   This post uses its own class prefix (implant5q-compare / implant5q-photo)
   rather than reusing implant-compare from the Sep-28 implant-planning
   post, matching this project's convention of a distinct component
   namespace per post even when the CSS mechanics are identical -- each
   post's assets are scoped to that post only, so there is no collision
   risk either way.

   Every selector is written under .damico-blog-container twice, the same
   trick Blog CSS uses, so these rules tie with the legacy layer and win on
   source order because page CSS is enqueued after Blog CSS.

   No backslash anywhere in this file (Rule Zero). No viewport-width units,
   no forced-nowrap, and nothing here hides content pending JavaScript: each
   comparison shows two complete, real photographs at a static 50/50 split
   by default, and both digital-planning photos render as plain static
   images; JavaScript only lets the visitor move the comparison split.
   ========================================================================== */

/* ── 1. Accessibility contrast fixes (same issue as every prior post in this
   series -- this is now the sixth consecutive post needing it, a strong
   candidate for promotion to Blog CSS). Measured against white: the legacy h3 colour
   #7FB3A6 is 2.4:1 (needs 3:1 even for large text) and the callback button
   white-on-#3F8F7D is 3.9:1 (needs 4.5:1). Same hues, darker values: 6.0:1
   for both. Delete either rule to fall back to the site-wide look, or
   promote it to Blog CSS. */
.damico-blog-container.damico-blog-container h3 {
  color: #2f6d5f;
}
.damico-blog-container.damico-blog-container .cta-btn-callback {
  background: #2f6d5f;
}
.damico-blog-container.damico-blog-container .cta-btn-callback:hover,
.damico-blog-container.damico-blog-container .cta-btn-callback:focus-visible {
  background: #245a4e;
}

/* ── 2. Before / after comparison. This page has three instances: one
   single-pair slider (right after the intro) and two more inside a 2-card
   gallery grid (alongside the digital-planning photos), so the shared
   .implant5q-compare / __frame / __range mechanics below serve both the
   single wrapper and each gallery card. ──────────────────────────────── */
.damico-blog-container.damico-blog-container .implant5q-compare-wrap {
  margin: 32px 0;
}
/* 2-up grid, same auto-fit pattern as the Sep-28 implant-planning post's
   5-card gallery: each card is free to drop to its own row under 280px. */
.damico-blog-container.damico-blog-container .implant5q-compare-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin: 32px 0;
}
.damico-blog-container.damico-blog-container .implant5q-compare {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px rgba(27, 58, 92, 0.14);
}
.damico-blog-container.damico-blog-container .implant5q-compare__frame {
  position: relative;
  overflow: hidden;
  background: #0d2436;
  --pos: 50%;
}
.damico-blog-container.damico-blog-container .implant5q-compare__img {
  user-select: none;
  pointer-events: none;
}
/* The "after" photo stays in normal document flow: a plain, full-width image
   that sizes itself from its own real width/height attributes (both pairs
   are verified 1920x1080 and 1625x1080). That is what gives the frame its
   height, so the comparison still shows a real, correctly-proportioned
   photograph even in a browser or environment where this stylesheet -- or
   any part of it -- fails to load or apply. Nothing depends on aspect-ratio
   support or on this specific selector matching. */
.damico-blog-container.damico-blog-container .implant5q-compare__img--after {
  display: block;
  width: 100%;
  height: auto;
  z-index: 1;
}
/* The "before" photo is the only piece that needs absolute positioning: it
   overlays the now-correctly-sized frame and gets clipped to reveal the
   photo underneath. */
.damico-blog-container.damico-blog-container .implant5q-compare__img--before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.damico-blog-container.damico-blog-container .implant5q-compare__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  z-index: 3;
  width: 3px;
  margin-left: -1.5px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(13, 36, 54, 0.18);
  pointer-events: none;
}
.damico-blog-container.damico-blog-container .implant5q-compare__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  color: #1b3a5c;
  box-shadow: 0 4px 14px rgba(13, 36, 54, 0.3);
}
/* !important on every background below is a defensive fix: a sitewide CSS
   rule forces <input> backgrounds to opaque white, which otherwise hides
   the photographs underneath this range input (found and fixed on the
   Sep-28 post, confirmed again on the Oct-3 post -- shipped from day one
   here rather than rediscovered live a third time). */
.damico-blog-container.damico-blog-container .implant5q-compare__range {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: ew-resize;
  touch-action: pan-y;
}
.damico-blog-container.damico-blog-container .implant5q-compare__range::-webkit-slider-runnable-track {
  height: 100%;
  background: transparent !important;
}
.damico-blog-container.damico-blog-container .implant5q-compare__range::-moz-range-track {
  height: 100%;
  background: transparent !important;
  border: 0;
}
.damico-blog-container.damico-blog-container .implant5q-compare__range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 8px;
  height: 100%;
  background: transparent !important;
  border: 0;
  cursor: ew-resize;
}
.damico-blog-container.damico-blog-container .implant5q-compare__range::-moz-range-thumb {
  width: 8px;
  height: 100%;
  background: transparent !important;
  border: 0;
  cursor: ew-resize;
}
.damico-blog-container.damico-blog-container .implant5q-compare__range:focus-visible {
  outline: none;
}
.damico-blog-container.damico-blog-container .implant5q-compare__frame:focus-within {
  box-shadow: inset 0 0 0 3px #c9a84c;
}

/* ── 2b. Static digital-planning photo grid (2 photos, no slider -- these
   are single images, not before/after pairs, matching the Sep-28
   implant-planning post's .implant-photo treatment, extended to a 2-up
   grid since this post has two such photos instead of one). ──────────── */
.damico-blog-container.damico-blog-container .implant5q-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 32px 0;
}
.damico-blog-container.damico-blog-container .implant5q-photo {
  margin: 0;
}
.damico-blog-container.damico-blog-container .implant5q-photo__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(27, 58, 92, 0.16);
}

/* ── 3. Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .damico-blog-container.damico-blog-container .implant5q-compare-wrap,
  .damico-blog-container.damico-blog-container .implant5q-compare-gallery,
  .damico-blog-container.damico-blog-container .implant5q-photo-grid {
    margin: 24px 0;
  }
  .damico-blog-container.damico-blog-container .implant5q-compare-gallery,
  .damico-blog-container.damico-blog-container .implant5q-photo-grid {
    gap: 16px;
  }
  .damico-blog-container.damico-blog-container .implant5q-compare__handle {
    width: 36px;
    height: 36px;
  }
}

/* ── 4. CTA phone-number overflow guard (identical fix to every prior post;
   the same phone number, so the same fix is needed again here -- a sixth
   sign this belongs in Blog CSS, not repeated per page). ──────────────── */
.damico-blog-container.damico-blog-container .cta-band__label {
  display: inline;
}
.damico-blog-container.damico-blog-container .cta-band__number {
  display: inline-block;
}
.damico-blog-container.damico-blog-container .cta-band__email {
  max-width: 100%;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .damico-blog-container.damico-blog-container .cta-band__place {
    text-align: left;
    text-wrap: balance;
  }
}
@media (max-width: 520px) {
  .damico-blog-container.damico-blog-container .cta-btn-call,
  .damico-blog-container.damico-blog-container .cta-btn-callback {
    padding: 14px 16px !important;
    font-size: 1.05em;
  }
  .damico-blog-container.damico-blog-container .cta-band__label {
    text-wrap: balance;
  }
  .damico-blog-container.damico-blog-container .cta-band__number {
    display: block;
  }
}
@media (max-width: 400px) {
  .damico-blog-container.damico-blog-container .cta-band {
    padding: 26px 14px;
  }
  .damico-blog-container.damico-blog-container .cta-band__email {
    font-size: 0.94em;
  }
}
@media (max-width: 360px) {
  .damico-blog-container.damico-blog-container .cta-band__email {
    gap: 6px;
    font-size: 0.86em;
  }
}

/* ── 4b. CTA button box-sizing fix (latent, sitewide Blog CSS bug, first
   found and fixed on the Oct-3 ortho post -- see that post's status doc).
   Blog CSS's own .cta-buttons-wrapper a rule applies 15px/30px padding on
   box-sizing: content-box, and its own <=520px rule then sets that same
   element to width: 100% -- the padding adds on top of the 100% content
   box instead of being absorbed into it, overflowing the button by about
   60px on narrow phones. box-sizing: border-box fixes the sizing math
   directly; !important is required above on this page's own small-screen
   padding override too, because a bare type selector like "...wrapper a"
   outranks a class selector at equal class-count, so Blog CSS's rule would
   otherwise win on specificity even though this file loads after it. */
.damico-blog-container.damico-blog-container .cta-buttons-wrapper a {
  box-sizing: border-box !important;
}

/* ── 5. Reduced motion ────────────────────────────────────────────────────
   Nothing on this page animates by default (the comparison split moves
   only in direct, 1:1 response to a drag or key press, never on its own),
   so this only guarantees the focus/hover colour changes above don't pick
   up an implied transition from elsewhere in the stylesheet cascade.

   !important is required on .cta-btn-callback specifically: Blog CSS's own
   .cta-buttons-wrapper a { transition: all 0.3s ease; } (line 664 at the
   time of writing) ties this rule's class count (3 each, counting the
   repeated .damico-blog-container) and then wins the tie-break on its
   trailing "a" type selector -- the same specificity pattern already
   fixed with !important on the CTA box-sizing rule above, just not
   previously caught for this property. Confirmed live with Playwright's
   prefers-reduced-motion emulation: without !important this resolved to
   "0.3s", not "none". This is a seventh sign the fix belongs in Blog CSS. */
@media (prefers-reduced-motion: reduce) {
  .damico-blog-container.damico-blog-container .cta-btn-callback {
    transition: none !important;
  }
  .damico-blog-container.damico-blog-container .implant5q-compare__frame {
    transition: none;
  }
}