html, body {
  background-color: #0a0a1a !important;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

main {
  flex: 1;
}

footer {
  margin-top: auto;
  position: relative;
  z-index: 1;
  background-color: #0a0a1a !important;
}

/* Town page deal rails — horizontal scroll (additive only; shared by town pages) */
.sm-rail-section {
  position: relative;
  margin-bottom: 2.25rem;
  padding-left: 0;
  padding-right: 0;
}
.sm-rail-section[hidden],
.sm-rail-section.sm-rail-section--empty {
  display: none !important;
}
.sm-rail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.875rem;
}
.sm-rail-header h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff !important;
}
.sm-rail-meta {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
}
.sm-rail-fade {
  position: relative;
}
.sm-rail-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.25rem 0 0.75rem;
  min-height: 0;
}
.sm-rail-track::-webkit-scrollbar {
  display: none;
}
.sm-rail-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: min(320px, 86vw);
  max-width: 360px;
  min-width: 0;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  .sm-rail-card {
    width: 360px;
  }
}
.sm-rail-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 10, 26, 0.85);
  color: rgba(255, 255, 255, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}
.sm-rail-btn svg {
  display: block;
}
.sm-rail-btn:hover:not(:disabled) {
  background: rgba(46, 125, 210, 0.35);
  border-color: rgba(46, 125, 210, 0.45);
}
.sm-rail-btn:disabled {
  opacity: 0.28;
  cursor: default;
}
.sm-rail-section .sm-rail-prev {
  left: 0;
}
.sm-rail-section .sm-rail-next {
  right: 0;
}
@media (min-width: 768px) {
  .sm-rail-btn {
    display: flex;
  }
}

/* Rail layout: title full width; track between arrow columns on desktop */
.sm-rail-section--grid {
  display: grid;
  grid-template-columns: 0 minmax(0, 1fr) 0;
  grid-template-rows: auto minmax(0, auto);
  align-items: stretch;
  column-gap: 0;
}
@media (min-width: 768px) {
  .sm-rail-section--grid {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
  }
}
.sm-rail-section--grid > .sm-rail-header {
  grid-column: 1 / -1;
}
.sm-rail-section--grid > .sm-rail-fade {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  position: relative;
}
.sm-rail-section--grid > .sm-rail-prev {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  justify-self: center;
}
.sm-rail-section--grid > .sm-rail-next {
  grid-column: 3;
  grid-row: 2;
  align-self: center;
  justify-self: center;
}
@media (max-width: 767px) {
  .sm-rail-section--grid {
    grid-template-columns: 1fr;
  }
  .sm-rail-section--grid > .sm-rail-fade {
    grid-column: 1;
    grid-row: 2;
  }
}
