/* Gallery & News page (Gallery.html). Brand colours as in mfa-contact.css:
   red #cb0000, navy #021325; type is the site's Oswald / Ubuntu / Open Sans.
   Layout: a dark matchday-programme hero with a moving photo wall, then
   video of the day, news, and a filterable media-day photo grid. */

.mg {
  --mg-red: #cb0000;
  --mg-red-dark: #a30000;
  --mg-navy: #021325;
  --mg-navy-2: #0a2540;
  --mg-ink: #0b1b2e;
  --mg-muted: #586577;
  --mg-line: #dfe4ea;
  --mg-paper: #f4f6f9;
  --mg-green: #1a7f45;
  --mg-gutter: 20px;
  background: var(--mg-paper);
  color: var(--mg-ink);
}

.mg-wrap {
  width: min(1140px, 100% - 2 * var(--mg-gutter));
  margin: 0 auto;
}

.mg p {
  margin: 0;
}

.mg p.mg-eyebrow {
  font: 700 0.8125rem/1.2 "Open Sans", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mg-red);
}

.mg h1,
.mg h2,
.mg h3 {
  margin: 0;
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  text-wrap: balance;
}

.mg a:focus-visible,
.mg button:focus-visible {
  outline: 3px solid #478ac9;
  outline-offset: 3px;
}

/* ---------- Hero with the moving photo wall ---------- */

.mg-hero {
  position: relative;
  overflow: hidden;
  background: var(--mg-navy);
  color: #fff;
  padding: 88px 0 72px;
}

.mg-wall {
  position: absolute;
  inset: -20px 0;
  display: grid;
  gap: 12px;
  align-content: center;
  transform: rotate(-4deg) scale(1.12);
  opacity: 0.8;
}

.mg-row {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: mg-slide 70s linear infinite;
}

.mg-row:nth-child(2) {
  animation-direction: reverse;
  animation-duration: 85s;
}

.mg-row:nth-child(3) {
  animation-duration: 100s;
}

.mg-row img {
  display: block;
  height: 168px;
  width: auto;
  border-radius: 12px;
  background: var(--mg-navy-2);
}

@keyframes mg-slide {
  to {
    transform: translateX(-50%);
  }
}

.mg-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 19, 37, 0.95) 0%, rgba(2, 19, 37, 0.75) 45%, rgba(2, 19, 37, 0.15) 100%),
    linear-gradient(0deg, rgba(2, 19, 37, 0.9) 0%, transparent 40%);
}

.mg-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  max-width: 640px;
}

.mg-hero p.mg-eyebrow {
  color: #ff6b6b;
}

.mg-hero h1 {
  font-size: clamp(2.75rem, 7vw, 5rem);
  line-height: 0.98;
  color: #fff;
}

.mg-hero p.mg-lede {
  font: 400 1.125rem/1.6 Ubuntu, sans-serif;
  color: rgba(255, 255, 255, 0.85);
  max-width: 34em;
}

.mg-hero p.mg-today {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font: 600 0.875rem/1.2 "Open Sans", sans-serif;
  color: #fff;
}

.mg-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 0 4px rgba(61, 220, 132, 0.25);
}

.mg-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.mg-jump a {
  padding: 11px 18px;
  border-radius: 10px;
  font: 700 0.9375rem/1 "Open Sans", sans-serif;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.mg-jump a:first-child {
  background: var(--mg-red);
}

.mg-jump a:hover {
  background: var(--mg-red-dark);
  color: #fff;
}

/* ---------- Shared section layout ---------- */

.mg-section {
  padding: 72px 0;
}

.mg-head {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.mg-head h2 {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.05;
  color: var(--mg-ink);
}

.mg-head p.mg-sub {
  font: 400 1.0625rem/1.6 Ubuntu, sans-serif;
  color: var(--mg-muted);
  max-width: 40em;
}

/* ---------- Video of the day ---------- */

.mg-video {
  background: #fff;
}

.mg-player {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.mg-main-clip {
  margin: 0;
}

.mg-main-clip video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #000;
}

.mg-main-clip figcaption {
  display: grid;
  gap: 4px;
  padding-top: 14px;
}

.mg-main-clip h3 {
  font-size: 1.75rem;
  line-height: 1.15;
}

.mg-main-clip p.mg-match {
  font: 400 1rem/1.4 Ubuntu, sans-serif;
  color: var(--mg-muted);
}

.mg-playlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.mg-playlist p.mg-eyebrow {
  margin-bottom: 2px;
}

.mg-clip-btn {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--mg-line);
  border-radius: 14px;
  background: var(--mg-paper);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.mg-clip-btn:hover {
  border-color: var(--mg-red);
}

.mg-clip-btn img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 9px;
}

.mg-clip-btn strong {
  display: block;
  font: 500 1rem/1.25 Oswald, sans-serif;
  text-transform: uppercase;
}

.mg-clip-btn span {
  display: block;
  margin-top: 4px;
  font: 400 0.8125rem/1.35 Ubuntu, sans-serif;
  color: var(--mg-muted);
}

/* ---------- News ---------- */

.mg-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--mg-navy);
  color: #fff;
  margin-bottom: 24px;
}

.mg-lead-media {
  background: #fff;
  display: grid;
  place-items: center;
  padding: 24px;
}

.mg-lead-media img {
  display: block;
  width: 100%;
  height: auto;
}

.mg-lead-body {
  display: grid;
  gap: 14px;
  align-content: center;
  padding: 36px;
}

.mg-lead-body h3 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.08;
  color: #fff;
}

.mg-lead-body p.mg-story-text {
  font: 400 1.0625rem/1.65 Ubuntu, sans-serif;
  color: rgba(255, 255, 255, 0.85);
}

.mg-score {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font: 600 1rem/1 "Open Sans", sans-serif;
}

.mg-score b {
  font: 600 1.75rem/1 Oswald, sans-serif;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.mg-stories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.mg-story {
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--mg-line);
}

.mg-story-media {
  aspect-ratio: 4 / 3;
  background: var(--mg-navy);
  overflow: hidden;
}

.mg-story-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mg-story-media img.mg-top {
  object-position: 50% 12%;
}

.mg-story-body {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 20px;
}

.mg-story-body h3 {
  font-size: 1.375rem;
  line-height: 1.15;
  color: var(--mg-ink);
}

.mg-story-body p.mg-story-text {
  font: 400 0.9688rem/1.6 Ubuntu, sans-serif;
  color: #33404f;
}

.mg p.mg-date {
  font: 700 0.75rem/1 "Open Sans", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mg-muted);
}

.mg-lead p.mg-date {
  color: #ff8a8a;
}

a.mg-more {
  justify-self: start;
  font: 700 0.9375rem/1.2 "Open Sans", sans-serif;
  color: var(--mg-red);
  text-decoration: none;
}

a.mg-more::after {
  content: " \2192";
}

a.mg-more:hover {
  text-decoration: underline;
}

/* ---------- Photos ---------- */

.mg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.mg-chip {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--mg-line);
  background: #fff;
  font: 600 0.875rem/1 "Open Sans", sans-serif;
  color: var(--mg-ink);
  cursor: pointer;
}

.mg-chip span {
  margin-left: 6px;
  color: var(--mg-muted);
  font-variant-numeric: tabular-nums;
}

.mg-chip[aria-pressed="true"] {
  background: var(--mg-navy);
  border-color: var(--mg-navy);
  color: #fff;
}

.mg-chip[aria-pressed="true"] span {
  color: rgba(255, 255, 255, 0.7);
}

.mg-grid {
  columns: 4 220px;
  column-gap: 14px;
}

.mg-tile {
  break-inside: avoid;
  margin: 0 0 14px;
}

.mg-tile button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--mg-navy);
  cursor: zoom-in;
}

.mg-tile img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.35s ease;
}

.mg-tile button:hover img {
  transform: scale(1.04);
}

.mg-tile[hidden] {
  display: none;
}

.mg-empty {
  font: 400 1rem/1.6 Ubuntu, sans-serif;
  color: var(--mg-muted);
}

/* ---------- Lightbox ---------- */

.mg-lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(2, 10, 20, 0.94);
  color: #fff;
}

.mg-lightbox::backdrop {
  background: rgba(2, 10, 20, 0.6);
}

.mg-lightbox[open] {
  display: grid;
  grid-template-rows: 1fr auto;
}

.mg-lightbox figure {
  margin: 0;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 56px 64px 8px;
}

.mg-lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 8px;
}

.mg-lightbox p.mg-lightbox-caption {
  padding: 10px 20px 22px;
  text-align: center;
  font: 400 0.9375rem/1.5 Ubuntu, sans-serif;
  color: rgba(255, 255, 255, 0.85);
}

.mg-lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: 400 1.75rem/1 Oswald, sans-serif;
  cursor: pointer;
}

.mg-lb-btn:hover {
  background: var(--mg-red);
}

.mg-lb-close {
  top: 14px;
  right: 14px;
}

.mg-lb-prev {
  top: 50%;
  left: 12px;
  margin-top: -24px;
}

.mg-lb-next {
  top: 50%;
  right: 12px;
  margin-top: -24px;
}

/* ---------- Join band ---------- */

.mg-join {
  background: var(--mg-red);
  color: #fff;
  padding: 48px 0;
}

.mg-join .mg-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.mg-join h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.05;
  color: #fff;
}

.mg-join p.mg-join-text {
  margin-top: 8px;
  font: 400 1.0625rem/1.5 Ubuntu, sans-serif;
  color: rgba(255, 255, 255, 0.9);
}

.mg-join a.mg-join-btn {
  padding: 15px 22px;
  border-radius: 12px;
  background: #fff;
  color: var(--mg-red);
  font: 700 1rem/1 "Open Sans", sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

.mg-join a.mg-join-btn:hover {
  background: var(--mg-navy);
  color: #fff;
}

/* ---------- Smaller screens ---------- */

@media (max-width: 991px) {
  .mg-player,
  .mg-lead {
    grid-template-columns: minmax(0, 1fr);
  }

  .mg-playlist {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .mg-playlist p.mg-eyebrow {
    grid-column: 1 / -1;
  }
}

@media (max-width: 575px) {
  .mg-hero {
    padding: 64px 0 52px;
  }

  .mg-row img {
    height: 120px;
  }

  .mg-section {
    padding: 52px 0;
  }

  .mg-lead-body {
    padding: 24px;
  }

  .mg-grid {
    columns: 2 140px;
    column-gap: 10px;
  }

  .mg-tile {
    margin-bottom: 10px;
  }

  .mg-lightbox figure {
    padding: 64px 12px 8px;
  }

  .mg-lb-prev,
  .mg-lb-next {
    top: auto;
    bottom: 14px;
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mg-row {
    animation: none;
  }

  .mg-tile img {
    transition: none;
  }
}
