/* ================================================================
   WEFORM V8 — six large 16:9 project films, two columns x three rows.
   All other sections, including the GIF hero, stay from Version 7.
   Brand palette and Sora inherited from config.js and brand stylesheet.
   ================================================================ */

/* Reserve breathing room OUTSIDE the gallery for the information tabs.
   At 1440px, the projects are ~490px wide and each side has ~215px. */
.weform-featured-work .weform-featured-grid {
  display: grid !important;
  flex-direction: initial !important;
  grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  column-gap: clamp(24px,2.5vw,36px) !important;
  row-gap: clamp(43px,4.4vw,68px) !important;
  width: 100% !important;
  max-width: min(1200px, calc(100vw - 430px)) !important;
  margin-inline: auto !important;
  align-items: start;
  overflow: visible;
}
.weform-featured-work .weform-featured-head {
  margin-bottom: clamp(32px,3.7vw,52px) !important;
}
.weform-hover-item.weform-work-v8 {
  min-width: 0;
  position: relative;
  z-index: 1;
  isolation: auto;
}
.weform-hover-item.weform-work-v8:is(:hover,:focus-within) {z-index: 20;}
.weform-work-v8 .weform-gallery-video {
  width: 100%;
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  text-align: left;
  background: none;
  border-radius: 19px;
}
.weform-work-v8 .weform-case-poster {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  width: 100%;
  border-radius: clamp(15px,1.6vw,21px);
  box-shadow: 0 16px 38px rgba(8,22,55,.095);
  border: 1px solid rgba(29,85,230,.10);
  background: var(--weform-mist);
  transition: transform .32s cubic-bezier(.2,.75,.22,1), box-shadow .32s ease;
}
.weform-work-v8 .weform-case-poster img {
  width: 100%;height: 100%;display: block;object-fit: cover;
  transition: transform .62s cubic-bezier(.2,.75,.22,1);
}
.weform-work-v8 .weform-gallery-video:is(:hover,:focus-visible) .weform-case-poster {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(29,85,230,.145);
}
.weform-work-v8 .weform-gallery-video:is(:hover,:focus-visible) .weform-case-poster img {
  transform: scale(1.018);
}
.weform-work-v8 .weform-project-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 15px 3px 1px;
  min-height: 53px;
  position: relative;
}
.weform-work-v8 .weform-project-name {
  font-family: 'Sora',system-ui,sans-serif;
  font-size: clamp(16px,1.53vw,21px);
  font-weight: 750;
  letter-spacing: -.048em;
  line-height: 1.32;
  color: var(--weform-navy);
  transition: color .25s ease;
}
.weform-work-v8 .weform-project-arrow {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;height: 30px;
  border: 1px solid rgba(29,85,230,.17);
  border-radius: 999px;
  color: var(--weform-blue);
  background: var(--weform-white);
  font-size: 15px;
  transition: transform .3s cubic-bezier(.2,.75,.22,1), background .3s ease, color .3s ease;
}
.weform-work-v8 .weform-gallery-video:is(:hover,:focus-visible) .weform-project-name {color:var(--weform-blue);}
.weform-work-v8 .weform-gallery-video:is(:hover,:focus-visible) .weform-project-arrow {
  transform: translate(2px,-2px);
  background: var(--weform-blue);color:var(--weform-white);
}
/* The panels live beside the cards, not above them. Their width fits
   the reserved side gutter; left cards reveal left, right cards right. */
.weform-work-v8 .weform-hover-panel,
.weform-work-v8:nth-child(n+4) .weform-hover-panel {
  display: block;
  position: absolute;
  top: clamp(42px, 17%, 70px);
  bottom: auto;
  width: 190px;
  max-width: none;
  min-height: 110px;
  padding: 18px 16px 17px 19px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: var(--weform-white);
  border: 1px solid rgba(29,85,230,.15);
  border-radius: 16px;
  box-shadow: 0 16px 42px rgba(8,22,55,.14);
  transition: opacity .22s ease, transform .35s cubic-bezier(.2,.75,.22,1), visibility .22s;
}
.weform-work-v8:nth-child(odd) .weform-hover-panel {
  left: auto;right: calc(100% + 13px);
  transform: translateX(9px) scale(.982);
  transform-origin: center right;
}
.weform-work-v8:nth-child(even) .weform-hover-panel {
  left: calc(100% + 13px);right: auto;
  transform: translateX(-9px) scale(.982);
  transform-origin: center left;
}
.weform-work-v8:is(:hover,:focus-within) .weform-hover-panel,
.weform-work-v8:nth-child(n+4):is(:hover,:focus-within) .weform-hover-panel {
  opacity:1;visibility:visible;transform:translateX(0) scale(1);
}
.weform-work-v8 .weform-hover-panel::before {left:0;top:15px;bottom:15px;background:var(--weform-cyan);}
.weform-work-v8 .weform-hover-panel::after,
.weform-work-v8:nth-child(n+4) .weform-hover-panel::after {
  content:'';position:absolute;top:44px;bottom:auto;
  width:10px;height:10px;
  background: var(--weform-white);
  border: 0;
  transform: rotate(45deg);
}
.weform-work-v8:nth-child(odd) .weform-hover-panel::after {
  left:auto;right:-6px;
  border-top:1px solid rgba(29,85,230,.15);
  border-right:1px solid rgba(29,85,230,.15);
}
.weform-work-v8:nth-child(even) .weform-hover-panel::after {
  left:-6px;right:auto;
  border-left:1px solid rgba(29,85,230,.15);
  border-bottom:1px solid rgba(29,85,230,.15);
}
.weform-work-v8 .weform-hover-client {
  font-family:'Sora',system-ui,sans-serif;
  font-size:14px;line-height:1.38;letter-spacing:-.03em;margin-bottom:7px;
}
.weform-work-v8 .weform-hover-customer {
  display:block;margin:-1px 0 8px;color:var(--weform-blue);
  font-family:'Sora',system-ui,sans-serif;font-size:10px;font-weight:600;letter-spacing:.005em;
}
.weform-work-v8 .weform-hover-description {
  font-size:11px;line-height:1.55;-webkit-line-clamp:4;
  max-width:none;
}

/* On smaller laptops, maximize thumbnail width. Tooltip remains outside
   the film, below its name, aligned to the corresponding outer edge. */
@media (min-width: 701px) and (max-width: 1199px) {
  .weform-featured-work .weform-featured-grid {
    max-width: min(100%,980px) !important;
    column-gap:clamp(17px,2.5vw,28px) !important;
    row-gap: 120px !important;
  }
  .weform-work-v8 .weform-hover-panel,
  .weform-work-v8:nth-child(n+4) .weform-hover-panel {
    top:calc(100% + 8px);bottom:auto;
    width:min(100%,360px);min-height:86px;
    padding:13px 17px 14px;
  }
  .weform-work-v8:nth-child(odd) .weform-hover-panel {
    left: 0;right:auto;transform:translateY(-8px) scale(.982);
    transform-origin:top left;
  }
  .weform-work-v8:nth-child(even) .weform-hover-panel {
    right: 0;left:auto;transform:translateY(-8px) scale(.982);
    transform-origin:top right;
  }
  .weform-work-v8:is(:hover,:focus-within) .weform-hover-panel,
  .weform-work-v8:nth-child(n+4):is(:hover,:focus-within) .weform-hover-panel {
    transform:translateY(0) scale(1);
  }
  .weform-work-v8 .weform-hover-panel::after,
  .weform-work-v8:nth-child(n+4) .weform-hover-panel::after {display:none;}
  .weform-work-v8 .weform-hover-description {-webkit-line-clamp:3;}
}
@media (max-width:700px) {
  .weform-featured-work .weform-featured-grid {
    max-width:100% !important;
    grid-template-columns:minmax(0,1fr) !important;
    row-gap: clamp(21px,5vw,34px) !important;
    column-gap:0 !important;
  }
  .weform-work-v8 .weform-project-name-row {padding:13px 1px 1px;min-height:45px;}
  .weform-work-v8 .weform-project-name {font-size:clamp(16px,4.25vw,20px);}
  .weform-work-v8 .weform-hover-panel {display:none !important;}
}
@media (hover:none) {
  /* Touch users can open the project dialog to read its description. */
  .weform-work-v8 .weform-hover-panel {display:none !important;}
}
@media (hover:none) and (min-width:701px) and (max-width:1199px) {
  .weform-featured-work .weform-featured-grid {row-gap:42px !important;}
}

/* One tasteful motion treatment across the page; no hero or layout changes.
   Content stays visible when JS is absent; do not animate reduced motion. */
html.weform-has-reveal .weform-work-v8[data-reveal],
html.weform-has-reveal .audience-card--focus[data-reveal],
html.weform-has-reveal .deliverables-section .deliverable-card[data-reveal] {
  opacity:0;
  transform:translate3d(0,18px,0);
  transition:opacity .7s cubic-bezier(.2,.75,.22,1),transform .7s cubic-bezier(.2,.75,.22,1);
  transition-delay:var(--reveal-delay,0ms);
}
html.weform-has-reveal .weform-work-v8.is-in-view,
html.weform-has-reveal .audience-card--focus.is-in-view,
html.weform-has-reveal .deliverables-section .deliverable-card.is-in-view {
  opacity:1;
  transform:translate3d(0,0,0);
}
@media(prefers-reduced-motion:reduce) {
  html.weform-has-reveal .weform-work-v8,
  html.weform-has-reveal .audience-card--focus,
  html.weform-has-reveal .deliverables-section .deliverable-card {
    opacity:1 !important;transform:none !important;transition:none !important;
  }
  .weform-work-v8 .weform-case-poster,
  .weform-work-v8 .weform-case-poster img,
  .weform-work-v8 .weform-project-name,
  .weform-work-v8 .weform-project-arrow,
  .weform-work-v8 .weform-hover-panel {transition:none !important;}
}
