/* The two media rows share the site's type, colours and logo motion. */
#agency-site .tm-section {
  --tm-row-height: clamp(280px, 30cqi, 360px);
  --tm-gap: clamp(16px, 2cqi, 28px);
  padding: clamp(72px, 9cqi, 128px) 0;
  min-width: 0;
}
#agency-site .tm-header {
  position: relative;
  width: min(1160px, 86%);
  margin: 0 auto clamp(28px, 4cqi, 52px);
  padding-right: 0;
}
#agency-site .tm-section--soft .tm-header { padding-inline: 0; }
#agency-site .tm-section--soft .tm-heading { margin-inline: auto; text-align: center; }
#agency-site .tm-section--framed {
  --tm-row-height: clamp(210px, 24cqi, 296px);
  margin: clamp(12px, 2.2cqi, 22px);
  padding-block: clamp(58px, 7cqi, 96px);
  background: var(--taste-mist);
  border-radius: var(--taste-radius);
}
#agency-site .tm-section--framed .tm-heading { max-width: 670px; }
#agency-site .tm-pause {
  position: absolute;
  right: 0;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #143e3826;
  border-radius: 50%;
  background: transparent;
  color: var(--taste-accent);
  transition: background 200ms ease, transform 240ms var(--taste-ease);
}
#agency-site .tm-pause:hover { background: var(--taste-tint); }
#agency-site .tm-section:not(.is-motion-ready) .tm-pause { display: none; }
#agency-site .tm-pause:active { transform: scale(.94); }
#agency-site .tm-pause__icon { width: 10px; height: 12px; border-inline: 3px solid currentColor; }
#agency-site .tm-pause[aria-pressed="true"] .tm-pause__icon {
  width: 0;
  height: 0;
  margin-left: 3px;
  border: 0 solid transparent;
  border-top-width: 6px;
  border-bottom-width: 6px;
  border-left: 10px solid currentColor;
}
#agency-site .tm-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-behavior: auto;
  touch-action: auto;
  -webkit-overflow-scrolling: touch;
}
#agency-site .tm-viewport::-webkit-scrollbar { display: none; }
#agency-site .tm-section.is-motion-ready .tm-viewport {
  overflow-x: auto;
  touch-action: auto;
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}
#agency-site .tm-section.is-keyboard-focused .tm-viewport { overflow-x: auto; }
#agency-site .tm-track { display: flex; width: max-content; }
#agency-site .tm-section.is-motion-ready .tm-track { transform: none; }
#agency-site .tm-group {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--tm-gap);
  padding: 44px calc(var(--tm-gap) / 2) 32px;
}
#agency-site .tm-card {
  position: relative;
  display: block;
  flex: none;
  width: calc(var(--tm-row-height) * var(--tm-ratio, 1));
  height: var(--tm-row-height);
  aspect-ratio: var(--tm-ratio, 1);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  text-align: initial;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 380ms var(--taste-ease);
}
#agency-site .tm-card__surface {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: var(--tm-placeholder, var(--taste-mist));
  box-shadow: inset 0 0 0 1px #143e380a;
}
#agency-site .tm-card:nth-child(3n + 2) { --tm-placeholder: #dceae3; }
#agency-site .tm-card:nth-child(3n + 3) { --tm-placeholder: #f1eee7; }
#agency-site .tm-card__surface::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #102e28b8 0%, #102e2870 24%, #102e2820 46%, transparent 68%);
  pointer-events: none;
}
#agency-site .tm-card[data-orientation="portrait"] .tm-card__surface::after {
  background: linear-gradient(0deg, #102e28c9 0%, #102e2882 24%, #102e2826 49%, transparent 73%);
}
#agency-site .tm-quote {
  position: absolute;
  z-index: 1;
  top: calc(var(--tm-badge-size) / 2 + 19px);
  left: clamp(20px, 2.2cqi, 30px);
  right: clamp(20px, 2.2cqi, 30px);
  color: #fbfdfc;
  pointer-events: none;
  text-shadow: 0 2px 12px #102e281f;
  text-align: left;
}
#agency-site .tm-quote q {
  display: block;
  max-width: 16ch;
  font-size: clamp(24px, 2.5cqi, 33px);
  font-weight: 550;
  line-height: 1.12;
  letter-spacing: -.035em;
  text-wrap: balance;
}
#agency-site .tm-quote q::before, #agency-site .tm-quote q::after { content: none; }
#agency-site .tm-section--quote-type { --tm-badge-size: 44px; }
#agency-site .tm-section--quote-badge { --tm-badge-size: 56px; }
#agency-site .tm-quote-mark {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  left: 0;
  top: calc(-1 * var(--tm-badge-size) - 17px);
  width: var(--tm-badge-size);
  height: var(--tm-badge-size);
  border-radius: 50%;
  background: #fbfdfc;
  color: #236e5f;
  font: calc(var(--tm-badge-size) * 1.2143)/1.3 Georgia, serif;
  pointer-events: none;
  box-shadow: 0 6px 20px #143e3817;
  text-shadow: none;
}
#agency-site .tm-card[data-orientation="portrait"] .tm-quote { top: auto; bottom: 26px; }
#agency-site .tm-card[data-orientation="portrait"] .tm-quote q { font-size: clamp(23px, 2.2cqi, 30px); }
#agency-site .tm-section--quote-badge .tm-card[data-orientation="portrait"] .tm-quote { top: auto; bottom: 26px; }
#agency-site .tm-section--quote-badge .tm-card__surface::after {
  background: linear-gradient(180deg, #102e28b0 0%, #102e287a 25%, #102e2824 48%, transparent 72%);
}
#agency-site .tm-section--quote-badge .tm-card[data-orientation="portrait"] .tm-card__surface::after {
  background: linear-gradient(0deg, #102e28bd 0%, #102e2888 26%, #102e2830 50%, transparent 75%);
}
#agency-site .tm-section--quote-type .tm-card .tm-quote {
  top: 28px;
  bottom: auto;
}
#agency-site .tm-section--quote-type .tm-header { margin-bottom: 6px; }
#agency-site .tm-section--quote-type .tm-group { padding-top: 36px; }
#agency-site .tm-section--quote-type .tm-card .tm-quote q { font-size: clamp(20px, 2.1cqi, 28px); }
#agency-site .tm-section--quote-type .tm-quote-mark {
  top: -54px;
  font-size: 62px;
  font-weight: 700;
  line-height: 1.15;
}
#agency-site .tm-section--quote-type .tm-card .tm-card__surface::after {
  background: linear-gradient(180deg, #102e28b8 0%, #102e2870 24%, #102e2820 46%, transparent 68%);
}
#agency-site .tm-section .tm-card[data-testimonial-style="plain"] .tm-card__surface::after { content: none; }
#agency-site .tm-card[data-testimonial-style="plain"] .tm-quote { display: none; }
#agency-site .tm-section.is-dragging .tm-card { cursor: grabbing; transform: none; transition: none; }
#agency-site .tm-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 14px 24px -14px #143e3840;
  opacity: 0;
  pointer-events: none;
  transition: opacity 380ms var(--taste-ease);
}
#agency-site .tm-section--framed .tm-card {
  border-radius: 14px;
  outline: 7px solid var(--taste-page);
  box-shadow: 0 10px 20px -16px #143e3866;
}
#agency-site .tm-section--framed .tm-card__surface { background: var(--tm-placeholder, #d2e4da); }
#agency-site .tm-card__open {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--taste-page);
  color: var(--taste-ink);
  font-size: 24px;
  line-height: 1;
  opacity: 0;
  transform: translateY(6px) scale(.92);
  transition: opacity 240ms ease, transform 340ms var(--taste-ease);
}
#agency-site .tm-play {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fbfdfcdb;
  color: var(--taste-ink);
  box-shadow: 0 6px 22px #143e380a;
  pointer-events: none;
  transition: transform 340ms var(--taste-ease);
}
#agency-site .tm-play::before {
  content: '';
  margin-left: 4px;
  border: 8px solid transparent;
  border-right: 0;
  border-left: 12px solid currentColor;
}
#agency-site .tm-thumbnail { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#agency-site .tm-card:focus-visible { outline-offset: 10px; }
#agency-site .tm-card:focus-visible .tm-card__open { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) {
  #agency-site .tm-card:hover { transform: translateY(-7px) scale(1.014); }
  #agency-site .tm-card:hover::after { opacity: 1; }
  #agency-site .tm-card:hover .tm-card__open { opacity: 1; transform: none; }
  #agency-site .tm-card:hover .tm-play { transform: scale(1.08); }
}
#agency-site .tm-card:active { transform: scale(.985); }
/* Native dialog owns focus. Only page scrolling stops; the rows keep moving. */
body.site-with-contact-bar:has(#testimonial-dialog[open]) #agency-site { overflow-y: hidden; }
body:has(#testimonial-dialog[open]) .site-overlay-scrollbar { opacity: 0; pointer-events: none; }
body:has(#testimonial-dialog[open]) .site-overlay-scrollbar__thumb { pointer-events: none; }
#agency-site .tm-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 76px 24px 24px;
  border: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: transparent;
  color: var(--taste-ink);
}
#agency-site .tm-dialog[open] { display: flex; align-items: center; justify-content: center; }
#agency-site .tm-dialog::backdrop { background: #102f29a8; }
#agency-site .tm-dialog[open]::backdrop { animation: tm-backdrop-in 280ms ease both; }
#agency-site .tm-dialog[data-closing]::backdrop { animation: tm-backdrop-out 240ms ease both; }
@keyframes tm-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tm-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
#agency-site .tm-dialog__panel {
  position: relative;
  flex: none;
  width: min(1040px, 88vw, calc((100dvh - 132px) * var(--tm-ratio, 1.6)));
  margin: auto;
  border-radius: 20px;
  background: var(--taste-page);
  box-shadow: 0 28px 80px #102f2940;
}
#agency-site .tm-viewer {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: var(--tm-ratio, 1.6);
  overflow: hidden;
  border-radius: inherit;
  background: var(--tm-placeholder, var(--taste-mist));
}
#agency-site .tm-media { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
#agency-site .tm-close {
  position: absolute;
  top: -56px;
  right: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0 0 3px;
  border: 1px solid #fbfdfc66;
  border-radius: 50%;
  background: var(--taste-page);
  font-size: 32px;
  line-height: 1;
  transition: transform 240ms var(--taste-ease);
}
#agency-site .tm-close:hover { transform: rotate(90deg); }
#agency-site .tm-viewer__error { position: relative; z-index: 1; padding: 28px; background: var(--taste-page); color: var(--taste-ink); text-align: center; }
#agency-site .tm-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@container (max-width: 680px) {
  #agency-site .tm-header { width: calc(100% - 40px); margin-bottom: 24px; }
  #agency-site .tm-section--soft .tm-header { padding-inline: 0; }
  #agency-site .tm-section--soft .tm-heading { text-align: left; }
  #agency-site .tm-section--framed { border-radius: 30px; }
  #agency-site .tm-card { border-radius: 18px; }
  #agency-site .tm-section--framed .tm-card { outline-width: 5px; }
  #agency-site .tm-play { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  #agency-site .tm-dialog::backdrop { animation: none; }
  #agency-site .tm-pause { display: none; }
  #agency-site .tm-section .tm-header { padding-inline: 0; }
  #agency-site .tm-section .tm-viewport { overflow-x: auto; mask-image: none; -webkit-mask-image: none; touch-action: auto; }
  #agency-site .tm-section .tm-track { transform: none !important; will-change: auto; }
  #agency-site [data-testimonial-clone] { display: none; }
  #agency-site .tm-card:hover, #agency-site .tm-card:active, #agency-site .tm-close:hover { transform: none; }
}

/* Optional bottom quote: the badge straddles the left edge alongside the text. */
#agency-site .tm-section .tm-card[data-testimonial-style="quote-bottom"] .tm-quote {
  top: auto;
  bottom: 18px;
  left: -22px;
  right: 16px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
#agency-site .tm-section .tm-card[data-testimonial-style="quote-bottom"] .tm-quote-mark {
  position: relative;
  top: auto;
  left: auto;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}
#agency-site .tm-section .tm-card[data-testimonial-style="quote-bottom"] .tm-quote q { flex: 1; min-width: 0; }
#agency-site .tm-section .tm-card[data-testimonial-style="quote-bottom"] .tm-card__surface::after {
  content: '';
  background: linear-gradient(0deg, #102e28ed 0%, #102e28b8 25%, #102e2840 44%, transparent 62%);
}
