/* ==========================================================================
   WP Tours Reviews

   Review cards use the theme's .review-card styles, so they look exactly like
   the home page design; this file adds only what is new. The full review
   opens as a postcard: the traveller's words on the left, who wrote them on
   the right. Colours come from the theme's brand tokens, with fallbacks.
   ========================================================================== */

.wtr-home,
.wtr-page {
  --wtr-ink: #123434;
  --wtr-ink-soft: #3f5353;
  --wtr-muted: #5c6e6e;
  --wtr-gold: var(--brand, #d8ad02);
  --wtr-gold-deep: var(--brand-deep, #836901);
  --wtr-gold-deeper: var(--brand-deeper, #604d01);
  --wtr-gold-light: var(--brand-light, #f4ca25);
  --wtr-gold-rgb: var(--brand-rgb, 216, 173, 2);
  --wtr-on-gold: var(--on-brand, #123434);
  --wtr-sand: #f4f1ea;
  --wtr-line: #e6dfcf;
  --wtr-field-line: #e2dac8;
  --wtr-star-off: #dcd5c5;
  --wtr-error: #b42318;
}

.wtr-page [hidden] { display: none !important; }

.wtr-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Stars and cards ---------- */
.wtr-stars { white-space: nowrap; }
.wtr-stars__off { color: var(--wtr-star-off); }
.wtr-photo { object-fit: cover; }

.wtr-card { display: flex; flex-direction: column; }
.wtr-card .review-card__author { margin-top: auto; }

/* Long comments stop after five lines so the cards stay even. On the Reviews
   page that only happens once the script is there to open the full review. */
.wtr-home .review-card__quote,
.wtr-js .wtr-page .review-card__quote {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
}

/* The whole card is clickable through a real button stretched over it. */
.wtr-card--popup { position: relative; transition: transform .25s ease, box-shadow .25s ease; }
.wtr-card--popup:hover { transform: translateY(-3px); box-shadow: 0 22px 40px -26px rgba(var(--brand-shadow-rgb, 131, 105, 1), .55); }
.wtr-card--popup .review-card__author { margin-top: 0; }
.wtr-card__open {
  align-self: flex-start;
  margin: auto 0 20px; /* Sits with the author at the foot, so the links line up across a row. */
  padding: 0;
  border: 0;
  background: none;
  color: var(--wtr-gold-deep);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.wtr-card__open::after { content: ""; position: absolute; inset: 0; border-radius: 22px; }
.wtr-card--popup:hover .wtr-card__open { color: var(--wtr-gold-deeper); text-decoration: underline; text-underline-offset: 3px; }
.wtr-card__open:focus-visible { outline: none; }
.wtr-card__open:focus-visible::after { outline: 2px solid var(--wtr-ink); outline-offset: 2px; }
html:not(.wtr-js) .wtr-card__open { display: none; }

/* Home page button */
.wtr-more { display: flex; justify-content: center; margin-top: 36px; }

/* ---------- Reviews page ---------- */
.wtr-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; margin-bottom: 34px; }
.wtr-summary__score { display: flex; align-items: center; gap: 16px; }
.wtr-summary__number { font-size: clamp(46px, 5vw, 60px); font-weight: 800; line-height: 1; letter-spacing: -.03em; color: var(--wtr-ink); }
.wtr-summary__detail { display: flex; flex-direction: column; gap: 5px; }
.wtr-summary__stars {
  width: fit-content;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 1px;
  color: transparent;
  background: linear-gradient(90deg, var(--wtr-gold) var(--wtr-fill, 100%), var(--wtr-star-off) var(--wtr-fill, 100%));
  -webkit-background-clip: text;
  background-clip: text;
}
.wtr-summary__count { font-size: 14px; color: var(--wtr-muted); }
.wtr-summary__write { margin-left: auto; }
.wtr-empty { margin: 0; padding: 24px 0 8px; text-align: center; font-size: 17px; line-height: 1.6; color: var(--wtr-muted); }

.wtr-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 36px; }
.wtr-pages .page-numbers {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 6px;
  border-radius: 22px;
  background: #fff;
  color: var(--wtr-ink);
  font-size: 15px;
  font-weight: 700;
  transition: background .2s, color .2s;
}
.wtr-pages a.page-numbers:hover { background: var(--wtr-gold); color: var(--wtr-on-gold); }
.wtr-pages .page-numbers.current { background: var(--wtr-gold); color: var(--wtr-on-gold); }
.wtr-pages .page-numbers.dots { background: none; }
.wtr-pages a.page-numbers:focus-visible { outline: 2px solid var(--wtr-ink); outline-offset: 2px; }

/* ---------- Popups ---------- */
html.wtr-locked { overflow: hidden; }
html.wtr-locked body { padding-right: var(--wtr-scrollbar, 0px); }

.wtr-dialog {
  position: fixed;
  inset: 0;
  width: min(820px, calc(100vw - 48px));
  height: fit-content;
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--wtr-ink);
  overflow: visible;
  opacity: 0;
  transform: translateY(24px) scale(.97);
  transition: opacity .25s ease, transform .4s cubic-bezier(.2, .9, .25, 1), overlay .4s allow-discrete, display .4s allow-discrete;
}
.wtr-dialog[open] { opacity: 1; transform: none; }
@starting-style {
  .wtr-dialog[open] { opacity: 0; transform: translateY(24px) scale(.97); }
}
.wtr-dialog--form { width: min(640px, calc(100vw - 48px)); }
.wtr-dialog::backdrop {
  background: rgba(8, 28, 28, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition: background .3s ease, backdrop-filter .3s ease, overlay .4s allow-discrete, display .4s allow-discrete;
}
.wtr-dialog[open]::backdrop {
  background: rgba(8, 28, 28, .62);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
@starting-style {
  .wtr-dialog[open]::backdrop { background: rgba(8, 28, 28, 0); backdrop-filter: blur(0); }
}

.wtr-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: min(84vh, 760px);
  max-height: min(84dvh, 760px);
  border-radius: 28px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .6);
}
.wtr-sheet__body { flex: 1 1 auto; min-height: 0; padding: 44px 48px 40px; overflow-y: auto; overscroll-behavior: contain; }

.wtr-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--wtr-sand);
  color: var(--wtr-ink);
  cursor: pointer;
  transition: background .2s, transform .3s;
}
.wtr-close:hover { background: var(--wtr-gold); transform: rotate(90deg); }
.wtr-close:focus-visible { outline: 2px solid var(--wtr-ink); outline-offset: 3px; }
.wtr-close svg { width: 20px; height: 20px; }

/* The postcard: words on the left, the sender on the right. */
.wtr-full { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); column-gap: 36px; }
.wtr-full__stars { margin-bottom: 18px; font-size: 22px; line-height: 1; color: var(--wtr-gold); }
.wtr-full__quote { margin: 0; font-size: clamp(18px, 1.5vw, 20px); font-weight: 500; line-height: 1.65; color: #24403f; overflow-wrap: anywhere; }
.wtr-full__from { padding: 22px 0 0 32px; border-left: 1px solid var(--wtr-line); }
.wtr-full__facts { display: grid; gap: 14px; margin: 24px 0 0; }
.wtr-full__facts dt { margin: 0 0 2px; font-size: 13px; color: var(--wtr-muted); }
.wtr-full__facts dd { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.wtr-full__facts a { color: var(--wtr-gold-deep); text-decoration: underline; text-underline-offset: 3px; }
.wtr-full__facts a:hover { color: var(--wtr-gold-deeper); }
.wtr-full__reply { grid-column: 1 / -1; margin-top: 30px; padding: 20px 24px; border-radius: 18px; background: var(--wtr-sand); }
.wtr-full__reply-label { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--wtr-ink); }
.wtr-full__reply-text { margin: 0; font-size: 15px; line-height: 1.6; color: var(--wtr-ink-soft); overflow-wrap: anywhere; }

/* ---------- The review form ---------- */
/* On the page for visitors without JavaScript; otherwise moved into its popup. */
.wtr-write { max-width: 760px; margin: 56px auto 0; padding: 40px 44px; border-radius: 28px; background: #fff; box-shadow: 0 30px 60px -36px rgba(var(--brand-shadow-rgb, 131, 105, 1), .45); scroll-margin-top: 110px; }
.wtr-dialog .wtr-write { max-width: none; margin: 0; padding: 0; border-radius: 0; background: none; box-shadow: none; }
.wtr-write__title { margin: 0 0 6px; padding-right: 44px; font-size: clamp(24px, 2.4vw, 30px); font-weight: 800; line-height: 1.2; letter-spacing: -.01em; color: var(--wtr-ink); outline: none; }
.wtr-write__intro { margin: 0 0 24px; font-size: 15px; line-height: 1.6; color: var(--wtr-ink-soft); }

.wtr-form { margin: 0; }
.wtr-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.wtr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.wtr-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }
.wtr-field--full { grid-column: 1 / -1; }
.wtr-label { padding: 0; font-size: 13px; font-weight: 700; color: var(--wtr-ink); }

.wtr-form input[type="text"],
.wtr-form input[type="email"],
.wtr-form select,
.wtr-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 12px 15px;
  border: 1.5px solid var(--wtr-field-line);
  border-radius: 14px;
  background-color: var(--wtr-sand);
  color: var(--wtr-ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  outline: none;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.wtr-form select {
  padding-right: 40px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23123434' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}
.wtr-form textarea { min-height: 124px; resize: vertical; }
.wtr-form input::placeholder,
.wtr-form textarea::placeholder { color: #5f706e; }
.wtr-form input:focus,
.wtr-form select:focus,
.wtr-form textarea:focus { border-color: var(--wtr-gold-deep); background-color: #fff; box-shadow: 0 0 0 4px rgba(var(--wtr-gold-rgb), .22); }
.wtr-form input[aria-invalid="true"],
.wtr-form select[aria-invalid="true"],
.wtr-form textarea[aria-invalid="true"] { border-color: var(--wtr-error); background-color: #fff8f7; }
.wtr-error { margin: 2px 0 0; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--wtr-error); }

/* Star picker: each star lights up with those before it. */
.wtr-rate__stars { display: inline-flex; gap: 2px; margin-left: -3px; }
.wtr-rate__star { position: relative; display: block; padding: 2px 3px; border-radius: 8px; font-size: 40px; line-height: 1; color: var(--wtr-star-off); cursor: pointer; transition: color .12s; }
.wtr-rate__star > span[aria-hidden] { display: block; }
.wtr-rate__star input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.wtr-rate__star:has(~ .wtr-rate__star input:checked),
.wtr-rate__star:has(input:checked) { color: var(--wtr-gold); }
.wtr-rate__star:has(input:checked) > span[aria-hidden] { animation: wtr-pop .32s cubic-bezier(.2, .9, .3, 1.4); }
.wtr-rate__star:has(input:focus-visible) { outline: 2px solid var(--wtr-ink); outline-offset: 1px; }
@keyframes wtr-pop { 50% { transform: scale(1.26); } }
@media (hover: hover) {
  .wtr-rate__stars:hover .wtr-rate__star { color: var(--wtr-star-off); }
  .wtr-rate__stars:hover .wtr-rate__star:has(~ .wtr-rate__star:hover),
  .wtr-rate__stars:hover .wtr-rate__star:hover { color: var(--wtr-gold); }
}

.wtr-check { position: relative; display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 500; line-height: 1.45; color: var(--wtr-ink); cursor: pointer; }
.wtr-check input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.wtr-check__box { flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid #b9ad93; border-radius: 8px; background: #fff; color: transparent; transition: background .2s, border-color .2s, color .2s; }
.wtr-check__box svg { width: 14px; height: 14px; stroke-width: 3.4; }
.wtr-check input:checked + .wtr-check__box { border-color: var(--wtr-gold); background: var(--wtr-gold); color: var(--wtr-on-gold); }
.wtr-check input:focus-visible + .wtr-check__box { outline: 2px solid var(--wtr-ink); outline-offset: 2px; }

.wtr-alert { margin: 16px 0 0; font-size: 14px; font-weight: 600; color: var(--wtr-error); }
.wtr-alert:empty { display: none; }
.wtr-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.wtr-actions .btn { justify-content: center; min-width: 180px; padding: 14px 28px; font-size: 16px; }
.wtr-page .btn:focus-visible { outline: 2px solid var(--wtr-ink); outline-offset: 3px; }
.wtr-submit:disabled { cursor: progress; opacity: .85; transform: none; }
.wtr-submit.is-busy::before { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: wtr-spin .7s linear infinite; }
@keyframes wtr-spin { to { transform: rotate(360deg); } }

.wtr-done { display: flex; flex-direction: column; align-items: center; padding: 20px 8px; text-align: center; outline: none; }
.wtr-done__mark { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--wtr-gold), var(--wtr-gold-light)); color: var(--wtr-on-gold); font-size: 32px; line-height: 1; }
.wtr-done__title { margin: 0 0 10px; font-size: clamp(24px, 2.4vw, 30px); font-weight: 800; line-height: 1.2; letter-spacing: -.01em; color: var(--wtr-ink); }
.wtr-done__text { max-width: 42ch; margin: 0 0 22px; font-size: 16px; line-height: 1.6; color: var(--wtr-ink-soft); }

/* ---------- Phones: popups become bottom sheets ---------- */
@media (max-width: 720px) {
  .wtr-dialog,
  .wtr-dialog--form {
    inset: auto 0 0 0;
    width: 100%;
    margin: 0;
    opacity: 1;
    transform: translateY(100%);
    transition: transform .42s cubic-bezier(.2, .9, .25, 1), overlay .42s allow-discrete, display .42s allow-discrete;
  }
  .wtr-dialog[open] { transform: none; }
  @starting-style {
    .wtr-dialog[open] { transform: translateY(100%); }
  }
  .wtr-sheet { max-height: 92vh; max-height: 92dvh; border-radius: 26px 26px 0 0; }
  .wtr-sheet__body { padding: 26px 22px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .wtr-close { top: 12px; right: 12px; }
  .wtr-full { grid-template-columns: minmax(0, 1fr); }
  .wtr-full__stars { padding-right: 44px; }
  .wtr-full__from { margin-top: 22px; padding: 20px 0 0; border-top: 1px solid var(--wtr-line); border-left: 0; }
  .wtr-full__reply { margin-top: 22px; padding: 16px 18px; }
  .wtr-grid { grid-template-columns: minmax(0, 1fr); }
  .wtr-write { margin-top: 36px; padding: 28px 22px; border-radius: 22px; }
  .wtr-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 560px) {
  .wtr-home .testimonials,
  .wtr-page .testimonials { padding: 40px 18px; border-radius: 24px; }
  .wtr-summary__write { flex: 1 1 100%; justify-content: center; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wtr-dialog,
  .wtr-dialog::backdrop,
  .wtr-card--popup,
  .wtr-close { transition: none; }
  .wtr-card--popup:hover { transform: none; }
  .wtr-rate__star:has(input:checked) > span[aria-hidden] { animation: none; }
  .wtr-submit.is-busy::before { animation-duration: 1.6s; }
}
