/* ==========================================================================
   Our own adverts: the offer cards in the guides, the docked bar, the offer
   form (lib/offers.js, assets/js/offers.js). Tokens from site.css.
   ========================================================================== */

/* ---------- The card between a guide's sections ---------- */
/* The sections around it give it room; a sand section next to it does not
   (its padding is inside the sand), so the card keeps its own there. */
.section--sand + .offer-slot { padding-top: clamp(48px, 5vw, 76px); }
.offer-slot:has(+ .section--sand) { padding-bottom: clamp(48px, 5vw, 76px); }

.offer {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  overflow: hidden;
  background: var(--sand-100);
  border: 1px solid var(--sand-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.offer__who {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 24px 16px;
  background: radial-gradient(120% 90% at 50% 0%, var(--forest-600), var(--forest-800) 70%);
  text-align: center;
}
.offer__avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 3px solid var(--gold-400);
  object-fit: cover;
  background: var(--forest-700);
}
.offer__name { font-size: .8rem; line-height: 1.35; color: rgba(255, 255, 255, .82); }
.offer__body { padding: 20px 28px 18px; }
.offer__eyebrow {
  margin: 0 0 6px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ember-600);
}
.offer__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.32rem, 2.1vw, 1.55rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--forest-800);
}
.offer__text { margin: 0 0 14px; font-size: .94rem; line-height: 1.52; color: var(--ink-700); }
.offer__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.offer__actions .btn { padding: .68em 1.3em; font-size: .93rem; }
.offer__actions .btn svg { flex: none; }
.offer__proof {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: .82rem;
  line-height: 1.4;
  color: var(--muted);
}
.offer__proof li { display: inline-flex; align-items: center; gap: .4em; }
.offer__proof svg { flex: none; width: 14px; height: 14px; color: var(--forest-500); }
.offer__proof a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(91, 102, 95, .4); }
.offer__proof a:hover { color: var(--forest-700); text-decoration-color: currentColor; }

/* Phones: Christian on a green strip at the top, the buttons full width. */
@media (max-width: 620px) {
  .offer { grid-template-columns: 1fr; }
  .offer__who { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 18px; text-align: left; }
  .offer__avatar { width: 52px; height: 52px; border-width: 2px; }
  .offer__name { font-size: .86rem; }
  .offer__eyebrow { font-size: .7rem; letter-spacing: .1em; }
  .offer__body { padding: 18px 18px 18px; }
  .offer__actions .btn { width: 100%; }
  .offer__proof { flex-direction: column; gap: 6px; margin-top: 16px; }
}

/* ---------- The dock: a bar along the bottom, a card in the corner on wide screens ---------- */
.offer-dock {
  position: fixed;
  z-index: 85;
  display: flex;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s ease, transform .35s cubic-bezier(.2, .7, .3, 1), visibility 0s linear .35s;
}
.offer-dock[hidden] { display: none; }
.offer-dock.is-shown { visibility: visible; opacity: 1; transform: none; transition: opacity .3s ease, transform .35s cubic-bezier(.2, .7, .3, 1), visibility 0s; }
.offer-dock p { margin: 0; }
.offer-dock__avatar { flex: none; border-radius: 50%; object-fit: cover; background: var(--forest-700); }
.offer-dock__text { flex: 1; min-width: 0; }
.offer-dock__actions { display: flex; align-items: center; gap: 8px; }
.offer-dock__actions .btn { box-shadow: none; }
.offer-dock__close {
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease;
}

/* A dark green bar along the bottom, above the iPhone's home bar: on
   phones, tablets and laptops. */
@media (max-width: 1919px) {
  .offer-dock {
    inset: auto 0 0 0;
    gap: 10px;
    min-height: 64px;
    padding: 10px 6px calc(10px + env(safe-area-inset-bottom)) 14px;
    background: var(--forest-800);
    color: #fff;
    box-shadow: 0 -8px 26px rgba(8, 32, 26, .22);
    transform: translateY(100%);
  }
  .offer-dock__avatar { width: 40px; height: 40px; border: 2px solid var(--gold-400); }
  .offer-dock__close { width: 32px; height: 32px; color: rgba(255, 255, 255, .7); }
  .offer-dock__close:hover { color: #fff; background: rgba(255, 255, 255, .1); }
  /* While it shows, the end of the page can still scroll clear of it, and
     a field or link reached with the keyboard isn't hidden under it. */
  body.has-offer-dock { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  html:has(> body.has-offer-dock) { scroll-padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}
/* Phones: the short line and a round WhatsApp button. */
@media (max-width: 719px) {
  .offer-dock__title, .offer-dock__line { display: none; }
  .offer-dock__short { font-size: .86rem; font-weight: 600; line-height: 1.3; }
  .offer-dock__wa { width: 42px; height: 42px; padding: 0; }
  .offer-dock__wa span { display: none; }
  .offer-dock__wa svg { width: 22px; height: 22px; }
  .offer-dock__form { padding: .66em 1.05em; font-size: .86rem; }
}
/* The smallest phones: the line keeps to two rows. */
@media (max-width: 374px) {
  .offer-dock { gap: 8px; padding-left: 10px; }
  .offer-dock__avatar { width: 36px; height: 36px; }
  .offer-dock__short { font-size: .8rem; }
  .offer-dock__form { padding: .66em .85em; }
}
/* Tablets and laptops: the longer line and both labels, kept to about the
   width of the guide's text column in the middle of the bar. */
@media (min-width: 720px) and (max-width: 1919px) {
  .offer-dock { gap: 14px; padding-inline: max(20px, calc((100% - 900px) / 2)); }
  .offer-dock__short { display: none; }
  .offer-dock__title { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; line-height: 1.25; }
  .offer-dock__line { margin-top: 2px; font-size: .86rem; line-height: 1.35; color: rgba(255, 255, 255, .78); }
  .offer-dock__actions .btn { padding: .62em 1.1em; font-size: .88rem; }
  .offer-dock__wa svg { width: 17px; height: 17px; }
}
/* Small tablets: the short line, which keeps the bar to one row of text. */
@media (min-width: 720px) and (max-width: 979px) {
  .offer-dock__title, .offer-dock__line { display: none; }
  .offer-dock__short { display: block; font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; line-height: 1.25; }
}

/* Wide screens: a card in the bottom-right corner, but only where it
   clears the page's widest content. The 1200px container holds 1152px of
   text and photos (a guide's text-and-photo sections put text on the
   right too), so the card needs (width + 1152) / 2 + 16 <= width - 360:
   1904px, and 1920 leaves room for a 17px scrollbar. */
@media (min-width: 1920px) {
  .offer-dock {
    right: 20px;
    bottom: 20px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 4px 12px;
    align-items: start;
    width: 340px;
    padding: 18px 16px 18px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--ember-500);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(16px);
  }
  .offer-dock__avatar { width: 44px; height: 44px; border: 2px solid var(--gold-400); }
  .offer-dock__short { display: none; }
  .offer-dock__title { padding-right: 20px; font-family: var(--font-display); font-size: 1rem; font-weight: 600; line-height: 1.25; color: var(--forest-800); }
  .offer-dock__line { margin-top: 4px; font-size: .88rem; line-height: 1.45; color: var(--ink-700); }
  .offer-dock__actions { grid-column: 2; margin-top: 10px; }
  .offer-dock__actions .btn { padding: .62em 1.05em; font-size: .86rem; }
  .offer-dock__wa svg { width: 17px; height: 17px; }
  .offer-dock__close { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; color: var(--ink-400); }
  .offer-dock__close:hover { color: var(--ink-900); background: var(--sand-100); }
}
@media (prefers-reduced-motion: reduce) {
  .offer-dock { transform: none; }
}
/* While the dock can show, it stands in for the plain WhatsApp button. */
.offer-dock-on .wa-float { display: none; }
/* Where focus goes when the dock closes under it: no ring round the page. */
main[tabindex="-1"]:focus { outline: none; }

/* ---------- The offer form (built by offers.js) ---------- */
.offer-dialog {
  width: min(600px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.offer-dialog::backdrop { background: rgba(8, 32, 26, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.offer-dialog[open] { animation: offer-in .25s ease-out; }
@keyframes offer-in { from { opacity: 0; transform: translateY(12px); } }
html.has-offer-dialog { overflow: hidden; }
.offer-dialog__inner { position: relative; padding: 26px 28px 28px; }
.offer-dialog__head {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
  padding-right: 34px;
}
.offer-dialog__head img { width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--gold-400); object-fit: cover; }
.offer-dialog__head h2 { margin: 0 0 4px; font-size: clamp(1.4rem, 3.4vw, 1.75rem); color: var(--forest-800); text-wrap: balance; }
.offer-dialog__head p { margin: 0; font-size: .93rem; line-height: 1.5; color: var(--muted); }
.offer-dialog__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sand-100);
  color: var(--ink-700);
  cursor: pointer;
}
.offer-dialog__close:hover { background: var(--sand-200); color: var(--ink-900); }
.offer-dialog .form-grid { gap: 14px 16px; }
.offer-dialog .field { gap: 6px; }
.offer-dialog .field input,
.offer-dialog .field select,
.offer-dialog .field textarea { padding: .72em .9em; }
.offer-dialog .field textarea { min-height: 84px; }
.offer-dialog .field__opt { font-weight: 500; color: var(--ink-400); }
.offer-dialog .btn-row { margin-top: 20px; gap: 10px; }
.offer-dialog__status {
  margin: 16px 0 0;
  padding: 12px 16px;
  border: 1px solid rgba(192, 57, 43, .35);
  border-radius: var(--r-md);
  background: rgba(192, 57, 43, .08);
  font-size: .92rem;
}
.offer-dialog__status.is-ok { border-color: rgba(42, 122, 88, .3); background: rgba(42, 122, 88, .1); }
.offer-dialog__done { padding: 6px 0 2px; }
.offer-dialog__done p {
  margin: 0 0 20px;
  padding: 16px 18px;
  border: 1px solid rgba(42, 122, 88, .3);
  border-radius: var(--r-md);
  background: rgba(42, 122, 88, .1);
  font-size: .98rem;
}
.offer-dialog__done p:focus { outline: none; }
/* Phones: the photo beside the heading, the line under both, and the
   month next to the number of travellers, so the buttons come sooner. */
@media (max-width: 560px) {
  .offer-dialog__inner { padding: 18px 18px 20px; }
  .offer-dialog__head { grid-template-columns: 44px minmax(0, 1fr); gap: 8px 12px; margin-bottom: 16px; padding-right: 0; }
  .offer-dialog__head > div { display: contents; }
  .offer-dialog__head img { width: 44px; height: 44px; }
  .offer-dialog__head h2 { margin: 0; padding-right: 40px; }
  .offer-dialog__head p { grid-column: 1 / -1; }
  .offer-dialog .form-grid { grid-template-columns: minmax(0, 1fr) 92px; gap: 12px; }
  .offer-dialog .field { grid-column: 1 / -1; }
  .offer-dialog .field--pair { grid-column: auto; }
  .offer-dialog .field input,
  .offer-dialog .field select,
  .offer-dialog .field textarea { padding: .64em .85em; }
  .offer-dialog .field textarea { min-height: 70px; }
  .offer-dialog .btn-row { margin-top: 16px; }
  .offer-dialog .btn-row .btn { width: 100%; }
  .offer-dialog__close { top: 12px; right: 12px; }
}
