/* =========================
   HOME.CSS – CLEAN & STABLE
   ========================= */

/* ---- Variabler ---- */
:root{
  --heartbeat-speed: 1.6s;             /* snabbare/slöare puls */

  /* Guldpalett (kort) */
  --gold-100: #fff7cc;
  --gold-200: #ffe69a;
  --gold-300: #ffd766;
  --gold-400: #f5c243;
  --gold-border: #e6b94c;
  --gold-shadow: rgba(156,105,0,.22);

  /* Video */
  --video-w: 960px;                    /* ändra vid behov (t.ex. 1100px) */
  --video-aspect: 16/9;                /* byt vid behov (t.ex. 4/3) */
  --video-radius: 16px;                /* rundade hörn */
}

/* ---- Bas / layout ---- */
*{ box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: #ffa500;                 /* apelsinbakgrund */
  overflow-x: hidden;                   /* stoppa horisontell scroll */
}
body {
  background-image: none !important;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;                  /* säkrare höjd på mobil */
  overscroll-behavior-x: none;         /* förhindrar sidleds-drag */
  touch-action: pan-y;                  /* tillåt bara vertikal scroll */
}
main { flex: 1 0 auto; }               /* puttar footern till botten */

/* ---------- Hero ---------- */
.hero {
  position: relative;                  /* för glans-linjen */
  text-align: center;
  padding: clamp(2rem, 6vw, 4rem) 1rem;
  background: linear-gradient(90deg, #ff3b30 0%, #ff5e13 45%, #ff8c00 100%);
  color: #111;
  overflow-x: clip;                     /* klipp ev. glow i X-led */
  overflow-y: visible;
  contain: layout paint;                /* isolera layout/paint */
}
.hero h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: #000;
}

/* ---- Glansig “hjärtrytm”-linje under hero ---- */
.hero::after,
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, 94vw);
  pointer-events: none;
}
.hero::after {
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,.55) 25%,
      rgba(255,255,255,.98) 50%,
      rgba(255,255,255,.55) 75%,
      rgba(255,255,255,0) 100%);
  background-size: 220% 100%;
  will-change: transform, box-shadow, background-position, opacity;
  transform-origin: center;
  animation:
    heartbeat-scale var(--heartbeat-speed) cubic-bezier(.32,0,.3,1) infinite,
    heartbeat-sheen var(--heartbeat-speed) cubic-bezier(.32,0,.3,1) infinite;
  box-shadow:
    0 1px 10px rgba(255,255,255,.35),
    0 0 1px rgba(255,255,255,.85) inset;
}
.hero::before {
  bottom: -6px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(to bottom, rgba(255,255,255,.28), rgba(255,255,255,0));
  filter: blur(6px);
  opacity: .55;
  will-change: opacity, filter;
  animation: heartbeat-glow var(--heartbeat-speed) cubic-bezier(.32,0,.3,1) infinite;
}

@keyframes heartbeat-scale {
  0%, 70%, 100% { transform: translateX(-50%) scaleX(1) scaleY(1); opacity: 1; }
  8%  { transform: translateX(-50%) scaleX(1.14) scaleY(1.8); }
  12% { transform: translateX(-50%) scaleX(1.02) scaleY(1.2); }
  22% { transform: translateX(-50%) scaleX(1.08) scaleY(1.5); }
  28% { transform: translateX(-50%) scaleX(1.00) scaleY(1.0); }
}
@keyframes heartbeat-sheen {
  0%, 100% { background-position: 0% 0; }
  9%       { background-position: 100% 0; }
  23%      { background-position: 100% 0; }
  35%      { background-position: 0% 0; }
}
@keyframes heartbeat-glow {
  0%, 70%, 100% { opacity: .55; filter: blur(6px); }
  8%            { opacity: .9;  filter: blur(8px); }
  12%           { opacity: .65; filter: blur(6.5px); }
  22%           { opacity: .8;  filter: blur(7.5px); }
  28%           { opacity: .6;  filter: blur(6.2px); }
}

/* ---------- Intro-video (OVANFÖR korten) ---------- */
.intro-video{
  display: flex;
  flex-direction: column;              /* rubrik ovanför videon */
  align-items: center;
  gap: clamp(8px, 1.5vw, 14px);
  margin: clamp(12px, 3vw, 24px) auto 0;
  padding: 0 1rem;
}
.intro-video .intro-title{
  width: min(var(--video-w), 95vw);
  margin: 0 auto;
  text-align: center;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 800;
  line-height: 1.25;
  color: #000;
}
.intro-video .video-frame{
  width: min(var(--video-w), 95vw);
  aspect-ratio: var(--video-aspect);
  border-radius: var(--video-radius);
  overflow: hidden;                    /* klipp hörn */
  background: #000;                    /* letterbox bakom videon */
  border: none;
  box-shadow: none;
}
.intro-video .video-frame video{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;                 /* visa HELA videon */
  border-radius: inherit;
}

/* ---------- Rubrik ovanför korten ---------- */
.section-head,
.courses-head{                          /* stöd för båda klassnamnen */
  width: min(1100px, 92vw);
  margin: clamp(16px, 3vw, 28px) auto 0;
  text-align: center;
}
.section-head .section-title,
.courses-head .section-title{
  margin: 0 0 .35rem 0;
  font-size: clamp(1.25rem, 3.2vw, 2rem);
  font-weight: 900;
  color: #000;
}
.section-head .section-sub,
.courses-head .section-sub{
  margin: 0;
  font-size: clamp(.95rem, 2.2vw, 1.05rem);
  color: #222;
  opacity: .9;
  max-width: 70ch;                     /* snygg radlängd */
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Kurssektion ---------- */
.courses{
  width: min(1100px, 92vw);            /* tydligt centrerad container */
  margin: clamp(1rem, 4vw, 3rem) auto;
  padding: 0 0;                        /* container styr padding */
  display: grid;
  gap: clamp(1rem, 2vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ----- Glossy Gold Cards ----- */
.course-card{
  position: relative;
  color: #1a1a1a;
  border-radius: 12px;
  border: 1px solid var(--gold-border);
  box-shadow:
    0 6px 18px var(--gold-shadow),
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -1px 0 rgba(0,0,0,.06);
  text-align: center;
  padding: clamp(1rem, 3vw, 1.5rem) 1rem;
  background:
    radial-gradient(120% 60% at 50% -20%, rgba(255,255,255,.85) 0%, rgba(255,255,255,0) 60%),
    linear-gradient(180deg, var(--gold-100) 0%, var(--gold-200) 30%, var(--gold-300) 60%, var(--gold-400) 100%);
}
.course-card::after{
  content:"";
  position:absolute;
  left: 12px; right:12px; top:10px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(to bottom, rgba(255,255,255,.65), rgba(255,255,255,0));
  pointer-events: none;
  opacity: .7;
  filter: saturate(110%);
}
.course-card:hover{
  transform: translateY(-2px);
  box-shadow:
    0 10px 24px rgba(156,105,0,.28),
    inset 0 1px 0 rgba(255,255,255,.6),
    inset 0 -1px 0 rgba(0,0,0,.07);
}
.course-card h2{ color:#111; }
.course-card p { color:#222; }

/* ---- Bilder i kort (visa HELA motivet) ---- */
.course-card img{
  display: block;
  width: 100%;
  height: 180px;                       /* enhetlig höjd */
  object-fit: contain;                 /* ingen beskärning */
  background: transparent;
  border: 0;
  border-radius: 10px;
  margin-bottom: 0.9rem;
}

/* ---- CTA-knappar ---- */
.course-card .btn {
  display: inline-block;
  padding: 0.9rem 1.6rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  color: #ffffff;                      /* vit text */
  background-color: #ff9800;           /* gul/orange */
  transition: background .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 2px 0 rgba(0,0,0,.06);
}
.course-card .btn:hover {
  background-color: #e67c00;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(0,0,0,.18);
}
.course-card .btn:focus-visible {
  outline: 3px solid #e67c00;
  outline-offset: 2px;
}
.course-card .btn.disabled {
  background-color: #ffbd66;
  color: #ffffff;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ---------- Footer (sticky längst ner) ---------- */
.site-footer{
  position: relative;
  margin-top: auto;
  text-align: center;
  padding: clamp(1rem, 2.5vw, 1.5rem) 1rem;
  background: linear-gradient(90deg, #ff3b30 0%, #ff5e13 45%, #ff8c00 100%);
  color: #111;
  z-index: 1;
  overflow-x: clip;                     /* klipp glow i X-led */
  overflow-y: visible;
  contain: layout paint;
}
.site-footer p{
  margin: 0;
  font-size: clamp(0.92rem, 2vw, 1rem);
  font-weight: 600;
}
.site-footer::before{
  content:"";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -1px;
  width: min(1200px, 94vw);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.6) 10%,
    rgba(255,255,255,.95) 50%,
    rgba(255,255,255,.6) 90%,
    rgba(255,255,255,0) 100%
  );
  box-shadow:
    0 1px 10px rgba(255,255,255,.35),
    0 0 1px rgba(255,255,255,.85) inset;
  pointer-events: none;
  z-index: 1;
  will-change: transform, box-shadow;
  animation: footer-heartbeat-scale var(--heartbeat-speed) cubic-bezier(.32,0,.3,1) infinite;
}
.site-footer::after{
  content:"";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -10px;
  width: min(1200px, 94vw);
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(to top, rgba(255,255,255,.28), rgba(255,255,255,0));
  filter: blur(6px);
  opacity: .5;
  pointer-events: none;
  z-index: 0;
}
@keyframes footer-heartbeat-scale {
  0%, 70%, 100% { transform: translateX(-50%) scaleX(1); }
  8%  { transform: translateX(-50%) scaleX(1.14); }
  12% { transform: translateX(-50%) scaleX(1.02); }
  22% { transform: translateX(-50%) scaleX(1.08); }
  28% { transform: translateX(-50%) scaleX(1.00); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .course-card .btn { transition: none; }
  .hero::after, .hero::before,
  .site-footer::before { animation: none; }
}