:root {
  --mac-teal: #008c8d;
  --mac-teal-dark: #045b60;
  --mac-gold: #ffbf47;
  --mac-ink: #10242b;
}

.btn-locked {
  opacity: 0.92;
}

.mac-home-navbar {
  background: rgba(7, 88, 93, 0.88) !important;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 40px rgba(6, 45, 50, 0.22) !important;
}

.mac-home-navbar .navbar-brand img {
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.2));
}

.mac-home-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.35);
}

.mac-home-navbar .navbar-toggler-icon {
  filter: invert(1) grayscale(1) brightness(3);
}

.mac-home-navbar .nav-link {
  border-radius: 999px;
  padding-left: 0.85rem !important;
  padding-right: 0.85rem !important;
  font-weight: 700;
}

.mac-home-navbar .nav-link:hover,
.mac-home-navbar .nav-link:focus,
.mac-home-navbar .dropdown-toggle.show {
  background: rgba(255, 255, 255, 0.13);
}

.mac-home-hero {
  position: relative;
  margin-top: -1px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 20%, rgba(255, 191, 71, 0.2), transparent 28%),
    linear-gradient(135deg, #061f25, #0a555b);
  --mac-hero-height: clamp(540px, 70vh, 760px);
}

.mac-home-hero .carousel,
.mac-home-hero .carousel-inner,
.mac-home-hero .carousel-item {
  height: var(--mac-hero-height);
  min-height: 0;
}

.mac-hero-image {
  height: var(--mac-hero-height);
  min-height: 0;
  object-fit: contain;
  object-position: center;
  filter: saturate(1.05) contrast(1.02);
}

.mac-hero-image-cover {
  object-fit: cover;
}

.mac-home-hero .carousel-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 26, 31, 0.72) 0%, rgba(6, 26, 31, 0.45) 37%, rgba(6, 26, 31, 0.08) 72%),
    linear-gradient(180deg, rgba(6, 26, 31, 0.25), rgba(6, 26, 31, 0.4));
  pointer-events: none;
}

.mac-hero-overlay {
  position: absolute;
  z-index: 2;
  left: clamp(1.25rem, 7vw, 6.5rem);
  top: 50%;
  transform: translateY(-50%);
  width: min(500px, calc(100% - 2.5rem));
  padding: clamp(1.05rem, 2.2vw, 2rem);
  border-radius: 24px;
  color: #fff !important;
  background: linear-gradient(135deg, rgba(5, 53, 58, 0.78), rgba(8, 140, 141, 0.48));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.mac-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
  color: var(--mac-gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}

.mac-hero-overlay h1 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.4rem, 5.3vw, 4.8rem);
  line-height: 0.94;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.mac-hero-overlay p {
  max-width: 34rem;
  margin: 0.75rem 0 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 1.8vw, 1.22rem);
}

.mac-hero-member-pulse {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin: 0.1rem 0 0.2rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 800;
}

.mac-hero-member-pulse strong {
  color: var(--mac-gold);
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 0.9;
}

.mac-hero-welcome {
  margin-top: 0.65rem !important;
  font-size: 1rem !important;
  letter-spacing: 0.02em;
}

.mac-hero-run-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.1rem 0 1.25rem;
}

.mac-hero-run-list div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.1rem 0.7rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.mac-hero-run-list i {
  grid-row: span 2;
  color: var(--mac-gold);
  font-size: 1.15rem;
}

.mac-hero-run-list span {
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.mac-hero-run-list strong {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
}

.mac-hero-actions .btn {
  border-radius: 999px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
}

.mac-hero-coming-soon {
  opacity: 1 !important;
  color: #10242b !important;
  cursor: default !important;
}

.mac-home-hero .carousel-control-prev,
.mac-home-hero .carousel-control-next {
  width: 6%;
}

.mac-home-hero .carousel-indicators {
  bottom: 1.4rem;
}

.mac-home-hero .carousel-indicators [data-bs-target] {
  width: 38px;
  height: 5px;
  border-radius: 999px;
  border: 0;
  background-color: rgba(255, 255, 255, 0.55);
}

.mac-home-hero .carousel-indicators .active {
  background-color: var(--mac-gold);
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 191, 71, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(0, 140, 141, 0.12), transparent 30%),
    #f3f7f8;
}

body > section {
  position: relative;
}

body > section.bg-white,
body > section.bg-light,
body > section:not(.mac-home-hero) {
  background: transparent !important;
}

body > section:not(.mac-home-hero) {
  padding-top: 4.5rem !important;
  padding-bottom: 4.5rem !important;
}

body > section:not(.mac-home-hero) h2 {
  color: var(--mac-ink);
  font-weight: 900;
  letter-spacing: -0.02em;
}

body > section:not(.mac-home-hero) .lead {
  color: #58707a;
}

#race .container,
#memberships .container,
#safeguarding .container,
#events .container,
section[aria-label="committee"] .container,
#committee .container,
#captains .container,
#gallery .container,
section.py-5.bg-light.text-center .container {
  position: relative;
}

#race .container,
section.py-5.bg-light.text-center .container {
  max-width: 960px;
  padding: 2rem;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(239, 249, 250, 0.92));
  border: 1px solid rgba(0, 140, 141, 0.1);
  box-shadow: 0 22px 54px rgba(17, 47, 54, 0.08);
}

#memberships .card,
#events .card,
#committee .card,
#captains .card,
#safeguarding .card {
  border: 1px solid rgba(17, 47, 54, 0.08) !important;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(17, 47, 54, 0.08) !important;
  overflow: hidden;
}

#memberships .card,
#events .card {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

#memberships .card:hover,
#events .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 26px 58px rgba(17, 47, 54, 0.14) !important;
}

#memberships .card h5,
#events .card h5 {
  color: var(--mac-ink);
  font-weight: 900;
}

#memberships .card p:first-of-type {
  color: var(--mac-teal-dark);
  font-size: 1.4rem;
  font-weight: 900;
}

.btn-primary,
.btn-outline-primary:hover,
.btn-outline-success:hover {
  background: linear-gradient(135deg, var(--mac-teal), var(--mac-teal-dark)) !important;
  border-color: var(--mac-teal) !important;
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-secondary {
  border-radius: 999px;
  font-weight: 800;
}

.btn-primary,
.btn-warning {
  border-radius: 999px;
  font-weight: 900;
}

#safeguarding .rounded-circle {
  background: linear-gradient(135deg, rgba(255, 191, 71, 0.22), rgba(0, 140, 141, 0.16)) !important;
}

#committee .card-img-top,
#captains .card-img-top {
  height: 300px;
  object-fit: cover;
}

#gallery .ratio {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(17, 47, 54, 0.1);
}

.custom-footer {
  background:
    radial-gradient(circle at top left, rgba(255, 191, 71, 0.2), transparent 28%),
    linear-gradient(135deg, #073f45, #008c8d);
}

.hero-image-viewer-modal .modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  background: #071f24;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
}

.hero-image-viewer-modal .modal-header {
  color: #fff;
  background: linear-gradient(135deg, rgba(5, 91, 96, 0.98), rgba(0, 140, 141, 0.94));
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-image-viewer-modal .modal-body {
  padding: clamp(1rem, 2.4vw, 2rem);
  background:
    radial-gradient(circle at top left, rgba(255, 191, 71, 0.14), transparent 32%),
    #071f24;
}

.hero-flip-viewer {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(78vh, 760px);
}

.hero-flip-page {
  position: relative;
  width: min(100%, 980px);
  min-height: min(72vh, 700px);
  display: grid;
  place-items: center;
  padding: clamp(0.45rem, 1.4vw, 0.9rem);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(236, 247, 248, 0.94));
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.35),
    inset -18px 0 28px rgba(6, 45, 50, 0.08);
  perspective: 1200px;
}

.hero-flip-page::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: clamp(54px, 8vw, 96px);
  height: clamp(54px, 8vw, 96px);
  border-bottom-right-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0) 49%, rgba(255, 191, 71, 0.7) 50%, rgba(0, 140, 141, 0.9) 100%);
  filter: drop-shadow(-7px -7px 14px rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.hero-flip-page img {
  display: block;
  width: 100%;
  max-height: min(70vh, 680px);
  object-fit: contain;
  border-radius: 18px;
  transform-origin: right center;
}

.hero-flip-page img.is-flipping {
  animation: heroPageFlip 0.42s ease both;
}

.hero-flip-btn {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 140, 141, 0.84);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.hero-flip-btn:hover,
.hero-flip-btn:focus {
  background: var(--mac-gold);
  color: var(--mac-ink);
}

.hero-flip-prev {
  left: clamp(0.35rem, 2vw, 1.5rem);
}

.hero-flip-next {
  right: clamp(0.35rem, 2vw, 1.5rem);
}

.hero-flip-counter {
  position: absolute;
  left: 50%;
  bottom: 0.8rem;
  transform: translateX(-50%);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(6, 31, 37, 0.78);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

@keyframes heroPageFlip {
  0% {
    opacity: 0;
    transform: rotateY(-16deg) translateX(18px);
  }

  100% {
    opacity: 1;
    transform: rotateY(0deg) translateX(0);
  }
}

@media (max-width: 767.98px) {
  .mac-home-hero {
    --mac-hero-height: clamp(560px, 78vh, 720px);
  }

  .mac-home-hero .carousel,
  .mac-home-hero .carousel-inner,
  .mac-home-hero .carousel-item,
  .mac-hero-image {
    height: var(--mac-hero-height);
    min-height: 0;
  }

  .mac-hero-overlay {
    left: 1rem;
    right: 1rem;
    bottom: 5rem;
    top: auto;
    transform: none;
    width: auto;
    border-radius: 22px;
  }

  .mac-hero-run-list div {
    padding: 0.7rem 0.8rem;
  }

  .hero-flip-viewer {
    min-height: 68vh;
  }

  .hero-flip-page {
    min-height: 58vh;
  }

  .hero-flip-btn {
    width: 40px;
    height: 40px;
  }
}
