/* =========================================================
   Video Grid (Elementor Extra widget: ee-media-video-grid)
   Columns and gap come from the widget's Layout section; colors
   and radius from its Style tab through the --ee-vg-* variables.
   ========================================================= */

.ee-media-video-grid {
  --ee-vg-ratio: 16 / 9;
  --ee-vg-radius: 12px;
  --ee-vg-play-bg: #fff;
  --ee-vg-play: #df241b;
  --ee-vg-title: #fff;
  --ee-vg-title-bg: rgba(0, 0, 0, 0.6);
  --ee-vg-focus: #1f6f8b;
}

.ee-media-video-grid__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
}
/* Fallback columns; the widget's "Columns" setting overrides these */
@media (max-width: 1024px) {
  .ee-media-video-grid__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .ee-media-video-grid__grid { grid-template-columns: 1fr; }
}

/* Card is a <button>: reset theme/Elementor button styles */
.ee-media-video-grid .ee-media-video-grid__card,
.ee-media-video-grid .ee-media-video-grid__card:hover,
.ee-media-video-grid .ee-media-video-grid__card:focus,
.ee-media-video-grid .ee-media-video-grid__card:active {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--ee-vg-radius);
  box-shadow: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  cursor: pointer;
  outline: none;
}

.ee-media-video-grid__thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--ee-vg-ratio);
  overflow: hidden;
  border-radius: var(--ee-vg-radius);
  background: #dfe5e8;
  isolation: isolate;
  transform: translateZ(0);
}
.ee-media-video-grid__thumb.ee-is-placeholder,
.ee-media-video-grid__thumb.ee-is-loading-thumb { background: #1a1a1a; }

.ee-media-video-grid__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.4s ease;
}
.ee-media-video-grid__card:hover .ee-media-video-grid__thumb img,
.ee-media-video-grid__card:focus-visible .ee-media-video-grid__thumb img { transform: scale(1.04); }

.ee-media-video-grid__card:focus-visible .ee-media-video-grid__thumb {
  outline: 3px solid var(--ee-vg-focus);
  outline-offset: 3px;
}

/* play button */
.ee-media-video-grid__play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 68px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--ee-vg-play-bg);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.ee-media-video-grid__play svg {
  width: 26px;
  height: 26px;
  fill: var(--ee-vg-play);
  transition: fill 0.2s ease;
}
.ee-media-video-grid__card:hover .ee-media-video-grid__play,
.ee-media-video-grid__card:focus-visible .ee-media-video-grid__play {
  background: var(--ee-vg-play);
  transform: translate(-50%, -50%) scale(1.08);
}
.ee-media-video-grid__card:hover .ee-media-video-grid__play svg,
.ee-media-video-grid__card:focus-visible .ee-media-video-grid__play svg { fill: var(--ee-vg-play-bg); }

/* title bar over the bottom of the thumbnail */
.ee-media-video-grid__title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  box-sizing: border-box;
  padding: 18px 22px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0 0 var(--ee-vg-radius) var(--ee-vg-radius);
  background: var(--ee-vg-title-bg);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  color: var(--ee-vg-title);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ee-media-video-grid__empty {
  padding: 24px;
  border: 1px dashed #c9c9c9;
  text-align: center;
  color: #7a7a7a;
}

/* ---------- phones: lighter title bar and play button ----------
   (A plain media query on purpose: sizing these to each card with CSS
   container queries made Elementor's flex containers measure the cards
   as 0px tall, so the next section overlapped the grid.) */
@media (max-width: 767px) {
  .ee-media-video-grid__title { padding: 12px 16px 14px; font-size: 0.95rem; }
  .ee-media-video-grid__play { width: 56px; height: 56px; }
  .ee-media-video-grid__play svg { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .ee-media-video-grid__thumb img,
  .ee-media-video-grid__play { transition: none; }
}

/* Inside an Elementor flex container, take the width Elementor gives widgets
   (100% in column containers) — the same rule Elementor uses for its own Video
   widget. Without it, a container with "Wrap" on measures this widget at 0px
   wide, so its height comes out near 0 and the next section overlaps it. */
.e-con-inner > .elementor-widget-ee-media-video-grid,
.e-con > .elementor-widget-ee-media-video-grid {
  width: var(--container-widget-width);
  --flex-grow: var(--container-widget-flex-grow);
}