/* ==========================================================================
   STAY ARI · picker.css  (shared: calendar, popover / sheet, guest steppers, modal shell)
   Used with assets/js/picker.js on stays.html, property.html, book.html
   ========================================================================== */
:root {
  --paper: #faf9f7; --paper-2: #f3ede4; --paper-ink: #2f2a25; --paper-mute: #6b645b;
  --paper-line: rgba(207, 65, 0, 0.26); --paper-green: #cf4100; --paper-sage: #cf4100; --paper-beige: #ffe8de;
}

/* ---------- popover + bottom sheet ---------- */
.sa-pop { position: fixed; inset: 0; z-index: 160; pointer-events: none; }
.sa-pop-back { position: absolute; inset: 0; background: rgba(6, 9, 6, .6); opacity: 0; transition: opacity .5s var(--ease); display: none; }
.sa-pop-panel {
  position: fixed; left: 0; top: 0; width: var(--pop-w, auto); max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow: auto;
  background: var(--paper); color: var(--paper-ink); border-radius: 16px; box-shadow: 0 28px 70px rgba(65, 45, 25, 0.17), 0 0 0 1px rgba(207, 65, 0, 0.25);
  opacity: 0; transform: translateY(10px) scale(.985); pointer-events: none; outline: none;
  transition: opacity .45s var(--ease), transform .55s var(--ease);
}
.sa-pop.show .sa-pop-panel { opacity: 1; transform: none; pointer-events: auto; }
.sa-pop-grab { display: none; }
.sa-pop-body { min-width: 0; }
@media (max-width: 760px) {
  .sa-pop { z-index: 170; }
  .sa-pop.show { pointer-events: auto; }
  .sa-pop-back { display: block; }
  .sa-pop.show .sa-pop-back { opacity: 1; }
  .sa-pop-panel { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-width: 100%; max-height: 90vh; border-radius: 22px 22px 0 0; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom, 0); transition: transform .7s var(--ease), opacity .4s var(--ease); opacity: 1; }
  .sa-pop.show .sa-pop-panel { transform: none; }
  .sa-pop-grab { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 4; padding: 16px 18px 6px; background: var(--paper); }
  .sa-pop-grab b { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; }
  .sa-grip { position: absolute; left: 50%; top: 7px; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: rgba(27, 31, 26, .2); }
  .sa-pop-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--paper-line); font-size: 22px; line-height: 1; color: var(--paper-ink); }
}

/* ---------- calendar ---------- */
.cal { --cell-h: 42px; position: relative; padding: 20px 22px 16px; color: var(--paper-ink); font-family: var(--sans); -webkit-user-select: none; user-select: none; }
.cal--prices { --cell-h: 56px; }
.cal--card { background: var(--paper); border-radius: 16px; box-shadow: 0 22px 50px rgba(65, 45, 25, 0.12); border: 1px solid var(--paper-line); padding: 24px 26px 18px; }
.cal-months { display: grid; gap: 0 44px; grid-template-columns: repeat(2, minmax(0, 1fr)); position: relative; }
.cal-months.m1 { grid-template-columns: minmax(0, 1fr); }
.cal-months.m2::before { content: ''; position: absolute; left: 50%; top: 40px; bottom: 6px; width: 1px; background: var(--paper-line); }
.cal-month { min-width: 0; }
.cal-mhead { position: relative; display: flex; align-items: center; justify-content: center; height: 40px; margin-bottom: 6px; }
.cal-title { font-family: var(--serif); font-size: 1.05rem; font-weight: 500; letter-spacing: .01em; }
.cal-nav { position: absolute; top: 2px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--paper-line); color: var(--paper-ink); box-shadow: 0 2px 8px rgba(65, 45, 25, 0.06); transition: transform .4s var(--ease), background-color .3s, opacity .3s; z-index: 2; }
.cal-nav svg { width: 15px; height: 15px; }
.cal-prev { left: 0; } .cal-next { right: 0; }
.cal-nav:hover:not(:disabled) { background: var(--paper-beige); transform: scale(1.06); }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; }
.cal-dow { text-align: center; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; color: var(--paper-mute); padding: 4px 0 8px; }
.cal-day {
  position: relative; height: var(--cell-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 13.5px; color: var(--paper-ink); border-radius: 0; transition: background-color .3s var(--ease), color .3s var(--ease), transform .4s var(--ease);
}
.cal-day::before { content: ''; position: absolute; inset: 2px 3px; border-radius: 10px; background: transparent; transition: background-color .3s var(--ease), box-shadow .3s var(--ease); z-index: 0; }
.cal-day > * { position: relative; z-index: 1; }
.cal-n { font-weight: 500; line-height: 1.1; }
.cal-price { font-style: normal; font-size: 9.5px; font-weight: 500; letter-spacing: .01em; color: var(--paper-sage); line-height: 1.1; }
.cal-day:hover:not([aria-disabled="true"])::before { background: rgba(255, 81, 0, 0.16); }
.cal-day:focus-visible { outline: none; }
.cal-day:focus-visible::before { box-shadow: 0 0 0 2px var(--gold-deep); }
.cal-day.is-today .cal-n { text-decoration: underline; text-decoration-color: var(--gold-deep); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.cal-day.is-past { color: rgba(27, 31, 26, .32); cursor: default; }
.cal-day.is-past::before, .cal-day.is-short::before { background: rgba(234, 217, 189, .5); }
.cal-day.is-short { color: rgba(27, 31, 26, .35); cursor: default; }
.cal-day.is-booked { color: rgba(27, 31, 26, .4); cursor: default; }
.cal-day.is-booked .cal-n { text-decoration: line-through; text-decoration-color: #b4584a; text-decoration-thickness: 1.5px; }
.cal-day.is-booked::before { background: rgba(180, 88, 74, .07); }
.cal-day.is-co .cal-n::after { content: ''; }
.cal-day.is-in::before, .cal-day.is-hov::before { background: rgba(255, 81, 0, 0.20); inset: 2px 0; border-radius: 0; }
.cal-day.is-start::before, .cal-day.is-end::before { background: var(--paper-green); inset: 2px 3px; border-radius: 10px; }
.cal-day.is-start.has-end::before { inset: 2px 0 2px 3px; border-radius: 10px 0 0 10px; }
.cal-day.is-end::before { inset: 2px 3px 2px 0; border-radius: 0 10px 10px 0; }
.cal-day.is-start, .cal-day.is-end { color: #fff; }
.cal-day.is-start .cal-price, .cal-day.is-end .cal-price { color: rgba(255, 255, 255, .78); }
.cal-day.is-hov:not(.is-start)::before { background: rgba(255, 81, 0, 0.16); }
/* the three keys in even thirds, centred (Cameron 2026-11-05) */
.cal-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--paper-line); font-size: 12px; color: var(--paper-mute); }
.cal-legend span { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
@media (max-width: 359px) { .cal-legend { font-size: 11px; gap: 6px; } .cal-legend span { gap: 6px; } }
.lg { width: 16px; height: 16px; border-radius: 4px; display: inline-grid; place-items: center; font-style: normal; font-size: 10px; line-height: 1; }
.lg-av { border: 1px solid rgba(65, 59, 50, 0.35); color: var(--paper-sage); background: #fff; }
.lg-bk { border: 1px solid rgba(180, 88, 74, .6); color: #b4584a; background: rgba(180, 88, 74, .08); font-size: 12px; }
.lg-na { background: var(--paper-beige); }
.cal-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; min-height: 26px; }
.cal-msg { flex: 1; text-align: center; font-size: 12.5px; letter-spacing: .02em; color: var(--paper-mute); transition: color .3s; }
.cal-msg.warn { color: #a5483b; }
.cal-clear { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-deep); padding: 6px 4px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(207, 65, 0, 0.45); }
.cal-clear:hover { color: var(--paper-ink); }
.cal-foot:has(.cal-clear) .cal-msg { text-align: left; }
.cal-note { margin-top: 6px; font-size: 11px; line-height: 1.5; color: var(--paper-mute); text-align: center; opacity: .85; }
.sa-pop .cal { width: min(var(--pop-w, 700px), calc(100vw - 24px)); }
@media (max-width: 760px) {
  .cal { padding: 8px 16px 18px; --cell-h: 46px; }
  .cal--prices { --cell-h: 54px; }
  .cal--card { padding: 18px 14px 14px; }
  .sa-pop .cal { width: 100%; }
  .cal-day::before { inset: 2px 2px; }
}

/* ---------- guest steppers ---------- */
.gp { padding: 8px 22px 14px; min-width: 300px; color: var(--paper-ink); }
.gp-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--paper-line); }
.gp-row:last-of-type { border-bottom: 0; }
.gp-l b { display: block; font-weight: 500; font-size: 14.5px; }
.gp-l small { display: block; color: var(--paper-mute); font-size: 12px; margin-top: 2px; }
.gp-s { display: inline-flex; align-items: center; gap: 12px; }
.gp-b { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(65, 59, 50, 0.30); display: grid; place-items: center; font-size: 17px; line-height: 1; color: var(--paper-ink); background: #fff; transition: background-color .3s, transform .35s var(--ease), opacity .3s; }
.gp-b:hover:not(:disabled) { background: var(--paper-beige); transform: scale(1.06); }
.gp-b:disabled { opacity: .3; cursor: default; }
.gp-v { min-width: 20px; text-align: center; font-weight: 500; font-size: 15px; }
.gp-cap { font-size: 11.5px; color: var(--paper-mute); line-height: 1.5; padding-top: 6px; }
.gp-cap:empty { display: none; }
@media (max-width: 760px) { .gp { padding: 4px 20px 22px; min-width: 0; } }

/* ---------- modal shell ---------- */
.sa-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(8, 11, 8, .86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .5s var(--ease); }
.sa-modal.show { opacity: 1; }
.sa-modal-x { position: fixed; right: 18px; top: 16px; z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--text); background: rgba(14, 18, 13, .5); transition: background-color .4s, transform .5s var(--ease); }
.sa-modal-x:hover { background: rgba(255, 81, 0, 0.14); transform: rotate(90deg); }
.sa-modal-x svg { width: 18px; height: 18px; }
@media (max-width: 760px) { .sa-modal { padding: 0; } .sa-modal-x { right: 12px; top: 12px; } }

/* Showtime 2026-10-20: warm, lighter backdrop for sheets and pickers (was green-black); photo and video viewers keep their dark stage. */
.sa-modal:not(.lb-modal):not(.tm-modal) { background: rgba(47, 42, 37, .55); }
.sa-modal:not(.lb-modal):not(.tm-modal) .sa-modal-x { background: rgba(255, 255, 255, .92); color: var(--ink, #2f2a25); }

/* ---------- photo viewer (SAPicker.viewer; the stay page's video viewer reuses .lb-nav) ---------- */
.lb-modal { background: rgba(5, 8, 5, .95); }
.lb-modal .sa-modal-x { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .35); color: #fff; }
.lb-fig { margin: 0; max-width: 100%; max-height: 100%; display: grid; justify-items: center; gap: 14px; }
.lb-img { max-width: min(1100px, calc(100vw - 150px)); max-height: calc(100vh - 150px); width: auto; height: auto; object-fit: contain; border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.lb-cap { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .72); text-align: center; min-height: 18px; display: flex; gap: 12px; align-items: center; justify-content: center; }
.lb-count { position: fixed; left: 0; right: 0; bottom: 18px; text-align: center; font-size: 12px; letter-spacing: .14em; color: rgba(242, 243, 238, .7); pointer-events: none; }
.lb-nav { position: fixed; top: 50%; width: 46px; height: 46px; margin-top: -23px; z-index: 4; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .35); color: #fff; transition: background-color .4s, transform .5s var(--ease), border-color .4s; }
.lb-nav svg { width: 18px; height: 18px; }
.lb-nav:hover { background: rgba(255, 81, 0, 0.18); border-color: var(--gold); }
.lb-prev { left: 20px; } .lb-next { right: 20px; }
.lb-prev:hover { transform: translateX(-3px); } .lb-next:hover { transform: translateX(3px); }
@media (max-width: 760px) {
  .lb-img { max-width: 100vw; max-height: calc(100vh - 160px); border-radius: 0; }
  .lb-nav { width: 40px; height: 40px; top: auto; bottom: 8px; margin: 0; }
  .lb-prev { left: 14px; } .lb-next { right: 14px; }
}
