.court-main {
  width: min(860px, calc(100% - 32px));
}

.court-detail {
  display: grid;
  gap: 16px;
}

.court-hero {
  position: relative;
  min-height: 240px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.court-hero-photo {
  position: absolute;
  inset: 0;
  background-color: #243044;
  background-size: cover;
  background-position: center;
  /* Modest lift so court photos read brighter under the text scrim. */
  filter: brightness(1.12) contrast(1.02);
  transform: scale(1.02);
}

.court-hero-scrim {
  position: absolute;
  inset: 0;
  /* Lighter than a heavy black wash so the photo stays visible. */
  background: linear-gradient(
    180deg,
    rgba(8, 10, 16, 0.28) 0%,
    rgba(8, 10, 16, 0.42) 48%,
    rgba(8, 10, 16, 0.72) 100%
  );
}

.court-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 240px;
  padding: 22px 22px 20px;
}

.court-hero-content h1 {
  margin: 0 0 6px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.court-hero-meta {
  margin: 0;
  color: rgba(244, 246, 251, 0.9);
  font-size: 0.98rem;
}

.court-info-card h2,
.court-gallery-card h2,
.court-cta h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.court-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.court-fact {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.court-gallery-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.court-gallery-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.court-gallery {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #161b24;
  /* Keep native horizontal swiping while still allowing page scrolling. */
  touch-action: pan-x pan-y;
}

.court-gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.court-gallery-track::-webkit-scrollbar {
  display: none;
}

.court-gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: 220px;
  max-height: 360px;
}

.court-gallery-slide img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  /* Match hero: slightly brighter court photos. */
  filter: brightness(1.08);
  background: #1c2230;
}

.court-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 12, 18, 0.55);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.court-gallery-nav:hover {
  background: rgba(10, 12, 18, 0.75);
}

.court-gallery-prev {
  left: 10px;
}

.court-gallery-next {
  right: 10px;
}

.court-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.court-gallery-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(168, 176, 192, 0.35);
  cursor: pointer;
  transition: width 0.18s ease, background 0.18s ease;
}

.court-gallery-dot[aria-current="true"] {
  width: 16px;
  background: var(--accent);
}

.courts-grid {
  display: grid;
  gap: 14px;
  margin: 18px 0 8px;
}

.court-card {
  position: relative;
  display: block;
  min-height: 170px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
}

.court-card-photo {
  position: absolute;
  inset: 0;
  background-color: #243044;
  background-size: cover;
  background-position: center;
  filter: brightness(1.12) contrast(1.02);
  transform: scale(1.02);
}

.court-card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 10, 16, 0.18) 0%,
    rgba(8, 10, 16, 0.38) 45%,
    rgba(8, 10, 16, 0.78) 100%
  );
}

.court-card-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 170px;
  padding: 18px;
}

.court-card-body h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.court-card-body p {
  margin: 0;
  color: rgba(244, 246, 251, 0.88);
  font-size: 0.92rem;
}

.court-cta .lead {
  margin-bottom: 8px;
}

.empty-state,
.error-state {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 720px) {
  .courts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .court-gallery-slide img {
    height: 300px;
  }
}
