/**
 * Activity (uag_bokun) full page, after the "Elding webpage" Figma design.
 *
 * Hand-written CSS (not compiled from sass/): loaded only on Activity pages
 * through the elding_theme/activity_page library.
 */

.activity-page {
  --ap-red: #e20427;
  --ap-blue: #07224b;
  --ap-text: #3a3a39;
  --ap-grey: #f6f6f6;
  --ap-pale-blue: #e1effb;
  --ap-gap: 48px;
  color: var(--ap-text);
}

/* ---------------------------------------------------------------- Layout */

/*
 * styles.css sets `overflow-x: hidden` on html and body, which turns them
 * into scroll containers and breaks `position: sticky`. `clip` still stops
 * sideways scrolling without that side effect. Only loaded on Activity pages.
 */
@supports (overflow-x: clip) {
  /* :root beats the plain html/body selectors in the later styles.css. */
  :root,
  :root body {
    overflow-x: clip;
  }
}

.activity-page__inner {
  max-width: 1200px;
  margin: 72px auto 80px;
  padding: 0 20px;
}

.activity-page__main > * + * {
  margin-top: 40px;
}

@media (min-width: 1024px) {
  /*
   * The main column's children and the booking box share one grid. The
   * booking box spans every row; the last row is flexible, so a tall widget
   * stretches only that row instead of opening gaps between the sections.
   */
  .activity-page__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    grid-template-rows: repeat(8, auto) 1fr;
    column-gap: var(--ap-gap);
  }

  .activity-page__main {
    display: contents;
  }

  .activity-page__main > * {
    grid-column: 1;
  }

  .activity-page__main > * + * {
    margin-top: 0;
  }

  /* Space between sections; the booking box (last in the markup) is not one. */
  .activity-page__main > :not(.activity-booking):has(~ :not(.activity-booking)) {
    margin-bottom: 48px;
  }

  .activity-page .activity-booking {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: start;
  }

  /* Set by activity-page.js, which also sets `top` from the box height. */
  .activity-page .activity-booking.is-sticky {
    position: sticky;
    top: 24px;
  }
}

/* --------------------------------------------------------------- Gallery */

.activity-gallery__stage {
  margin: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--ap-pale-blue);
}

.activity-gallery__stage.splide {
  /* Splide hides itself until mounted; show the first photo without JS. */
  visibility: visible;
}

.activity-gallery__stage .splide__track,
.activity-gallery__stage .splide__list,
.activity-gallery__stage .splide__slide {
  height: 100%;
}

.activity-gallery__stage .splide__slide {
  flex: 0 0 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.activity-gallery__stage .splide__slide::before {
  content: none;
}

.activity-gallery__stage .splide__arrow {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.9);
  opacity: 1;
  box-shadow: 0 2px 10px rgba(7, 34, 75, 0.25);
}

.activity-gallery__stage .splide__arrow svg {
  width: 18px;
  height: 18px;
  fill: var(--ap-blue);
}

.activity-gallery__stage .splide__arrow:hover:not(:disabled),
.activity-gallery__stage .splide__arrow:focus-visible {
  background: #fff;
}

.activity-gallery__stage .splide__arrow:hover:not(:disabled) svg {
  fill: var(--ap-red);
}

.activity-gallery__stage .splide__arrow:focus-visible {
  outline: 2px solid var(--ap-blue);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .activity-gallery__stage .splide__arrow {
    width: 38px;
    height: 38px;
  }
}

.activity-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.activity-gallery__thumbs {
  display: flex;
  gap: 10px;
  margin: -40px 0 0;
  padding: 0 40px 6px;
  list-style: none;
  overflow-x: auto;
  position: relative;
  scrollbar-width: thin;
}

.activity-gallery__thumbs li {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

.activity-gallery__thumbs li::before {
  content: none;
}

.activity-gallery__thumb {
  display: block;
  width: 110px;
  height: 82px;
  padding: 0;
  border: 3px solid #fff;
  background: #fff;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s, border-color 0.15s;
}

.activity-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.activity-gallery__thumb:hover,
.activity-gallery__thumb:focus-visible,
.activity-gallery__thumb.is-active {
  opacity: 1;
}

.activity-gallery__thumb.is-active {
  border-color: var(--ap-red);
}

.activity-gallery__thumb:focus-visible {
  outline: 2px solid var(--ap-blue);
  outline-offset: 2px;
}

/* ----------------------------------------------------------------- Intro */

.activity-intro__text,
.activity-intro__text p {
  font-size: 20px;
  line-height: 1.6;
}

.activity-intro__text p:last-child {
  margin-bottom: 0;
}

/*
 * Info line: season, duration, location, language, pickup, price. Two rows
 * of three on wide screens, two columns on phones.
 */
.activity-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 28px;
  margin: 28px 0 0;
  padding: 24px 0;
  border-top: 1px solid #d5dbe3;
  border-bottom: 1px solid #d5dbe3;
  list-style: none;
}

.activity-facts__item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.activity-facts__item::before {
  content: none;
}

/* Icons from the Puffin Tours theme, in Elding navy. */
.activity-facts__icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.activity-facts__label,
.activity-facts__value {
  display: block;
}

.activity-facts__label {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--ap-blue);
}

.activity-facts__value {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.activity-facts__item--price .activity-facts__value {
  color: var(--ap-red);
  font-weight: 700;
}

@media (max-width: 600px) {
  .activity-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 16px;
  }
}

/* Tripadvisor rating, between the gallery and the intro text. */
.activity-rating {
  display: inline-flex;
  color: inherit;
  text-decoration: none;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  font-size: 16px;
}

a.activity-rating:hover .activity-rating__count,
a.activity-rating:focus-visible .activity-rating__count {
  text-decoration: underline;
}

.activity-rating__dots {
  display: inline-flex;
  gap: 4px;
}

.activity-rating__dot {
  width: 12px;
  height: 12px;
  border: 2px solid #00aa6c;
  border-radius: 50%;
}

.activity-rating__dot--full {
  background: #00aa6c;
}

.activity-rating__dot--half {
  background: linear-gradient(90deg, #00aa6c 50%, transparent 50%);
}

/* ------------------------------------------------------- Text sections */

.activity-page h2.activity-section__title,
.activity-page h2.activity-list__title,
.activity-page h2.activity-related__title {
  margin: 0 0 20px;
  font-family: 'Aquawax', sans-serif;
  font-weight: 600;
  color: var(--ap-blue);
  line-height: 1.1;
}

.activity-page h2.activity-section__title,
.activity-page h2.activity-related__title {
  font-size: clamp(32px, 4vw, 52px);
}

.activity-text,
.activity-text p,
.activity-text li {
  font-size: 18px;
  line-height: 1.65;
}

.activity-text a {
  color: var(--ap-text);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--ap-red);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.activity-text a:hover,
.activity-text a:focus {
  color: var(--ap-red);
}

.activity-note {
  padding: 32px;
  border-radius: 12px;
  background: var(--ap-pale-blue);
}

.activity-description .activity-text p:last-child,
.activity-note .activity-text p:last-child {
  margin-bottom: 0;
}

/* ----------------------------------------------------------------- Video */

.activity-video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.activity-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ------------------------- Included / Exclusions, then What to bring */

.activity-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px;
  padding: 36px 28px;
  border-radius: 12px;
  background: var(--ap-grey);
}

@media (max-width: 600px) {
  .activity-lists {
    grid-template-columns: 1fr;
    padding: 28px 20px;
  }
}

.activity-bring,
.activity-itinerary {
  padding: 36px 28px;
  border: 2px solid var(--ap-grey);
  border-radius: 12px;
}

.activity-bring ul {
  columns: 2 220px;
  column-gap: 28px;
}

.activity-bring li {
  break-inside: avoid;
}

@media (max-width: 600px) {
  .activity-bring,
  .activity-itinerary {
    padding: 28px 20px;
  }
}

/* Itinerary: closed until clicked, numbered stops joined by a line. */
.activity-itinerary__toggle {
  position: relative;
  display: block;
  padding-right: 44px;
  cursor: pointer;
  list-style: none;
}

.activity-itinerary__toggle::-webkit-details-marker {
  display: none;
}

.activity-page .activity-itinerary__toggle h2.activity-list__title {
  margin: 0;
}

/* Chevron, pointing down when closed and up when open. */
.activity-itinerary__toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 6px;
  width: 12px;
  height: 12px;
  border-right: 3px solid var(--ap-red);
  border-bottom: 3px solid var(--ap-red);
  transform: translateY(-75%) rotate(45deg);
  transition: transform 0.2s ease;
}

.activity-itinerary[open] .activity-itinerary__toggle::after {
  transform: translateY(-25%) rotate(-135deg);
}

.activity-itinerary__toggle:focus-visible {
  outline: 2px solid var(--ap-blue);
  outline-offset: 6px;
  border-radius: 4px;
}

.activity-itinerary[open] .activity-itinerary__toggle {
  margin-bottom: 24px;
}

.activity-itinerary__stops {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: stop;
}

.activity-itinerary__stop {
  position: relative;
  padding: 0 0 24px 52px;
  counter-increment: stop;
}

.activity-itinerary__stop:last-child {
  padding-bottom: 0;
}

.activity-itinerary__stop::before {
  content: counter(stop);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ap-red);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

.activity-itinerary__stop:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 40px;
  bottom: 6px;
  left: 16px;
  width: 2px;
  background: var(--ap-grey);
}

.activity-itinerary__stop h3 {
  margin: 4px 0 8px;
  font-size: 20px;
  line-height: 1.25;
  color: var(--ap-blue);
}

.activity-itinerary__stop p {
  margin: 0 0 0.6em;
  font-size: 17px;
  line-height: 1.5;
}

.activity-itinerary__stop p:last-child {
  margin-bottom: 0;
}

.activity-page h2.activity-list__title {
  font-size: clamp(26px, 2.6vw, 34px);
}

.activity-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  position: relative;
  margin: 0 0 10px;
  padding: 0 0 0 30px;
  font-size: 17px;
  line-height: 1.45;
}

.activity-list li::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  width: 18px;
  height: 18px;
  background: no-repeat center / contain;
}

.activity-list--check li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M2 11.5l5 5L18 3' fill='none' stroke='%23e20427' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.activity-list--cross li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 4l12 12M16 4L4 16' fill='none' stroke='%23e20427' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------- Booking */

.activity-booking__card {
  min-height: 420px;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 28px rgba(7, 34, 75, 0.14);
}

@media (max-width: 1023px) {
  .activity-booking {
    scroll-margin-top: 16px;
  }

  .activity-booking__card {
    padding: 8px;
  }
}

/* Today's departures from the Elding schedule, above the calendar. */
.activity-schedule {
  margin: 0 0 16px;
  padding: 16px 16px 12px;
  border-radius: 12px;
  background: var(--ap-pale-blue);
}

.activity-page h3.activity-schedule__title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ap-blue);
}

.activity-schedule__date {
  font-weight: 400;
  font-size: 15px;
}

/*
 * Four departures per row, each a quarter of the box; more (Viðey) wrap
 * onto the next row at the same width, from the left.
 */
.activity-schedule__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-schedule__item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 6px 7px;
  border-left: 4px solid #8a94a3;
  border-radius: 6px;
  background: #fff;
}

.activity-schedule__item::before {
  content: none;
}

.activity-schedule__time {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ap-blue);
  overflow-wrap: break-word;
}

.activity-schedule__status {
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: break-word;
}

/* Text instead of a clock time (e.g. Viðey's "All departures"). */
.activity-schedule__item--wide {
  grid-column: span 2;
}

.activity-schedule__item--wide .activity-schedule__time {
  font-size: 15px;
}

.activity-schedule__item--confirmed {
  border-left-color: #1e8a4c;
}

.activity-schedule__item--pending {
  border-left-color: #e8a317;
}

.activity-schedule__item--cancelled {
  border-left-color: var(--ap-red);
}

.activity-schedule__item--cancelled .activity-schedule__time {
  text-decoration: line-through;
}

/* --------------------------------------------------- You might also like */

.activity-related {
  position: relative;
  padding: 64px 20px 88px;
  background: var(--ap-grey);
}

.activity-related::before {
  content: "";
  position: absolute;
  top: -28px;
  left: 0;
  width: 100%;
  height: 41px;
  background: var(--ap-grey);
  -webkit-mask: url(../../images/svg/wave-bg.svg) repeat-x;
  mask: url(../../images/svg/wave-bg.svg) repeat-x;
}

.activity-related__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.activity-page h2.activity-related__title {
  margin-bottom: 40px;
  text-align: center;
}

.activity-related__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
}

/* Tour cards (node--ferd--c-card.html.twig) on the grey band. */
.activity-related .c-card {
  position: relative;
  margin: 0;
}

/* ------------------------------------------------- Mobile "Book now" bar */

.activity-book-bar {
  display: none;
}

@media (max-width: 1023px) {
  .activity-book-bar {
    display: block;
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 50;
    padding: 16px;
    border-radius: 12px;
    background: var(--ap-red);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
  }

  .activity-page a.activity-book-bar:link,
  .activity-page a.activity-book-bar:visited,
  .activity-page a.activity-book-bar:hover,
  .activity-page a.activity-book-bar:focus {
    color: #fff;
  }

  .activity-book-bar.is-hidden {
    transform: translateY(150%);
    opacity: 0;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .activity-book-bar {
    transition: none;
  }
}
