@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&display=swap');

/* Homepage gallery frame: two clipped rows show three moving club panels at a time. */
.gallery-main { background: var(--home-black, #111211); }
/* Gallery control: remain fixed over the photos while paused images can scroll underneath. */
.gallery-frame { position:relative; }
.gallery-main .gallery-pause {
  position:absolute;
  bottom:12px;
  left:12px;
  z-index:2;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  width:44px;
  height:44px;
  margin:0;
  padding:10px;
  border:1px solid #111211;
  border-radius:0;
  color:#000;
  background:#faecd2;
  cursor:pointer;
}
.gallery-main .gallery-pause[hidden] { display:none; }
.gallery-pause svg { display:block; width:24px; height:24px; pointer-events:none; }
.gallery-pause .gallery-play-icon,
.gallery-pause[data-paused="true"] .gallery-pause-icon { display:none; }
.gallery-pause[data-paused="true"] .gallery-play-icon { display:block; }
.gallery-main .gallery-pause:focus-visible { outline:3px solid #000; outline-offset:2px; box-shadow:0 0 0 6px #faecd2; }

/* Homepage shortcuts: let the shared mission background show around the buttons. */
.home-quick-actions {
  display:flex;
  justify-content:center;
  gap:12px;
  box-sizing:border-box;
  width:100%;
  padding:18px clamp(18px, 5vw, 72px);
  background:transparent;
}
.home-quick-actions__link {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  box-sizing:border-box;
  min-height:60px;
  padding:8px 18px 8px 8px;
  border:1px solid #454945;
  border-radius:6px;
  color:#faecd2;
  background:#111211;
  font:700 14px/1.4 Arial, Helvetica, sans-serif;
  letter-spacing:.08em;
  text-decoration:none;
  text-transform:uppercase;
  transition:transform .18s ease, border-color .18s ease;
}
/* Editorial shortcuts: a separate green arrow tile leads the label. */
.home-quick-actions__icon { display:grid; flex:0 0 44px; width:44px; height:44px; place-items:center; border-radius:3px; color:#111211; background:#dffc3a; }
.home-quick-actions__icon svg { width:20px; height:20px; transition:transform .25s cubic-bezier(.16, 1, .3, 1); }
.home-quick-actions__title { flex:1; min-width:0; }
.home-quick-actions__link:hover,
.home-quick-actions__link:focus-visible { border-color:#dffc3a; }
.home-quick-actions__link:hover .home-quick-actions__icon svg,
.home-quick-actions__link:focus-visible .home-quick-actions__icon svg { transform:translateX(2px); }
.home-quick-actions__link:active { transform:scale(.98); }
.home-quick-actions__link:focus-visible { outline:2px solid #faecd2; outline-offset:4px; }
@media (prefers-reduced-motion:reduce) {
  .home-quick-actions__link,
  .home-quick-actions__icon svg { transition:none; transform:none !important; }
}
.a11y-reduce-motion .home-quick-actions__link,
.a11y-reduce-motion .home-quick-actions__icon svg { transform:none !important; }
@media (max-width:760px) {
  .home-quick-actions { flex-direction:column; }
  .home-quick-actions__link { width:100%; }
}
.grid-container#club-gallery {
  --gallery-card-width: calc(100vw / 3);
  --gallery-image-height: clamp(150px, 25vw, 330px);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  border: 0;
  min-height: calc(var(--gallery-image-height) * 2);
  background: #111211;
}

/* Both rows share one roll direction and duration; row two starts half a card later. */
/* First paint: hide only the gallery during its shuffle and hold motion through page navigation. */
.gallery-initialising #club-gallery,
.gallery-initialising .gallery-pause { visibility:hidden; }
.gallery-initialising #club-gallery .gallery-track,
.gallery-navigating #club-gallery .gallery-track { animation-play-state:paused; }
#club-gallery .gallery-row {
  width: 100%;
  overflow: hidden;
  border: 0;
}
#club-gallery .gallery-track {
  display: flex;
  width: calc(var(--gallery-card-width) * var(--gallery-card-count));
  border: 0;
  animation: club-panel-roll var(--roll-duration, 36s) linear infinite;
  animation-delay: var(--roll-phase-offset, 0s);
  will-change: transform;
}
/* Container units resize the entire loop in the same layout pass, without observer lag. */
@supports (width: 1cqw) {
  #club-gallery .gallery-row { container-type: inline-size; }
  #club-gallery .gallery-track { --gallery-card-width: calc(100cqw / 3); }
}
@keyframes club-panel-roll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Desktop tiles retain the grayscale-to-hazy-green hover and keyboard-focus treatment. */
#club-gallery .gallery-card {
  position: relative;
  flex: 0 0 var(--gallery-card-width);
  width: var(--gallery-card-width);
  height: var(--gallery-image-height);
  overflow: hidden;
  border: 0;
  background: rgba(223, 252, 58, .62);
}

#club-gallery .gallery-card a { display: block; position: relative; height: 100%; color: white; }
#club-gallery .gallery-card img {
  display: block;
  float: none;
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  opacity: 1;
  transition: opacity .5s ease;
}
/* Photo framing: favour the upper part of these group photos to keep heads visible. */
#club-gallery .gallery-card[data-club-id="sale-harriers"] img,
#club-gallery .gallery-card[data-club-id="ghap-badminton"] img {
  object-position: center 25%;
}
/* Revolution framing: move the photo upward inside its gallery tile. */
#club-gallery .gallery-card[data-club-id="manchester-revolution"] img {
  object-position: center 75%;
}
#club-gallery .gallery-card a:hover img,
#club-gallery .gallery-card a:focus-visible img { opacity: .5; }
/* Desktop captions keep their original black text and animated reveal. */
#club-gallery .gallery-caption {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: fit-content;
  max-width: calc(100% - 36px);
  color: var(--black);
  /* Keep the sport and area free of an extra border beneath the caption. */
  border-bottom: 0;
  opacity: 0;
  transition: opacity .85s ease;
  pointer-events: none;
}
#club-gallery .gallery-caption h2 {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  font: 400 clamp(14px, 1.8vw, 21px)/1.2 'Archivo Black', Arial, Helvetica, sans-serif;
  letter-spacing: -.055em;
  text-transform: uppercase;
}
#club-gallery .gallery-caption__details {
  margin: 17px 0 0;
  font: 700 clamp(10px, 1.1vw, 13px)/1.2 Arial, Helvetica, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .55s ease .12s, transform .55s ease .12s;
}
#club-gallery .gallery-caption h2::before,
#club-gallery .gallery-caption h2::after {
  position: absolute;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--black);
  content: '';
  transform: scaleX(0);
  transition: transform .85s ease;
}
#club-gallery .gallery-caption h2::before { top: -8px; transform-origin: center; }
#club-gallery .gallery-caption h2::after { bottom: -8px; transform-origin: center; }
#club-gallery .gallery-card a:hover .gallery-caption,
#club-gallery .gallery-card a:focus-visible .gallery-caption { opacity: 1; }
#club-gallery .gallery-card a:hover .gallery-caption__details,
#club-gallery .gallery-card a:focus-visible .gallery-caption__details {
  opacity: 1;
  transform: translateY(0);
}
#club-gallery .gallery-card a:hover .gallery-caption h2::before,
#club-gallery .gallery-card a:hover .gallery-caption h2::after,
#club-gallery .gallery-card a:focus-visible .gallery-caption h2::before,
#club-gallery .gallery-card a:focus-visible .gallery-caption h2::after { transform: scaleX(1); }
#club-gallery .gallery-card--unavailable { background: #30342a; }
#club-gallery .gallery-card--unavailable img { visibility: hidden; }
#club-gallery .gallery-card--unavailable .gallery-caption,
#club-gallery .gallery-card--unavailable .gallery-caption__details { color: #faecd2; opacity: 1; }

/* Respect reduced-motion preferences by stopping automatic movement. */
@media (prefers-reduced-motion: reduce) {
  #club-gallery .gallery-track { animation: none; }
  #club-gallery .gallery-card img,
  #club-gallery .gallery-caption,
  #club-gallery .gallery-caption__details,
  #club-gallery .gallery-caption h2::before,
  #club-gallery .gallery-caption h2::after { transition: none; }
}

@media (max-width: 1040px) {
  /* Match the mobile navbar: keep photos grayscale and captions visible without hover. */
  #club-gallery .gallery-card,
  #club-gallery .gallery-card--unavailable { background: #202220; }
  #club-gallery .gallery-card a { color: #dffc3a; }
  #club-gallery .gallery-card img,
  #club-gallery .gallery-card a:hover img,
  #club-gallery .gallery-card a:focus-visible img { opacity: 1; transition: none; }
  #club-gallery .gallery-caption,
  #club-gallery .gallery-card--unavailable .gallery-caption {
    color: #dffc3a;
    opacity: 1;
    transform: none;
    transition: none;
    text-shadow: 0 1px 2px #111211, 0 0 6px rgba(17, 18, 17, .9);
  }
  /* Mobile captions: show only the club title, centred along the bottom of each photo. */
  #club-gallery .gallery-caption { top:auto; bottom:18px; right:18px; width:auto; text-align:center; }
  /* Mobile title labels: neon-green text on a solid grey box replaces the decorative rails. */
  #club-gallery .gallery-caption h2 {
    box-sizing:border-box;
    margin-inline:auto;
    padding:4px 6px;
    color:#dffc3a;
    background:#303030;
    text-shadow:none;
    font-size:clamp(10px, calc(1.8vw - 4px), 17px);
  }
  #club-gallery .gallery-caption h2::before,
  #club-gallery .gallery-caption h2::after { display:none; }
  #club-gallery .gallery-caption__details { display:none; }
}

/* Compact phone sizing remains separate from the mobile colour and interaction rules. */
@media (max-width: 600px) {
  .grid-container#club-gallery { --gallery-image-height: clamp(125px, 36vw, 210px); }
  #club-gallery .gallery-caption { left: 10px; right:10px; top:auto; bottom:10px; max-width: calc(100% - 20px); }
  #club-gallery .gallery-caption h2 { font-size: 9px; }
}
