/* ==========================================================================
   DADALAB — Case Study Styles
   --------------------------------------------------------------------------
   Loaded only on case study pages (controlled via functions.php by slug).
   Contains: keyframe animations, screenshot grid, animated screen components.
   Requires: CSS custom properties defined in style.css (--dl-* tokens).
   ========================================================================== */


/* ── KEYFRAMES ───────────────────────────────────────────────────────────── */

/*
   dl-scroll-down
   Scrolls the nav screenshot downward to reveal an overlong list, then resets.
   calc() offset matches .dl-screen--nav height (720px).
*/
@keyframes dl-scroll-down {
  0%,  8%   { transform: translateY(0); }
  75%, 88%  { transform: translateY(calc(-100% + 720px)); }
  96%, 100% { transform: translateY(0); }
}

/*
   dl-subtle-pan
   Zooms out slowly from a close crop to full frame on the search screenshot.
   Runs in alternate mode so it breathes back and forth.
*/
@keyframes dl-subtle-pan {
  0%   { transform: scale(1.18) translate(4%, 6%); }
  100% { transform: scale(1)    translate(0,   0); }
}


/* ── WIDE BREAKOUT WRAPPER ────────────────────────────────────────────────
   Stretches the screenshot grid beyond the WordPress content column width.
   Wrap the .dl-screens grid inside .dl-screens-wide in your HTML block.
   ========================================================================== */

.dl-screens-wide {
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  padding-inline: clamp(20px, 4vw, 60px);
  box-sizing: border-box;
  margin-block: 48px;
}


/* ── SCREENSHOT GRID ──────────────────────────────────────────────────────
   Two-column layout: portrait nav screen left, landscape search screen right.
   Wider columns than the default — 380px nav, rest for search.

   Usage — wrap this whole block in .dl-screens-wide:
     <div class="dl-screens-wide">
       <div class="dl-screens"> … </div>
       <p class="dl-screens__caption"> … </p>
     </div>
   ========================================================================== */

.dl-screens {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  align-items: start;
  max-width: 1200px;
  margin-inline: auto;
}

.dl-screens__caption {
  font-family: var(--dl-font, 'Manrope', sans-serif);
  font-size: 0.82rem;
  color: var(--dl-gray, #686868);
  line-height: 1.5;
  margin-top: 16px;
  margin-inline: auto;
  max-width: 1200px;
  font-style: italic;
}

@media (max-width: 800px) {
  .dl-screens {
    grid-template-columns: 1fr;
  }
}


/* ── SHARED SCREEN BASE ──────────────────────────────────────────────────── */

.dl-screen {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.12);
  margin: 0;
}

.dl-screen img {
  width: 100%;
  display: block;
}


/* ── SCREEN: NAV (portrait, scroll animation) ─────────────────────────────
   Fixed height clips the image. ::before fakes a browser bar (data-url attr).
   ::after fades the bottom to imply more content below.
*/
.dl-screen--nav {
  height: 720px;
  background: #0d2132;
}

.dl-screen--nav img {
  animation: dl-scroll-down 16s ease-in-out 1.5s infinite;
  transform-origin: top center;
}

/* Simulated browser address bar — set data-url="…" on the <figure> */
.dl-screen--nav::before {
  content: attr(data-url);
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 10;
  background: #1a3a52;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--dl-font, 'Manrope', monospace);
  font-size: 0.65rem;
  padding: 6px 12px;
  letter-spacing: 0.05em;
}

/* Bottom fade — implies the list continues below the visible area */
.dl-screen--nav::after {
  content: '';
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  height: 100px;
  background: linear-gradient(transparent, #0d2132);
  pointer-events: none;
  z-index: 5;
}

@media (max-width: 800px) {
  .dl-screen--nav { height: 480px; }
}


/* ── SCREEN: WIDE / SEARCH (landscape, zoom-pan animation) ─────────────── */

.dl-screen--wide {
  background: #fff;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.10);
}

.dl-screen--wide img {
  animation: dl-subtle-pan 18s ease-in-out 0s infinite alternate;
}

/* Stat overlay — hardcoded colours so it renders even before CSS vars load */
.dl-screen__stat {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  background: #111111;               /* --dl-contrast fallback */
  color: #ffffff;                    /* --dl-base fallback      */
  padding: 16px 24px;
  border-radius: 4px;
  font-family: var(--dl-font, 'Manrope', sans-serif);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  max-width: 240px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.dl-screen__stat strong {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -1px;
  color: #FFEE58;                    /* --dl-yellow fallback */
  line-height: 1;
  margin-bottom: 6px;
}