/* ============================================================
 * Jonaz Thern — Cybersäkerhetskursen shared styles
 * Used by kurs/*.html and en/kurs/*.html (episode + hub pages).
 * Page-specific main{max-width} stays inline per page.
 * ============================================================ */

/* ── Episode header ── */
.ep-head { position: relative; margin-bottom: 2.5rem; }
.ep-num {
  position: absolute; top: -2.6rem; right: -0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(6rem, 16vw, 10rem); font-weight: 700; line-height: 1;
  color: var(--blue-soft); z-index: -1; user-select: none;
}
.ep-meta {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.page-label {
  display: inline-flex; padding: 0.4rem 0.9rem;
  background: var(--blue-soft); color: var(--blue); border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 600;
}
.ep-meta .ep-facts {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.1em; color: var(--mute);
  text-transform: uppercase;
}
main h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); margin-bottom: 1.2rem; line-height: 1.05; }
main h1 em { background: linear-gradient(120deg, var(--blue) 0%, var(--blue-2) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.intro { color: var(--slate); font-size: 1.05rem; margin-bottom: 2.5rem; line-height: 1.75; }

/* ── Table of contents ── */
.toc {
  padding: 1.4rem 1.6rem; background: var(--off-white);
  border: 1px solid var(--line); border-radius: 14px; margin-bottom: 3rem;
}
.toc-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue); font-weight: 700; margin-bottom: 0.8rem;
}
.toc ol { padding-left: 1.4rem; }
.toc li { padding: 0.3rem 0; font-size: 0.95rem; }
.toc a { color: var(--ink-2); transition: color 0.15s; }
.toc a:hover { color: var(--blue); }

/* ── Article sections ── */
.guide-section { margin-bottom: 3.5rem; scroll-margin-top: 5rem; }
.guide-section h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin-bottom: 1.2rem;
  padding-bottom: 0.6rem; border-bottom: 2px solid var(--blue-soft);
}
.guide-section h3 { font-size: 1.15rem; color: var(--ink-2); margin: 1.6rem 0 0.6rem; }
.guide-section p { color: var(--slate); margin-bottom: 1rem; line-height: 1.75; font-size: 0.96rem; }
.guide-section p strong { color: var(--ink-2); font-weight: 700; }
.guide-section a { color: var(--blue); border-bottom: 1px solid var(--blue-soft); }
.guide-section a:hover { border-bottom-color: var(--blue); }

.example-box {
  padding: 1.2rem 1.3rem; border-radius: 12px;
  margin: 1.2rem 0; display: flex; flex-direction: column; gap: 0.4rem;
  background: var(--off-white); border: 1px solid var(--line);
}
.example-box .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 700;
  color: var(--blue); margin-bottom: 0.5rem;
}
.example-box code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem; padding: 0.45rem 0.7rem;
  background: var(--white); border-radius: 6px;
  color: var(--ink-2); border: 1px solid var(--line);
}
.example-box.bad  { background: rgba(226,58,58,0.06); border: 1px solid var(--danger); }
.example-box.good { background: rgba(15,212,160,0.08); border: 1px solid var(--accent); }
.example-box.bad .label  { color: var(--danger); }
.example-box.good .label { color: #067a5b; }

.warning, .tip {
  padding: 1.1rem 1.3rem; border-radius: 12px; margin: 1.4rem 0;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.warning { background: rgba(255,147,64,0.08); border: 1px solid var(--warn); }
.tip { background: var(--blue-soft); border: 1px solid var(--blue); }
.warn-label, .tip-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 700;
}
.warn-label { color: #92420a; }
.tip-label  { color: var(--blue); }
.warning span:last-child, .tip span:last-child { color: var(--ink-2); font-size: 0.94rem; line-height: 1.65; }

.checklist { list-style: none; padding: 0; margin: 1rem 0; }
.checklist li {
  padding: 0.55rem 0 0.55rem 1.8rem; position: relative;
  color: var(--slate); font-size: 0.96rem; line-height: 1.65;
  border-bottom: 1px dashed var(--line);
}
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: '✓'; position: absolute; left: 0; top: 0.5rem;
  color: var(--accent); font-weight: 700;
}
.checklist strong { color: var(--ink-2); font-weight: 700; }
.checklist a { color: var(--blue); border-bottom: 1px solid var(--blue-soft); }

/* Numbered step list (steg-för-steg) */
.steps { list-style: none; padding: 0; margin: 1rem 0; counter-reset: step; }
.steps li {
  position: relative; padding: 0.65rem 0 0.65rem 2.6rem;
  color: var(--slate); font-size: 0.96rem; line-height: 1.65;
  border-bottom: 1px dashed var(--line);
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0.65rem;
  width: 1.7rem; height: 1.7rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-soft); color: var(--blue);
  border-radius: 50%; font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; font-weight: 700;
}
.steps strong { color: var(--ink-2); font-weight: 700; }
.steps a { color: var(--blue); border-bottom: 1px solid var(--blue-soft); }

/* Comparison / info table */
.kurs-table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: 0.92rem; }
.kurs-table th {
  font-family: 'JetBrains Mono', monospace; font-size: 0.66rem;
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
  color: var(--blue); text-align: left;
  padding: 0.6rem 0.8rem; border-bottom: 2px solid var(--blue-soft);
}
.kurs-table td {
  padding: 0.6rem 0.8rem; color: var(--slate); line-height: 1.55;
  border-bottom: 1px dashed var(--line); vertical-align: top;
}
.kurs-table tr:last-child td { border-bottom: 0; }
.kurs-table td strong { color: var(--ink-2); }

/* ── Bonus group/card list ── */
.group-list { display: grid; gap: 0.8rem; margin: 1.4rem 0; counter-reset: grp; }
.group-item {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem;
  padding: 1.1rem 1.2rem; background: var(--white);
  border: 1px solid var(--line); border-radius: 12px;
  transition: border-color 0.15s, transform 0.15s;
}
.group-item:hover { border-color: var(--blue-2); transform: translateX(4px); }
.group-item::before {
  counter-increment: grp; content: counter(grp, decimal-leading-zero);
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 0.85rem; color: var(--blue); padding-top: 0.15rem;
}
.group-item h4 { font-size: 1rem; color: var(--ink-2); margin-bottom: 0.25rem; }
.group-item p { font-size: 0.9rem; color: var(--slate); line-height: 1.6; margin: 0; }
.group-item .grp-target {
  display: inline-block; margin-top: 0.45rem;
  font-family: 'JetBrains Mono', monospace; font-size: 0.66rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute);
}
.group-item .grp-target strong { color: var(--blue); font-weight: 700; }

/* ── Sources ── */
.sources { list-style: none; padding: 0; margin: 1rem 0; counter-reset: src; }
.sources li {
  position: relative; padding: 0.6rem 0 0.6rem 2.4rem;
  border-bottom: 1px dashed var(--line);
  font-size: 0.92rem; color: var(--slate); line-height: 1.6;
}
.sources li:last-child { border-bottom: 0; }
.sources li::before {
  counter-increment: src; content: "[" counter(src) "]";
  position: absolute; left: 0; top: 0.6rem;
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
  color: var(--blue); font-weight: 700;
}
.sources a { color: var(--blue); border-bottom: 1px solid var(--blue-soft); word-break: break-word; }
.sources a:hover { border-bottom-color: var(--blue); }

/* ── Prev/next episode cards ── */
.next-ep {
  margin-top: 3rem; padding: 1.8rem 2rem;
  background: linear-gradient(135deg, var(--ink-2) 0%, #112a4a 100%);
  border-radius: 16px; color: var(--white); display: block;
}
.next-ep .next-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: #7ecaff; font-weight: 700; display: block; margin-bottom: 0.6rem;
}
.next-ep h3 { color: var(--white); font-size: 1.3rem; margin-bottom: 0.5rem; }
.next-ep p { color: #c3d0e2; font-size: 0.92rem; line-height: 1.65; margin-bottom: 0; }
a.next-ep { transition: transform 0.18s, box-shadow 0.18s; }
a.next-ep:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(11,26,44,0.25); }

.back-links { display: flex; gap: 2rem; flex-wrap: wrap; }
.back-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--blue); font-weight: 700;
  border-bottom: 1px solid currentColor; padding-bottom: 3px;
  transition: gap 0.15s;
}
.back-link:hover { gap: 0.8rem; }

/* ── Hub page (kurs/index.html) ── */
.page-hero { margin-bottom: 4rem; }
.page-kicker {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.9rem;
  background: rgba(15,212,160,0.12); color: #067a5b;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 600; margin-bottom: 1.4rem;
}
.page-hero h1 { font-size: clamp(2.6rem, 5.5vw, 4.2rem); line-height: 1.02; margin-bottom: 1.4rem; }
.page-hero p { font-size: 1.08rem; color: var(--slate); max-width: 640px; line-height: 1.75; }

.course-points {
  display: flex; gap: 1.6rem; flex-wrap: wrap; margin-top: 1.8rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--mute);
}
.course-points span::before { content: '✓ '; color: var(--accent); font-weight: 700; }

.ep-list { display: grid; gap: 1rem; margin-bottom: 4rem; }
.ep-row {
  position: relative; display: grid;
  grid-template-columns: auto 1fr auto; gap: 1.6rem; align-items: center;
  padding: 1.6rem 1.8rem; background: var(--white);
  border: 1px solid var(--line); border-radius: 16px;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
a.ep-row:hover { transform: translateY(-3px); border-color: var(--blue-2); box-shadow: 0 14px 32px rgba(11,26,44,0.08); }
a.ep-row:hover .ep-go { transform: translateX(4px); color: var(--blue); }
.ep-no {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.2rem; font-weight: 700; line-height: 1;
  color: var(--blue); min-width: 2ch;
}
.ep-row.soon .ep-no { color: var(--line); }
.ep-body h2 { font-size: 1.25rem; margin-bottom: 0.3rem; color: var(--ink-2); }
.ep-body p { font-size: 0.92rem; color: var(--slate); line-height: 1.6; margin: 0; }
.ep-tags { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.7rem; }
.ep-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.25rem 0.6rem; border-radius: 999px; font-weight: 700;
}
.ep-tag.live { background: rgba(15,212,160,0.12); color: #067a5b; }
.ep-tag.soon { background: var(--soft); color: var(--mute); }
.ep-tag.meta { background: var(--off-white); color: var(--mute); border: 1px solid var(--line); font-weight: 400; }
.ep-go { font-size: 1.4rem; color: var(--mute); transition: transform 0.15s, color 0.15s; }
.ep-row.soon { background: var(--off-white); }
.ep-row.soon .ep-body h2 { color: var(--slate); }

.more-soon {
  text-align: center; padding: 1.4rem;
  border: 1px dashed var(--line); border-radius: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute);
}

.crosslink {
  margin-bottom: 4rem; padding: 1.8rem;
  background: var(--off-white); border-left: 3px solid var(--blue);
  border-radius: 10px;
}
.crosslink p { color: var(--slate); font-size: 0.95rem; line-height: 1.7; margin-bottom: 0.6rem; }
.crosslink a { color: var(--blue); font-weight: 700; border-bottom: 1px solid currentColor; }

.cta-banner {
  text-align: center; padding: 3.5rem 2rem;
  background: linear-gradient(135deg, var(--ink-2) 0%, #112a4a 100%);
  border-radius: 20px; color: var(--white);
}
.cta-banner h2 { color: var(--white); margin-bottom: 1rem; font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.cta-banner h2 em, .page-hero h1 em {
  background: linear-gradient(120deg, var(--blue) 0%, var(--blue-2) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.cta-banner h2 em {
  background: linear-gradient(120deg, #7ecaff 0%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.cta-banner p { color: #c3d0e2; max-width: 560px; margin: 0 auto 1.8rem; }
.cta-banner .cta {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 1.8rem; background: var(--white); color: var(--ink-2);
  border-radius: 999px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase;
  transition: transform 0.15s;
}
.cta-banner .cta:hover { transform: translateY(-2px); }

/* ── Wiki term hover-cards (lexikon) ── */
.guide-section a.wiki-term,
a.wiki-term {
  position: relative;
  color: var(--blue);
  border-bottom: 1px dashed var(--blue-2);
  font-weight: 600;
  cursor: help;
  white-space: nowrap;
}
.guide-section a.wiki-term:hover { border-bottom-color: var(--blue-2); }
.wiki-term .wiki-pop {
  position: absolute;
  left: 50%; bottom: calc(100% + 11px);
  transform: translateX(-50%) translateY(4px);
  width: min(282px, 78vw);
  background: var(--ink-2); color: #eaf1f8;
  padding: 0.8rem 0.95rem 0.65rem; border-radius: 12px;
  box-shadow: 0 14px 34px rgba(11,26,44,0.28);
  font-size: 0.82rem; line-height: 1.55; font-weight: 400;
  white-space: normal; text-align: left;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 40;
}
.wiki-term .wiki-pop::after {
  content: ""; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: var(--ink-2);
}
.wiki-term .wiki-pop b { color: #fff; font-weight: 700; }
.wiki-term .wiki-pop .wiki-pop-more {
  display: block; margin-top: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--blue-2); font-weight: 700;
}
.wiki-term:hover .wiki-pop,
.wiki-term:focus .wiki-pop,
.wiki-term:focus-within .wiki-pop {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0); pointer-events: auto;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .ep-row { grid-template-columns: auto 1fr; }
  .ep-go { display: none; }
}
@media (max-width: 560px) {
  .guide-section a.wiki-term, a.wiki-term { white-space: normal; }
  .group-item { grid-template-columns: 1fr; gap: 0.3rem; }
  .kurs-table { font-size: 0.84rem; }
  .kurs-table th, .kurs-table td { padding: 0.5rem 0.5rem; }
}
