/*
 * sharie.ch – Werdegang ("Über mich"), works together with werdegang.js
 */

/* Entries closed on mobile */
.cv-track > [hidden] { display: none !important; }
.cv-more[hidden] { display: none !important; }
/* gap to the slider = space-xs (the section itself has a gap of space-l, so pull it up by the difference) */
.cv-more { margin-top: calc(var(--space-xs, 8px) - var(--space-l, 48px)); }

/* ---- Slider (≥ 768px) ---- */
.cv-slider .cv-viewport {
  width: 100% !important; max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.cv-slider .cv-viewport::-webkit-scrollbar { display: none; }
.cv-slider .cv-item { scroll-snap-align: start; }

/* Desktop: 3 cards side by side, tablet: 2 */
.cv-slider .cv-track { gap: 32px !important; }
.cv-slider .cv-item { flex: 0 0 calc((var(--cv-view, 1200px) - 64px) / 3) !important; width: auto !important; max-width: none !important; }
@media (max-width: 1024px) {
  .cv-slider .cv-item { flex-basis: calc((var(--cv-view, 900px) - 32px) / 2) !important; }
}

/* Arrows top right, next to the title: white, turquoise on hover */
.cv-head { position: relative; }
.cv-nav { display: none; }
.cv-slider .cv-nav { display: flex; gap: 12px; position: absolute; right: 0; bottom: 0; }
.cv-slider .cv-nav[hidden] { display: none; }
.cv-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0;
  border: 1px solid #FFFFFF; border-radius: 50%;
  background: transparent !important; color: #FFFFFF !important;
  cursor: pointer; transition: all 300ms ease;
}
.cv-arrow:hover:not(:disabled),
.cv-arrow:focus-visible { border-color: #7CF2D4; color: #7CF2D4 !important; background: transparent !important; }
.cv-arrow:focus-visible { outline: 2px solid #7CF2D4; outline-offset: 3px; }
.cv-arrow:active { background: transparent !important; }
.cv-arrow:disabled { opacity: 0.3; cursor: default; }

/* Timeline below the cards: each card carries its piece of the line (point in the middle).
   The whole line changes colour while sliding (colour set by werdegang.js). */
.cv-track { --cv-line-color: #7CF2D4; }
.cv-line-mark { display: none; }
.cv-slider .cv-track { padding-bottom: 116px; }
.cv-slider .cv-item { overflow: visible !important; }
.cv-slider .cv-line-mark {
  display: block; position: absolute; pointer-events: none;
  top: calc(100% + 40px); left: -17px; right: -17px; height: 60px;   /* half the gap + 1px overlap */
}
.cv-slider .cv-item:first-child .cv-line-mark { left: 0; }
.cv-slider .cv-item:last-child .cv-line-mark { right: 0; }
.cv-line-mark::before {
  content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 2px;
  background: var(--cv-line-color); transition: background-color 400ms ease;
}
.cv-line-dot {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--cv-line-color); transition: background-color 400ms ease;
}
.cv-slider .cv-item:first-child .cv-line-dot { left: calc(50% - 8.5px); }
.cv-slider .cv-item:last-child .cv-line-dot { left: calc(50% + 8.5px); }
.cv-line-year {
  position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
  font-size: 1.125rem; font-weight: 600; letter-spacing: 0.06em; white-space: nowrap;
  color: var(--cv-line-color); transition: color 400ms ease;
}
.cv-slider .cv-item:first-child .cv-line-year { left: calc(50% - 8.5px); }
.cv-slider .cv-item:last-child .cv-line-year { left: calc(50% + 8.5px); }
/* the years are on the line, so not repeated in the cards */
.cv-slider .cv-item .step-number { display: none; }

/* The logo is the link; the whole card opens it too (werdegang.js, class cv-has-link).
   Hover: a turquoise copy of the logo fades in over the white logo. */
.cv-has-link { cursor: pointer; }
.cv-item > a.e-image-link-base { display: block; position: relative; width: fit-content; max-width: 100%; margin-inline: auto; }   /* logo centred */
.cv-item > img.cv-logo { margin-inline: auto; }   /* logo without link (face) */
.cv-item > a.e-image-link-base > img { display: block; }
.cv-logo-tint {
  position: absolute; top: 0; left: 0; right: 0; height: 84px; pointer-events: none;   /* = logo height (class cv-logo) */
  background-color: #7CF2D4;
  -webkit-mask: var(--cv-logo) center center / contain no-repeat;
          mask: var(--cv-logo) center center / contain no-repeat;
  opacity: 0; transition: opacity 300ms ease;
}
.cv-has-link:hover .cv-logo-tint,
.cv-item a:focus-visible .cv-logo-tint { opacity: 1; }
.cv-item a:focus-visible { outline: 2px solid #7CF2D4; outline-offset: 4px; border-radius: 4px; }

/* "Fakten über mich": title turns turquoise on hover (border via class fact-card) */
.fact-card .fact-value { transition: color 300ms ease; }
.fact-card:hover .fact-value { color: #7CF2D4; }

/* ---- Mobile (≤ 767px): timeline on the left, newest at the top ----
   werdegang.js draws the line + dots (.cv-vline) and sets .cv-active on the
   entries whose year has passed one third of the screen height. */
.cv-vline { display: none; }
@media (max-width: 767px) {
  .elementor .cv-track { flex-direction: column !important; padding-inline-start: 34px !important; }
  .cv-viewport { position: relative; }
  .cv-vline { display: block; position: absolute; inset: 0 auto 0 0; width: 18px; pointer-events: none; }
  .cv-vline-base,
  .cv-vline-fill { position: absolute; left: 8px; width: 2px; border-radius: 2px; }
  .cv-vline-base { background: rgba(255, 255, 255, 0.18); }
  .cv-vline-fill { background: #7CF2D4; height: 0; }
  .cv-vdot {
    position: absolute; left: 3px; width: 12px; height: 12px; margin-top: -6px;
    border-radius: 50%; background: #2A0D35; border: 2px solid rgba(255, 255, 255, 0.35);
    box-sizing: border-box; transition: all 300ms;
  }
  .cv-vdot.is-active { background: #7CF2D4; border-color: #7CF2D4; }
  .cv-vdot[hidden] { display: none; }

  /* year: white text → turquoise when reached (no box) */
  .cv-track .cv-item .step-number { color: #FFFFFF; transition: all 300ms; }
  .cv-track .cv-item.cv-active .step-number { color: #7CF2D4; }

  /* "Mehr anzeigen": older entries slide in from below one after another */
  .cv-item.cv-reveal { animation: cv-reveal 500ms ease both; }

  /* no logo hover / turquoise logo on mobile */
  .cv-logo-tint { display: none !important; }
}
@keyframes cv-reveal {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cv-item.cv-reveal { animation: none; }
}

/* ---- Werdegang as component "Werdegang Station" (2347) ----
   Components can't carry a width per instance, so each logo gets its width
   here, by file name. New logo: add a line (otherwise it uses the default). */
.cv-item img.cv-logo { width: 160px; }
.cv-item img.cv-logo[src*="logo-zhdk"]           { width: 185px; }
.cv-item img.cv-logo[src*="logo-fruitjuicer"]    { width: 270px; }
.cv-item img.cv-logo[src*="logo-speech-academy"] { width: 116px; }
.cv-item img.cv-logo[src*="logo-prioma"]         { width: 170px; }
.cv-item img.cv-logo[src*="logo-ucc"]            { width: 104px; }
.cv-item img.cv-logo[src*="logo-fhgr"]           { width: 250px; }
.cv-item img.cv-logo[src*="logo-kinochur"]       { width: 240px; }
.cv-item img.cv-logo[src*="logo-face"]           { width: 120px; }
.cv-item img.cv-logo[src*="logo-bernina"]        { width: 250px; }
/* empty "Beschreibung" field: no empty line */
.cv-item .text-small:empty { display: none; }

/* ---- "Fakten über mich" icons (component "Fakt Karte" 2344, class fact-icon) ----
   Line icons in orange; hover (mobile: card in the middle of the screen) →
   turquoise, the lines draw themselves again and the icon lifts a little. */
.fact-icon svg,
.fact-icon svg * { fill: none !important; }
.fact-card .fact-icon { transition: color 300ms ease, transform 300ms ease; }
.fact-card:hover .fact-icon,
.fact-card.is-active .fact-icon { color: #7CF2D4; transform: translate3d(0, -3px, 0); }
/* like the format cards on Digital Storytelling: border + title turquoise (mobile: card in the middle of the screen) */
.fact-card.is-active { border-color: #7CF2D4 !important; }
.fact-card .fact-value { transition: color 300ms ease; }
.fact-card:hover .fact-value,
.fact-card.is-active .fact-value { color: #7CF2D4 !important; }
.fact-icon svg * { stroke-dasharray: 1 1.02; stroke-dashoffset: 0; }
.fact-card:hover .fact-icon svg *,
.fact-card.is-active .fact-icon svg * { animation: fact-draw 1100ms cubic-bezier(.45, 0, .2, 1) both; }
@keyframes fact-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .fact-card:hover .fact-icon svg *,
  .fact-card.is-active .fact-icon svg * { animation: none; }
  .fact-card .fact-icon { transform: none !important; }
}
