/* Section styles: extras: "Za polaznike" benefit plates.
   Unlayered, so it overrides css/base.css. Every selector is scoped under [data-section="extras"]. */

/* ------------------------------------------------------------------ layout */
[data-section="extras"] .extras__layout { display: grid; gap: clamp(32px, 5vw, 88px); }
[data-section="extras"] .extras__viewer { display: none; }
@media (min-width: 1024px) {
  [data-section="extras"] .extras__layout { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  [data-section="extras"] .extras__viewer { display: block; position: sticky; top: calc(var(--nav-h) + 28px); }
  [data-section="extras"] .extras__main { padding-bottom: var(--extras-tail, 0px); }
  [data-section="extras"] .extra__media { display: none; }
}

/* ------------------------------------------------------------------ list + items */
[data-section="extras"] .extras__list { display: grid; gap: clamp(16px, 2vw, 20px); margin: 0; padding: 0; list-style: none; }
[data-section="extras"] .extra { position: relative; display: grid; min-width: 0; }

/* phones: photo on top, plate under it */
[data-section="extras"] .extra__media { --ar: 4 / 3; border-radius: var(--radius) var(--radius) 0 0; }
[data-section="extras"] .extra__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0) 55%, rgba(11, 11, 12, .55) 100%);
}
[data-section="extras"] .extra__media + .extra__plate { border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }

/* tablets: photo left, plate right */
@media (min-width: 640px) and (max-width: 1023.98px) {
  [data-section="extras"] .extra { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  [data-section="extras"] .extra__media { --ar: auto; aspect-ratio: auto; min-height: 100%; border-radius: var(--radius) 0 0 var(--radius); }
  [data-section="extras"] .extra__media + .extra__plate { border-top: 1px solid var(--line); border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; }
}
@media (min-width: 640px) and (max-width: 1023.98px) and (orientation: landscape) and (max-height: 520px) {
  [data-section="extras"] .extra { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}

/* ------------------------------------------------------------------ plate */
[data-section="extras"] .extra__plate {
  position: relative; display: grid; gap: 12px; align-content: start;
  padding: clamp(20px, 2.4vw, 32px);
  transition: background-color .45s var(--ease-out), border-color .45s var(--ease-out);
}
[data-section="extras"] .extra__plate::before {
  content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; background: var(--blood);
  transform: scaleY(0); transform-origin: 50% 0; transition: transform .6s var(--ease-out);
}
[data-section="extras"] .extra.is-active .extra__plate { background: var(--ink-2); border-color: var(--line-2); }
[data-section="extras"] .extra.is-active .extra__plate::before { transform: none; }
[data-section="extras"] .extra__plate > p { color: var(--mute); }
[data-section="extras"] .extra.is-active .extra__plate > p { color: var(--bone); }
[data-section="extras"] .extra__plate > h3 { transition: color .3s; }

[data-section="extras"] .extra__top { display: flex; align-items: center; gap: 18px; margin-bottom: 4px; }
[data-section="extras"] .extra__num { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; line-height: 1; }
[data-section="extras"] .extra__num::after {
  content: ""; flex: 1; height: 1px; background: var(--line-2);
  transform-origin: 0 50%; transition: transform .9s var(--ease-out), background-color .4s;
}
[data-section="extras"] .extra.is-active .extra__num::after { background: rgba(217, 28, 28, .6); }

/* line-draw icons: drawn by default (no JS); .extras.is-anim hides them until each plate is drawn */
[data-section="extras"] .extra__icon { flex: 0 0 auto; width: clamp(40px, 3.4vw, 48px); height: clamp(40px, 3.4vw, 48px); color: var(--bone); overflow: visible; }
[data-section="extras"] .extra__icon .ln {
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1 1.5; stroke-dashoffset: 0;   /* gap longer than the path: no zero-length dash (a round-cap dot) at the end */
}
[data-section="extras"] .extra__icon .ln--hot { stroke: var(--blood-hot); stroke-width: 1.9; }
[data-section="extras"].is-anim .extra:not(.is-drawn) .extra__icon .ln { stroke-dashoffset: 1; }
[data-section="extras"].is-anim .extra:not(.is-drawn) .extra__num::after { transform: scaleX(0); }
[data-section="extras"].is-anim .extra.is-drawn .extra__icon .ln { transition: stroke-dashoffset 1.3s var(--ease-out); }
[data-section="extras"].is-anim .extra.is-drawn .extra__icon .ln:nth-child(2) { transition-delay: .18s; }
[data-section="extras"].is-anim .extra.is-drawn .extra__icon .ln:nth-child(3) { transition-delay: .42s; transition-duration: .8s; }
/* activating a plate redraws its icon */
[data-section="extras"].is-anim .extra.is-drawn.is-active .extra__icon .ln { animation: extras-draw 1.1s var(--ease-out) both; }
[data-section="extras"].is-anim .extra.is-drawn.is-active .extra__icon .ln:nth-child(2) { animation-delay: .12s; }
[data-section="extras"].is-anim .extra.is-drawn.is-active .extra__icon .ln:nth-child(3) { animation-delay: .3s; animation-duration: .7s; }
@keyframes extras-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ------------------------------------------------------------------ desktop viewer */
[data-section="extras"] .extras__frame { overflow: hidden; border: 1px solid var(--line); background: var(--ink); }
[data-section="extras"] .extras__shot {
  z-index: 0; clip-path: inset(100% 0 0 0); transform: scale(1.08);
  transition: clip-path .9s var(--ease-in-out), transform 1.4s var(--ease-out);
}
[data-section="extras"] .extras__shot.is-prev { z-index: 1; clip-path: inset(0 0 0 0); transform: scale(1); transition: none; }
[data-section="extras"] .extras__shot.is-active { z-index: 2; clip-path: inset(0 0 0 0); transform: scale(1); }
[data-section="extras"] .extras__frame::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0) 62%, rgba(5, 5, 5, .7) 100%);
}
[data-section="extras"] .extras__scan {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; height: 2px; background: var(--blood-hot);
  box-shadow: 0 0 18px 2px rgba(255, 59, 48, .55); opacity: 0; pointer-events: none;
}
[data-section="extras"] .extras__scan.is-run { animation: extras-scan .9s var(--ease-in-out) both; }
@keyframes extras-scan {
  0% { transform: translateY(0); opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translateY(calc(-1 * var(--frame-h, 600px))); opacity: 0; }
}
[data-section="extras"] .extras__count {
  position: absolute; z-index: 5; left: clamp(16px, 1.6vw, 24px); bottom: clamp(12px, 1.4vw, 20px);
  font-family: var(--f-display); font-size: clamp(64px, 6vw, 96px); line-height: 1; color: transparent;
  -webkit-text-stroke: 1.5px rgba(237, 232, 223, .7);
}

/* ------------------------------------------------------------------ desktop hover */
@media (hover: hover) and (pointer: fine) {
  [data-section="extras"] .extra__plate { cursor: default; }
  [data-section="extras"] .extra.is-active h3 { color: var(--white); }
}

/* ------------------------------------------------------------------ reduced motion */
[data-motion="reduced"] [data-section="extras"] .extras__shot { transform: none; }
[data-motion="reduced"] [data-section="extras"] .extras__scan { display: none; }
