/* =====================================================================
   Kristenstart – ljust, varmt tema inspirerat av ungdomskanon.se
   WCAG 2.1 AA. Ren HTML/CSS/JS. Byggd för statiskt webbhotell.
   ===================================================================== */

/* ---------- Design-tokens ---------- */
:root {
  --bg:        #ffffff;   /* rent, ljust */
  --surface:   #ffffff;
  --surface-2: #eef4fc;   /* luftig ljusblå yta */
  --ink:       #16202b;
  --ink-soft:  #38434f;
  --muted:     #55606c;   /* AA mot bg */
  --border:    #e7eef8;
  --border-2:  #d3e1f1;

  --accent:      #1668c0; /* blå – AA-säker mot vit text */
  --accent-ink:  #0f4f97; /* för text på ljust */
  --accent-soft: #dcebfb; /* frisk ljusblå */
  --accent-bright:#4aa3f0;/* dekorativ, ljus */
  --sky:         #38a0e6; /* ljusare azur (dekor/stor text) */
  --sky-soft:    #e5f2fd;
  --gold:        #c2700f; /* varm accent för värme (AA som text) */
  --gold-soft:   #fdefd6;

  --focus: #0b3ea8;

  --radius:    18px;
  --radius-sm: 12px;
  --radius-lg: 26px;

  --shadow-sm: 0 1px 2px rgba(31,36,32,.06), 0 1px 3px rgba(31,36,32,.05);
  --shadow-md: 0 6px 20px rgba(31,36,32,.08);
  --shadow-lg: 0 18px 48px rgba(31,36,32,.12);

  --maxw: 1120px;
  --gap: clamp(1rem, 2.5vw, 2rem);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Poppins", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

/* ---------- Layout helpers ---------- */
.container { width: min(var(--maxw), 100% - 2.5rem); margin-inline: auto; }
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--tint { background: var(--surface-2); }
.section__eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; font-size: .78rem; color: var(--accent-ink);
  background: var(--accent-soft); padding: .35rem .8rem; border-radius: 999px;
  margin-bottom: 1rem;
}
.section__lead { color: var(--muted); font-size: 1.1rem; max-width: 62ch; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.18; color: var(--ink); letter-spacing: -0.005em; }
h1 { font-size: clamp(2.3rem, 1.6rem + 3.4vw, 4rem); }
h2 { font-size: clamp(1.7rem, 1.2rem + 1.9vw, 2.7rem); }
h3 { font-size: clamp(1.2rem, 1rem + 0.7vw, 1.5rem); }
p + p { margin-top: 1rem; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 10px;
  transition: top .18s ease; font-weight: 600;
}
.skip-link:focus { top: 1rem; color: #fff; }

/* ---------- Focus visibility (WCAG 2.4.7) ---------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .7rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-head); font-weight: 600; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand img, .brand svg { width: 34px; height: 34px; }
.nav__links { display: flex; align-items: center; gap: .35rem; list-style: none; padding: 0; }
.nav__links a {
  display: inline-block; padding: .5rem .85rem; border-radius: 10px;
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .98rem;
}
.nav__links a:hover, .nav__links a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.nav__toggle {
  display: none; background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 10px; padding: .5rem .7rem; cursor: pointer; color: var(--ink);
  font: inherit; font-weight: 600; align-items: center; gap: .5rem;
}
.nav__toggle svg { width: 20px; height: 20px; }

@media (max-width: 720px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute; inset: 100% 0 auto 0; flex-direction: column; align-items: stretch;
    gap: .2rem; background: var(--surface); border-bottom: 1px solid var(--border);
    padding: .6rem 1.25rem 1rem; box-shadow: var(--shadow-md);
  }
  .nav__links[hidden] { display: none; }
  .nav__links a { padding: .8rem .6rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 700; font-size: 1rem; padding: .85rem 1.5rem; border-radius: 999px;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: transform .12s ease, background .18s ease, box-shadow .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-ink); color: #fff; box-shadow: var(--shadow-md); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--border-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--gold { background: var(--gold); color: #fff; }
.btn--gold:hover { background: #9c6122; color: #fff; }
.btn--sm { padding: .55rem 1rem; font-size: .92rem; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(3rem, 8vw, 6rem); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(55rem 28rem at 82% -12%, var(--accent-soft), transparent 62%),
    radial-gradient(48rem 24rem at 100% 30%, var(--sky-soft), transparent 60%),
    radial-gradient(50rem 26rem at -5% 8%, var(--gold-soft), transparent 58%);
}
.hero__inner { max-width: 46rem; }
.hero h1 { margin-top: .8rem; }
.hero p.lead { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); color: var(--ink-soft); margin-top: 1.2rem; max-width: 40ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

/* ---------- Steps overview grid ---------- */
.steps-nav {
  margin-top: 3rem; display: grid; gap: 1rem;
  grid-template-columns: 1fr; max-width: 60rem; margin-inline: auto;
}
@media (min-width: 560px) { .steps-nav { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .steps-nav { grid-template-columns: repeat(3, 1fr); } }
.step-card {
  display: flex; flex-direction: column; gap: .35rem; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.35rem 1.25rem; box-shadow: var(--shadow-sm); color: var(--ink); text-align: center;
  align-items: center;
  transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease;
}
.step-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-2); color: var(--ink); }
.step-card__num {
  font-family: var(--font-head); font-size: .82rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent-ink);
}
.step-card__title { font-family: var(--font-head); font-size: 1.18rem; font-weight: 600; }
.step-card__desc { color: var(--muted); font-size: .95rem; }

/* ---------- Generic cards / grids ---------- */
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease;
}
.card--link { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-2); color: var(--ink); }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--ink-soft); }
.card__meta { color: var(--muted); font-size: .92rem; }
.card__cta { margin-top: auto; padding-top: .9rem; color: var(--accent-ink); font-weight: 700; }
.card__cta::after { content: " →"; }

/* Step section wrapper */
.step { scroll-margin-top: 84px; }
.step__head { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.8rem; }

/* ---------- Denomination (samfund) cards ---------- */
.samfund-grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; max-width: 68rem; margin-inline: auto; }
@media (min-width: 560px) { .samfund-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .samfund-grid { grid-template-columns: repeat(3, 1fr); } }
.samfund {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease;
}
.samfund:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-2); color: var(--ink); }
.samfund__logo {
  aspect-ratio: 16 / 9; display: grid; place-items: center;
  background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 1.2rem;
}
.samfund__logo img { max-height: 92px; width: auto; object-fit: contain; }
.samfund__body { padding: 1.15rem 1.25rem 1.35rem; display: flex; flex-direction: column; gap: .35rem; }
.samfund__name { font-family: var(--font-head); font-size: 1.2rem; font-weight: 600; }
.samfund__desc { color: var(--muted); font-size: .95rem; }
.samfund__cta { margin-top: .5rem; color: var(--accent-ink); font-weight: 700; }
.samfund__cta::after { content: " →"; }

/* ---------- Video ---------- */
.video-wrap { position: relative; }
.video-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-list { list-style: none; padding: 0; display: grid; gap: .8rem; margin-top: 1.4rem; }
.video-list li { display: flex; gap: .7rem; align-items: flex-start; color: var(--ink-soft); }
.video-list svg { flex: none; width: 22px; height: 22px; color: var(--accent); margin-top: .2rem; }

/* ---------- Bible / prayer ---------- */
.split { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.plan-list { list-style: none; padding: 0; display: grid; gap: .8rem; }
.plan-list a {
  display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .9rem 1rem; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .18s ease;
}
.plan-list a:hover { transform: translateX(3px); box-shadow: var(--shadow-md); color: var(--ink); }
.plan-badge {
  flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: .85rem; text-align: center; line-height: 1.05;
}
.plan-list strong { display: block; }
.plan-list span.muted { color: var(--muted); font-size: .92rem; }

.prayer-steps { counter-reset: pr; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.prayer-step { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem 1.35rem 1.35rem; box-shadow: var(--shadow-sm); }
.prayer-step::before {
  counter-increment: pr; content: counter(pr);
  position: absolute; top: -.9rem; left: 1.2rem;
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--gold); color: #fff; font-family: var(--font-head); font-weight: 700; box-shadow: var(--shadow-sm);
}
.prayer-step h3 { margin-top: .6rem; }

/* ---------- Resource explorer (Gräv djupare) ---------- */
.explorer__controls { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search-field input {
  width: 100%; font: inherit; padding: .9rem 1rem .9rem 2.8rem; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--ink);
}
.search-field input::placeholder { color: var(--muted); }
.filter-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filter-label { font-weight: 700; font-size: .9rem; color: var(--muted); margin-right: .25rem; }
.chip {
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
  padding: .45rem .95rem; border-radius: 999px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--ink-soft); transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.explorer__count { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }

.resource-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.resource {
  display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease;
}
.resource:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-2); color: var(--ink); }
.resource__top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.resource__name { font-family: var(--font-head); font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.resource__ext { flex: none; width: 18px; height: 18px; color: var(--muted); margin-top: .25rem; }
.resource__tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag {
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  padding: .2rem .55rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink);
}
.tag--lang { background: var(--gold-soft); color: var(--gold); }
.resource__desc { color: var(--ink-soft); font-size: .95rem; }
.resource__empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

/* ---------- Support / CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-ink) 100%);
  color: #fff; border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3.4rem);
  box-shadow: var(--shadow-lg); text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.9); max-width: 52ch; margin-inline: auto; margin-top: .8rem; }
.cta-band .btn { margin-top: 1.6rem; }
.cta-band .btn--ghost { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.5); color: #fff; }
.cta-band .btn--ghost:hover { background: rgba(255,255,255,.24); color: #fff; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: .8rem; max-width: 60rem; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .3rem 1.25rem; box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer; font-family: var(--font-head); font-weight: 600; font-size: 1.1rem;
  padding: .95rem 0; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-body); font-size: 1.5rem; color: var(--accent); line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq p { color: var(--ink-soft); padding: .9rem 0 1.1rem; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1.1rem; max-width: 34rem; }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 700; font-size: .95rem; }
.field .hint { color: var(--muted); font-weight: 400; font-size: .85rem; }
.field input, .field textarea {
  font: inherit; width: 100%; padding: .8rem .95rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--surface); color: var(--ink);
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { min-height: 8rem; resize: vertical; }
.field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status { border-radius: var(--radius-sm); padding: .9rem 1.1rem; font-weight: 600; }
.form__status[data-state="ok"] { background: var(--accent-soft); color: var(--accent-ink); }
.form__status[data-state="error"] { background: #fdeceb; color: #a4231c; }
.form__status[hidden] { display: none; }

/* ---------- About ---------- */
.about-layout { display: flex; flex-direction: column; gap: 2.75rem; max-width: 42rem; }
.prose { max-width: 62ch; }
.prose h2 { margin-bottom: .6rem; }
.prose h3 { margin-top: 2rem; margin-bottom: .5rem; }
.prose p { color: var(--ink-soft); }
.prose strong { color: var(--ink); }
.about-hero { background:
    radial-gradient(50rem 24rem at 90% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(40rem 20rem at 0% 0%, var(--gold-soft), transparent 55%);
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d9ddd7; padding-block: 3rem 2rem; margin-top: 2rem; }
.site-footer a { color: #eef1ec; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.8fr 1fr; align-items: start; }
.footer-brand { font-family: var(--font-head); font-size: 1.3rem; color: #fff; display: inline-flex; gap: .5rem; align-items: center; }
.footer-brand img, .footer-brand svg { width: 30px; height: 30px; }
.site-footer p { color: #b6bcb4; margin-top: .8rem; max-width: 40ch; }
.footer-col h4 { color: #fff; font-family: var(--font-body); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .8rem; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2.2rem; padding-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; color: #9aa198; font-size: .9rem; }

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; }
}

/* ---------- Cookie-samtycke ---------- */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 300;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 1.1rem 1.25rem;
  max-width: 64rem; margin-inline: auto;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.cookie-banner__text { flex: 1 1 320px; }
.cookie-banner__text h2 { font-size: 1.1rem; margin-bottom: .25rem; }
.cookie-banner__text p { color: var(--ink-soft); font-size: .95rem; }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-left: auto; }
@media (max-width: 520px) {
  .cookie-banner__actions { width: 100%; }
  .cookie-banner__actions .btn { flex: 1 1 auto; }
}

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; }
.badge-inline { display: inline-flex; align-items: center; gap: .4rem; background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: .8rem; padding: .3rem .7rem; border-radius: 999px; }
