/* ==================================================================
   Guided — "Learning doesn't happen once."  (LOCAL PREVIEW ONLY)

   Four tiles, each holding the actual piece of work, with the moment
   and the subject beneath it.
   ================================================================== */

/* apple.css carries `section img { display: block !important }`, so the
   flat original needs out-specifying, not an inline hide. A class on the
   section is (0,1,1) against that rule's (0,0,2). */
.gs-retention img,
.gs-retention .gs-ph,
.gs-retention .gs-carousel {
  display: none !important;
}

/* The authored copy column is copied out, not moved — React must keep
   owning it — so hide whatever this file did not build. Selecting by
   exclusion rather than by an added class means a re-render that resets
   className cannot un-hide it. */
.gs-retention > div > div:not(.gs-ret):not(.gs-ret-lead):not(.gs-ret-footer) {
  display: none !important;
}

.gs-ret {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 1180px;
  margin: 56px auto 0;
}

.gs-ret-card {
  margin: 0;
  min-width: 0;
}

/* the work itself */
.gs-ret-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 26px 24px;
  border-radius: 18px;
  background: #F5F5F7;
  position: relative;
  overflow: hidden;
}

.gs-ret-work {
  color: #1D1D1F;
  text-align: center;
}

.gs-ret-quote {
  font-size: 19px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.012em;
}

.gs-ret-sum {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* the one they finally got — the same blue pen mark as the worked
   example above, so the two sections read as the same tutor */
.gs-ret-work.is-marked {
  padding-bottom: 3px;
  background-image: linear-gradient(rgba(0, 113, 227, 0.55),
                                    rgba(0, 113, 227, 0.55));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 3px;
}

/* .is-live is only added once the sequence is definitely going to run,
   so with reduced motion — or if the script never gets that far — the
   tiles stay fully written and the mark stays drawn. */
.gs-ret.is-live .gs-ret-work.is-marked { background-size: 0 3px; }

.gs-ret.is-live .gs-ret-work.is-marked.is-drawn {
  animation: gsUnderline 0.7s cubic-bezier(0.4, 0.7, 0.35, 1) forwards;
}

@keyframes gsUnderline { to { background-size: 100% 3px; } }

/* ---- the tutor is writing ---- */

.gs-ret-work.is-typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 2px;
  vertical-align: -0.1em;
  background: #0071E3;
  animation: gsCaret 1s steps(1, end) infinite;
}

@keyframes gsCaret { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* ---- it talks, and it listens ---- */

.gs-ret-speak {
  position: absolute;
  top: 14px;
  left: 15px;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: #A1A1A6;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gs-speak-body { fill: #A1A1A6; stroke: none; }

.gs-speak-wave { opacity: 0.35; }

.gs-ret-tile.is-speaking .gs-speak-body { fill: #0071E3; }

.gs-ret-tile.is-speaking .gs-speak-wave {
  stroke: #0071E3;
  animation: gsWave 1.05s ease-in-out infinite;
}

.gs-ret-tile.is-speaking .gs-speak-w2 { animation-delay: 0.16s; }

@keyframes gsWave {
  0%, 100% { opacity: 0.18; }
  50%      { opacity: 0.95; }
}

/* the moment */
.gs-ret-cap {
  display: grid;
  gap: 4px;
  padding: 16px 2px 0;
  text-align: left;
}

.gs-ret-when {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #0071E3;
  text-align: left;
}

.gs-ret-subject {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: #1D1D1F;
  text-align: left;
}

.gs-ret-note {
  margin-top: 2px;
  font-size: 15.5px;
  line-height: 1.5;
  color: #6E6E73;
  text-align: left;
}

/* ---- mobile: swipe through them ---- */

@media (max-width: 1024px) {
  .gs-ret {
    display: flex;
    gap: 14px;
    margin-bottom: 34px;
    padding: 0 22px 6px;
    max-width: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .gs-ret::-webkit-scrollbar { display: none; }

  .gs-ret-quote { font-size: 18px; }
  .gs-ret-sum { font-size: 34px; }
  .gs-ret-note { font-size: 15px; }
}

/* ==================================================================
   1. the claim — headline and one line, with the photograph
   ================================================================== */

.gs-ret-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 64px;
  align-items: center;
  width: 100%;
}

.gs-ret-photo {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  background: #FFFFFF center / cover no-repeat;
  justify-self: center;
}

.gs-ret-copy {
  display: grid;
  gap: 20px;
  align-content: center;
  text-align: left;
}

.gs-ret-head {
  margin: 0;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -0.026em;
  color: #1D1D1F;
  text-align: left !important;
}

.gs-ret-lede {
  margin: 0;
  font-size: 19px;
  line-height: 1.55;
  color: #6E6E73;
  max-width: 46ch;
  text-align: left !important;
}

/* ==================================================================
   3. the coda — the line that closes it, and the detail folded away
   ================================================================== */

.gs-ret-footer {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: 46px;
  padding-top: 34px;
  border-top: 1px solid #DCDCE0;
  text-align: center;
}

.gs-ret-coda {
  margin: 0 !important;
  max-width: 58ch;
  font-size: 19px !important;
  line-height: 1.5;
  color: #1D1D1F !important;
  text-align: center !important;
}

.gs-ret-more { text-align: center; }

.gs-ret-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
  font-size: 16px;
  font-weight: 500;
  color: #0071E3;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}

.gs-ret-summary::-webkit-details-marker { display: none; }

.gs-ret-summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.2s ease;
}

.gs-ret-more[open] .gs-ret-summary::after {
  transform: rotate(-135deg) translate(-1px, -1px);
}

.gs-ret-summary:hover { color: #0056b3; }

.gs-ret-summary:focus-visible {
  outline: 2px solid #0071E3;
  outline-offset: 3px;
  border-radius: 4px;
}

/* NB: an author `display` on the body defeats the UA rule that hides a
   closed <details>, so the closed state has to be stated outright. */
.gs-ret-more:not([open]) .gs-ret-more-body { display: none !important; }

.gs-ret-more[open] .gs-ret-more-body {
  padding-top: 14px;
  max-width: 62ch;
  margin: 0 auto;
}

.gs-ret-more-body p {
  margin: 0 !important;
  text-align: center !important;
}

@media (max-width: 1024px) {
  .gs-ret-lead {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .gs-ret-photo { max-width: 300px; border-radius: 16px; }

  .gs-ret { margin-top: 34px; }

  .gs-ret-footer {
    margin-top: 32px;
    padding-top: 26px;
    gap: 12px;
  }

  .gs-ret-head { font-size: 30px; }
  .gs-ret-lede { font-size: 17px; }
  .gs-ret-coda { font-size: 17px !important; }
  .gs-ret-summary { font-size: 15.5px; }
}
