/* TeamSpirit Santos 1.3.14 - front page polish.
   This stylesheet is loaded only on the homepage. It replaces v1.3.13
   styles, avoiding conflicting rules for partner/gallery arrows. */

/* Unified title treatment: the same actual TeamSpirit symbol above every
   main heading, including old Gutenberg headings and ACF builder headings. */
.home #content .ts-home-heading {
  font-family: Karla, Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 2.7vw, 3.6rem);
  line-height: 1.2;
  letter-spacing: -.025em;
  color: var(--ts-ink, #142038);
}
.home #content :is(h2,h3,h4).ts-home-heading::before {
  content: '';
  display: block;
  width: 3.4rem;
  height: 4rem;
  margin: 0 auto 1.5rem;
  background: url('../images/teamspirit-stripes.svg') center / contain no-repeat;
  box-shadow: none;
  border: 0;
  transform: none;
}
/* These main section headings are centered; the Text+Media content stays
   aligned to its own text column. */
.home #content > .ts-home-heading,
.home #content .part-title .ts-home-heading {
  text-align: center;
}
.home #content .part-title .ts-home-heading {
  text-transform: none;
}
.home #content .part-txtmedia .ts-home-heading::before {
  margin-left: 0;
  margin-right: 0;
}
@media (max-width: 991.98px) {
  .home #content .part-txtmedia .ts-home-heading::before {
    margin-left: 0;
    margin-right: 0;
  }
}

/* The gallery's excessive 100px ACF builder padding + default block
   margins used to produce a huge space under its separate heading.
   These classes are added to ACTUAL page structure by teamspirit-home.js. */
.home #content .ts-home-gallery-section {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
.home #content .ts-home-gallery-section > .part-gallery-slider,
.home #content .ts-home-gallery-section .part-gallery-slider {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.home #content .ts-home-gallery-heading {
  margin-bottom: 2.2rem !important;
}
.home #content .ts-home-gallery-title-block {
  padding-bottom: 2.2rem !important;
  margin-bottom: 0 !important;
}
.home #content .ts-home-gallery-title-block .part-title {
  margin-bottom: 0 !important;
}
.home #content .ts-home-gallery-section .part-title + .part-gallery-slider {
  margin-top: 2.2rem !important;
}
.home #content .ts-home-gallery-spacer {
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
/* Existing gallery loupe is reused from Text + Media, with the same overlay. */
.home #content .part-gallery-slider .swiper-slide a::before {
  background-image: url('../images/loupe.svg');
  width: 3.4rem;
  height: 3.4rem;
}

/* Partners: reduce the inter-section whitespace, not the logo card itself. */
.home #content .ts-home-partners-section {
  padding-top: 3.5rem !important;
  padding-bottom: 1.6rem !important;
  margin-top: 0 !important;
}
.home #content .ts-home-before-partners {
  padding-bottom: 1.5rem !important;
}
.home #content { padding-bottom: 1.5rem; }
.home #content .part-title + .part-logo-slider {margin-top: 2rem;}

/* Slider buttons: small, plain arrows with comfortably sized click targets.
   Completely neutralise circular backgrounds, hover circles and outlines
   from the previous custom slider controls. Keyboard focus stays visible. */
.home #content :is(.part-gallery-slider,.part-logo-slider) .swiper-button-prev,
.home #content :is(.part-gallery-slider,.part-logo-slider) .swiper-button-next {
  box-sizing: border-box;
  display: block;
  width: 3.4rem;
  height: 3.4rem;
  min-width: 3.4rem;
  min-height: 3.4rem;
  padding: 0;
  margin: 0;
  background-image: url('../images/arrow-l-b.svg');
  background-size: 0.85rem auto;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: opacity .2s ease;
}
.home #content :is(.part-gallery-slider,.part-logo-slider) .swiper-button-prev:hover,
.home #content :is(.part-gallery-slider,.part-logo-slider) .swiper-button-next:hover {
  opacity: .58;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.home #content :is(.part-gallery-slider,.part-logo-slider) .swiper-button-prev:focus-visible,
.home #content :is(.part-gallery-slider,.part-logo-slider) .swiper-button-next:focus-visible {
  outline: 2px solid #0072cd !important;
  outline-offset: 2px !important;
}
.home #content :is(.part-gallery-slider,.part-logo-slider) .swiper-button-prev::after,
.home #content :is(.part-gallery-slider,.part-logo-slider) .swiper-button-next::after {
  display: none !important;
  content: none !important;
}
/* Gallery: modest chevrons outside photos on large screens. */
.home #content .part-gallery-slider .swiper-button-prev {
  left: -3.2rem;
  top: 50%;
  transform: translateY(-50%);
}
.home #content .part-gallery-slider .swiper-button-next {
  left: auto;
  right: -3.2rem;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
}

/* Partners: arrows outside the logo card on desktops. */
.home #content .part-logo-slider > .container {
  display: grid;
  grid-template-columns: 3.4rem minmax(0,1fr) 3.4rem;
  gap: 1.2rem;
  align-items: center;
  padding: 0 1.2rem;
}
.home #content .part-logo-slider .logo-slider {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  width: 100%;
}
.home #content .part-logo-slider .swiper-slide { padding: 1rem .6rem; }
.home #content .part-logo-slider .swiper-button-prev,
.home #content .part-logo-slider .swiper-button-next {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
}
.home #content .part-logo-slider .swiper-button-prev {
  grid-column: 1;
  grid-row: 1;
  transform: none;
}
.home #content .part-logo-slider .swiper-button-next {
  grid-column: 3;
  grid-row: 1;
  transform: rotate(180deg);
}

@media (max-width: 767.98px) {
  .home #content .ts-home-partners-section {padding-top: 2.2rem !important; padding-bottom: 1rem !important;}
  .home #content .ts-home-before-partners {padding-bottom: 1rem !important;}
  .home #content .ts-home-gallery-heading {margin-bottom: 1.6rem !important;}
  .home #content .ts-home-gallery-title-block {padding-bottom: 1.6rem !important;}
  .home #content .ts-home-gallery-section .part-title + .part-gallery-slider {margin-top: 1.6rem !important;}
  .home #content .part-gallery-slider .swiper-button-prev {left: 0;}
  .home #content .part-gallery-slider .swiper-button-next {right: 0;}
  .home #content {padding-bottom: 1rem;}
  .home #content .ts-home-heading {font-size: 2.8rem;}
}
@media (max-width: 575.98px) {
  /* Partners: narrow-screen controls below the logo, not over the artwork. */
  .home #content .part-logo-slider > .container {
    grid-template-columns: minmax(0,1fr) 3.4rem 1.2rem 3.4rem minmax(0,1fr);
    column-gap: 0;
    row-gap: .6rem;
    padding: 0 1rem;
  }
  .home #content .part-logo-slider .logo-slider {grid-column: 1/-1;grid-row: 1;}
  .home #content .part-logo-slider .swiper-slide {padding: .5rem .15rem;}
  .home #content .part-logo-slider .swiper-button-prev {grid-column: 2;grid-row: 2;}
  .home #content .part-logo-slider .swiper-button-next {grid-column: 4;grid-row: 2;}
  .home #content .ts-home-heading {font-size: 2.5rem;}
}
@media (prefers-reduced-motion: reduce) {
  .home #content :is(.part-logo-slider,.part-gallery-slider) .swiper-button-prev,
  .home #content :is(.part-logo-slider,.part-gallery-slider) .swiper-button-next {transition: none;}
}


/* 1.3.15 - independently locate the Winter Cup gallery, even when its title
   is nested in Gutenberg instead of being a sibling ACF Builder element. */
.home #content .ts-home-gallery-heading-exact {
  display: block;
  text-align: center;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
.home #content :is(h2,h3,h4).ts-home-gallery-heading-exact::before {
  content: '';
  display: block;
  width: 3.4rem;
  height: 4rem;
  background: url('../images/teamspirit-stripes.svg') center / contain no-repeat;
  margin: 0 auto 1.5rem;
  border: 0;
  box-shadow: none;
  transform: none;
}
/* Structural CSS fixes, also useful before the script has run. */
.home #content .acf-block-element:has(.part-gallery-slider) {
  padding-top: 0 !important;
}
.home #content .acf-block-element:has(+ .acf-block-element:has(.part-gallery-slider)) {
  padding-bottom: 0 !important;
}
.home #content .acf-block-element:has(.part-gallery-slider) .part-title + .part-gallery-slider {
  margin-top: 2.4rem !important;
}
/* Extra WordPress/Gutenberg margins must not reintroduce a large gap. */
.home #content .ts-home-gallery-section .part-gallery-slider {
  padding-top: 0 !important;
}
@media (max-width: 767.98px) {
  .home #content .acf-block-element:has(.part-gallery-slider) .part-title + .part-gallery-slider {
    margin-top: 2rem !important;
  }
  .home #content :is(h2,h3,h4).ts-home-gallery-heading-exact::before {
    margin-bottom: 1.2rem;
  }
}
