/*
 * Gaelic 4 Good responsive media system — v5.33
 * Keeps photographs, background heroes, crests, logos and decorative artwork
 * proportionate across desktop, tablet and phone layouts.
 */

html {
  max-width: 100%;
  overflow-x: clip;
}
body {
  max-width: 100%;
  overflow-x: hidden;
}
img,
picture,
video,
canvas {
  max-width: 100%;
}
img {
  height: auto;
}
figure,
picture {
  min-width: 0;
}
main figure,
main picture {
  max-width: 100%;
}
.g4g-wrap,
[class*="-grid"] > *,
[class*="-layout"] > *,
.split-feature > *,
.sponsor-story > *,
.image-banner > *,
.involved-story > * {
  min-width: 0;
}

/* Background photographs must never tile on touch devices. */
.hero-photo,
.page-hero-photo,
.gala-photo-bg,
.events-hero.events-hero-photo,
.partner-proof.has-proof-background,
.scrapbook-hero,
.contact-hero-modern,
.home-team-card.team-card-photo,
.impact-card.impact-photo {
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-attachment: scroll !important;
}

/* Logos and artwork should remain fully visible rather than being cropped. */
.brand img,
.footer-brand img,
.team-crest,
.captain-crest,
.panel-heading > img,
.sponsor-logo img,
.sponsor-story-logo:not(.has-photo) > img,
.sponsor-logo-badge img,
.events-logo-panel img,
.events-hero-mark img,
.merch-crests img,
.player-charity img {
  object-fit: contain;
}

/* Tablet: iPad, Android tablet and smaller laptop widths. */
@media (max-width: 1050px) {
  .g4g-wrap {
    width: min(100% - 44px, 1260px);
  }

  .hero,
  .page-hero,
  .events-hero,
  .scrapbook-hero,
  .awards27-hero {
    min-height: clamp(590px, 72svh, 760px);
  }

  .hero-photo {
    background-position:
      var(--g4g-focal-x, 50%)
      calc(var(--g4g-focal-y, 44%) + var(--g4g-parallax-y, 0px));
  }
  .page-hero-photo {
    background-position:
      var(--g4g-focal-x, 50%)
      calc(var(--g4g-focal-y, 50%) + var(--g4g-parallax-y, 0px));
  }
  .events-hero.events-hero-photo {
    background-position:
      var(--events-hero-x, 50%)
      var(--events-hero-y, 50%);
  }
  .scrapbook-hero {
    background-position:
      var(--scrapbook-focal-x, 50%)
      var(--scrapbook-focal-y, 50%);
  }
  .contact-hero-modern {
    background-position:
      center center,
      center center,
      var(--contact-hero-x, 50%) var(--contact-hero-y, 50%);
  }

  .feature-photo {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
  .feature-photo img {
    width: 100%;
    height: 100%;
  }

  .story-gallery {
    grid-template-rows: repeat(2, clamp(230px, 28vw, 320px));
  }

  .home-team-card {
    min-height: clamp(390px, 48vw, 520px);
  }
  .team-crest {
    width: clamp(145px, 24vw, 210px);
    max-height: 250px;
  }

  .image-banner > img,
  .involved-story > img {
    height: clamp(410px, 58vw, 590px);
  }

  .captain-photo {
    height: auto;
    aspect-ratio: 4 / 3;
  }
  .captain-photo > img {
    width: 100%;
    height: 100%;
  }
  .captain-crest {
    width: clamp(78px, 10vw, 100px);
    height: clamp(78px, 10vw, 100px);
  }

  .panel-poster {
    width: min(100%, 620px);
    max-width: 100%;
  }
  .panel-poster img {
    width: 100%;
    height: auto;
  }

  .sponsor-story-logo.has-photo {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
  .sponsor-story-logo.has-photo > .sponsor-story-photo {
    width: 100%;
    height: 100%;
  }

  .events-hero-mark {
    justify-self: center;
    width: min(100%, 430px);
  }
  .events-hero-mark img {
    width: 100%;
    height: auto;
  }

  .merch-crests img {
    width: min(48%, 280px);
  }

  .awards27-ribbon {
    width: clamp(280px, 37vw, 390px);
  }
  .awards27-star {
    width: clamp(26px, 3.5vw, 36px);
    height: clamp(26px, 3.5vw, 36px);
  }

  .partner-proof.partner-proof-v2.has-proof-background {
    background-position:
      var(--proof-focal-x, 68%)
      var(--proof-focal-y, 50%);
  }
}

/* Phones and narrow tablets. */
@media (max-width: 760px) {
  .g4g-wrap {
    width: min(100% - 32px, 1260px);
  }

  .hero {
    min-height: clamp(600px, 82svh, 720px);
  }
  .page-hero,
  .events-hero,
  .scrapbook-hero,
  .awards27-hero {
    min-height: clamp(540px, 76svh, 680px);
  }
  .contact-hero-modern {
    min-height: clamp(320px, 48svh, 440px);
    display: grid;
    align-items: end;
    padding: 66px 0 58px;
  }

  .hero-photo,
  .page-hero-photo,
  .gala-photo-bg,
  .events-hero.events-hero-photo,
  .partner-proof.has-proof-background,
  .scrapbook-hero,
  .contact-hero-modern {
    background-size: cover !important;
  }

  .hero-inner,
  .page-hero-inner,
  .events-hero-grid,
  .scrapbook-hero-inner,
  .awards27-hero-grid {
    width: 100%;
  }

  .impact-card.impact-photo {
    min-height: 0;
    aspect-ratio: 4 / 5;
  }
  .home-team-card {
    min-height: 0;
    aspect-ratio: 4 / 5;
    background-position:
      var(--team-focal-x, 50%)
      var(--team-focal-y, 50%);
  }
  .team-crest {
    width: clamp(120px, 38vw, 165px);
    max-height: 180px;
  }

  .feature-photo {
    min-height: 0;
    aspect-ratio: 4 / 5;
  }
  .feature-photo img {
    object-position: center 24%;
  }

  .story-gallery {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-rows: auto;
  }
  .story-shot,
  .story-shot-lead,
  .story-shot:nth-child(2),
  .story-shot:nth-child(3) {
    grid-column: 1;
    grid-row: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
  .story-shot-lead {
    aspect-ratio: 4 / 5;
  }
  .story-shot img {
    width: 100%;
    height: 100%;
  }

  .sponsor-logo {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 10;
    padding: clamp(22px, 8vw, 36px);
  }
  .sponsor-logo img {
    width: 100%;
    height: 100%;
  }
  .sponsor-story-logo,
  .sponsor-story-logo.has-photo {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
  .sponsor-logo-badge {
    width: min(46%, 180px);
  }

  .merch-crests {
    min-height: 250px;
  }
  .merch-crests img {
    width: min(58%, 230px);
    max-width: 230px;
  }
  .merch-crests img + img {
    margin-left: -42px;
  }

  .events-logo-panel {
    width: 100%;
  }
  .events-logo-panel img,
  .events-hero-mark img {
    display: block;
    width: 100%;
    height: auto;
  }
  .events-hero-mark {
    width: min(78vw, 330px);
    margin-inline: auto;
  }

  .image-banner > img,
  .involved-story > img {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 5;
    object-fit: cover;
  }

  .captain-photo {
    height: auto;
    aspect-ratio: 4 / 3;
  }
  .captain-crest {
    top: -38px;
    right: 20px;
    width: clamp(72px, 22vw, 92px);
    height: clamp(72px, 22vw, 92px);
  }
  .panel-heading > img {
    width: clamp(72px, 24vw, 96px);
    height: clamp(72px, 24vw, 96px);
  }
  .panel-poster {
    width: 100%;
  }

  .player-directory-photo {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  .scrapbook-content img,
  .scrapbook-photo-grid img,
  .scrapbook-photo-grid-polaroid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .scrapbook-photo-link,
  .scrapbook-photo-grid-polaroid .scrapbook-photo-link {
    aspect-ratio: 4 / 3;
  }

  .awards27-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position:
      var(--awards27-hero-x, 50%)
      var(--awards27-hero-y, 50%);
  }
  .awards27-ribbon {
    width: clamp(220px, 70vw, 300px);
    height: clamp(42px, 12vw, 54px);
  }
  .awards27-ribbon-blue {
    left: -125px;
  }
  .awards27-ribbon-yellow {
    right: -115px;
  }
  .awards27-star-two {
    right: 4%;
    bottom: 10%;
  }

  .partner-proof.partner-proof-v2.has-proof-background {
    background-position:
      var(--proof-focal-x, 62%)
      var(--proof-focal-y, 50%);
  }

  .venue-map-frame,
  .venue-map-frame iframe {
    width: 100%;
  }
}

/* Small phones. */
@media (max-width: 520px) {
  .g4g-wrap {
    width: min(100% - 26px, 1260px);
  }

  .hero {
    min-height: clamp(570px, 84svh, 690px);
  }
  .page-hero,
  .events-hero,
  .scrapbook-hero,
  .awards27-hero {
    min-height: clamp(510px, 78svh, 640px);
  }

  .impact-card.impact-photo,
  .home-team-card,
  .feature-photo,
  .story-shot-lead,
  .image-banner > img,
  .involved-story > img {
    aspect-ratio: 4 / 5;
  }

  .story-shot:not(.story-shot-lead) {
    aspect-ratio: 5 / 4;
  }

  .sponsor-logo,
  .sponsor-story-logo,
  .sponsor-story-logo.has-photo {
    aspect-ratio: 4 / 3;
  }

  .merch-crests {
    min-height: 210px;
  }
  .merch-crests img {
    width: min(62%, 195px);
  }
  .merch-crests img + img {
    margin-left: -34px;
  }

  .events-hero-mark {
    width: min(74vw, 280px);
  }

  .awards27-ribbon-blue {
    top: -16px;
    left: -145px;
  }
  .awards27-ribbon-yellow {
    right: -145px;
    bottom: -15px;
  }
  .awards27-star-two {
    display: none;
  }
}

/* Phones held sideways: keep hero imagery visible without enormous vertical crops. */
@media (max-width: 950px) and (orientation: landscape) and (max-height: 600px) {
  .hero,
  .page-hero,
  .events-hero,
  .scrapbook-hero,
  .awards27-hero {
    min-height: max(500px, 100svh);
  }
  .contact-hero-modern {
    min-height: max(300px, 78svh);
  }
  .hero-inner,
  .page-hero-inner,
  .events-hero-grid,
  .scrapbook-hero-inner,
  .awards27-hero-grid {
    padding-top: 52px;
    padding-bottom: 44px;
  }
}

/* Player portal 2026 responsive */
@media (max-width: 1080px) {
  .player-portal-hero-inner { padding-left: 34px; }
  .player-portal-quickgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-portal-quickgrid article:nth-child(2) { border-right: 0; }
  .player-portal-quickgrid article:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.12); }
  .player-portal-intro-grid, .player-portal-citylink-card, .player-portal-signin-grid { grid-template-columns: 1fr; gap: 40px; }
  .player-portal-travel-grid, .player-portal-prep-grid { grid-template-columns: 1fr; }
  .player-portal-route-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .player-portal-hero { min-height: 650px; }
  .player-portal-hero::after { background: linear-gradient(180deg, rgba(7,20,16,.58), rgba(7,20,16,.94)); }
  .player-portal-hero-inner { padding-top: 112px; padding-right: 0; padding-bottom: 64px; padding-left: 0; }
  .player-portal-hero h1 { font-size: clamp(3.6rem, 15vw, 6rem); }
  .player-portal-feature-grid, .player-portal-code-grid, .player-portal-route-cards { grid-template-columns: 1fr; }
  .player-portal-feature-card { min-height: 350px; }
  .player-schedule-item { grid-template-columns: 42px 118px 1fr; gap: 12px; padding: 17px 18px; }
  .player-portal-map-card iframe { height: 390px; }
  .player-portal-map-footer { align-items: flex-start; flex-direction: column; }
  .player-portal-checklist { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .player-portal-quickgrid { grid-template-columns: 1fr; }
  .player-portal-quickgrid article { min-height: 92px; padding: 18px 20px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .player-portal-quickgrid article:last-child { border-bottom: 0; }
  .player-portal-intro-grid { gap: 28px; }
  .player-schedule-item { grid-template-columns: 36px 1fr; gap: 4px 12px; align-items: start; padding: 18px 15px; }
  .player-schedule-item time { padding-top: 1px; }
  .player-schedule-item p { grid-column: 2; }
  .player-portal-feature-card, .player-portal-citylink-card, .player-portal-checklist-card, .player-portal-note-card, .player-portal-links-card, .player-portal-form-card { border-radius: 18px; }
  .player-portal-citylink-card { padding: 28px 20px; }
  .player-portal-code-grid > div { min-height: 210px; padding: 23px; }
  .player-portal-map-card iframe { height: 330px; }
  .player-portal-map-footer { padding: 20px; }
  .player-portal-form .form-grid { grid-template-columns: 1fr; }
  .player-portal-hero-actions .g4g-btn, .player-portal-link-buttons .g4g-btn { width: 100%; justify-content: center; }
}
