/* Green placeholder until the footer HTML has loaded, then display:contents
   so the real <footer> is what actually paints. */
site-footer {
  display: block;
  min-height: 16rem;
  background: #1a2418;
}

site-footer[data-ready] {
  display: contents;
}

site-footer img {
  max-width: 100%;
  display: block;
}

site-footer a {
  color: inherit;
}

site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer {
  background: #1a2418;
  color: rgba(245, 241, 228, 0.82);
}

/* Cream strip of logos. The track is twice as long as the originals
   (JS clones them) so a -50% translate loops without a jump. */
.sponsors {
  overflow: hidden;
  background: var(--paper);
  padding: 2.25rem 0 2rem;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.sponsors__label {
  margin: 0 0 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Fade the logos out at the edges so they don't clip hard. */
.sponsors__viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 5%,
    #000 95%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 5%,
    #000 95%,
    transparent
  );
}

.sponsors__track {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: max-content;
  padding: 0.35rem 1.25rem;
  animation: marquee 110s linear infinite;
}

.sponsors__track:hover {
  animation-play-state: paused;
}

.sponsors__track img {
  display: block;
  box-sizing: border-box;
  width: 9.5rem;
  height: 9.5rem;
  object-fit: contain;
  object-position: center;
  flex: 0 0 auto;
}

.sponsors__track img[data-sponsor-id] {
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}

.sponsors__track img[data-sponsor-id]:hover {
  transform: scale(1.05);
}

.sponsors__track img[data-sponsor-id]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* These four sponsor logos ship with an opaque brand-colour background
   (not white like the rest), so they can't float on the strip the same
   way — give them a small matte instead of leaving a bare colour block. */
.sponsors__track img[src$="/25.jpg"],
.sponsors__track img[src$="/11.jpg"],
.sponsors__track img[src$="/42.jpg"],
.sponsors__track img[src$="/44.jpg"] {
  padding: 0.6rem;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 0.35rem;
}

/* No sliding strip — wrap the logos in a static grid instead. */
@media (prefers-reduced-motion: reduce) {
  .sponsors__track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: min(100% - 2rem, var(--content));
    margin-inline: auto;
    gap: 0.85rem 1rem;
    padding: 0.25rem 0;
  }

  .sponsors__viewport {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .sponsors__track img[aria-hidden="true"] {
    display: none;
  }

  .sponsors__track img {
    width: 8rem;
    height: 8rem;
  }
}

/* Dark green block under the logos: contact details + site links. */
.footer-main {
  padding: var(--space-xl) 0 var(--space-lg);
}

.footer-main__inner {
  display: grid;
  gap: var(--space-lg);
  width: min(100% - 2rem, var(--content));
  margin-inline: auto;
  margin-bottom: var(--space-lg);
}

.footer-brand__logo {
  display: block;
  width: auto;
  height: 2.75rem;
  max-width: min(12.5rem, 42vw);
  object-fit: contain;
  object-position: left center;
  margin: 0 0 0.85rem;
}

.footer-brand p {
  margin-bottom: 0.35rem;
}

.footer-contact {
  margin-top: 1rem !important;
  font-size: 0.95rem;
}

.footer-contact a {
  color: var(--yolk-bright);
  text-decoration: none;
}

.footer-nav ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
}

.footer-nav a {
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-nav a:hover {
  color: var(--paper);
}

.footer-copy {
  width: min(100% - 2rem, var(--content));
  margin: 0 auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(245, 241, 228, 0.1);
  font-size: 0.85rem;
  color: rgba(245, 241, 228, 0.55);
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (min-width: 840px) {
  .footer-main__inner {
    grid-template-columns: 1fr 1.4fr;
    align-items: start;
  }

  .footer-nav ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---- Sponsor popup (opened by clicking a logo; built by footer.js) ---- */
html.sponsor-modal-open {
  overflow: hidden;
}

.sponsor-modal {
  width: min(32rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(38, 40, 31, 0.35);
  overflow: auto;
}

.sponsor-modal::backdrop {
  background: rgba(38, 40, 31, 0.6);
}

.sponsor-modal__panel {
  position: relative;
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
  font-family: var(--font-body);
}

.sponsor-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius);
}

.sponsor-modal__close:hover {
  color: var(--ink);
}

.sponsor-modal__close:focus-visible,
.sponsor-modal__link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.sponsor-modal__logo img {
  display: block;
  width: 11rem;
  height: 11rem;
  margin: 0 auto 1rem;
  object-fit: contain;
}

.sponsor-modal__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.25;
  color: var(--field);
}

.sponsor-modal__body {
  margin: 0 0 1.5rem;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink);
}

.sponsor-modal__body.is-loading {
  text-align: center;
  color: var(--muted);
}

.sponsor-modal__body p {
  margin: 0 0 0.85rem;
}

.sponsor-modal__body a {
  color: var(--field);
  text-decoration: underline;
}

.sponsor-modal__link {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  background: var(--field);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.sponsor-modal__link:hover {
  background: var(--field-deep);
}
