/* Student Journey case study (same building blocks as citi.css)
   - Site navigation (fixed name / About / Work / Personal)
   - Title section: title, rule, Role / Date / Company, laptop image on the right edge
   - .section: heading with a rule under it (.section-title), white or grey (.section--grey)
   - .section-text: a paragraph under the heading
   - .section-image / .image-pair: centered images
   - .dp-slideshow: the Degree Progress slideshow */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Avenir", "Avenir Next", "Nunito Sans", "Segoe UI", sans-serif;
  color: #333;
}

a {
  text-decoration: none;
}


/* ---------- Site navigation ---------- */

/* Name + About at the top, Work + Personal at the bottom,
   fixed above the page content while it scrolls (same spacing as the homepage) */
.site-header,
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 20;                /* above the images */
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;       /* clicks pass through the empty space between the links */
}

.site-header {
  top: 0;
  padding: 36px 44px 0;
}

.site-footer {
  bottom: 0;
  padding: 0 44px 36px;
}

.site-header a,
.site-footer a {
  pointer-events: auto;       /* ...but the links themselves stay clickable */
}

.site-name,
.site-nav-link {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #000;
}

.site-name {
  text-transform: uppercase;
}

.site-name:hover,
.site-nav-link:hover {
  color: #d65e1c;
}


/* ---------- Title section ---------- */

#cs-title-container {
  background: #d6d9e8;
  padding: 120px 0 120px 80px;   /* none on the right so the laptop sits on the edge */
  display: flex;                 /* text on the left, laptop on the right */
  align-items: center;           /* text is centered vertically against the laptop */
  justify-content: space-between;
  gap: 60px;                     /* minimum space between the text and the laptop */
}

.cs-intro {
  flex: 0 1 900px;               /* up to 900px wide, narrower when the window is */
  min-width: 0;
}

.cs-title {
  margin: 0 0 40px;
  padding-bottom: 36px;
  /* border-bottom: 3px solid #333;   same rule as under the section headings */
  font-family: Georgia, "Times New Roman", serif;
  font-size: 64px;
  font-weight: bold;
  line-height: 64px;
  letter-spacing: 0.02em;
  color: #585f80;
}

/* Role / Date / Company row under the title */
.cs-details {
  display: flex;
  margin: 0;
}

.cs-details div {
  flex: 0 1 300px;               /* each field starts 300px after the last, closer when space is tight */
}

.cs-details dt,
.cs-details dd {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  letter-spacing: 0.06em;
}

.cs-details dt {
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* Laptop: flush to the section's right edge */
.cs-laptop {
  display: block;
  flex-shrink: 0;
  width: 450px;
}


/* ---------- Sections ---------- */

.section {
  background: #fff;
  padding: 100px 80px;
}

.section--grey {
  background: #f4f4f4;
}

.section-title {
  margin: 0 0 56px;
  padding-bottom: 12px;
  border-bottom: 3px solid #333;   /* the rule under the heading */
  font-size: 36px;
  font-weight: 700;
  line-height: 44px;
  letter-spacing: 0.06em;
}

.section-text {
  max-width: 900px;                /* keeps the lines a comfortable length */
  margin: 0;
  font-size: 20px;
  line-height: 29px;
  letter-spacing: 0.06em;
  hyphens: auto;                   /* splits long words at line ends */
  -webkit-hyphens: auto;
}


/* ---------- Text column ---------- */

/* Headings, their rules and text share one centered column,
   the same width as the lists on the Work / About / Personal pages */
.section > .section-title,
.section > .section-text,
.section-wrap {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}


/* ---------- Centered images ---------- */

.section-image {
  display: block;
  max-width: 100%;                 /* actual size, shrinks on smaller screens */
  height: auto;
  margin: 0 auto;
}

/* Space between the text and an image under it */
.section-text + .section-image,
.section-text + .dp-slideshow {
  margin-top: 80px;
}

/* Add to .section-image for a drop shadow */
.section-image--shadow {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Two images side by side, centered */
.image-pair {
  display: flex;
  justify-content: center;
  align-items: center;             /* lines them up by their centers when their heights differ */
  gap: 60px;
  margin-top: 80px;
}

.image-pair img {
  display: block;
  min-width: 0;                    /* lets them shrink to fit side by side */
  max-width: 100%;
  height: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);   /* separates screenshots from the background */
}


/* ---------- Degree Progress slideshow ---------- */

.dp-slideshow {
  max-width: 785px;                /* the screens' actual width */
  margin: 0 auto;                  /* centered */
}

/* All screens sit in the same grid cell, stacked on top of each other */
.dp-slides {
  display: grid;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.dp-slides img {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.2s ease;   /* same fade as the GIF */
}

.dp-slides img.is-active {
  opacity: 1;
}

/* Nav bar: 5 pieces in a row, 6px apart */
.dp-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.dp-nav button {
  width: 20px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: #999;
  cursor: pointer;
}

.dp-nav button[aria-current="true"] {
  background: #333;
}

.dp-nav button:focus-visible {
  outline: 2px solid #333;
  outline-offset: 3px;
}


/* ---------- Next project ---------- */

/* Dark band at the very bottom, linking to the next project in the Work list */
.next-project {
  display: block;
  padding: 120px 80px;
  background: #2d2d2d;
  color: #fff;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-align: center;
}

.next-project:hover {
  color: #d65e1c;
}

/* Work / Personal turn white while the dark band is behind them */
.site-footer.is-on-dark .site-nav-link {
  color: #fff;
}

.site-footer.is-on-dark .site-nav-link:hover {
  color: #d65e1c;
}

@media (max-width: 700px) {
  .next-project {
    padding: 80px 20px;
    font-size: 20px;
  }
}


/* ---------- Narrower screens ---------- */

@media (max-width: 1000px) {
  /* Title section: the laptop moves below the text, still flush right */
  #cs-title-container {
    flex-direction: column;
    align-items: stretch;
  }

  .cs-intro {
    flex: none;
    max-width: 900px;
    margin-right: 80px;            /* the container has no right padding, so the text gets it here */
  }

  .cs-laptop {
    align-self: flex-end;
    max-width: 90%;
  }
}


/* ---------- Phones ---------- */

@media (max-width: 700px) {
  .site-header {
    padding: 24px 20px 0;
  }

  .site-footer {
    padding: 0 20px 24px;
  }

  .site-name,
  .site-nav-link {
    font-size: 15px;
  }

  #cs-title-container {
    padding: 100px 0 60px 20px;    /* 20px gutter on the left; laptop stays flush right */
    gap: 48px;
  }

  .cs-intro {
    margin-right: 20px;
  }

  .cs-title {
    margin-bottom: 32px;
  }

  /* Fields wrap onto new lines when they don't fit side by side */
  .cs-details {
    flex-wrap: wrap;
    gap: 24px 48px;
  }

  .section {
    padding: 60px 20px 80px;
  }

  .section-title {
    margin-bottom: 32px;
    font-size: 28px;
    line-height: 36px;
  }

  .section-text {
    font-size: 17px;
    line-height: 26px;
    letter-spacing: 0.03em;
  }

  .section-text + .section-image,
  .section-text + .dp-slideshow {
    margin-top: 48px;
  }

  /* Stack the pair */
  .image-pair {
    flex-direction: column;
    gap: 40px;
    margin-top: 48px;
  }
}
