/* =====================================================================
   Directline — 04 / testimonials («شركاء نجاح حقيقيين»), replaces the old
   pricing section. Dark band, four portrait cards: real client videos play
   in a lightbox (testimonials.js); slots without an approved video show a
   quiet «قريبًا» card and are not clickable.
   One-screen rule (≥801px): the card height follows the viewport so head →
   cards → note fit under the sticky header; section-fit.js is the backstop.
   ===================================================================== */
.tm-section {
  --tm-gap: 18px;
  position: relative; overflow: hidden;
  padding: 92px 0 84px; color: white;
  background:
    var(--brand-grad);
}
.tm-head { margin-bottom: 34px; }
.tm-head .eyebrow { color: #d4c4e5; }
.tm-head h2 { font-size: 50px; line-height: 1.4; margin: 16px 0 0; }
.tm-head h2 > span { color: var(--lime); }
.tm-intro { display: grid; justify-items: start; gap: 10px; padding-bottom: 8px; }
.tm-intro p { margin: 0; font-size: 14px; line-height: 1.9; color: #b5a2c5; }
.tm-intro .text-link { font-size: 14px; gap: 18px; }

.tm-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--tm-gap);
}
.tm-card {
  position: relative; display: block; width: 100%;
  height: clamp(280px, calc(100svh - 395px), 468px);
  border-radius: 14px; overflow: hidden; padding: 0;
  border: 1px solid #ffffff1f; background: #33195c; color: white; text-align: right;
  isolation: isolate;
}
button.tm-card { cursor: pointer; transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .25s, box-shadow .35s; }
.tm-card img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: var(--tm-pos, 50% 30%); z-index: -2; /* per video, set on the card */
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.tm-card::after { /* legibility scrim: the top ~55% stays clear, then a long, eased fall into the deep purple */
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to bottom, color-mix(in srgb, var(--deep) 38%, transparent), transparent 15%), /* soft top edge: keeps the duration pill legible over burned-in marks */
    linear-gradient(to bottom,
    transparent 0 52%,
    color-mix(in srgb, var(--deep) 14%, transparent) 60%,
    color-mix(in srgb, var(--deep) 42%, transparent) 69%,
    color-mix(in srgb, var(--deep) 72%, transparent) 80%,
    color-mix(in srgb, var(--deep) 90%, transparent) 92%,
    color-mix(in srgb, var(--deep) 94%, transparent) 100%);
}
.tm-time {
  position: absolute; top: 14px; left: 14px; direction: ltr;
  font-size: 12px; font-weight: 500; line-height: 1; letter-spacing: .3px; font-variant-numeric: tabular-nums;
  padding: 7px 10px; border-radius: 99px; color: #fff;
  background: color-mix(in srgb, var(--deep) 62%, transparent); backdrop-filter: blur(8px);
}
.tm-play { /* same spot on every card: under the faces, above the text */
  position: absolute; top: min(58%, calc(100% - 156px)); left: 50%; translate: -50% -50%;
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  border: 1.5px solid #ffffffd9; background: #ffffff24; backdrop-filter: blur(6px);
  box-shadow: 0 6px 22px #140a2a40;
  transition: transform .3s cubic-bezier(.2,.7,.2,1), background .25s, color .25s, border-color .25s;
}
.tm-play svg { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; } /* optical centre of the triangle */
.tm-meta { position: absolute; inset: auto 18px 18px; display: grid; justify-items: start; gap: 6px; text-shadow: 0 1px 12px #140a2a80; }
.tm-chip {
  font-size: 11px; line-height: 1; padding: 6px 10px; border-radius: 99px; text-shadow: none;
  border: 1px solid #ffffff4d; color: #efe6f7; background: color-mix(in srgb, var(--deep) 35%, transparent); backdrop-filter: blur(6px);
}
.tm-title { font-size: 18px; font-weight: 600; line-height: 1.5; margin-top: 4px; }
.tm-sub { font-size: 12px; line-height: 1.7; color: #c7b7d6; }

button.tm-card:hover, button.tm-card:focus-visible { transform: translateY(-4px); border-color: #f3ef3080; box-shadow: 0 18px 40px #140a2a66; }
button.tm-card:hover img { transform: scale(1.04); }
button.tm-card:hover .tm-play, button.tm-card:focus-visible .tm-play { background: var(--lime); border-color: var(--lime); color: var(--deep); transform: scale(1.08); }
button.tm-card:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* a slot waiting for an approved client video */
.tm-soon {
  background:
    radial-gradient(circle at 85% 12%, #ffffff0d 0 30%, transparent 30.5%),
    linear-gradient(160deg, #3d2269, #2a164d);
  border-style: dashed; border-color: #ffffff2e;
}
.tm-soon::after { display: none; }
.tm-soon-num { position: absolute; top: 18px; right: 20px; font-size: 40px; font-weight: 600; line-height: 1; color: #f3ef3040; }
.tm-soon-mark {
  position: absolute; top: 42%; left: 50%; translate: -50% -50%;
  width: 68px; height: 68px; border-radius: 50%; border: 1.5px dashed #ffffff40;
  display: grid; place-items: center; color: #ffffff59;
}
.tm-soon-mark svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.tm-soon .tm-title { color: #e2d6ee; }

.tm-note { margin: 22px 0 0; font-size: 11px; color: #b39bc5; }

/* lightbox */
.tm-dialog {
  padding: 0; border: 0; background: transparent; overflow: visible;
  width: fit-content; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px);
}
.tm-dialog::backdrop { background: #140a2ae0; backdrop-filter: blur(8px); }
.tm-dialog[open] { display: block; }
.tm-player {
  display: block; background: #000; border-radius: 12px;
  aspect-ratio: var(--ratio, 16 / 9);
  height: min(calc(100dvh - 120px), 820px); max-width: calc(100vw - 32px); width: auto;
}
.tm-dialog[data-shape="wide"] .tm-player { height: auto; width: min(calc(100vw - 32px), 1100px, (100dvh - 120px) * 16 / 9); }
.tm-dialog .close-dialog { position: absolute; top: -48px; left: 0; background: #ffffff1f; color: white; }
.tm-dialog .close-dialog:hover { background: var(--lime); color: var(--deep); }

/* anchor jumps land with the heading right under the header */
@media (min-width: 801px) { #testimonials { scroll-margin-top: -86px; } }
@media (min-width: 801px) and (max-height: 760px) {
  .tm-section { padding-top: 84px; }
  .tm-head { margin-bottom: 24px; }
  .tm-head h2 { font-size: 44px; }
  .tm-note { margin-top: 14px; }
  .tm-card { height: clamp(260px, calc(100svh - 345px), 468px); }
}
@media (max-width: 1150px) {
  .tm-head h2 { font-size: 44px; }
  .tm-title { font-size: 16px; }
  .tm-meta { inset: auto 14px 14px; }
}
/* tablets/phones: one swipeable row, the next card peeks in */
@media (max-width: 800px) {
  .tm-section { padding: 65px 0 60px; }
  .tm-head { display: grid; gap: 28px; margin-bottom: 26px; }
  .tm-head h2 { font-size: 40px; }
  .tm-head h2 br { display: none; }
  .tm-list {
    display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin-inline: -20px; padding: 4px 20px 14px; scroll-padding-inline: 20px; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .tm-list::-webkit-scrollbar { display: none; }
  .tm-item { flex: 0 0 min(84%, 340px); scroll-snap-align: start; } /* one prominent card, the next one peeks in */
  .tm-card { height: auto; aspect-ratio: 3 / 4.2; }
  .tm-note { margin-top: 10px; }
}
@media (max-width: 520px) { .tm-head h2 { font-size: 36px; } }
@media (prefers-reduced-motion: reduce) {
  button.tm-card, .tm-card img, .tm-play { transition: none; }
  button.tm-card:hover, button.tm-card:focus-visible { transform: none; }
  button.tm-card:hover img { transform: none; }
}
