/* Talking Water — Guesty availability panel / embed.
   Paired with 00-assets/guesty-calendar.js. Uses the site palette tokens
   (--green, --amber, --sage, --cream) already defined on each page. */

.gcal { margin-top: 18px; }

/* ── MODE 'link': availability panel ─────────────────────────────────── */
.gcal-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-radius: 16px;
  background: rgba(11, 69, 61, .06);
  border: 1px solid rgba(11, 69, 61, .14);
}

.gcal-eyebrow {
  display: block;
  font-family: "Urbanist", system-ui, sans-serif;
  font-weight: 800;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #9C4822;
  margin-bottom: 5px;
}

.gcal-copy { flex: 1 1 260px; }
.gcal-copy p { margin: 0; font-size: .96rem; line-height: 1.5; }
.gcal-btn { flex: 0 0 auto; }

/* Stacked variant — used on the cabin cards, where this panel is the only
   booking CTA (it replaced the duplicate full-width "Book Now" that linked
   to the exact same Guesty URL). Button goes full width to keep the weight. */
/* MUST be stretch, not start. .cabin-info is a COLUMN flex container, so
   align-self controls the horizontal axis: `start` shrink-wraps the panel to
   its content. That was invisible while the panel held a paragraph — text
   fit-content filled the column anyway — but the window-card grid's
   fit-content is narrow, which collapsed the panel to ~253px and stacked all
   three cards. Stretch gives the grid the full ~640px column it needs to lay
   out 3-up. */
.gcal--stack { align-self: stretch; }
.gcal--stack .gcal-panel {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;   /* not space-between — the cabin column
                                    stretches this box and would otherwise
                                    strand the button at the bottom */
  gap: 16px;
}
/* flex-basis is the HEIGHT once the panel turns into a column — the 260px
   basis above is a row-layout width and must be reset here. */
.gcal--stack .gcal-copy { flex: 0 0 auto; }
.gcal--stack .gcal-btn { width: 100%; text-align: center; flex: 0 0 auto; }

/* ── MODE 'iframe': embedded Guesty property page ────────────────────── */
.gcal-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(11, 69, 61, .16);
  background: rgba(11, 69, 61, .05);
  min-height: 620px;
}

.gcal-frame iframe {
  display: block;
  width: 100%;
  height: 820px;
  border: 0;
}

.gcal-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: .95rem;
  color: rgba(11, 69, 61, .7);
}
.gcal-frame.is-loaded .gcal-loading { display: none; }

.gcal-fallback {
  display: inline-block;
  margin-top: 10px;
  font-size: .9rem;
  color: #9C4822;
}

/* ── MODE 'live': real next-available dates ──────────────────────────── */
.gcal-next {
  display: block;
  font-size: 1.05rem;
  line-height: 1.45;
}
.gcal-next strong {
  font-family: "Urbanist", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: .01em;
}
.gcal-min {
  display: block;
  margin-top: 4px;
  font-size: .88rem;
  opacity: .8;
}

/* ── MODE 'live': open-window cards ──────────────────────────────────────
   Up to three (MAX_WINDOWS in functions/api/availability.js). auto-fit rather
   than a fixed 3 columns: the cabin panels sit in the ~610px right-hand
   column at desktop but drop to full width on mobile, and the whole-site
   panel is wider still. This goes 3-up / 2-up / stacked on its own. */
.gcal-windows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
}

.gcal-win {
  background: var(--cream, #F4E7CF);
  border: 1px solid rgba(11, 69, 61, .16);
  border-radius: 13px;
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 2px 0 rgba(11, 69, 61, .1);
}

.gw-span {
  font-family: "Urbanist", system-ui, sans-serif;
  font-weight: 800;
  font-size: .93rem;
  letter-spacing: .04em;
  text-transform: uppercase;   /* DOM keeps mixed case for screen readers */
  color: var(--green, #0E3B36);
}

.gw-meta {
  font-size: .72rem;
  line-height: 1.35;
  opacity: .72;
}

/* ── On a dark section ───────────────────────────────────────────────────
   The default panel is ink-on-light. Dropped onto one of the dark green
   bands (#08312D) that would be ~1.2:1 — unreadable. This variant restates
   every colour rather than inheriting. Measured against #08312D:
     sage  #BCCCC5 body    8.44:1  ✓ AA
     amber #E8913A eyebrow 5.74:1  ✓ AA  (terracotta is only 3.08:1 — and at
                                          .72rem the eyebrow is not "large"
                                          text, so it needs the full 4.5:1)
   Amber is also what the site already uses for eyebrows on dark. */
/* Solid, not translucent, for the same reason as the window cards below:
   .how puts pillars-mountains.jpg behind this at opacity .32, and a
   translucent panel inherits it. The amber eyebrow measured 4.68:1 where the
   panel happens to sit today but only 2.08:1 over the photo's bright sky —
   a pre-existing AA failure that moved with viewport height.
     #0D3531 vs amber eyebrow  5.44:1  ✓ AA (.72rem needs the full 4.5:1)
     the #1A423E cards still lift off it by 1.21:1 plus their border */
.gcal--on-dark .gcal-panel {
  background: #0D3531;
  border-color: rgba(255, 255, 255, .18);
}
.gcal--on-dark .gcal-eyebrow { color: var(--amber, #E8913A); }
.gcal--on-dark .gcal-copy p  { color: var(--sage, #BCCCC5); }
.gcal--on-dark .gcal-loading { color: var(--sage, #BCCCC5); }
.gcal--on-dark .gcal-fallback { color: var(--amber, #E8913A); }

/* Window cards on the dark band. The background here is SOLID on purpose.
   .how is #08312D, but it also carries a ::after layer of
   pillars-mountains.jpg at opacity .32 sitting behind this content — so the
   real backdrop is a photograph, not a flat colour. A translucent
   rgba(255,255,255,.07) card inherits whatever is behind it: measured
   #294D4D over the live render, but #5C7368 over the photo's bright sky,
   where .gw-meta fell to 2.66:1 — a plain AA failure. Section height moves
   with viewport and copy, so which part of the photo lands here is not fixed.
   A solid colour makes the card immune to all of that.
     #1A423E vs the band          1.27:1  — still reads as a lifted card,
                                            helped by the 19% white border
     #FFFFFF        span         11.09:1  ✓ AAA
     sage @85%      meta          5.28:1  ✓ AA  (.72rem needs the full 4.5:1)
   Light variant for comparison: green on cream 10.12:1, ink@72% 5.18:1. */
.gcal--on-dark .gcal-win {
  background: #1A423E;
  border-color: rgba(255, 255, 255, .19);
  box-shadow: none;
}
.gcal--on-dark .gw-span { color: #fff; }
.gcal--on-dark .gw-meta { color: var(--sage, #BCCCC5); opacity: .85; }

@media (max-width: 760px) {
  .gcal-panel { flex-direction: column; align-items: stretch; }
  /* Same trap as the stack variant: once the panel is a column, the 260px
     flex-basis on .gcal-copy is read as a HEIGHT and strands the button. */
  .gcal-copy { flex: 0 0 auto; }
  .gcal-btn { width: 100%; text-align: center; flex: 0 0 auto; }
  .gcal-frame iframe { height: 700px; }
}

@media (prefers-reduced-motion: reduce) {
  .gcal-frame, .gcal-panel { transition: none; }
}
