@import url("styles-base.css");

/* Keep primary site controls rectangular and consistent with the visual system. */
.button {
  border-radius: 2px;
}

/* Equal visual size for book cover and sample page. */
.book-cover,
.book-spread {
  width: 100%;
  max-width: 300px;
  justify-self: center;
}
.book-cover img,
.book-spread img {
  display: block;
  width: 100%;
  height: 390px;
  min-height: 0;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

/* Hero portrait: a quiet vertical field behind the figure. */
.hero .hero-portrait-image::before {
  left: 34%;
  right: -7%;
  top: 5%;
  bottom: 0;
  background: #f6f1eb;
  border: 0;
}
.hero .hero-portrait-image::after {
  display: none;
}

/* About portrait: same visual logic, with less dead space above the portrait. */
#about {
  padding-top: 64px;
}
#about .about-photo-wrap {
  position: relative;
  isolation: isolate;
}
#about .about-photo-wrap::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -10%;
  right: 31%;
  top: 7%;
  bottom: 0;
  background: #f6f1eb;
}
#about .about-photo {
  position: relative;
  z-index: 1;
}

/* Trial gift: two separate takeaways instead of one long sentence. */
#trial .trial-gift {
  max-width: 580px;
  margin: 34px 0 0;
  padding: 26px 0 0;
  border-top: 2px solid var(--accent);
  color: var(--text);
}
#trial .trial-gift > strong {
  display: block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .02em;
}
#trial .trial-gift-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}
#trial .trial-gift-list li {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  font-size: clamp(18px, 1.8vw, 23px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -.015em;
}
#trial .trial-gift-list li::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: .48em;
  background: var(--accent);
}

/* The embedded form should occupy its real visual footprint, not a 620px reserve. */
#trial .alfacrm-frame {
  height: 500px;
  min-height: 0;
  margin-top: 20px;
}
#trial .alfacrm-fallback {
  margin-top: 8px;
}

/* Shared carousel presentation. Touch devices keep native swipe. */
.review-slider,
.achievement-carousel {
  min-width: 0;
}
.review-slides,
.achievement-track {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  user-select: none;
}
.review-slides::-webkit-scrollbar,
.achievement-track::-webkit-scrollbar {
  display: none;
}

.review-slides {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
}
.review-slide,
.review-slide.is-active {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  cursor: zoom-in;
}
.review-slide img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.achievement-track {
  overflow-x: auto !important;
  scroll-snap-type: x mandatory !important;
  overscroll-behavior-x: contain;
}
.achievement-track .achievement-item {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.review-controls,
.achievement-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.carousel-desktop-arrow {
  display: none;
}

/* Desktop carousel: fixed navigation row above a stable image viewport. */
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
  #about .about-photo-wrap {
    margin-top: -28px;
  }

  .review-slider,
  .achievement-carousel {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .review-controls,
  .achievement-controls {
    order: -1;
    justify-content: flex-end;
    min-height: 42px;
  }
  .review-controls {
    margin: 0 0 16px;
  }
  .achievement-controls {
    margin: 0 0 20px;
  }

  .review-slides,
  .achievement-track {
    order: 0;
    overflow: visible !important;
    scroll-snap-type: none !important;
    scroll-behavior: auto;
    cursor: default;
    transition: transform 260ms cubic-bezier(.2,.7,.2,1);
    will-change: transform;
  }

  .review-slider::after,
  .achievement-carousel::after {
    content: "";
    position: absolute;
    z-index: 4;
    pointer-events: none;
    top: 58px;
    right: -1px;
    bottom: 0;
    width: 1px;
    background: var(--line);
  }

  .review-slider {
    overflow: hidden;
    max-width: 720px;
  }
  .review-slides {
    gap: 0;
    align-items: flex-start;
    transition: transform 260ms cubic-bezier(.2,.7,.2,1), height 220ms ease;
  }
  .review-slide,
  .review-slide.is-active {
    display: flex;
    flex: 0 0 100%;
    width: 100%;
    align-self: flex-start;
    justify-content: center;
  }
  .review-slide img {
    width: auto;
    max-width: 100%;
    max-height: min(68vh, 640px);
    height: auto;
    margin: 0 auto;
    object-fit: contain;
  }

  .achievement-carousel {
    overflow: hidden;
  }
  .achievement-track {
    gap: 18px;
  }
  .achievement-track .achievement-item {
    flex: 0 0 calc((100% - 54px) / 4);
  }

  .carousel-desktop-arrow {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 0;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease, opacity 150ms ease;
  }
  .carousel-desktop-arrow + .carousel-desktop-arrow {
    margin-left: -1px;
  }
  .carousel-desktop-arrow:hover:not(:disabled) {
    background: var(--text);
    border-color: var(--text);
    color: #fff;
  }
  .carousel-desktop-arrow:disabled {
    opacity: .24;
    cursor: default;
  }
  .carousel-desktop-arrow:focus-visible {
    position: relative;
    z-index: 2;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .review-counter,
  .achievement-counter {
    min-width: 58px;
    margin-right: 4px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    font-variant-numeric: tabular-nums;
  }
}

/* Phones/tablets: swipe remains the primary control; no desktop arrows. */
@media (max-width: 1024px), (hover: none), (pointer: coarse) {
  #about {
    padding-top: 72px;
  }
  .review-slides,
  .achievement-track {
    cursor: grab;
  }
  .review-slides {
    height: auto !important;
  }
  .carousel-desktop-arrow {
    display: none !important;
  }
}

@media (max-width: 720px) {
  #about {
    padding-top: 56px;
  }
  .book-cover,
  .book-spread {
    max-width: 280px;
    justify-self: start;
  }
  .book-cover img,
  .book-spread img {
    height: 360px;
  }
  .hero .hero-portrait-image::before {
    left: 28%;
    right: -2%;
    top: 6%;
    bottom: 0;
  }
  #about .about-photo-wrap::before {
    left: -4%;
    right: 34%;
    top: 8%;
    bottom: 0;
  }
  #trial .trial-gift-list li {
    font-size: 18px;
  }
  #trial .alfacrm-frame {
    height: 540px;
  }
}

/* Lightbox follows the same rectangular control language as the rest of the site. */
.lightbox-close {
  border-radius: 0;
}
.lightbox-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Carousel behavior lives in index.html; this file controls only presentation. */


/* Legal links and compact signup form. */
#trial .signup-form > .alfacrm-frame {
  margin-top: 0;
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}
.footer-legal a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}
.footer-legal a:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

/* Learning section: same interaction language as the students' scores. */
#learning .learning-heading {
  margin-bottom: 36px;
}
#learning .learning-browser {
  display: block;
}
#learning .learning-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  width: 100%;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
#learning .learning-tab {
  min-width: 0;
  min-height: 118px;
  margin: 0;
  padding: 20px 18px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: none;
}
#learning .learning-tab:last-child {
  border-right: 0;
}
#learning .learning-tab span {
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
#learning .learning-tab:hover {
  background: transparent;
  color: var(--text);
}
#learning .learning-tab:hover span {
  color: var(--muted);
}
#learning .learning-tab.is-active,
#learning .learning-tab.is-active:hover {
  background: var(--text);
  color: #fff;
  font-weight: 600;
}
#learning .learning-tab.is-active span,
#learning .learning-tab.is-active:hover span {
  color: #cfcfcf;
}
#learning .learning-stage {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, .55fr) minmax(0, 1.45fr);
  gap: 48px;
  align-items: start;
  padding-top: 42px;
}
#learning .learning-caption {
  order: 1;
  padding: 4px 0 0;
}
#learning .learning-image-button {
  order: 2;
}
#learning .learning-image-button img {
  width: 100%;
  min-height: 0;
  height: auto;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line);
}
#learning .learning-caption > span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
#learning .learning-caption h3 {
  margin-top: 12px;
  font-size: 28px;
}
#learning .learning-caption p {
  max-width: 360px;
}

@media (max-width: 980px) {
  #learning .learning-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  #learning .learning-tabs::-webkit-scrollbar {
    display: none;
  }
  #learning .learning-tab {
    flex: 0 0 170px;
    min-height: 104px;
  }
  #learning .learning-stage {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  #learning .learning-caption,
  #learning .learning-image-button {
    order: initial;
  }
  #learning .learning-caption {
    max-width: 640px;
  }
}

@media (max-width: 720px) {
  .footer-legal {
    width: 100%;
    justify-content: flex-start;
  }
  #learning .learning-tabs {
    display: flex;
    grid-template-columns: none;
    border-left: 0;
    overflow-x: auto;
  }
  #learning .learning-tab {
    flex: 0 0 148px;
    width: auto;
    min-height: 96px;
    padding: 16px 14px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    white-space: normal;
  }
  #learning .learning-tab span {
    font-size: 10px;
  }
  #learning .learning-stage {
    padding-top: 30px;
  }
}
