/* ==========================================================
   TripVrip - inner page styles
   Extends styles.css. Uses the same tokens, no overrides.
   ========================================================== */

/* ---------- Inner page hero ---------- */
.page-hero {
  position: relative;
  display: grid;
  min-height: 62vh;
  place-items: end start;
  overflow: hidden;
  isolation: isolate;
  background: var(--deep);
}

.page-hero-img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(90deg, rgba(9, 38, 53, .82), rgba(9, 38, 53, .3) 56%, rgba(9, 38, 53, .58)),
    linear-gradient(180deg, transparent 42%, rgba(9, 38, 53, .78));
}

.page-hero::after {
  position: absolute;
  inset: auto -8% -24% -8%;
  height: 34%;
  content: "";
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 210, 63, .9), rgba(255, 107, 74, .82), rgba(0, 169, 184, .88));
  clip-path: polygon(0 48%, 20% 26%, 40% 46%, 60% 18%, 78% 38%, 100% 16%, 100% 100%, 0 100%);
  opacity: .82;
}

.page-hero-copy {
  width: min(760px, calc(100% - 56px));
  padding: 0 0 104px max(28px, 10vw);
  color: #fff;
  text-shadow: 0 16px 38px rgba(0, 0, 0, .44);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
}

.crumbs a {
  color: #fff;
  text-decoration: none;
  opacity: .82;
}

.crumbs a:hover {
  opacity: 1;
  text-decoration: underline;
}

.crumbs span[aria-hidden] {
  opacity: .5;
}

.crumbs [aria-current] {
  opacity: .95;
}

.page-kicker {
  display: inline-grid;
  min-height: 34px;
  margin: 0 0 14px;
  padding: 0 16px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(12px);
}

.page-hero h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 92px);
  font-weight: 800;
  line-height: .94;
}

.page-lede {
  max-width: 54ch;
  margin: 0;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 500;
  line-height: 1.5;
}

/* ---------- Shared section bits ---------- */
.section-lede {
  max-width: 68ch;
  margin: -12px 0 24px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.prose-section {
  margin: 0 max(24px, 6%) 0;
  padding-top: 50px;
}

.prose-section h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 700;
  line-height: 1.06;
}

.prose-body p {
  max-width: 72ch;
  margin: 0 0 16px;
  color: #33454f;
  font-size: 17px;
  line-height: 1.7;
}

.prose-body p:last-child {
  margin-bottom: 0;
}

.ghost-cta {
  display: inline-grid;
  min-height: 46px;
  padding: 0 22px;
  place-items: center;
  border: 2px solid var(--logo-blue);
  border-radius: 999px;
  background: transparent;
  color: var(--logo-blue);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.ghost-cta:hover {
  background: var(--logo-blue);
  color: #fff;
}

/* ---------- Fact grid ---------- */
.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fact-grid li {
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1px solid rgba(13, 85, 184, .16);
  border-radius: 20px;
  background: linear-gradient(160deg, #fff, var(--wash));
  box-shadow: 0 14px 34px rgba(9, 38, 53, .08);
}

.fact-grid strong {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.15;
}

.fact-grid span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* ---------- FAQ ---------- */
.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  padding: 18px 22px;
  border: 1px solid rgba(13, 85, 184, .16);
  border-radius: 18px;
  background: rgba(255, 255, 255, .84);
}

.faq-item summary {
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  float: right;
  content: "+";
  color: var(--logo-blue);
  font-size: 22px;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item p {
  margin: 12px 0 0;
  max-width: 72ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

/* ---------- Video grid ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

.video-card h3 {
  margin: 14px 0 6px;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.12;
}

.video-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.video-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 210px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  background: var(--deep);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.video-thumb:hover img {
  transform: scale(1.06);
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 30px rgba(9, 38, 53, .35);
  transform: translate(-50%, -50%);
}

.video-play::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid var(--deep);
}

.video-time {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(9, 38, 53, .78);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.video-note {
  min-height: 22px;
  margin: 18px 0 0;
  color: var(--logo-blue-dark);
  font-size: 14px;
  font-weight: 700;
}

/* ---------- Deal cards ---------- */
.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}

.deal-card {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(13, 85, 184, .14);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.deal-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.deal-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
}

.deal-tag {
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--logo-blue-soft);
  color: var(--logo-blue-dark);
  font-size: 11px;
  font-weight: 800;
}

.deal-body h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.12;
}

.deal-body > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.deal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.deal-meta li {
  padding: 5px 11px;
  border-radius: 999px;
  background: #e9f5f3;
  color: #545b61;
  font-size: 11px;
  font-weight: 800;
}

.deal-price {
  margin: 4px 0 0;
  display: grid;
  gap: 2px;
}

.deal-price strong {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--leaf);
}

.deal-price span {
  color: var(--muted);
  font-size: 13px;
}

.deal-body .yellow-cta {
  margin-top: auto;
  align-self: flex-start;
}

/* ---------- Trip planner quiz ---------- */
.quiz {
  padding: 28px;
  border: 1px solid rgba(13, 85, 184, .18);
  border-radius: 26px;
  background: linear-gradient(165deg, #fff, var(--wash));
  box-shadow: var(--shadow);
}

.quiz-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(13, 85, 184, .12);
}

.quiz-bar-fill {
  display: block;
  width: 16.6%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--logo-blue), var(--aqua));
  transition: width .3s ease;
}

.quiz-step {
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quiz-card {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.quiz-card.is-active {
  display: block;
}

.quiz-card legend {
  padding: 0;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.12;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.quiz-options button {
  padding: 18px 20px;
  border: 2px solid rgba(13, 85, 184, .18);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.quiz-options button:hover {
  border-color: var(--logo-blue);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(13, 85, 184, .18);
}

.quiz-nav {
  margin-top: 20px;
}

.quiz-nav .ghost-cta[hidden] {
  display: none;
}

.quiz-result h3 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 38px);
}

.quiz-matches {
  display: grid;
  gap: 14px;
}

.quiz-match {
  display: grid;
  gap: 6px;
  padding: 20px;
  border-left: 5px solid var(--gold);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(9, 38, 53, .1);
}

.quiz-match strong {
  font-family: var(--font-display);
  font-size: 21px;
}

.quiz-match span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .page-hero {
    min-height: 54vh;
  }

  .page-hero-copy {
    padding-bottom: 88px;
  }

  .prose-section {
    margin: 0 20px;
  }
}

@media (max-width: 620px) {
  .page-hero {
    min-height: 48vh;
  }

  .page-hero-copy {
    width: calc(100% - 36px);
    padding: 0 0 72px 18px;
  }

  .quiz {
    padding: 20px;
  }

  .video-thumb {
    height: 180px;
  }

  .deal-card img {
    height: 165px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .video-thumb img,
  .quiz-options button,
  .quiz-bar-fill {
    transition: none;
  }
}

/* ---------- Check list (guide pages) ---------- */
.check-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding: 16px 20px 16px 52px;
  border: 1px solid rgba(13, 85, 184, .14);
  border-radius: 16px;
  background: rgba(255, 255, 255, .86);
  color: #33454f;
  font-size: 16px;
  line-height: 1.55;
}

.check-list li::before {
  position: absolute;
  top: 16px;
  left: 18px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  content: "\2713";
  border-radius: 50%;
  background: linear-gradient(135deg, var(--logo-blue), var(--aqua));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

/* ---------- Header tool links ---------- */
.tool-link {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

/* ---------- Rail cards used as links ---------- */
a.story-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

a.story-card h3 {
  color: #fff;
}

/* ---------- Fix: back-to-top button position
   The site's own CSS positions this at right:22%, which lands mid-page
   on wide viewports instead of near the corner. Pin it to a fixed
   distance from the edge instead, at every viewport width. ---------- */
button.float-top,
.float-top {
  right: 28px !important;
  left: auto !important;
  bottom: 32px !important;
}

@media (max-width: 900px) {

  button.float-top,
  .float-top {
    right: 18px !important;
    bottom: 18px !important;
  }
}

/* ---------- Fix: header tool icons (Travel help / Saved trips / Search)
   These are now <a> links so they can point at real pages, but the
   site's own CSS only sizes .header-tools button. Mirror those exact
   rules onto the anchor so the header renders identically. ---------- */
.header-tools a.tool-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 2px;
  border-radius: 50%;
  text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}

.header-tools a.tool-link:hover {
  background: rgba(13, 85, 184, .12);
  transform: translateY(-2px);
}

.header-tools a.tool-link svg {
  width: 100%;
  height: 100%;
  fill: var(--logo-blue-dark);
}

@media (max-width: 900px) {
  .header-tools a.tool-link {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, .3);
  }

  .header-tools a.tool-link:not([aria-label="Search"]) {
    display: none;
  }
}

/* ---------- Image fallback ----------
   If any photo fails to load (dead link, offline, blocked host), show a
   themed placeholder instead of a broken-image icon. Paired with the
   onerror handler in pages.js. ---------- */
img.img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 16px;
  background: linear-gradient(135deg, var(--logo-blue-soft, #e7f0fb), var(--wash));
  color: var(--logo-blue-dark);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  object-fit: contain !important;
}
