/* ═══════════════════════════════════════════════════════
   hub.css — /boeken and /tto-boeken hub pages (v4)
   Depends on style.css (tokens) and methode.css (hero-gradient,
   methode-section, badge, tag, faq__list, text-shield, btn--*)

   Concept: a simple, beautiful product overview in a premium
   publisher register. One loud fan in the hero, four quiet
   mini-fans in the rows. Strict mirrored 12-column geometry
   for the alternating rows, hairline separators, typography
   and the covers doing the work.

   Motion register: entrance fan-out on the hero (same easing
   family as the overview pages' .book-fan), idle float on the
   hero covers, marker-swipe on the trust line (pure CSS, like
   the homepage's nh-mark), mini-fans spreading on hover, and
   a transform-only translate-up reveal on scroll (js/hub.js).
   Content never depends on JS; reduced motion turns it all off.
   ═══════════════════════════════════════════════════════ */

/* ─── Trust line with marker swipe (homepage nh-mark language,
       recreated as hub-* so nh-* stays homepage-scoped) ─── */

.hub-claim {
  text-align: center;
  font-size: 1.02rem;
  font-weight: var(--fw-semibold);
  color: #1d1d1f;
  line-height: 1.8;
  max-width: 46rem;
  margin: 0 auto var(--space-lg);
}

.hub-mark {
  background: linear-gradient(#cfe8cf, #cfe8cf) left center no-repeat;
  background-size: 100% 100%;
  color: inherit;
  padding: 3px 8px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Pure CSS swipe: plays without JS, text itself is never hidden */
.hub-mark--swipe {
  background-size: 0% 100%;
  animation: hub-markerSwipe 0.9s ease 0.8s both;
}

@keyframes hub-markerSwipe {
  to { background-size: 100% 100%; }
}


/* ─── Hero: fanned cover collage ─── */

.hub-hero .hero-gradient__image {
  min-height: 420px;
}

.hub-fan {
  position: relative;
  width: 340px;
  height: 400px;
  margin: 0 auto;
}

/* The item carries the fan position/rotation (entrance + hover);
   the img inside carries the idle float, so transforms never fight. */
.hub-fan__item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 172px;
  transition: transform 0.35s ease;
}

.hub-fan__cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.4);
  animation: hub-fan-float 6s ease-in-out infinite;
}

@keyframes hub-fan-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hub-fan__item--1 {
  transform: translate(-50%, -50%) translate(-132px, 30px) rotate(-15deg);
  z-index: 1;
  animation: hub-fan-in-1 0.65s cubic-bezier(0.34, 1.2, 0.64, 1) 0.45s backwards;
}

.hub-fan__item--2 {
  transform: translate(-50%, -50%) translate(-46px, 6px) rotate(-5deg);
  z-index: 2;
  animation: hub-fan-in-2 0.7s cubic-bezier(0.34, 1.15, 0.64, 1) 0.15s backwards;
}

.hub-fan__item--3 {
  transform: translate(-50%, -50%) translate(46px, 0) rotate(5deg);
  z-index: 3;
  animation: hub-fan-in-3 0.7s cubic-bezier(0.34, 1.15, 0.64, 1) 0.15s backwards;
}

.hub-fan__item--4 {
  transform: translate(-50%, -50%) translate(136px, 22px) rotate(15deg);
  z-index: 4;
  animation: hub-fan-in-4 0.65s cubic-bezier(0.34, 1.2, 0.64, 1) 0.45s backwards;
}

/* Entrance: gathered low in the center, springs out to the fan.
   fill-mode backwards (not both): once finished, the static
   transforms above resume, so the hover fan-out keeps working. */
@keyframes hub-fan-in-1 {
  from { opacity: 0; transform: translate(-50%, -50%) translate(0, 44px) scale(0.9) rotate(0deg); }
  to { opacity: 1; transform: translate(-50%, -50%) translate(-132px, 30px) rotate(-15deg); }
}

@keyframes hub-fan-in-2 {
  from { opacity: 0; transform: translate(-50%, -50%) translate(0, 44px) scale(0.9) rotate(0deg); }
  to { opacity: 1; transform: translate(-50%, -50%) translate(-46px, 6px) rotate(-5deg); }
}

@keyframes hub-fan-in-3 {
  from { opacity: 0; transform: translate(-50%, -50%) translate(0, 44px) scale(0.9) rotate(0deg); }
  to { opacity: 1; transform: translate(-50%, -50%) translate(46px, 0) rotate(5deg); }
}

@keyframes hub-fan-in-4 {
  from { opacity: 0; transform: translate(-50%, -50%) translate(0, 44px) scale(0.9) rotate(0deg); }
  to { opacity: 1; transform: translate(-50%, -50%) translate(136px, 22px) rotate(15deg); }
}

/* Hover: fan out wider (same easing family as .book-fan) */
.hub-fan:hover .hub-fan__item--1 {
  transform: translate(-50%, -50%) translate(-156px, 30px) rotate(-19deg);
}

.hub-fan:hover .hub-fan__item--2 {
  transform: translate(-50%, -50%) translate(-56px, 2px) rotate(-7deg);
}

.hub-fan:hover .hub-fan__item--3 {
  transform: translate(-50%, -50%) translate(56px, -4px) rotate(7deg);
}

.hub-fan:hover .hub-fan__item--4 {
  transform: translate(-50%, -50%) translate(164px, 22px) rotate(19deg);
}


/* ─── Light intro (condensed, under the hero) ─── */

.hub-intro-section {
  padding: 4.5rem 0 3.5rem;
}

.hub-intro__prose {
  max-width: 640px;
  margin: 0 auto var(--space-xl);
}

/* Subtitles under section headings wrap balanced instead of
   leaving a single dangling word (safe no-op where unsupported) */
.methode-section__header p {
  text-wrap: balance;
}

.hub-intro__prose p {
  color: var(--color-text-light);
  line-height: 1.8;
  font-size: 1.02rem;
  margin-bottom: var(--space-md);
}

.hub-intro__prose p:last-child {
  margin-bottom: 0;
}

/* Bullet list in the intro family (also used by the stream
   overview pages, e.g. tto-boeken/vmbo-tl-havo.php) */
.hub-intro__bullets {
  max-width: 760px;
  margin: var(--space-lg) auto 0;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.hub-intro__bullets li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--color-text);
}

.hub-intro__bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
}


/* ═══ Kies jouw niveau — four calm rows, strict mirrored grid ═══ */

.hub-products {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-md);
}

/* Exact geometry: a 12-column grid with a fixed gutter.
   Art spans 5 columns, text spans 6, one column breathes
   between them; even rows mirror the placement precisely. */
.hub-product {
  --p-accent: var(--color-primary);
  /* Deep, readable version of the stream accent for text and chips */
  --p-deep: color-mix(in srgb, var(--p-accent) 62%, #10393d);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(16px, 2vw, 28px);
  align-items: center;
  padding: clamp(44px, 5vw, 68px) 0;
}

.hub-product + .hub-product {
  border-top: 1px solid rgba(16, 57, 61, 0.12);
}

.hub-product:nth-of-type(odd) .hub-product__art {
  grid-column: 1 / 6;
}

.hub-product:nth-of-type(odd) .hub-product__body {
  grid-column: 7 / 13;
}

.hub-product:nth-of-type(even) .hub-product__body {
  grid-column: 1 / 7;
  grid-row: 1;
}

.hub-product:nth-of-type(even) .hub-product__art {
  grid-column: 8 / 13;
  grid-row: 1;
}

/* ─── Row art: a small, quiet fan of the stream's covers ─── */

.hub-product__art {
  display: flex;
  justify-content: center;
}

.hub-minifan {
  position: relative;
  display: block;
  width: 280px;
  height: 225px;
}

/* Soft accent glow grounding the fan (the one accent surface) */
.hub-minifan::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 300px;
  height: 260px;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--p-accent) 16%, transparent),
    transparent 74%
  );
  border-radius: 50%;
  pointer-events: none;
}

.hub-minifan__cover {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 145px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(16, 57, 61, 0.25);
  transition: transform 0.35s ease;
}

/* Two-cover streams */
.hub-minifan--2 .hub-minifan__cover:nth-child(1) {
  transform: translate(-50%, -50%) translate(-40px, -4px) rotate(-8deg);
  z-index: 2;
}

.hub-minifan--2 .hub-minifan__cover:nth-child(2) {
  transform: translate(-50%, -50%) translate(40px, 8px) rotate(8deg);
  z-index: 1;
}

.hub-minifan--2:hover .hub-minifan__cover:nth-child(1) {
  transform: translate(-50%, -50%) translate(-54px, -4px) rotate(-11deg);
}

.hub-minifan--2:hover .hub-minifan__cover:nth-child(2) {
  transform: translate(-50%, -50%) translate(54px, 8px) rotate(11deg);
}

/* Three-cover streams (havo/vwo): year 2 fronts the fan, like
   the overview pages' .book-fan center cover */
.hub-minifan--3 .hub-minifan__cover {
  width: 138px;
}

.hub-minifan--3 .hub-minifan__cover:nth-child(1) {
  transform: translate(-50%, -50%) translate(-64px, 10px) rotate(-11deg);
  z-index: 1;
}

.hub-minifan--3 .hub-minifan__cover:nth-child(2) {
  transform: translate(-50%, -50%) translate(0, -8px);
  z-index: 3;
}

.hub-minifan--3 .hub-minifan__cover:nth-child(3) {
  transform: translate(-50%, -50%) translate(64px, 10px) rotate(11deg);
  z-index: 2;
}

.hub-minifan--3:hover .hub-minifan__cover:nth-child(1) {
  transform: translate(-50%, -50%) translate(-80px, 10px) rotate(-14deg);
}

.hub-minifan--3:hover .hub-minifan__cover:nth-child(2) {
  transform: translate(-50%, -50%) translate(0, -14px);
}

.hub-minifan--3:hover .hub-minifan__cover:nth-child(3) {
  transform: translate(-50%, -50%) translate(80px, 10px) rotate(14deg);
}

/* Wide desktop: fans grow ~20%, there is room to spare (user request).
   Hero grows with them so the size hierarchy stays intact. */
@media (min-width: 1201px) {
  .hub-fan__item {
    width: 196px;
  }

  .hub-minifan {
    width: 340px;
    height: 270px;
  }

  .hub-minifan::before {
    width: 360px;
    height: 312px;
  }

  .hub-minifan__cover {
    width: 175px;
  }

  .hub-minifan--2 .hub-minifan__cover:nth-child(1) {
    transform: translate(-50%, -50%) translate(-49px, -5px) rotate(-8deg);
  }

  .hub-minifan--2 .hub-minifan__cover:nth-child(2) {
    transform: translate(-50%, -50%) translate(49px, 10px) rotate(8deg);
  }

  .hub-minifan--2:hover .hub-minifan__cover:nth-child(1) {
    transform: translate(-50%, -50%) translate(-66px, -5px) rotate(-11deg);
  }

  .hub-minifan--2:hover .hub-minifan__cover:nth-child(2) {
    transform: translate(-50%, -50%) translate(66px, 10px) rotate(11deg);
  }

  .hub-minifan--3 .hub-minifan__cover {
    width: 166px;
  }

  .hub-minifan--3 .hub-minifan__cover:nth-child(1) {
    transform: translate(-50%, -50%) translate(-78px, 12px) rotate(-11deg);
  }

  .hub-minifan--3 .hub-minifan__cover:nth-child(3) {
    transform: translate(-50%, -50%) translate(78px, 12px) rotate(11deg);
  }

  .hub-minifan--3:hover .hub-minifan__cover:nth-child(1) {
    transform: translate(-50%, -50%) translate(-97px, 12px) rotate(-14deg);
  }

  .hub-minifan--3:hover .hub-minifan__cover:nth-child(3) {
    transform: translate(-50%, -50%) translate(97px, 12px) rotate(14deg);
  }
}

/* ─── Row body: name, niveau line, one paragraph, chips, action ─── */

.hub-product__body {
  min-width: 0;
  max-width: 560px;
}

.hub-product__label {
  display: block;
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hub-product__meta {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--p-deep);
}

.hub-product__badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 9999px;
  padding: 2px 10px;
  margin-top: var(--space-xs);
  width: fit-content;
  white-space: nowrap;
}

.hub-product__desc {
  color: var(--color-text-light);
  font-size: 0.97rem;
  line-height: 1.75;
  margin: var(--space-sm) 0 var(--space-md);
  max-width: 54ch;
}

.hub-product__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-md);
}

.hub-product__chip {
  display: inline-block;
  padding: 0.34rem 0.95rem;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--p-deep) 55%, transparent);
  color: var(--p-deep);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.hub-product__chip:hover {
  background: var(--p-deep);
  border-color: var(--p-deep);
  color: #ffffff;
  transform: translateY(-2px);
}

/* Primary row action: small outlined button, btn--outline-primary
   family but in the stream's deep accent */
.hub-product__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.4rem;
  border-radius: 6px;
  border: 2px solid var(--p-deep);
  color: var(--p-deep);
  font-size: 0.875rem;
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.hub-product__cta:hover {
  background: var(--p-deep);
  color: #ffffff;
  transform: translateY(-2px);
}

.hub-product__cta .hub-product__arrow {
  display: inline-block;
  transition: transform 0.25s ease;
}

.hub-product__cta:hover .hub-product__arrow {
  transform: translateX(3px);
}

/* Scroll reveal: js/hub.js adds .hub-reveal only when it runs AND
   prefers-reduced-motion is off, so content never starts hidden.
   Transform-only, no opacity: if JS fails the page is complete. */

.hub-reveal {
  transform: translateY(30px);
}

.hub-reveal.is-in {
  transform: translateY(0);
  transition: transform 0.7s var(--ease-out);
}


/* ─── TTO banner (boeken.php) / cross-banner (tto-boeken.php) ─── */

.hub-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
  padding: var(--space-lg);
  border-radius: 20px;
  background: var(--color-primary-light);
}

.hub-banner__text {
  max-width: 640px;
}

.hub-banner__text h2 {
  font-size: 1.4rem;
  font-weight: var(--fw-bold);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.hub-banner__text p {
  color: var(--color-text-light);
  line-height: 1.65;
  font-size: 0.95rem;
}

.hub-banner__text p strong {
  color: var(--color-text);
}

.hub-banner .btn--outline-primary {
  flex-shrink: 0;
}

/* Dark variant — the page's single dark accent */
.hub-banner--dark {
  background: #10393d;
}

.hub-banner--dark .hub-banner__text h2 {
  color: #ffffff;
}

.hub-banner--dark .hub-banner__text p {
  color: #c4d7d5;
}

.hub-banner--dark .hub-banner__text p strong {
  color: #8fd0c9;
}

.btn--outline-light {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.55rem 1.4rem;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.btn--outline-light:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #10393d;
  transform: translateY(-2px);
}


/* ─── CTA row (two buttons) ─── */

.hub-cta-row {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.btn--solid-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.6rem;
  border-radius: 6px;
  background: var(--color-primary);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn--solid-primary:hover {
  transform: translateY(-2px);
  filter: brightness(0.92);
}


/* ─── Responsive ─── */

@media (max-width: 1200px) {
  .hub-minifan {
    width: 240px;
    height: 200px;
  }

  .hub-minifan__cover {
    width: 126px;
  }

  .hub-minifan--3 .hub-minifan__cover {
    width: 118px;
  }

  .hub-minifan--3 .hub-minifan__cover:nth-child(1) {
    transform: translate(-50%, -50%) translate(-48px, 8px) rotate(-10deg);
  }

  .hub-minifan--3 .hub-minifan__cover:nth-child(3) {
    transform: translate(-50%, -50%) translate(48px, 8px) rotate(10deg);
  }
}

@media (max-width: 860px) {
  .hub-product,
  .hub-product:nth-of-type(even) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
    padding: var(--space-xl) 0;
  }

  .hub-product__art {
    justify-content: center;
  }

  /* Tight stack: rows stay short on mobile */
  .hub-minifan {
    width: 200px;
    height: 168px;
  }

  .hub-minifan::before {
    width: 220px;
    height: 190px;
  }

  .hub-minifan__cover,
  .hub-minifan--3 .hub-minifan__cover {
    width: 108px;
  }

  .hub-minifan--2 .hub-minifan__cover:nth-child(1) {
    transform: translate(-50%, -50%) translate(-14px, -3px) rotate(-5deg);
  }

  .hub-minifan--2 .hub-minifan__cover:nth-child(2) {
    transform: translate(-50%, -50%) translate(14px, 4px) rotate(5deg);
  }

  .hub-minifan--3 .hub-minifan__cover:nth-child(1) {
    transform: translate(-50%, -50%) translate(-24px, 6px) rotate(-6deg);
  }

  .hub-minifan--3 .hub-minifan__cover:nth-child(2) {
    transform: translate(-50%, -50%) translate(0, -6px);
  }

  .hub-minifan--3 .hub-minifan__cover:nth-child(3) {
    transform: translate(-50%, -50%) translate(24px, 6px) rotate(6deg);
  }

  .hub-product__body {
    max-width: none;
  }

  .hub-product__desc {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .hub-intro-section {
    padding: 3.5rem 0 2.5rem;
  }

  .hub-claim {
    font-size: 0.95rem;
  }

  .hub-fan {
    width: 280px;
    height: 340px;
  }

  .hub-fan__item {
    width: 140px;
  }

  .hub-banner {
    flex-direction: column;
    text-align: center;
    padding: var(--space-md);
  }

  .hub-banner__text {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-fan__cover,
  .hub-fan__item,
  .hub-mark--swipe {
    animation: none !important;
  }

  .hub-mark--swipe {
    background-size: 100% 100%;
  }

  .hub-reveal,
  .hub-reveal.is-in {
    transform: none !important;
    transition: none !important;
  }

  .hub-fan__item,
  .hub-minifan__cover,
  .hub-product__chip,
  .hub-product__cta,
  .hub-product__cta .hub-product__arrow {
    transition: none !important;
  }
}
