/* Community Hub — card-based layout */

body[data-page="community"] {
  --page-subnav-h: 3.25rem;
}

body[data-page="community"] .page-hero--community {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(64vh, 740px);
  height: min(64vh, 740px);
  max-height: none;
  padding: 0;
  background-color: #1e1208;
  overflow: hidden;
}

body[data-page="community"] .page-hero--community::before {
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(20, 10, 4, 0.35) 0%,
    rgba(20, 10, 4, 0.22) 45%,
    rgba(20, 10, 4, 0.45) 100%
  );
}

body[data-page="community"] .page-subnav--links {
  padding: 0;
  background: rgba(255, 255, 255, 0.97);
}

body[data-page="community"] .page-subnav--links .page-subnav__inner {
  justify-content: center;
  gap: 0.15rem;
  flex-wrap: wrap;
  overflow: visible;
}

body[data-page="community"] .page-subnav--links a {
  padding: 0.7rem 0.85rem;
  font-size: 0.8rem;
}

body[data-page="community"] .community-hero__slideshow {
  position: absolute;
  inset: 0;
  z-index: 0;
}

body[data-page="community"] .community-hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation-duration: 50s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

body[data-page="community"] .community-hero__slide:nth-child(1) { animation-name: community-hero-1; }
body[data-page="community"] .community-hero__slide:nth-child(2) { animation-name: community-hero-2; }
body[data-page="community"] .community-hero__slide:nth-child(3) { animation-name: community-hero-3; }
body[data-page="community"] .community-hero__slide:nth-child(4) { animation-name: community-hero-4; }
body[data-page="community"] .community-hero__slide:nth-child(5) { animation-name: community-hero-5; }

body[data-page="community"] .community-hero__slide img {
  width: 100%;
  height: 100%;
  /* Show the full photo — hero height is ~16:9 so side gutters stay small */
  object-fit: contain;
  object-position: center;
  display: block;
}

@keyframes community-hero-1 {
  0%, 18%, 20%, 100% { opacity: 0; }
  1.5%, 16.5% { opacity: 1; }
}

@keyframes community-hero-2 {
  0%, 18%, 22%, 38%, 40%, 100% { opacity: 0; }
  21.5%, 36.5% { opacity: 1; }
}

@keyframes community-hero-3 {
  0%, 38%, 42%, 58%, 60%, 100% { opacity: 0; }
  41.5%, 56.5% { opacity: 1; }
}

@keyframes community-hero-4 {
  0%, 58%, 62%, 78%, 80%, 100% { opacity: 0; }
  61.5%, 76.5% { opacity: 1; }
}

@keyframes community-hero-5 {
  0%, 78%, 82%, 98%, 100% { opacity: 0; }
  81.5%, 96.5% { opacity: 1; }
}

body[data-page="community"] .page-hero--community .page-hero__layout {
  position: relative;
  z-index: 2;
  min-height: 100%;
  align-items: center;
}

body[data-page="community"] .page-hero--community .page-hero__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 1.25rem;
  box-sizing: border-box;
}

/* Side logos over photo edges — compact, with dark disc for contrast */
body[data-page="community"] .page-hero--community > .page-hero__logo {
  display: flex;
}

body[data-page="community"] .page-hero__logo--left {
  left: clamp(0.5rem, 2vw, 1.5rem);
}

body[data-page="community"] .page-hero__logo--right {
  right: clamp(0.5rem, 2vw, 1.5rem);
}

body[data-page="community"] .page-hero__logo .hero__logo-ring {
  width: min(100px, 11vw);
}

body[data-page="community"] .page-hero__logo .hero__logo-ring::before {
  inset: -18%;
  background: radial-gradient(
    circle,
    rgba(18, 10, 4, 0.78) 0%,
    rgba(18, 10, 4, 0.48) 44%,
    transparent 72%
  );
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

body[data-page="community"] .page-hero__logo .logo-spinner__img {
  mix-blend-mode: normal;
  filter:
    drop-shadow(0 3px 10px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 12px rgba(255, 180, 100, 0.3));
}

body[data-page="community"] .page-hero__logo .hero__orbit--inner {
  border-color: rgba(255, 255, 255, 0.9);
}

body[data-page="community"] .page-hero__logo .hero__orbit--outer {
  border-color: rgba(232, 148, 72, 0.95);
}

body[data-page="community"] .community-hero__card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: clamp(0.5rem, 2vw, 1rem) 1rem;
  max-width: 560px;
  width: 100%;
  margin-inline: auto;
  text-align: center;
}

body[data-page="community"] .community-hero__card .page-hero__eyebrow {
  display: inline-block;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75), 0 1px 3px rgba(0, 0, 0, 0.9);
  margin-bottom: 0.5rem;
}

body[data-page="community"] .community-hero__card h1 {
  color: var(--color-white);
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.8), 0 1px 4px rgba(0, 0, 0, 0.95);
  margin-bottom: 0.65rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

body[data-page="community"] .community-hero__card p {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75), 0 1px 3px rgba(0, 0, 0, 0.9);
  max-width: none;
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
}

@media (max-width: 768px) {
  body[data-page="community"] .community-hero__card {
    max-width: min(100%, 420px);
    padding: 0.5rem 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="community"] .community-hero__slide {
    animation: none !important;
    opacity: 0;
  }

  body[data-page="community"] .community-hero__slide:first-child {
    opacity: 1;
  }
}

.community-section {
  scroll-margin-top: calc(var(--header-h) + var(--page-subnav-h) + 1rem);
}

.community-section--card {
  padding: 0.65rem 0;
  background: var(--color-bg);
}

.community-section--card:first-of-type {
  padding-top: 2.5rem;
}

.community-section--card:last-of-type {
  padding-bottom: 3rem;
}

.community-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow: var(--shadow);
  border: 1px solid rgba(139, 69, 19, 0.08);
  border-top: 4px solid var(--color-accent);
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
}

.community-card--wide {
  max-width: var(--max-w);
}

.community-card .eyebrow {
  display: inline-block;
  color: var(--color-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
}

.community-card h2 {
  margin-top: 0.35rem;
  margin-bottom: 1rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.community-card__lead,
.community-card__body p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  text-align: center;
}

.community-card__body {
  text-align: center;
  max-width: 920px;
  margin-inline: auto;
}

.community-card__body h3 {
  font-size: 1.08rem;
  margin: 2rem 0 1rem;
  color: var(--color-text);
  text-align: center;
}

.community-card__body > .content-accordion:first-child {
  margin-top: 0.35rem;
}

.content-accordion + .content-accordion {
  margin-top: 0.5rem;
}

.community-card__body > ul,
.community-program ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 auto 1.5rem;
  padding: 0;
  max-width: 720px;
  width: 100%;
  justify-items: stretch;
}

.community-card__body > ul > li,
.community-program ul > li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 5.5rem;
  padding: 1.1rem 1.25rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid rgba(139, 69, 19, 0.12);
  border-top: 4px solid var(--color-accent);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: center;
}

.community-card__body > ul > li::before,
.community-program ul > li::before {
  display: none;
  content: none;
}

.community-card__body > ul > li strong,
.community-program ul > li strong {
  color: var(--color-accent);
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.community-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.community-photos__item {
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(139, 69, 19, 0.08);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}

.community-photos__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .community-photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .community-card__body > ul,
  .community-program ul {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}

/* Split columns keep left-aligned copy beside images */
.community-card__body--split {
  text-align: left;
}

.community-card__body--split p {
  text-align: left;
}

.community-card__body--split > ul {
  grid-template-columns: 1fr;
  max-width: none;
  margin-inline: 0;
}

.community-card__body--split > ul > li {
  align-items: flex-start;
  text-align: left;
  min-height: 0;
}

.community-card__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  text-align: left;
}

.community-card__split img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.community-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.community-card--flush {
  padding: 0;
  overflow: hidden;
}

.community-card__inner {
  padding: clamp(1.75rem, 4vw, 2.5rem);
}

.community-section-banner {
  position: relative;
  min-height: clamp(280px, 38vw, 400px);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 3rem) 1.25rem;
}

.community-section-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(20, 10, 4, 0.62) 0%,
    rgba(20, 10, 4, 0.42) 50%,
    rgba(20, 10, 4, 0.72) 100%
  );
}

.community-section-banner--dark::before {
  background: linear-gradient(
    180deg,
    rgba(20, 10, 4, 0.7) 0%,
    rgba(20, 10, 4, 0.55) 50%,
    rgba(20, 10, 4, 0.78) 100%
  );
}

.community-section-banner--slideshow {
  overflow: hidden;
}

.community-section-banner__slideshow {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.community-section-banner__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1);
  animation-duration: 24s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.community-section-banner__slide:nth-child(1) {
  animation-name: community-culture-slide-1, community-culture-zoom-1;
}

.community-section-banner__slide:nth-child(2) {
  animation-name: community-culture-slide-2, community-culture-zoom-2;
}

@keyframes community-culture-slide-1 {
  0%, 45%, 50%, 100% { opacity: 0; }
  2%, 43% { opacity: 1; }
}

@keyframes community-culture-slide-2 {
  0%, 45%, 55%, 95%, 100% { opacity: 0; }
  50%, 93% { opacity: 1; }
}

@keyframes community-culture-zoom-1 {
  0%, 45%, 50%, 100% { transform: scale(1); }
  2%, 43% { transform: scale(1.08); }
}

@keyframes community-culture-zoom-2 {
  0%, 45%, 55%, 100% { transform: scale(1); }
  50%, 93% { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .community-section-banner__slide {
    animation: none !important;
    opacity: 0;
  }

  .community-section-banner__slide:first-child {
    opacity: 1;
    transform: none;
  }
}

.community-section-banner__content {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin-inline: auto;
  text-align: center;
  color: var(--color-white);
}

.community-section-banner__content .eyebrow {
  color: rgba(255, 255, 255, 0.9);
}

.community-section-banner__content h2 {
  color: var(--color-white);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.community-section-banner__content .community-card__lead,
.community-section-banner__content p {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  text-align: center;
  margin-inline: auto;
}

.community-section-banner__content .community-card__actions {
  justify-content: center;
  margin-top: 1.25rem;
}

.community-sports__hero {
  position: relative;
  min-height: clamp(320px, 42vw, 440px);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 3rem) 1.25rem;
}

.community-sports__hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(20, 10, 4, 0.55) 0%,
    rgba(20, 10, 4, 0.35) 50%,
    rgba(20, 10, 4, 0.6) 100%
  );
}

.community-sports__hero-content {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin-inline: auto;
  text-align: center;
  color: var(--color-white);
}

.community-sports__hero-content .eyebrow {
  color: rgba(255, 255, 255, 0.9);
}

.community-sports__hero-content h2 {
  color: var(--color-white);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.community-sports__hero-content .community-card__lead,
.community-sports__hero-content p {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  text-align: center;
  margin-inline: auto;
}

.community-sports__hero-content .community-card__actions {
  justify-content: center;
  margin-top: 1.25rem;
}

.community-sports__btn-ghost {
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.65);
}

.community-sports__btn-ghost:hover {
  background: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-white);
}

.community-quick {
  background: var(--color-bg);
  border-bottom: 1px solid rgba(139, 69, 19, 0.1);
  padding: 0.85rem 0;
}

.community-quick .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.community-quick .btn--ghost {
  background: var(--color-white);
  border-color: rgba(139, 69, 19, 0.35);
  color: var(--color-primary);
}

.community-quick .btn--ghost:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

/* Wellbeing program tabs */
.community-programs {
  text-align: center;
}

.community-programs__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(139, 69, 19, 0.1);
}

.community-programs__tab {
  border: 2px solid rgba(139, 69, 19, 0.15);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: 99px;
  cursor: pointer;
  transition: all var(--transition);
}

.community-programs__tab:hover {
  border-color: var(--color-accent);
  color: var(--color-primary);
}

.community-programs__tab.is-active {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  color: var(--color-primary);
}

.community-program {
  display: none;
  text-align: center;
}

.community-program.is-active {
  display: block;
}

.community-program h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.community-program p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--color-text-muted);
  margin-bottom: 0.85rem;
  text-align: center;
  max-width: 40rem;
  margin-inline: auto;
}

.community-resources {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(139, 69, 19, 0.08);
}

.community-resources h4 {
  font-size: 0.9rem;
  margin-bottom: 0.65rem;
  text-align: center;
}

.community-resources ol {
  list-style: none;
  counter-reset: resource;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.community-resources li {
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}

.community-resources a {
  font-weight: 600;
  word-break: break-word;
}

.community-enquiry-cta {
  text-align: center;
}

.community-enquiry-cta .community-card__lead {
  max-width: 520px;
  margin-inline: auto;
}

.community-enquiry-cta .community-card__actions {
  justify-content: center;
  margin-top: 1.25rem;
}

.community-business__inner {
  text-align: center;
}

.community-business__block + .community-business__block {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(139, 69, 19, 0.1);
}

.community-business__block h3 {
  font-size: 1.15rem;
  margin-bottom: 0.65rem;
}

.community-business__intro {
  max-width: 640px;
  margin: 0 auto 1.25rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.community-business__inner .business-feed-card {
  max-width: 100%;
}

.community-business__inner .business-updated {
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .community-card__split {
    grid-template-columns: 1fr;
  }

  .community-card__split img {
    order: -1;
    max-height: 260px;
    object-fit: cover;
  }
}
