/* =========================================================
   Traveller Stories page
   Builds on .escape-paradise-section / .escape-title /
   .escape-subtitle from island-escape.css for the page header.
   ========================================================= */

.stories-section {
  padding-bottom: clamp(40px, 6vh, 60px);
}

/* Even rows of up to 3 cards; an incomplete last row is centred. */
.stories-grid {
  --stories-gap: clamp(20px, 3vw, 32px);
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: var(--stories-gap);
}

.story-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 1 calc((100% - 2 * var(--stories-gap)) / 3);
  min-width: 300px;
  margin: 0;
  padding: clamp(28px, 3vw, 36px) clamp(22px, 2.5vw, 30px) clamp(22px, 2.5vw, 28px);
  background: #fff;
  border-radius: 10px;
  border-top: 3px solid #89ECDA;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.story-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.14);
}

.story-quote-mark {
  display: block;
  font-family: 'Kaisei Opti', serif;
  font-size: 64px;
  line-height: 0.6;
  height: 28px;
  color: #89ECDA;
  margin-bottom: 14px;
  user-select: none;
}

.story-text {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(14px, 1.1vw, 15px);
  font-weight: 300;
  line-height: 1.8;
  color: #444;
}

.story-text p + p {
  margin-top: 12px;
}

/* Long reviews are trimmed to 8 lines until "Read more" is pressed.
   The class is added by JS, so without JS the full text shows. */
.story-text.is-collapsed {
  max-height: calc(1.8em * 8);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 65%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 65%, transparent 100%);
}

.story-toggle {
  align-self: flex-start;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: #00796B;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.story-toggle i {
  margin-left: 6px;
  font-size: 11px;
  transition: transform 0.3s ease;
}

.story-toggle:hover i,
.story-toggle:focus-visible i {
  transform: translateX(3px);
}

.story-toggle:hover,
.story-toggle:focus-visible {
  text-decoration: underline;
}

.story-toggle:focus-visible {
  outline: 2px solid #89ECDA;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Space between the review and the author row; the author row is
   pushed to the bottom so cards in the same row line up. */
.story-text,
.story-toggle {
  margin-bottom: 24px;
}

.story-author {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.story-avatar {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a1a 0%, #000 100%);
  color: #89ECDA;
  font-family: 'Kaisei Opti', serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.story-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.story-name {
  font-family: 'Kaisei Opti', serif;
  font-size: 17px;
  font-weight: 500;
  font-style: normal;
  color: #1E1E1E;
  line-height: 1.3;
}

.story-details {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: #777;
  line-height: 1.5;
}

.story-tag {
  display: inline-block;
  align-self: flex-start;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(137, 236, 218, 0.18);
  color: #00796B;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* Closing call to action — reuses the home page's heading,
   line-dot-line divider and .unforgettable-btn from styles.css */
.stories-cta {
  width: 100%;
  margin: 0;
  padding: clamp(20px, 4vh, 40px) 20px clamp(60px, 10vh, 100px);
  text-align: center;
  background: #fff;
}

.stories-cta-lines {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.stories-cta-desc {
  font-family: "Poppins", sans-serif;
  font-size: clamp(14px, 1.2vw, 16px);
  font-weight: 300;
  line-height: 1.7;
  color: #0a0a0a;
  max-width: 640px;
  margin: 0 auto var(--spacing-xl);
}

.stories-cta .unforgettable-btn {
  text-decoration: none;
}

.stories-cta .unforgettable-btn:focus-visible {
  outline: 2px solid var(--primary-teal);
  outline-offset: 3px;
}

@media (max-width: 1023px) {
  .story-card {
    flex-basis: calc((100% - var(--stories-gap)) / 2);
  }
}

@media (max-width: 700px) {
  .story-card {
    flex-basis: 100%;
    min-width: 0;
  }
}

/* =========================================================
   Full review popup
   ========================================================= */
html.story-modal-open {
  overflow: hidden;
}

.story-modal {
  width: min(560px, calc(100% - 32px));
  max-width: none;
  max-height: min(78vh, 620px);
  margin: auto;
  padding: 0;
  border: 0;
  border-top: 3px solid #89ECDA;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.story-modal[open] {
  display: flex;
  flex-direction: column;
  animation: story-modal-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.story-modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.story-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 22px 18px 28px;
  border-bottom: 1px solid #eee;
}

.story-modal-header .story-meta {
  flex: 1;
}

.story-modal-close {
  align-self: flex-start;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e3e3e3;
  border-radius: 50%;
  background: #fff;
  color: #141414;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.story-modal-close:hover,
.story-modal-close:focus-visible {
  background: #141414;
  border-color: #141414;
  color: #89ECDA;
}

.story-modal-close:focus-visible {
  outline: 2px solid #89ECDA;
  outline-offset: 2px;
}

.story-modal-body {
  overflow-y: auto;
  padding: 24px 28px 28px;
  overscroll-behavior: contain;
  outline: none;
}

.story-modal-body .story-text {
  margin-bottom: 0;
}

@keyframes story-modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 600px) {
  .story-modal-header {
    padding: 18px 16px 14px 20px;
  }

  .story-modal-body {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-card {
    transition: none;
  }

  .story-modal[open] {
    animation: none;
  }

  .story-card:hover {
    transform: none;
  }
}
