/* =========================
   GLOBAL
========================= */

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  background-color: #C7C8D3;
}


/* =========================
   HEADER / MENU
========================= */

.container {
  display: flex;

  gap: 0;

  border-bottom: 2px solid black;

  padding: 10px;

  font-size: 2rem;

  font-family: "DM Sans", sans-serif;
}

.box1 {
  flex: 1;

  padding: 0;
}

.box2 {
  flex: 1;

  text-align: right;

  padding: 0;
}


/* =========================
   CAROUSEL CONTAINER
========================= */

.carousel-container {

  width: 100%;

  position: relative;

  /*
    Space below the menu.
    Adjust if your menu is taller/shorter.
  */

  padding-top: 120px;

  padding-bottom: 80px;
}


/* =========================
   IMAGE STAGE
========================= */

.carousel {

  width: 100%;

  max-width: 1300px;

  /*
    Fixed image area.

    The caption sits outside this,
    so caption length cannot affect
    the position of the images,
    previews, or arrows.
  */

  height: 70vh;

  margin: 0 auto;

  padding: 0 20px;

  display: flex;

  align-items: center;

  justify-content: center;

  gap: 18px;

  position: relative;
}


/* =========================
   SLIDES
========================= */

.slide {

  flex-shrink: 0;

  display: flex;

  align-items: center;

  justify-content: center;

  position: relative;

  transition:
    opacity 0.18s ease;
}


/* =========================
   ACTIVE SLIDE
========================= */

.slide.active {

  flex: 1 1 auto;

  max-width: 65%;

  display: flex;

  align-items: center;

  justify-content: center;
}


/* =========================
   ACTIVE IMAGE
========================= */

.slide.active img {

  display: block;

  width: auto;

  height: auto;

  max-width: 100%;

  max-height: 70vh;

  object-fit: contain;
}


/* =========================
   PREVIEW SLIDES
========================= */

.slide.preview {

  width: 110px;

  height: 110px;

  flex: 0 0 110px;

  overflow: hidden;

  opacity: 0.5;

  position: relative;

  transform-origin: center center;

  transition:
    transform 0.35s
      cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.35s ease;

  will-change:
    transform,
    opacity;
}


/* =========================
   PREVIEW IMAGES
========================= */

.slide.preview img {

  display: block;

  width: 100%;

  height: 100%;

  object-fit: cover;
}


/* =========================
   PREVIEW ARC
========================= */

/*
   LEVEL 1
   Closest to active image.

   Moved upward and slightly inward.
*/

#prev1 {

  opacity: 0.6;

  transform:
    translateY(-22px)
    translateX(0px)
    scale(1);
  
    z-index: 5;
}


#next1 {

  opacity: 0.6;

  transform:
    translateY(-22px)
    translateX(0px)
    scale(1);
  
    z-index: 5;
}


/*
   LEVEL 2
   Further away and higher.

   Creates the upper part of
   the semicircle.
*/

#prev2 {

  opacity: 0.35;

  transform:
    translateY(-55px)
    translateX(20px)
    scale(0.75);
  
    z-index: 5;
}


#next2 {

  opacity: 0.35;

  transform:
    translateY(-55px)
    translateX(-20px)
    scale(0.75);
  
  z-index: 5;
}


/* =========================
   LEVEL 1 HOVER
========================= */

#prev1.slide.preview:hover {

  opacity: 1 !important;

  transform:
    translateY(-22px)
    translateX(0px)
    scale(1.15);

  z-index: 5;
}


#next1.slide.preview:hover {

  opacity: 1 !important;

  transform:
    translateY(-22px)
    translateX(0px)
    scale(1.15);

  z-index: 5;
}


/* =========================
   LEVEL 2 HOVER
========================= */

/*
   More subtle enlargement than
   the first-level previews.
*/

#prev2.slide.preview:hover {

  opacity: 1 !important;

  transform:
    translateY(-55px)
    translateX(20px)
    scale(0.85);

  z-index: 5;
}


#next2.slide.preview:hover {

  opacity: 1 !important;

  transform:
    translateY(-55px)
    translateX(-20px)
    scale(0.85);

  z-index: 5;
}


/* =========================
   NAVIGATION
========================= */

/*
   The arrows are INSIDE .carousel.

   Therefore top: 66% is calculated
   against the fixed image stage,
   not the caption.
*/

.nav {

  position: absolute;

  top: 66%;

  transform:
    translateY(-50%);

  font-size: 32px;

  background:
    rgba(0, 0, 0, 0.35);

  border: none;

  color: #C7C8D3;

  cursor: pointer;

  padding: 8px 12px;

  z-index: 10;

  transition:
    background 0.25s ease,
    transform 0.25s ease;
}


/* =========================
   NAVIGATION HOVER
========================= */

.nav:hover {

  background:
    rgba(0, 0, 0, 0.6);

  transform:
    translateY(-50%)
    scale(1.05);
}


/* =========================
   NAVIGATION POSITION
========================= */

.nav.left {

  left: 10px;
}


.nav.right {

  right: 10px;
}


/* =========================
   CAPTION STAGE
========================= */

.caption-stage {

  width: 100%;

  display: flex;

  justify-content: center;

  text-align: left;

  transition:
    opacity 0.18s ease;
}


/* =========================
   CAPTION / META
========================= */

.caption-stage .meta {

  /*
    JavaScript dynamically sets
    this to the actual rendered
    width of the active image.
  */

  width: auto;

  max-width: 100%;

  margin-top: 16px;

  height: auto;

  overflow: visible;
}


/* =========================
   TITLE
========================= */

.meta h2 {

  margin: 0 0 6px;

  font-size: 20px;

  font-weight: 600;

  line-height: 1.2;
  
  font-family: 'DM Sans';
}


/* =========================
   AUTHOR
========================= */

.meta .author {

  margin: 0 0 8px;

  font-size: 14px;

  line-height: 1.3;
  
  font-family: 'DM Sans';
}


.meta .author strong {

  font-weight: 500;
}


/* =========================
   CAPTION
========================= */

.meta .caption {

  margin: 0;

  font-size: 18px;

  line-height: 1.3;

  opacity: 0.8;
  
  font-family: 'DM Sans';

  overflow-wrap: break-word;

  word-wrap: break-word;
}


/* =========================
   FADE
========================= */

.slide.is-fading {

  opacity: 0;
}


.caption-stage.is-fading {

  opacity: 0;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 900px) {

  /* =========================
     CONTAINER
  ========================= */

  .carousel-container {

    padding-top: 200px;

    padding-bottom: 60px;
  }


  /* =========================
     IMAGE STAGE
  ========================= */

  .carousel {

    height: 65vh;

    padding: 0 10px;

    gap: 0;
  }


  /* =========================
     HIDE PREVIEWS
  ========================= */

  .slide.preview {

    display: none;
  }


  /* =========================
     ACTIVE IMAGE
  ========================= */

  .slide.active {

    width: 100%;

    max-width: 100%;
    
    padding: 0px 20px;
  }


  .slide.active img {

    max-width: 100%;

    max-height: 65vh;
  }


  /* =========================
     CAPTION
  ========================= */

  .caption-stage .meta {

    max-width: 100%;
  }


  /* =========================
     NAVIGATION
  ========================= */

  .nav {

    top: 66%;

    font-size: 28px;

    padding: 6px 10px;
  }


  .nav.left {

    left: 8px;
  }


  .nav.right {

    right: 8px;
  }

}