/* TODO: COUNTERS BROKEN */

:root {
  color-scheme: light dark;

  --link: light-dark(#9b3f32, #edb6a3);
  --link-visited: light-dark(#7a405a, #d7a68f);
  --link-hover: light-dark(#783a31, #f2c5b4);
  --link-active: light-dark(#87402f, #ffd0ba);
  --link-focus: var(--link);
 
  --body-padding: 2rem;
  --card-width: 20rem;
  --corner: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 170 163'%3E%3Cpath d='m108.36,21.66c-2.36-3.81-3.57-10.12-2.94-14.02.71-4.46,4.36-7.35,7.62-7.62,4.97-.41,6.99,3.26,4.15,5.54-2.29,1.84-3.74,3.59-4.95,5.67-1.21,2.08-1.8,5.64-1.1,8.7.84,3.7-.85,4.82-2.77,1.73Z'/%3E%3Cpath d='m105.98,37.5c-3.81-2.36-10.12-3.57-14.02-2.94-4.46.71-7.35,4.36-7.62,7.62-.41,4.97,3.26,6.99,5.54,4.15,1.84-2.29,3.59-3.74,5.67-4.96,2.08-1.21,5.64-1.8,8.7-1.1,3.7.84,4.82-.85,1.73-2.77Z'/%3E%3Cpath d='m154.05,72.04c2.59,2.04,7.12,3.44,10.02,3.3,3.32-.16,5.73-2.59,6.2-4.95.71-3.61-1.82-5.38-3.72-3.49-1.53,1.53-2.93,2.45-4.55,3.16-1.62.72-4.28.86-6.46.1-2.64-.92-3.6.23-1.49,1.89Z'/%3E%3Cpath d='m138.18,64.06c-.18,3.29-2.11,7.62-4.13,9.71-2.31,2.39-5.73,2.6-7.81,1.39-3.18-1.85-2.85-4.92-.18-5.1,2.16-.14,3.77-.59,5.38-1.34,1.61-.74,3.46-2.65,4.33-4.79,1.05-2.59,2.55-2.56,2.4.12Z'/%3E%3Cpath d='m60.73,1.86c-2.06.91-5.34,4.25-6.39,6.72-.71,1.66-1.24,1.58-2.57-.24-1.94-2.65-5.19-4.15-9.34-5.02-4.16-.87-36.26-.99-40.58-1.1C-.66,2.15-.6.2,1.93.2h58.66c1.28,0,1.43,1.08.15,1.65Z'/%3E%3Cpath d='m163.48,102.52c-.91,2.06-4.25,5.34-6.72,6.39-1.66.71-1.58,1.25.24,2.58,2.65,1.94,4.15,5.19,5.02,9.35.86,4.15.99,36.26,1.1,40.58.07,2.5,2.01,2.43,2.01-.08v-58.66c0-1.28-1.08-1.43-1.65-.15Z'/%3E%3Cpath d='m55.75,12.24C60.71,1.19,76.68-1.11,86.92,2.58c11.93,4.3,17.28,17.58,23.59,27.49,6.61,10.38,19.58,18.94,32.29,14.67,6.05-2.03,11.17-6.83,13.73-12.65,2.44-5.53,1.65-12.17-.73-17.57-4.64-10.51-20-16.57-27.8-5.92-6.06,8.27-.73,21.1,9.43,22.69,5.17.81,8.65-3.83,8.61-8.6-.02-2.43-1.53-4.52-3.27-6.07-.36-.32-.84-.68-1.37-1.03-.34,1.38-1.77,2.63-3.7,3.05-2.45.53-4.75-.48-5.14-2.27-.36-1.64,1.04-3.35,3.17-4.03.23-.08.44-.14.57-.17,4.84-1.07,9.74.51,12.88,4.43,3.2,4,2.04,10.1-1.75,13.31-8.65,7.34-21.59,3.47-26.07-6.46-2.19-4.86-.82-10.49,2.04-14.73,3.07-4.55,8.43-6.95,13.67-7.89,11.21-1.99,21.64,4.83,24.94,15.54,3.73,12.12-3.26,23.18-14.04,28.55-11.11,5.53-24.75,3.64-34.35-4.04-9.53-7.62-13.27-20.29-21.15-29.35-4.55-5.23-11.02-8.36-17.99-8.23-6.59.12-12.18,3.71-14.45,9.92-1.7,4.68-1.28,10.04,1.19,14.34,2.89,5.02,9.71,7.79,15.25,5.99,5.66-1.84,6.75-8.66,5.11-13.63-.88-2.68-2.94-5.01-5.52-6.14-2.17-.96-4.29-.41-5.25,1.27.83.8,1.37,2.05,1.37,3.47,0,2.41-1.55,4.37-3.46,4.37s-3.46-1.96-3.46-4.37c.01-5.48,5.73-7.2,10.31-7.56,5.41-.42,9.63,3.42,11.25,8.34,4.1,12.43-10.31,18.72-20.35,16.75-11.02-2.16-15.01-14.27-10.73-23.81Z'/%3E%3Cpath d='m127.19,93.08c.32-6.13,3.73-11.17,9.72-12.85,7.19-2.01,16.09,2.37,15.43,10.66-.29,3.69-2.91,6.31-6.36,7.2-3.13.81-7.67.68-9.82-2.11-1.27-1.62-1.31-3.7-.11-4.64,1.21-.94,3.21-.39,4.47,1.23.74.94,1.05,2.04.95,2.97,2.67,2.8,5.29-1.93,5.68-4.37.55-3.45-1.48-6.62-4.26-8.46-3.21-2.12-6.6.28-8.4,3.04-1.94,2.97-2.36,6.82-2.08,10.28.59,7.2,8.63,12.06,15.4,10.35,6.79-1.72,11.09-8.65,10.66-15.42-.45-7-6.02-12.04-10.59-16.72-4.72-4.83-9.91-9.6-9.13-16.95.62-5.88,5.02-9.28,10.5-10.35,5.2-1.01,11.5.51,13.61,5.89,1.8,4.56-.31,9.22-4.62,11.39-3.8,1.92-9.86.78-11.71-3.29-1.01-2.03-.47-4.35,1.2-5.18,1.67-.83,3.84.15,4.85,2.18.68,1.37.64,2.87.04,3.95.58.71,1.27,1.29,1.87,1.06,1.42-.53,2.39-1.97,3.11-3.22,1.73-3.03.54-6.66-1.65-9.06-2.34-2.57-5.91-2.21-8.52-.33-2.75,1.98-3.65,5.73-3.61,8.92.09,7.19,7.51,12.53,12.03,17.27,4.44,4.65,8.22,9.9,7.81,16.66-.81,13.15-16.98,18.61-27.72,14.01-6-2.56-9.1-7.67-8.76-14.11Z'/%3E%3C/svg%3E");
}

section:nth-of-type(3) ul {
  display: grid;
  gap: 2rem;
  grid-auto-flow: column;
  scroll-snap-type: x mandatory;
  overflow-x: auto;
  anchor-name: --trip-carousel;
  counter-reset: day;

  /*  "break out" of body padding  */
  width: 100dvw;
  margin-left: calc(-1 * var(--body-padding));

  /*  hide scrollbar  */
  scrollbar-width: none;

  /*  smooth scrolling  */
  scroll-behavior: smooth;

  /*  add prev/next buttons  */
  &::scroll-button(left) {
    content: "arrow_back_ios" / "Scroll Left";
    position-area: left;
    padding-left: 0.75rem;
    transform: translateX(calc(2 * var(--body-padding)));
  }

  &::scroll-button(right) {
    content: "arrow_forward_ios" / "Scroll Right";
    position-area: right;
    transform: translateX(calc(-2 * var(--body-padding)));
  }

  &::scroll-button(*) {
    position: absolute;
    position-anchor: --trip-carousel;
    z-index: 1;
    font-size: 1.5rem;
    font-family: "Material Symbols Outlined";
    font-variation-settings: "wght" 100;
    display: grid;
    place-items: center;
    width: 3rem;
    color: white;
    aspect-ratio: 1 / 1;
    border: 2px solid dimgray;
    background: white;
    border-radius: 100%;
    cursor: pointer;
    transition: font-variation-settings 0.25s ease, scale 0.25s ease;
    background: #333;
  }

  &::scroll-button(*):disabled {
    border: 2px solid blackgray;
    color: gray;
  }

  &::scroll-button(*):not(:disabled):hover {
    font-variation-settings: "wght" 400;
    scale: 1.05;
  }

  &::scroll-button(*):focus-visible {
    outline-offset: 5px;
  }

  /*  scroll markers  */
  scroll-marker-group: after;

  &::scroll-marker-group {
    position: fixed;
    position-anchor: --trip-carousel;
    position-area: bottom;
    margin-top: 2rem;
    display: flex;
    gap: 0.25rem;
  }

  /*  This doesn't work but it would be cool if it did  -- idea placeholder */
  /*   &::scroll-marker-group::before {
    content: 'Day: ';
    display: block;
  } */

  li::scroll-marker {
    content: counter(day-num);
    aspect-ratio: 1 / 1;
    width: 1rem;
    background: #444;
    padding: 0.2rem;
    font-size: 0.8rem;
    color: white;
    border-radius: 100%;
    cursor: pointer;
    display: grid;
    place-content: center;
    text-decoration: none;
    transition: transform 0.2s ease;
  }

  li::scroll-marker:target-current {
    anchor-name: --active-target;
    transform: translateY(-0.5rem);
  }

  /*  Move first item over a bit  */
  li:first-child {
    margin-left: 5rem;
  }

  #staff {
    position: absolute;
    right: calc(-100dvw + var(--card-width));
    visibility: hidden;
  }

  li {
    width: var(--card-width);
    position: relative;
    overflow: hidden;
    counter-increment: day-num;
    scroll-snap-align: center;
    container-type: scroll-state;

    img {
      aspect-ratio: 5/7;
      object-fit: cover;
      object-position: bottom;
    }

    &:hover,
    &:focus {
      figcaption {
        transform: translateY(0);
      }
    }

    figure {
      anchor-scope: --photo;
      margin: 0;
    }

    figure > img {
      display: block;
      anchor-name: --photo;
    }

    figure::after {
      content: "";
      position: absolute;
      position-anchor: --photo;
      inset-block-start: calc(anchor(self-start) + 0.5rem);
      inset-inline-end: calc(anchor(self-end) + 0.5rem);
      inline-size: 6rem;
      aspect-ratio: 170 / 163;
      background-color: currentColor;
      mask: var(--corner) center / contain no-repeat;
      pointer-events: none;
    }

    figcaption {
      position: absolute;
      bottom: 0;
      width: calc(100% - 2rem);
      transform: translateY(calc(100% - 3rem));
      background-color: color-mix(in srgb, #000 50%, transparent);
      color: white;
      padding: 1rem;
      transition: transform 0.5s ease;

      @container scroll-state(snapped: x) {
        transform: translateY(0);
      }

      h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        letter-spacing: 2px;
        text-transform: uppercase;
        font-weight: 500;
        font-size: 1rem;
      }

      /*     &::before {
        counter-increment: day;
        content: "Day " counter(day);
        font-size: 0.8rem;
        display: block;
        position: absolute;
        top: 0.5rem;
        left: 0;
        background: #222;
        color: white;
        padding: 0.5rem;
        border-radius: 0 0.75rem 0.75rem 0;
      } */
    }

    p {
      line-height: 1.5;
      font-weight: 300;
    }
  }
}

/* .flight,
.train,
.car {
  &::after {
    content: "";
    position: absolute;
    font-family: "Material Symbols Outlined";
    font-size: 1.25rem;
    font-family: "Material Symbols Outlined";
    font-variation-settings: "wght" 100;
    color: white;
    background: #222;
    border-radius: 100% 0 0 100%;
    top: 0.5rem;
    right: 0;
    padding: 0.25rem;
  }
}

.flight::after {
  content: "travel" / "Flight";
}

.train::after {
  content: "train" / "Train";
}

.car::after {
  content: "directions_car" / "Car";
} */

img {
  width: 100%;
}

.action-bar {
  font-size: 1rem;
  margin-bottom: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 400;
  font-size: 1rem;
  display: flex;
  gap: 1rem;

  a {
    border-bottom: 1px solid;
    text-decoration: none;
    padding-bottom: 0.25rem;
    border-color: dimgray;
    color: white;
  }

  a:link {
    color: var(--link);
  }

  a:visited {
    color: var(--link-visited);
  }

  a:hover {
    color: var(--link-hover);
  }

  a:focus-visible {
    outline: 2px solid var(--link-focus);
    outline-offset: 2px;
  }

  a:active {
    color: var(--link-active);
  }
}

.plane {
  position: fixed;
  width: 1.5rem;
  display: flex;
  justify-content: center;
  position-anchor: --active-target;
  inset: anchor(inside);
  margin-top: anchor-size();
  transition: inset 0.5s linear;

  &::after {
    font-size: 1.25rem;
    font-family: "Material Symbols Outlined";
    content: "navigation";
  }
}
