/*!
 * Great States Construction: company timeline ([gsc_timeline]), GSC Timeline plugin
 * Loads only on pages that use the shortcode. Content comes from Timeline in the WordPress menu.
 * Self-contained: brand colors are set below, sizes are relative to the timeline (not the theme),
 * and headings and body text use the theme's own fonts.
 *
 * Without JavaScript the milestones read as a simple list: photo beside text.
 * assets/js/timeline.js adds .is-live and turns it into a full-screen story: a photo stays pinned
 * while each milestone's text scrolls over it, with a year rail, a skip button, and a progress bar.
 */

/* ---------- Brand colors and a fixed base size, so the theme cannot shrink or recolor it ---------- */

.gsc-story {
  --gsc-orange: #f79a20;
  --gsc-orange-dk: #d9800c;
  --gsc-orange-text: #a85a00;
  --gsc-ink: #1c262d;
  --gsc-radius: 6px;
  --gsc-wrap: 1240px;
  font-size: 16px;
  line-height: 1.5;
}
.gsc-story,
.gsc-story * {
  box-sizing: border-box;
}
.gsc-story li,
.gsc-story figure {
  margin: 0 !important;
}
.gsc-story li:before,
.gsc-story li:after {
  content: none !important;
}
.gsc-story .gsc-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 .6em !important;
  padding: 0 !important;
  font-size: .85em !important;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gsc-orange-text) !important;
}
.gsc-story .gsc-eyebrow:before {
  content: "";
  width: 28px;
  height: 2px;
  background: currentColor;
  flex: none;
}
.gsc-story.is-live .gsc-eyebrow {
  color: var(--gsc-orange) !important;
}
.gsc-story__after {
  display: block;
  height: 0;
  outline: none;
}

/* ---------- List view (before JavaScript, or if it fails) ---------- */

.gsc-story__steps {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.gsc-story__step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 0 0 56px !important;
}
.gsc-story__photo {
  margin: 0;
}
.gsc-story__photo ~ .gsc-story__photo {
  display: none;
}
.gsc-story__photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3/2;
  object-fit: cover;
  border-radius: var(--gsc-radius);
}
.gsc-story__photo figcaption {
  display: none;
}
.gsc-story__year {
  margin: 0 0 .15em !important;
  padding: 0 !important;
  font-size: clamp(2.4em,4vw,3.4em) !important;
  font-weight: 800;
  line-height: 1 !important;
  letter-spacing: -.02em;
  color: var(--gsc-orange-dk) !important;
}
.gsc-story__card h2,
.gsc-story__card h3 {
  margin: 0 0 .45em !important;
  padding: 0 !important;
}
.gsc-story__card h3 {
  font-size: clamp(1.3em,2vw,1.7em) !important;
}
.gsc-story__text p {
  font-size: 1.05em !important;
  line-height: 1.65;
}
.gsc-story__text p:last-child,
.gsc-story__card > :last-child {
  margin-bottom: 0 !important;
}
.gsc-story__more {
  margin-top: 1em !important;
}
.gsc-story__more a {
  font-weight: 700;
}

/* opening slide: a big number with a short line beside it */
.gsc-story__mark {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin: 0 0 28px !important;
  line-height: .8 !important;
}
.gsc-story__mark strong {
  font-size: clamp(7em,14vw,12em);
  font-weight: 800;
  letter-spacing: -.05em;
  color: var(--gsc-orange);
}
.gsc-story__mark span {
  display: block;
  padding-bottom: .5em;
  font-size: .85em;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gsc-ink);
}

/* closing slide: one large line */
.gsc-story__outro {
  margin: 0 !important;
  padding: 0 !important;
  font-size: clamp(1.8em,3.6vw,3.2em) !important;
  line-height: 1.15 !important;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--gsc-ink);
}

/* WordPress and page builders can add empty paragraphs between tags */
:is(.gsc-story, .gsc-story__steps, .gsc-story__step, .gsc-story__photo, .gsc-story__card) > :is(p:empty, br) {
  display: none;
}

@media (max-width: 767px) {
  .gsc-story__step {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ---------- Full-screen story ---------- */

.gsc-story.is-live {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

/* the pinned layer: photos, shade, caption, year rail, skip button, progress bar */
.gsc-story__stage {
  display: none;
}
.gsc-story.is-live .gsc-story__stage {
  display: block;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--gsc-ink);
}
.gsc-story .gsc-story__bg {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  object-fit: cover;
  opacity: 0;
  transform: translateX(8%) scale(1.04);
  transition: opacity .9s ease, transform 1.2s cubic-bezier(.2,.7,.2,1);
}
.gsc-story .gsc-story__bg.is-before {
  transform: translateX(-8%) scale(1.04);
}
.gsc-story .gsc-story__bg.is-active {
  opacity: 1;
  transform: none;
}
.gsc-story__stage:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20,28,34,.88) 0%, rgba(20,28,34,.62) 40%, rgba(20,28,34,.15) 75%, rgba(20,28,34,.05) 100%);
  pointer-events: none;
  transition: background .6s ease;
}
/* closing slide: shade from the bottom so faces stay clear */
.gsc-story__stage.is-bottom:after {
  background: linear-gradient(0deg, rgba(20,28,34,.9) 0%, rgba(20,28,34,.55) 32%, rgba(20,28,34,0) 60%);
}

.gsc-story__caption {
  position: absolute;
  z-index: 2;
  left: max(24px, calc((100vw - var(--gsc-wrap, 1240px)) / 2));
  bottom: 40px;
  margin: 0 !important;
  padding: 0 !important;
  font-size: .75em !important;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.85) !important;
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}
.gsc-story__caption:before {
  content: "Pictured: ";
  color: var(--gsc-orange);
}

.gsc-story__rail {
  position: absolute;
  z-index: 2;
  right: max(24px, calc((100vw - var(--gsc-wrap, 1240px)) / 2));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: opacity .4s ease;
}
.gsc-story__rail.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.gsc-story__rail button {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 6px 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: .8em;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(255,255,255,.55);
  text-shadow: 0 1px 8px rgba(0,0,0,.45);
  transition: color .3s ease;
}
.gsc-story__rail button:after {
  content: "";
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: width .3s ease;
}
.gsc-story__rail button:hover,
.gsc-story__rail button.is-active {
  color: #fff;
}
.gsc-story__rail button.is-active:after {
  width: 36px;
  background: var(--gsc-orange);
}
.gsc-story__rail button:focus-visible {
  outline: 2px solid var(--gsc-orange);
  outline-offset: 4px;
}

.gsc-story__skip {
  position: absolute;
  z-index: 2;
  right: max(24px, calc((100vw - var(--gsc-wrap, 1240px)) / 2));
  bottom: 40px;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 3px;
  background: rgba(20,28,34,.35);
  color: #fff;
  font: inherit;
  font-size: .75em;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.gsc-story__skip:after {
  content: " \2193";
}
.gsc-story__skip:hover,
.gsc-story__skip:focus-visible {
  background: var(--gsc-orange);
  border-color: var(--gsc-orange);
  color: var(--gsc-ink);
  outline: none;
}

.gsc-story__progress {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255,255,255,.18);
}
.gsc-story__progress span {
  display: block;
  height: 100%;
  background: var(--gsc-orange);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

/* the milestones scroll over the pinned layer, one screen each */
.gsc-story.is-live .gsc-story__steps {
  position: relative;
  z-index: 1;
  margin-top: -100vh !important;
  margin-top: -100svh !important;
  pointer-events: none;
}
.gsc-story.is-live .gsc-story__step {
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0 max(24px, calc((100vw - var(--gsc-wrap, 1240px)) / 2)) !important;
  pointer-events: none;
}
.gsc-story.is-live .gsc-story__photo {
  display: none;
}
.gsc-story.is-live .gsc-story__card {
  max-width: 480px;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0,0,0,.35);
  pointer-events: auto;
  opacity: .25;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.gsc-story.is-live .gsc-story__step.is-active .gsc-story__card {
  opacity: 1;
  transform: none;
}
.gsc-story.is-live .gsc-story__year {
  color: var(--gsc-orange) !important;
  font-size: clamp(3.5em,7vw,6em) !important;
}
.gsc-story.is-live .gsc-story__card h2,
.gsc-story.is-live .gsc-story__card h3 {
  color: #fff !important;
}
.gsc-story.is-live .gsc-story__card h3 {
  font-size: clamp(1.6em,2.6vw,2.2em) !important;
}
.gsc-story.is-live .gsc-story__text p {
  color: rgba(255,255,255,.88) !important;
  font-size: 1.12em !important;
}
.gsc-story.is-live .gsc-story__card a {
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--gsc-orange);
}
.gsc-story.is-live .gsc-story__more a:after {
  content: " \2192";
}

/* opening slide */
.gsc-story.is-live .gsc-story__step--opening .gsc-story__card {
  max-width: 780px;
}
.gsc-story.is-live .gsc-story__mark span {
  color: #fff;
}
.gsc-story.is-live .gsc-story__step--opening h2 {
  font-size: clamp(2.4em,5vw,4.4em) !important;
  line-height: 1.02 !important;
  margin: 0 !important;
}

/* closing slide */
.gsc-story.is-live .gsc-story__step--closing {
  align-items: flex-end;
  padding-bottom: 72px !important;
}
.gsc-story.is-live .gsc-story__step--closing .gsc-story__card {
  max-width: 900px;
}
.gsc-story.is-live .gsc-story__outro {
  color: #fff;
}

/* milestones with several photos: one screen of scrolling per photo. The card is a full-height
   sticky box, so the text holds still in the middle of the screen while the photos change behind it. */
.gsc-story.is-live .gsc-story__step.has-photos {
  display: block;
  min-height: calc(var(--photos, 1) * 100vh);
  min-height: calc(var(--photos, 1) * 100svh);
}
.gsc-story.is-live .gsc-story__step.has-photos .gsc-story__card {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}
.gsc-story.is-live .gsc-story__step.has-photos .gsc-story__card > * {
  pointer-events: auto;
}

@media (max-width: 767px) {
  .gsc-story__stage:after {
    background: linear-gradient(0deg, rgba(20,28,34,.9) 0%, rgba(20,28,34,.55) 50%, rgba(20,28,34,.15) 100%);
  }
  .gsc-story.is-live .gsc-story__step {
    align-items: flex-end;
    padding: 0 20px 104px !important;
  }
  .gsc-story.is-live .gsc-story__step.has-photos .gsc-story__card {
    justify-content: flex-end;
    padding-bottom: 104px;
  }
  .gsc-story.is-live .gsc-story__step--closing {
    padding-bottom: 48px !important;
  }
  .gsc-story.is-live .gsc-story__text p {
    font-size: 1em !important;
  }
  .gsc-story__rail {
    top: auto;
    bottom: 18px;
    right: 20px;
    left: 20px;
    transform: none;
    flex-direction: row;
    justify-content: space-between;
  }
  .gsc-story__rail button {
    font-size: .68em;
    letter-spacing: .04em;
    flex-direction: column-reverse;
    gap: 4px;
  }
  .gsc-story__rail button:after,
  .gsc-story__rail button.is-active:after {
    width: 100%;
  }
  .gsc-story__skip {
    top: calc(var(--gsc-tl-head, 64px) + 20px);
    bottom: auto;
    right: 16px;
    padding: 8px 12px;
    font-size: .68em;
  }
  .gsc-story__caption {
    top: calc(var(--gsc-tl-head, 64px) + 20px);
    bottom: auto;
    left: 16px;
    right: 150px;
    font-size: .64em !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gsc-story .gsc-story__bg,
  .gsc-story.is-live .gsc-story__card {
    transition: none;
    transform: none !important;
  }
}

/* a word in place of a year, such as "The beginning" */
.gsc-story .gsc-story__year--word {
  font-size: clamp(1.9em,3.2vw,2.6em) !important;
  letter-spacing: -.01em;
}
.gsc-story.is-live .gsc-story__year--word {
  font-size: clamp(2.4em,4.6vw,4em) !important;
}
