/* Per-page shapes from the client's survey. Each page that has its own shapes renders
   an empty #page-shapes marker (see src/lib/page-shapes.ts). Values match what the survey showed. */

/* Menu bar: the lower edge takes the wave. */
body:has(#page-shapes[data-top]) .nav-bar {
  position: relative;
  background: #fffdfa;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
body:has(#page-shapes[data-top='wave']) .nav-bar::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  top: calc(100% - 3px);
  height: clamp(18px, 2.4vw, 36px);
  background: #fffdfa;
  pointer-events: none;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath transform='matrix(1 0 0 -1 0 100)' fill-rule='evenodd' d='M0 0H100V100H0Z M0 0H100V45C82 112 64 100 50 55S18 -8 0 55Z'/%3E%3C/svg%3E")
    0 0 / 100% 100% no-repeat;
}

/* Bottom of the main photo. */
body:has(#page-shapes[data-hero='wave']) main .hero {
  --depth: clamp(34px, 7.5vw, 125px);
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V45C82 112 64 100 50 55S18 -8 0 55Z'/%3E%3C/svg%3E");
  border-radius: 0;
  mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--depth) + 1px) no-repeat,
    var(--wave) bottom / 100% var(--depth) no-repeat;
}

/* Blocks with their own background. */
body:has(#page-shapes[data-sections='soft'])
  main
  :is(.newsletter-section, .contact-form-section, .home-award-proof) {
  border-radius: clamp(20px, 3vw, 44px);
  overflow: hidden;
}
body:has(#page-shapes[data-sections='wave']) main :is(.article-header, section.section.patterned) {
  --depth: clamp(22px, 4.6vw, 76px);
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V45C82 112 64 100 50 55S18 -8 0 55Z'/%3E%3C/svg%3E");
  --wave-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath transform='matrix(1 0 0 -1 0 100)' d='M0 0H100V45C82 112 64 100 50 55S18 -8 0 55Z'/%3E%3C/svg%3E");
  border-block: var(--depth) solid transparent;
  background-origin: border-box;
  mask:
    var(--wave-top) top / 100% var(--depth) no-repeat,
    var(--wave) bottom / 100% var(--depth) no-repeat,
    linear-gradient(#000 0 0) center / 100% calc(100% - 2 * var(--depth) + 2px) no-repeat;
  mask-origin: border-box;
  mask-clip: border-box;
}

/* Safari, experience, journal, destination and team cards. */
body:has(#page-shapes[data-cards])
  :is(.tour-card, .adventure-card, .journal-card, .destination-card, .team-card) {
  border-radius: 3px !important;
}
body:has(#page-shapes[data-cards])
  :is(.tour-card, .adventure-card, .journal-card, .destination-card, .team-card)
  img {
  border-radius: 0 !important;
}
body:has(#page-shapes[data-cards='soft'])
  :is(.tour-card, .adventure-card, .journal-card, .destination-card, .team-card) {
  border-radius: 26px !important;
  overflow: hidden;
}
body:has(#page-shapes[data-cards='soft'])
  :is(.tour-card, .adventure-card, .journal-card, .destination-card, .team-card)
  img {
  border-radius: 20px !important;
}
body:has(#page-shapes[data-cards='leaf'])
  :is(.tour-card, .adventure-card, .journal-card, .destination-card, .team-card) {
  border-radius: 64px 6px !important;
  overflow: hidden;
}
body:has(#page-shapes[data-cards='leaf'])
  :is(.tour-card, .adventure-card, .journal-card, .destination-card, .team-card)
  img {
  border-radius: 60px 0 !important;
}
/* Team portraits sit contained in a pale box: fill the frame so the shape has something to cut. */
body:has(#page-shapes[data-cards]) .team-card > img {
  width: 100% !important;
  height: 300px !important;
  max-width: none;
  object-fit: cover !important;
  object-position: 50% 16% !important;
  padding: 0 !important;
  margin: 0 !important;
}
body:has(#page-shapes[data-cards='pebble'])
  :is(.tour-card, .adventure-card, .journal-card, .destination-card, .team-card)
  img {
  aspect-ratio: 1 !important;
  height: auto !important;
  width: calc(100% - 18px) !important;
  margin: 9px auto 0 !important;
  object-fit: cover;
  border-radius: 42% 58% 54% 46% / 48% 42% 58% 52% !important;
}

/* Buttons. */
body:has(#page-shapes[data-buttons='square']) .button {
  border-radius: 2px !important;
}
body:has(#page-shapes[data-buttons='leaf']) .button {
  border-radius: 26px 4px !important;
}

/* Guest quotes. */
body:has(#page-shapes[data-quotes='soft']) :is(.review-carousel-track figure, .review-card) {
  border-radius: 22px !important;
}
