/* =========================================================
   SHAAGIRD VIDEOS GALLERY — STORIES OF CHANGE
   Branded with Shaagird Teal (#299D8E) & Design System
========================================================= */

.m2s-gallery {
  --accent: #299D8E;
  --accent-dark: #217F74;
  --text: #173B38;
  --muted: #5F716E;
  --bg: #E7F5F2;
  --panel: #FFFFFF;
  --ink: #173B38;
  --line: #DCE9E6;
  --shadow: 0 18px 50px rgba(23, 59, 56, 0.08);

  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding: 36px 0 70px;
  font-family: "Inter", Arial, sans-serif;
  background:
    linear-gradient(90deg, rgba(41, 157, 142, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(41, 157, 142, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, #FFFFFF 0%, var(--bg) 42%, #FFFFFF 100%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
  color: var(--text);
  text-align: left;
  word-spacing: normal;
  overflow-x: hidden;
}

.m2s-gallery *,
.m2s-gallery *::before,
.m2s-gallery *::after {
  box-sizing: border-box;
}

.m2s-gallery p,
.m2s-gallery h1,
.m2s-gallery h2,
.m2s-gallery h3 {
  margin: 0;
  text-align: left;
  word-spacing: normal;
}

.m2s-gallery .gallery-header,
.m2s-gallery .gallery-content {
  width: min(1400px, calc(100% - 24px));
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Gallery Header */
.m2s-gallery .gallery-header {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.98) 0%, rgba(231, 245, 242, 0.96) 62%, rgba(41, 157, 142, 0.08) 100%);
  box-shadow: var(--shadow);
}

.m2s-gallery .gallery-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
}

.m2s-gallery .gallery-header::after {
  content: "";
  position: absolute;
  right: clamp(18px, 4vw, 50px);
  bottom: -36px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(41, 157, 142, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

.m2s-gallery .eyebrow,
.m2s-gallery .category-heading p {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.m2s-gallery .gallery-header h1 {
  max-width: 720px;
  color: var(--ink);
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1;
  letter-spacing: 0;
}

.m2s-gallery .header-copy {
  max-width: 680px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

/* Gallery Content Area */
.m2s-gallery .gallery-content {
  display: grid !important;
  gap: 18px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.m2s-gallery .category-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.m2s-gallery .category-heading h2 {
  color: var(--ink);
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.05;
}

.m2s-gallery .category-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.m2s-gallery .category-heading span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
}

.m2s-gallery .channel-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 6px 13px;
  background: var(--accent);
  color: #FFFFFF !important;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(41, 157, 142, 0.25);
}

.m2s-gallery .channel-link:hover {
  background: var(--accent-dark);
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(41, 157, 142, 0.35);
}

.m2s-gallery .channel-link .yt-badge-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.m2s-gallery .channel-link:hover .yt-badge-icon {
  transform: scale(1.08);
}

/* Video Grid and Cards */
.m2s-gallery .video-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 18px !important;
}

.m2s-gallery .video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 10px 26px rgba(23, 59, 56, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.m2s-gallery .video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(23, 59, 56, 0.12);
}

.m2s-gallery .video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
  overflow: hidden;
  cursor: pointer;
}

.m2s-gallery .video-frame .video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
  display: block;
}

.m2s-gallery .video-card:hover .video-thumb {
  transform: scale(1.04);
}

.m2s-gallery .video-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.18);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background 0.25s ease;
  z-index: 2;
}

.m2s-gallery .video-card:hover .video-play-btn {
  background: rgba(0, 0, 0, 0.04);
}

.m2s-gallery .video-play-btn svg {
  width: 60px;
  height: 42px;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.5));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.m2s-gallery .video-play-btn svg .play-btn-bg {
  fill: #FF0000;
  transition: fill 0.2s ease;
}

.m2s-gallery .video-card:hover .video-play-btn svg {
  transform: scale(1.14);
  filter: drop-shadow(0 6px 18px rgba(255, 0, 0, 0.5));
}

.m2s-gallery .video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 5;
}

.m2s-gallery .video-info {
  display: grid;
  gap: 12px;
  min-height: 112px;
  padding: 15px 14px 18px;
}

.m2s-gallery .video-info h3 {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
}

.m2s-gallery .video-info a {
  align-self: end;
  width: fit-content;
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.m2s-gallery .video-info a:hover {
  background: var(--accent-dark);
  color: #FFFFFF;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .m2s-gallery .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .m2s-gallery {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 28px 0 46px;
  }

  .m2s-gallery .gallery-header h1 {
    max-width: 300px;
    font-size: 42px;
    line-height: 1.05;
    text-align: left !important;
  }

  .m2s-gallery .header-copy {
    max-width: 100%;
    text-align: left !important;
    word-spacing: normal !important;
  }

  .m2s-gallery .video-grid {
    grid-template-columns: 1fr !important;
  }

  .m2s-gallery .category-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
