/* ==========================================================================
   PAGE ASSETS -> CSS
   post: "Do You Really Need Braces or Aligners? 7 Signs Your Teeth May Need
   Orthodontic Treatment"
   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: the featured hero before/after comparison and the three-card
   before/after gallery.

   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,
   and nothing here hides content pending JavaScript: every comparison shows
   two complete, real photographs at a static 50/50 split by default.
   JavaScript only lets the visitor drag that split, and -- as a pure
   enhancement -- adds a scroll-triggered entrance to each card. If JS never
   runs, every card is simply visible immediately; nothing is ever hidden by
   CSS alone (see section 3).

   Known site-wide trap (hit on the Sep-28 "Digital Implant Planning" post,
   see claude/damico-implant-planning-blog-post-status.md): some other
   sitewide rule forces a solid white background onto bare <input> elements
   strongly enough to paint over an intentionally-transparent, absolutely
   positioned <input type="range"> drag-surface. Every background value on
   .ortho-compare__range and its pseudo-elements below carries !important
   from the start so this page never needs that whole debugging cycle again.
   ========================================================================== */

/* ── 1. Accessibility contrast fixes (same two the Sep-20 Brushing post and
   the Sep-28 Digital Implant Planning post both needed -- a third
   independent post needing them is a strong signal to promote these two to
   Blog CSS instead of repeating them per page). ────────────────────────────
   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;
}

/* ── 1b. CTA phone-number overflow guard (identical fix needed on the two
   prior posts; same phone number, so the same fix is needed again here).
   Newly found while testing THIS post (not caught by the two earlier ones):
   Blog CSS's own ".cta-buttons-wrapper a" rule sets 15px/30px padding on
   box-sizing: content-box, and its own <=520px rule sets that same element
   to width: 100% without ever switching it to border-box. The padding
   then adds on top of the 100% content width instead of being absorbed by
   it, so the button renders wider than its container -- a real, measured
   6px horizontal overflow at 375px, independent of anything above. Forcing
   border-box here is the correct general fix (makes width:100% behave at
   any padding value); !important on both declarations because a type
   selector ("...wrapper a") is one specificity tier above a plain class
   selector ("...cta-btn-call"), so an un-!important override here would
   lose to Blog CSS's own rule even though this file loads after it. */
.damico-blog-container.damico-blog-container .cta-buttons-wrapper a {
  box-sizing: border-box !important;
}
.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;
  }
}

/* ── 2. Before / after comparison card (shared by the hero and the gallery) ─ */
.damico-blog-container.damico-blog-container .ortho-compare-hero {
  margin: 36px 0 40px;
}
.damico-blog-container.damico-blog-container .ortho-compare-hero .ortho-compare {
  max-width: 820px;
  margin: 0 auto;
}
.damico-blog-container.damico-blog-container .ortho-compare-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin: 32px 0;
}
.damico-blog-container.damico-blog-container .ortho-compare {
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px rgba(27, 58, 92, 0.14);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
/* Luxury hover treatment: a gentle lift and a stronger, warmer shadow. The
   drag-handle also brightens so hover reads as "this is interactive". */
.damico-blog-container.damico-blog-container .ortho-compare:hover,
.damico-blog-container.damico-blog-container .ortho-compare:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 18px 38px rgba(27, 58, 92, 0.26);
}
.damico-blog-container.damico-blog-container .ortho-compare:hover .ortho-compare__handle,
.damico-blog-container.damico-blog-container .ortho-compare:focus-within .ortho-compare__handle {
  background: #c9a84c;
  color: #fff;
  transform: translate(-50%, -50%) scale(1.1);
}
.damico-blog-container.damico-blog-container .ortho-compare__frame {
  position: relative;
  overflow: hidden;
  background: #0d2436;
  --pos: 50%;
}
.damico-blog-container.damico-blog-container .ortho-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. 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
   (the same fix applied to the Sep-28 Digital Implant Planning post after
   its frame collapsed to 0 height on an aspect-ratio-only layout). */
.damico-blog-container.damico-blog-container .ortho-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 .ortho-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 .ortho-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 .ortho-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);
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
/* The range input IS the drag surface: full-frame, on top, transparent.
   Backgrounds below are !important -- see the file header note. This page
   ships that defence from day one instead of discovering the need for it
   live, the way the Sep-28 post did. */
.damico-blog-container.damico-blog-container .ortho-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 .ortho-compare__range::-webkit-slider-runnable-track {
  height: 100%;
  background: transparent !important;
}
.damico-blog-container.damico-blog-container .ortho-compare__range::-moz-range-track {
  height: 100%;
  background: transparent !important;
  border: 0;
}
.damico-blog-container.damico-blog-container .ortho-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 .ortho-compare__range::-moz-range-thumb {
  width: 8px;
  height: 100%;
  background: transparent !important;
  border: 0;
  cursor: ew-resize;
}
.damico-blog-container.damico-blog-container .ortho-compare__range:focus-visible {
  outline: none;
}
.damico-blog-container.damico-blog-container .ortho-compare__frame:focus-within {
  box-shadow: inset 0 0 0 3px #c9a84c;
}

/* ── 3. Entrance reveal (progressive enhancement only) ───────────────────────
   Default state: every card is fully visible with no transform, full stop.
   A visitor with JavaScript disabled, blocked, or erroring sees complete,
   correctly-proportioned photographs immediately -- identical to the
   gallery below, just without the scroll-in motion. The hidden "about to
   animate" state only exists once page.js has confirmed it is safe to
   animate and has added .js-reveal to the gallery wrapper; see page.js. */
.damico-blog-container.damico-blog-container .js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.damico-blog-container.damico-blog-container .js-reveal [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
/* Stagger the three gallery cards slightly for a less mechanical entrance;
   the hero has only one card so no stagger is needed there. */
.damico-blog-container.damico-blog-container .js-reveal .ortho-compare-gallery [data-reveal]:nth-child(2) {
  transition-delay: 0.08s;
}
.damico-blog-container.damico-blog-container .js-reveal .ortho-compare-gallery [data-reveal]:nth-child(3) {
  transition-delay: 0.16s;
}

/* ── 4. Responsive ────────────────────────────────────────────────────────
   The gallery already fluid-wraps via auto-fit; only spacing, the handle
   size and the hover lift need to come down on small phones. */
@media (max-width: 640px) {
  .damico-blog-container.damico-blog-container .ortho-compare-gallery {
    gap: 18px;
    margin: 24px 0;
  }
  .damico-blog-container.damico-blog-container .ortho-compare-hero {
    margin: 28px 0 32px;
  }
  .damico-blog-container.damico-blog-container .ortho-compare__handle {
    width: 36px;
    height: 36px;
  }
  .damico-blog-container.damico-blog-container .ortho-compare:hover,
  .damico-blog-container.damico-blog-container .ortho-compare:focus-within {
    transform: translateY(-3px);
  }
}

/* ── 5. Reduced motion ────────────────────────────────────────────────────
   The hover lift, the handle's hover scale, and the JS-driven entrance all
   move something on screen, so all three are neutralised here. The
   comparison split itself is unaffected -- it only ever moves in direct,
   1:1 response to a drag or key press, never on its own. */
@media (prefers-reduced-motion: reduce) {
  .damico-blog-container.damico-blog-container .cta-btn-callback,
  .damico-blog-container.damico-blog-container .ortho-compare,
  .damico-blog-container.damico-blog-container .ortho-compare__handle {
    transition: none;
  }
  .damico-blog-container.damico-blog-container .ortho-compare:hover,
  .damico-blog-container.damico-blog-container .ortho-compare:focus-within {
    transform: none;
  }
  .damico-blog-container.damico-blog-container .ortho-compare:hover .ortho-compare__handle,
  .damico-blog-container.damico-blog-container .ortho-compare:focus-within .ortho-compare__handle {
    transform: translate(-50%, -50%);
  }
  .damico-blog-container.damico-blog-container .js-reveal [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}