/* Mobile-only corrections. Desktop rules, text and image frames remain unchanged. */
.detail-mobile-rail-controls { display: none; }
@media (max-width: 767px) {
  .detail-refined .refined-card { min-height: 0; }
  .detail-refined p[data-mobile-balance] { text-wrap: balance; }
  .detail-refined .refined-group__track.has-detail-mobile-controls { scrollbar-width: none; padding-bottom: 0; }
  .detail-refined .refined-group__track.has-detail-mobile-controls::-webkit-scrollbar { display: none; }
  /* Same arrows, button borders, spacing and 2px progress line as the homepage. */
  .detail-mobile-rail-controls:not([hidden]) { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 32px; }
  .detail-mobile-rail-controls button { background: transparent; color: inherit; border: 1px solid #aaa398; padding: 8px 14px; cursor: pointer; }
  .detail-mobile-rail-controls button:disabled { opacity: .35; cursor: default; }
  .detail-mobile-rail-controls button:focus-visible { outline: 2px solid #313131; outline-offset: 4px; }
  .detail-mobile-rail-controls progress { width: min(50%, 500px); height: 2px; accent-color: #79736a; }
}

/* Reuse the approved intro alignment and the existing static-phone media query. */
@media (max-width: 767px), (max-width: 1024px) and (max-height: 500px) and (hover: none) and (pointer: coarse) {
  .has-site-js:not([data-site-ipad]) .detail-refined .refined-detail:is([data-topic="stay"], [data-topic="coffee-and-tea"], [data-topic="gathering"], [data-topic="more"]) [data-intro-text] { text-align: center; }
}

/* Aman At Sea references viewed locally. Every rule is limited to mobile details. */
@media (max-width: 767px) {
  .detail-refined .refined-opening { min-height: 0; padding: 32px 24px 0; }
  .detail-refined .refined-opening__image { width: 100%; }
  .detail-refined .refined-opening__text { width: 100%; margin-top: 24px; text-align: left; }
  .detail-refined .refined-opening h1 { margin-bottom: 24px; }
  .detail-refined .refined-opening__block { padding-bottom: 44px; border-bottom: 1px solid #d9d6d0; }
  .detail-refined .refined-gallery { margin-top: 64px; gap: 64px; }
  .detail-refined .refined-group__cards:not(.refined-group__track) { gap: 64px; }
  .detail-refined .refined-group__intro { margin-bottom: 32px; }
  .detail-refined .refined-group__intro h2 { margin-bottom: 24px; }
  .detail-refined .refined-card figure { padding-bottom: 44px; border-bottom: 1px solid #d9d6d0; }
  .detail-refined .refined-card__image { aspect-ratio: auto; max-height: none; background: transparent; }
  .detail-refined .refined-card__image img { width: 100%; height: auto; object-fit: contain; }
  .detail-refined .refined-card figcaption { margin-top: 24px; }
  .detail-refined .refined-card h2,
  .detail-refined .refined-card h3 { min-height: 0; margin-bottom: 24px; }
  .detail-refined .refined-card__description { width: 100%; }
  .detail-mobile-rail-controls:not([hidden]) { margin-top: 24px; }
}

/* The named local phone frame reserves 49px above its fixed header.
   Keep the opening photo 32px below that header at scrollY=0. */
@media (max-width: 767px) {
  html[data-preview-phone-safe-area="49"] .detail-refined .refined-opening { padding-top: 81px; }
}

/* Approved 16px additional opening space for mobile intro only. */
@media (max-width: 767px) {
  .detail-refined .refined-detail[data-topic="intro"] .refined-opening { padding-top: 48px; }
  html[data-preview-phone-safe-area="49"] .detail-refined .refined-detail[data-topic="intro"] .refined-opening { padding-top: 97px; }
}
