/* Media page fixes (page review 2026-10-15). Loaded after the theme styles, on /media/ only. */

/* ---------- Videos ----------
   Each player is pre-wrapped in the same 16:9 box FitVids builds (classic/fixes/media.json), so the theme
   script leaves it alone instead of moving and reloading every iframe. These rules keep the box working
   even before or without the theme script. A navy fill shows while a player loads instead of a blank white box. */
#content .video-embed > .fluid-width-video-wrapper {
  position: relative;
  width: 100%;
  background-color: #0A285A;
}
#content .video-embed > .fluid-width-video-wrapper > iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* The second video block is empty in WordPress (no video picked): it only added an extra 40px gap. */
#content .video-embed:empty {
  display: none;
}

/* ---------- Page title (now the h1; keeps the look of the h2 it was) ---------- */
#content h1.media-title {
  line-height: 1.8;
  color: #333333;
}

/* ---------- In The News ----------
   One link sat in the first of three columns with the other two empty. Centre it under the heading. */
#content .media-news-item ~ .vc_col-sm-4 {
  display: none;
}
@media (min-width: 768px) {
  #content .media-news-item {
    float: none;
    margin-left: auto;
    margin-right: auto;
  }
}
/* The white section notch above that row is invisible on white, but on phones it cut a gap
   into the top border of the news link. */
#content .section-triangle {
  display: none;
}

/* ---------- Video grid (polish 2026-10-16) ----------
   The 17 videos were stacked full width (about 12,000px of page on desktop). They now sit in a grid
   (wrapper added in classic/fixes/media.json): 2 columns from iPad portrait up, 1 column on phones.
   The first video (the newest, SKY5 Chicago Police Pursuit January 2025) spans both columns as the
   featured one, so the other 16 fill 8 even rows with no odd one out. Order is unchanged. */
#content .media-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
#content .media-grid > .video-embed {
  margin: 0;
  min-width: 0;
}
@media (min-width: 700px) {
  #content .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 30px;
  }
  #content .media-grid > .video-embed:first-child {
    grid-column: 1 / -1;
  }
}

/* (2026-11-12) HeliOps Magazine's Cook County video is now first. It and SKY5 both span the two columns, so the other
   16 still fill 8 even rows. */
@media (min-width: 700px) {
  #content .media-grid > .video-embed.media-wide { grid-column: 1 / -1; }
}
