/* Scene order: Jobs → Projects → Events → Communities.
   student_landing.js now reads the order from the tabs; these rules cover what
   company_solutions.css still ties to the old order (Events → Projects → Jobs),
   and style the new Communities step, which shows the career-post belt. */

/* ---- Narrow screens: the services are listed in the new order. */
#solutions[data-company-solutions] :is([data-offer-detail="jobs"], #offer-panel-jobs) { --company-service: 10; }
#solutions[data-company-solutions] :is([data-offer-detail="projects"], #offer-panel-projects) { --company-service: 20; }
#solutions[data-company-solutions] :is([data-offer-detail="events"], #offer-panel-events) { --company-service: 30; }
#solutions[data-company-solutions] :is([data-offer-detail="communities"], #offer-panel-communities) { --company-service: 40; }
@media (max-width: 1023px) {
  /* The first service sits closer to the index above it. */
  #solutions[data-company-solutions] [data-offer-detail="events"] .landing-offer-detail-index { margin-top: 88px; }
  #solutions[data-company-solutions] [data-offer-detail="jobs"] .landing-offer-detail-index { margin-top: 32px; }
  #solutions[data-company-solutions] #offer-panel-communities { aspect-ratio: 4 / 5; max-height: 520px; }
}

@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  /* ---- Projects → Events: the film rises from the foot of the stage over
     the phone. It takes the right half, the footprint it keeps once active. */
  #solutions[data-company-solutions] #what-we-offer[data-company-event-entering="true"] #offer-panel-events {
    inset-inline: var(--company-project-bleed) 0;
    z-index: 30;
    /* The film's still shows until its player is ready. */
    background: #0b0c0f var(--offer-event-poster, none) center / cover no-repeat;
    box-shadow: 0 -32px 64px -32px rgb(17 19 24 / 45%);
    content-visibility: visible;
    opacity: 1;
    transform: translate3d(0, calc(100% * (1 - var(--company-event-entry, 0))), 0);
    transition: none;
    visibility: visible;
  }

  /* ---- Events → Communities: the leaving film uncovers Communities, not Projects. */
  #solutions[data-company-solutions] #what-we-offer[data-company-event-preview="true"][data-jobs-map-scene] #offer-panel-projects {
    opacity: 0; pointer-events: none; visibility: hidden;
  }
  #solutions[data-company-solutions] #what-we-offer[data-company-event-preview="true"] #offer-panel-communities {
    bottom: 0; top: auto; inset-inline: auto 0;
    width: calc(50vw + var(--company-project-bleed)); height: var(--company-media-height);
    z-index: 1;
    content-visibility: visible; opacity: 1; pointer-events: auto; visibility: visible;
    transform: translateY(calc(28px * (1 - var(--company-project-entry, 0)))) scale(calc(0.96 + 0.04 * var(--company-project-entry, 0)));
    transform-origin: calc(100% - 25vw) center;
    transition: none;
  }

  /* Communities keeps that footprint once active: the belt runs on a little
     under the copy, which stays above it. */
  #solutions[data-company-solutions] #what-we-offer[data-company-active-offer="communities"]:not([data-company-event-scene="true"]) [data-offer-stage] {
    margin-left: calc(-1 * var(--company-project-bleed)); width: calc(100% + var(--company-project-bleed));
  }
  #solutions[data-company-solutions] #what-we-offer[data-company-active-offer="communities"]:not([data-company-event-scene="true"]) .landing-offer-media-column {
    transform: translateY(calc(28px * (1 - var(--company-project-entry, 1)))) scale(calc(0.96 + 0.04 * var(--company-project-entry, 1)));
    transition: none;
  }
  #solutions[data-company-solutions] #what-we-offer[data-company-active-offer="communities"] :is(.landing-offer-detail-column, [data-offer-card-window]) {
    position: relative; z-index: 2;
    width: calc(100% - var(--company-project-bleed)); padding-right: var(--company-scene-gutter);
    opacity: var(--company-project-copy-entry, 1);
    transform: translateY(calc(16px * (1 - var(--company-project-copy-entry, 1))));
    transition: none;
  }
  #solutions[data-company-solutions] #what-we-offer[data-company-active-offer="communities"] #offer-panel-communities { transition: none; }
}
