/* ============ CHM POPUPS ============
   Styles for assets/popups.js (modal, banner, slide-in).
   Colours inherit the site tokens (--blue, --navy, --grey); fallbacks keep it
   working on a page that doesn't define them, so the file is reusable across hotels. */

:root{
  --chm-pu-accent: var(--blue, #006EB6);
  --chm-pu-accent-dark: var(--navy, #1A2332);
  --chm-pu-ink: var(--navy, #1A2332);
  --chm-pu-muted: var(--grey, #75787B);
  --chm-pu-radius: 8px;
}

html.chm-pu-lock{ overflow: hidden; }

.chm-pu-card, .chm-pu-banner, .chm-pu-overlay{ font-family: inherit; box-sizing: border-box; }
.chm-pu-card *, .chm-pu-banner *{ box-sizing: border-box; }

/* ---------- shared pieces ---------- */
.chm-pu-close{
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; z-index: 5;
  border: 0; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--chm-pu-ink);
  font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 6px rgba(26,35,50,0.18); transition: background .15s, transform .15s;
}
.chm-pu-modal:focus{ outline: none; }
.chm-pu-scroll{ overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border-radius: inherit; min-height: 0; }
.chm-pu-close:hover{ background: #fff; transform: scale(1.06); }
.chm-pu-close:focus-visible, .chm-pu-cta:focus-visible{ outline: 3px solid var(--chm-pu-accent); outline-offset: 2px; }

.chm-pu-media img{ display: block; width: 100%; height: auto; max-height: 300px; object-fit: cover; }
.chm-pu-content{ padding: 26px 28px 30px; }
.chm-pu-title{ margin: 0 0 10px; font-size: 22px; line-height: 1.3; color: var(--chm-pu-ink); font-weight: 700; padding-right: 28px; }
.chm-pu-body{ margin: 0 0 20px; font-size: 15px; line-height: 1.7; color: var(--chm-pu-muted); white-space: pre-line; }
.chm-pu-body:last-child{ margin-bottom: 0; }

.chm-pu-cta{
  display: inline-block; padding: 12px 28px; border-radius: 26px; background: var(--chm-pu-accent);
  color: #fff; font-size: 15px; font-weight: 600; text-decoration: none; transition: background .2s;
}
.chm-pu-cta:hover{ background: var(--chm-pu-accent-dark); }

/* ---------- modal ---------- */
.chm-pu-overlay{
  position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(6,14,26,0.62); opacity: 0; transition: opacity .25s ease;
}
.chm-pu-overlay.is-open{ opacity: 1; }
.chm-pu-modal{
  position: relative; width: 100%; max-width: 460px; max-height: 100%; display: flex; flex-direction: column;
  background: #fff; border-radius: var(--chm-pu-radius); box-shadow: 0 24px 60px rgba(6,14,26,0.35);
  transform: translateY(16px) scale(.98); transition: transform .3s cubic-bezier(.22,.61,.36,1);
}
.chm-pu-overlay.is-open .chm-pu-modal{ transform: none; }

/* ---------- slide-in (bottom-right card) ---------- */
.chm-pu-slide{
  position: fixed; right: 20px; bottom: 20px; z-index: 1090; width: min(360px, calc(100vw - 40px));
  background: #fff; border-radius: var(--chm-pu-radius); box-shadow: 0 14px 40px rgba(6,14,26,0.28);
  border-top: 3px solid var(--chm-pu-accent); overflow: hidden;
  opacity: 0; transform: translateY(24px); transition: opacity .3s ease, transform .35s cubic-bezier(.22,.61,.36,1);
}
.chm-pu-slide.is-open{ opacity: 1; transform: none; }
.chm-pu-slide .chm-pu-media img{ max-height: 150px; }
.chm-pu-slide .chm-pu-content{ padding: 20px 22px 22px; }
.chm-pu-slide .chm-pu-title{ font-size: 18px; }
.chm-pu-slide .chm-pu-body{ font-size: 14px; margin-bottom: 16px; }
.chm-pu-slide .chm-pu-cta{ padding: 10px 22px; font-size: 14px; }

/* ---------- announcement banner (top of page, scrolls away) ---------- */
.chm-pu-banner{
  background: var(--chm-pu-accent-dark); color: #fff; overflow: hidden; max-height: 0; opacity: 0;
  transition: max-height .35s ease, opacity .35s ease;
}
.chm-pu-banner.is-open{ max-height: 140px; opacity: 1; }
.chm-pu-banner-inner{
  max-width: 1160px; margin: 0 auto; padding: 10px 56px 10px 24px; position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px 18px; flex-wrap: wrap;
  font-size: 14px; line-height: 1.5; text-align: center;
}
.chm-pu-banner-text{ color: #fff; white-space: pre-line; }
.chm-pu-banner-text strong{ font-weight: 700; }
.chm-pu-banner .chm-pu-cta{ padding: 6px 18px; font-size: 13px; background: #fff; color: var(--chm-pu-accent-dark); }
.chm-pu-banner .chm-pu-cta:hover{ background: var(--chm-pu-accent); color: #fff; }
.chm-pu-banner .chm-pu-close{
  top: 50%; right: 14px; margin-top: -14px; width: 28px; height: 28px; font-size: 18px;
  background: rgba(255,255,255,0.16); color: #fff; box-shadow: none;
}
.chm-pu-banner .chm-pu-close:hover{ background: rgba(255,255,255,0.3); }

/* ---------- small screens ---------- */
@media (max-width: 680px){
  .chm-pu-overlay{ padding: 14px; align-items: flex-end; }
  .chm-pu-content{ padding: 22px 22px 26px; }
  .chm-pu-title{ font-size: 20px; }
  .chm-pu-slide{ left: 12px; right: 12px; bottom: 12px; width: auto; }
  .chm-pu-banner-inner{ padding: 10px 48px 10px 16px; font-size: 13px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  .chm-pu-overlay, .chm-pu-modal, .chm-pu-slide, .chm-pu-banner, .chm-pu-close, .chm-pu-cta{
    transition: none !important;
  }
  .chm-pu-modal, .chm-pu-slide{ transform: none !important; }
}
