/* V7 stability + mobile calendar fixes */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

main,
section,
.section-shell,
.calendar-wrap,
.calendar-copy,
.calendar-card,
.calendar-grid,
.days button,
.empty-day {
  min-width: 0;
  max-width: 100%;
}

/* Content is server-rendered/static; never hide it while JS initializes. */
.reveal,
.reveal.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

.calendar-wrap {
  width: var(--shell);
  margin: 80px auto 0;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(32px, 4vw, 60px);
  align-items: start;
}

.calendar-card {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 22px;
}

.calendar-grid {
  width: 100%;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.days button,
.empty-day {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 0.78;
  overflow: hidden;
}

.days button small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 0.48rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Avoid native anchor jumps racing against layout/state updates. */
.price-card .button {
  touch-action: manipulation;
}

.booking-scroll-target {
  scroll-margin-top: 18px;
}

@media (max-width: 980px) {
  .calendar-wrap {
    width: var(--shell);
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 680px) {
  html,
  body {
    overflow-x: hidden;
  }

  .calendar-wrap {
    width: calc(100% - 24px);
    margin-top: 54px;
    gap: 24px;
  }

  .calendar-copy h3 {
    font-size: clamp(2rem, 10vw, 2.55rem);
  }

  .calendar-selection {
    width: 100%;
    padding: 15px 14px;
  }

  .calendar-card {
    width: 100%;
    padding: 14px 8px 12px;
    border-radius: 16px;
  }

  .calendar-header {
    margin-bottom: 12px;
  }

  .calendar-header strong {
    font-size: 1.12rem;
  }

  .calendar-header button {
    width: 34px;
    height: 34px;
  }

  .calendar-grid {
    gap: 2px;
  }

  .day-labels {
    margin-bottom: 4px;
  }

  .day-labels span {
    min-width: 0;
    padding: 5px 0;
    font-size: 0.52rem;
  }

  .days button,
  .empty-day {
    aspect-ratio: 1 / 1.08;
    border-radius: 6px;
  }

  .days button {
    padding: 2px 0;
    font-size: 0.66rem;
  }

  .days button small {
    font-size: 0.38rem;
    letter-spacing: -0.02em;
  }

  .calendar-live-status {
    margin-top: 10px;
    padding: 0 8px;
  }

  .field-row,
  .field-row.three {
    grid-template-columns: 1fr;
  }

  .field-row.three label:first-child {
    grid-column: auto;
  }
}

@media (max-width: 380px) {
  .calendar-wrap {
    width: calc(100% - 16px);
  }

  .calendar-card {
    padding-inline: 5px;
  }

  .day-labels span {
    font-size: 0.47rem;
  }

  .days button {
    font-size: 0.61rem;
  }

  .days button small {
    font-size: 0.34rem;
  }
}


/* V8: no accidental full-screen panels or persisted open accordion */
[hidden],
.lightbox[hidden],
.gallery-item[hidden] {
  display: none !important;
}

.rules {
  position: relative;
  z-index: 0;
  min-height: 0;
  overflow: visible;
}

.rules.section {
  padding-block: clamp(72px, 7vw, 105px);
}

.rules-heading {
  position: static !important;
  top: auto !important;
}

.rules-list details {
  position: relative;
  overflow: clip;
}

.rules-list details:not([open]) > p {
  display: none;
}

.rules-list summary {
  -webkit-user-select: none;
  user-select: none;
}

/* The circular + is an accordion control, not a floating close button. */
.rules-list summary span {
  flex: 0 0 auto;
}

@media (max-width: 680px) {
  .rules.section {
    padding-block: 58px;
  }

  .rules-grid {
    gap: 20px;
  }

  .rules-heading h2 {
    margin-bottom: 18px;
  }

  .rules-list summary {
    gap: 16px;
  }
}
