/* S.I.F. Skydning – Ungdomsafdelingen: "Bag skytten".
   Siden læses af forælderen først (hero, træning og udstyr), så skifter den til den unge
   (scenen ned ad banen, "Hold vejret", træning og stævner) og ender i prøveskydning.
   Samme verden som Træningstider og Prøveskydning: mørk havblå flade, havblå accent,
   signalrød kun til træffet. Kort og afslutning kommer fra proeveskydning-remake.css.
   Bevægelse ligger i assets/js/ungdom.js; alt indhold står synligt uden script og med reduceret bevægelse. */

.un-page {
  --un-dark: var(--dark);
  --un-dark-2: var(--dark-2);
  --un-on-dark: var(--tekst-moerk);
  --un-on-dark-2: var(--tekst-moerk-2);
  --un-line: var(--linje-moerk);
  --un-blue-light: var(--havblaa-lys);
  --un-r: 28px;
  --radius-sm: 20px; --ease-out: var(--ease);
  /* Skiverækkens midte i bas.jpg (målt på billedet) */
  --un-maal-x: 55.3%; --un-maal-y: 42.7%;
}
.un-page ::selection { background: var(--accent); color: #fff; }

/* ---------- 1. Hero: bag båsen, hvor forælderen står ---------- */
.un-hero {
  position: relative; min-height: 100svh; overflow: hidden; isolation: isolate;
  display: flex; align-items: flex-end;
  background: var(--un-dark); color: var(--un-on-dark);
  padding: 120px 0 clamp(40px, 7vh, 80px);
}
.un-hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--dark) url(../img/ungdom/bas-480.jpg) 50% 42% / cover no-repeat; } /* lille forhåndsvisning, mens det skarpe billede hentes */
.un-hero-bg img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%;
  transform-origin: var(--un-maal-x) var(--un-maal-y);
}
.un-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(19, 38, 45, 0.94) 0%, rgba(19, 38, 45, 0.72) 30%, rgba(19, 38, 45, 0.12) 62%, rgba(19, 38, 45, 0.3) 100%),
    rgba(19, 38, 45, 0.16);
}
.un-hero-in { max-width: var(--max); }
.un-hero h1 {
  color: #fff; font-size: clamp(34px, 9.6vw, 116px); line-height: 0.95; letter-spacing: -0.045em;
}
.un-hero .indledning { color: var(--un-on-dark-2); margin-top: 22px; max-width: 40em; }
.un-hero .handlinger { margin-top: 28px; }
.un-hero .mere { color: #fff; }
.un-knap-moerk { background: rgba(19, 38, 45, 0.6); color: #fff; border-color: rgba(255, 255, 255, 0.28); }
@media (hover: hover) { .un-knap-moerk:hover { background: rgba(19, 38, 45, 0.85); } }

.un-fakta {
  list-style: none; padding: 0; margin: clamp(28px, 4vh, 44px) 0 0;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.un-fakta li {
  display: flex; align-items: baseline; gap: 10px; margin: 0;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--un-line);
  background: rgba(19, 38, 45, 0.55); font-size: 15px; color: var(--un-on-dark-2);
}
.un-fakta strong { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .un-hero { padding-top: 104px; padding-bottom: 112px; } /* fri af mobilens dock nederst */
  .un-hero-bg { background-position: 30% 40%; }
  .un-hero-bg img { object-position: 30% 40%; }
  .un-scrim {
    background:
      linear-gradient(to top, rgba(19, 38, 45, 0.96) 0%, rgba(19, 38, 45, 0.88) 55%, rgba(19, 38, 45, 0.66) 82%, rgba(19, 38, 45, 0.5) 100%);
  }
  .un-fakta li { font-size: 14px; padding: 8px 13px; flex-wrap: wrap; row-gap: 0; }
}

/* ---------- 2. Træning og udstyr: tryghed for forælderen ---------- */
.un-delt { display: grid; gap: clamp(40px, 6vw, 96px); align-items: center; }
@media (min-width: 900px) { .un-delt { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.un-tekst .indledning { margin-top: 20px; }
.un-broed { margin-top: 24px; color: var(--ink-2); max-width: 36em; }
.un-discipliner { list-style: none; padding: 0; margin: 22px 0 6px; display: grid; gap: 8px; }
.un-discipliner li {
  display: flex; align-items: center; gap: 14px; margin: 0;
  font-size: clamp(22px, 2.4vw, 30px); font-weight: 650; letter-spacing: -0.02em; color: var(--ink); line-height: 1.2;
}
.un-discipliner li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex: none; }

.un-foto { margin: 0; position: relative; border-radius: var(--un-r); overflow: hidden; aspect-ratio: 1; background: var(--accent-soft); }
.un-foto img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
/* Dækket, der trækkes væk, når billedet ruller ind (som Prøveskydnings .pv-wipe) */
.js .un-foto::after {
  content: ""; position: absolute; inset: 0; background: var(--bg); transform-origin: 50% 0;
  transition: transform 1.1s var(--ease);
}
.js .un-foto.is-in::after { transform: scaleY(0); }
.rv-safe .un-foto::after { display: none; }

/* ---------- 3. Scenen: kameraet kører ned ad banen ---------- */
.un-scene { position: relative; background: var(--un-dark); color: #fff; overflow: clip; } /* clip (ikke hidden), så sticky virker */
.un-scene-stage { position: relative; }
.un-scene-kort {
  position: relative; margin: 0; overflow: hidden;
  aspect-ratio: 16 / 9; max-height: 100svh; width: 100%;
}
.un-scene-kort img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%;
  transform-origin: var(--un-mx, var(--un-maal-x)) var(--un-my, var(--un-maal-y));
}
.un-scene-scrim { position: absolute; inset: 0; background: var(--un-dark); opacity: 0.45; }
/* Slør under ordene, så de kan læses på den lyse bås-væg */
.un-scene-kort::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(19, 38, 45, 0.82) 0%, rgba(19, 38, 45, 0.55) 30%, rgba(19, 38, 45, 0) 55%);
}
.un-ringe {
  position: absolute; left: var(--un-rx, var(--un-mx, var(--un-maal-x))); top: var(--un-my, var(--un-maal-y));
  width: min(70vh, 62vw); height: auto; aspect-ratio: 1; translate: -50% -50%;
  color: rgba(237, 242, 243, 0.7); overflow: visible; pointer-events: none;
}
/* "1 2": ved offset 1 er hele ringen i et hul (ingen løse prikker); ved 0 er den tegnet helt */
.un-ringe circle[pathLength] { stroke-dasharray: 1 2; stroke-dashoffset: 0; }
.un-ringe-midte { fill: none; stroke: #fff; stroke-width: 1.2; }
.un-ringe-traef { fill: var(--signal); }
.un-ord {
  position: absolute; left: 50%; bottom: clamp(32px, 9vh, 96px); translate: -50% 0; z-index: 2;
  width: min(100% - 2 * var(--gutter), 42ch); margin: 0; text-align: center;
  font-size: clamp(24px, 3.6vw, 52px); font-weight: 650; line-height: 1.04; letter-spacing: -0.035em; color: #fff;
  text-wrap: balance;
}
.un-ord span { display: inline-block; }

/* Låst scene (sættes af ungdom.js, når bevægelse er tilladt): sektionen er højere end skærmen, og scenen
   står fast (sticky) med almindelig scroll, mens billedet åbner fra et kort og kameraet kører ind */
.un-scene.is-laast { height: 260svh; }
.un-scene.is-laast .un-scene-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.un-scene.is-laast .un-scene-kort { position: absolute; inset: 0; aspect-ratio: auto; max-height: none; height: 100%; }
.un-scene.is-laast .un-ord { bottom: auto; top: 66%; }
@media (max-width: 899px) { .un-scene.is-laast { height: 240svh; } .un-scene.is-laast .un-ord { top: auto; bottom: 120px; } }

@media (max-width: 899px) {
  .un-scene-kort { aspect-ratio: 4 / 5; }
  .un-scene-kort img { object-position: 34% 42%; }
  .un-ringe { width: 92vw; }
  .un-ord { font-size: 24px; }
}

/* ---------- 4. Hold vejret ---------- */
.un-sigte { overflow: hidden; }
.un-delt--sigte { align-items: center; }
.un-sigte .indledning { max-width: 30ch; }
.un-skive-felt { position: relative; width: min(100%, 560px); justify-self: center; }
.un-skive { width: 100%; height: auto; aspect-ratio: 1; overflow: visible; touch-action: none; }
.un-skive-flade { fill: #f1f2ee; }
.un-skive-sort { fill: #1a2328; }
.un-skive-ringe circle { stroke: rgba(26, 35, 40, 0.55); }
.un-skive-ringe circle:nth-child(-n+6) { stroke: rgba(241, 242, 238, 0.5); }
.un-skive-ti { fill: rgba(241, 242, 238, 0.85); }
@keyframes un-ramt { 0% { transform: scale(3); opacity: 0; } 60% { transform: scale(0.85); opacity: 1; } 100% { transform: scale(1); } }


@media (max-width: 899px) {
  .un-broed, .un-sigte .indledning { max-width: none; }
  .un-skive-felt { width: min(100%, 420px); order: -1; }
    }

/* ---------- 5. Kortene ---------- */
.pv-grid.un-kort { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: clamp(14px, 1.6vw, 22px); }
.un-kort .pv-card { display: flex; flex-direction: column; gap: 12px; min-height: 260px; }
.un-kort .pv-card h3 { font-size: clamp(22px, 2vw, 28px); }
.un-kort .pv-card .mere { color: #fff; margin-top: auto; padding-top: 8px; }
.un-kort .pv-card { overflow: clip; } /* klasket bliver inde i kortet */

/* Klask: træffet i øverste højre hjørne, når kortet lander (ungdom.js sætter left/top) */
.pv-card > .un-klask { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 3; }
.un-klask > span { position: absolute; left: 0; top: 0; }
.un-klask-kerne {
  width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--signal);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
  animation: un-kerne 1.05s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.un-klask-ring {
  width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 3px solid #fff;
  animation: un-ring 0.6s var(--ease) both;
}
.un-klask-ring--2 { border-color: var(--signal); border-width: 2px; animation-duration: 0.85s; animation-delay: 0.05s; }
.un-klask-gnist {
  width: 3px; height: 16px; margin: -8px 0 0 -1.5px; border-radius: 2px; background: #fff;
  transform: rotate(var(--a)) translateY(-10px) scaleY(0.4); opacity: 0;
  animation: un-gnist 0.45s cubic-bezier(0.1, 0.8, 0.3, 1) both;
}
@keyframes un-kerne { 0% { transform: scale(2.6); opacity: 0; } 12% { transform: scale(0.8); opacity: 1; } 30% { transform: scale(1.1); } 45% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.9); opacity: 0; } }
@keyframes un-ring { 0% { transform: scale(0.2); opacity: 1; } 100% { transform: scale(4.2); opacity: 0; } }
@keyframes un-gnist {
  0% { transform: rotate(var(--a)) translateY(-10px) scaleY(0.4); opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(-46px) scaleY(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .un-klask { display: none; } }

@media (max-width: 899px) { .pv-grid.un-kort { grid-template-columns: 1fr !important; } .un-kort .pv-card { min-height: 0; } }

/* Afslutningsknappen: synlig fra start; ungdom.js giver den popper-effekten (Prøveskydnings .is-pop) */
.js .un-page .pv-cta-btn:not(.is-pop) { opacity: 1; scale: 1; }
.js .un-page .pv-cta-btn.un-klar:not(.is-pop) { opacity: 0; scale: 0.6; }

@media (prefers-reduced-motion: reduce) {
  .js .un-foto::after { display: none; }
    }
