/* Stil för index-sidan och installationsguiderna */

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Sidhuvud */
.site-header {
  background: var(--gradient);
  color: #fff;
  padding: 56px 0 72px;
  position: relative;
  overflow: hidden;
}
.site-header::after {
  content: "";
  position: absolute;
  inset: auto -10% -60px -10%;
  height: 120px;
  background: var(--cream);
  border-radius: 50% 50% 0 0;
}
.site-header h1 {
  color: #fff;
  font-size: clamp(2rem, 6vw, 3.4rem);
  margin-bottom: 0.2em;
  text-shadow: 0 3px 0 rgba(107, 46, 78, 0.25);
}
.site-header p { font-size: 1.15rem; margin: 0; max-width: 40em; }
.site-header .eyebrow {
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.site-header a { color: #fff; }

.crumbs { font-weight: 700; margin-bottom: 10px; }
.crumbs a { text-decoration: none; opacity: 0.9; }
.crumbs a:hover { opacity: 1; text-decoration: underline; }

main { padding: 8px 0 64px; }

section { margin: 40px 0; }
section > h2 { font-size: 1.7rem; }

/* Kortrutnät */
.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  font-weight: 400;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.card:hover {
  transform: translateY(-3px) rotate(-0.3deg);
  box-shadow: 0 16px 36px rgba(158, 72, 28, 0.18);
  color: var(--ink);
}
.card .emoji { font-size: 2rem; line-height: 1; }
.card h3 { margin: 4px 0 0; font-size: 1.25rem; }
.card p { margin: 0; color: var(--ink-soft); }
.card .meta { margin-top: auto; padding-top: 8px; font-weight: 800; color: var(--coral); font-size: 0.9rem; }

.card.big {
  background: linear-gradient(160deg, #fff 0%, var(--sand) 100%);
}

/* Lektionsblock */
.lesson {
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 24px;
}
.lesson-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin-bottom: 16px; }
.lesson-head h3 { margin: 0; font-size: 1.4rem; }
.pill {
  background: var(--sun);
  color: var(--plum);
  border-radius: 999px;
  padding: 2px 12px;
  font-weight: 800;
  font-size: 0.85rem;
}
.pill.soft { background: var(--sand); }

/* Steglista */
ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 26px 56px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(242, 96, 63, 0.3);
}
ol.steps > li::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 40px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}
ol.steps > li:last-child::after { display: none; }
ol.steps h3 { font-size: 1.2rem; margin-bottom: 0.3em; }
ol.steps p { margin: 0.3em 0 0.6em; }

/* OS-väljare */
.os-switch {
  display: inline-flex;
  background: var(--sand);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin: 8px 0 4px;
  flex-wrap: wrap;
}
.os-switch button {
  border: 0;
  background: transparent;
  color: var(--plum);
  font: 800 0.95rem var(--font-body);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.os-switch button[aria-pressed="true"] {
  background: var(--paper);
  box-shadow: 0 2px 8px rgba(158, 72, 28, 0.15);
  color: var(--coral);
}
.os-note { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 8px; }

/* Visa bara innehåll för valt operativsystem */
[data-os-only] { display: none; }
body[data-os="windows"] [data-os-only~="windows"],
body[data-os="mac"] [data-os-only~="mac"],
body[data-os="linux"] [data-os-only~="linux"] { display: block; }

/* Kodblock */
.code {
  position: relative;
  margin: 10px 0 14px;
}
.code .label {
  display: inline-block;
  background: var(--plum);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 8px 8px 0 0;
}
.code pre {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 16px 18px;
  padding-right: 84px;
  border-radius: 0 12px 12px 12px;
  overflow-x: auto;
  font-size: 0.92rem;
  line-height: 1.55;
}
.code pre .c { color: #c9a58c; }
.copy-btn {
  position: absolute;
  top: 30px;
  right: 8px;
  border: 0;
  background: var(--orange);
  color: #fff;
  font: 800 0.8rem var(--font-body);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.copy-btn:hover { background: var(--coral); }
.copy-btn.done { background: var(--leaf); }

/* Informationsrutor */
.note {
  border-radius: 14px;
  padding: 14px 18px;
  margin: 14px 0;
  background: #fff4d6;
  border-left: 6px solid var(--sun);
}
.note.tip { background: #e8f6ee; border-left-color: var(--leaf); }
.note.warn { background: #ffe6df; border-left-color: var(--coral); }
.note strong:first-child { color: var(--plum); }
.note p { margin: 0.3em 0; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--sand); color: var(--plum); font-family: var(--font-head); }
tr:last-child td { border-bottom: 0; }

/* Navigering mellan guider */
.guide-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 40px;
}
.guide-nav a {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.checklist { list-style: none; padding: 0; }
.checklist li { padding: 6px 0 6px 34px; position: relative; }
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--leaf);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.site-footer {
  text-align: center;
  color: var(--ink-soft);
  padding: 32px 16px 48px;
  font-size: 0.9rem;
}

/* Rubrik med QR-kod till kurssidan */
.header-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.qr-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  box-shadow: 0 12px 30px rgba(107, 46, 78, 0.25);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transform: rotate(2deg);
  transition: transform 0.15s ease;
}
.qr-card:hover { transform: rotate(0deg) scale(1.03); color: var(--ink); }
.qr-card img { display: block; width: 160px; height: 160px; }
.qr-text { display: flex; flex-direction: column; align-items: center; }
.qr-label { font-size: 0.8rem; font-weight: 800; color: var(--ink-soft); margin-top: 6px; }
.site-header .qr-card .qr-url { color: var(--coral); font-weight: 800; font-size: 0.95rem; }

@media (max-width: 640px) {
  .header-grid { grid-template-columns: 1fr; }
  .qr-card { justify-self: start; flex-direction: row; gap: 12px; transform: none; padding: 10px 16px 10px 10px; }
  .qr-card img { width: 72px; height: 72px; }
  .qr-text { align-items: flex-start; }
  .qr-label { margin-top: 0; }
}

/* Utfällbart alternativ, till exempel terminalversionen */
details.alt {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-top: 8px;
}
details.alt summary {
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--plum);
  font-size: 1.1rem;
}
details.alt[open] summary { margin-bottom: 10px; }

/* Kodblock med radbrytning, för långa prompter */
.code.wrap pre { white-space: pre-wrap; word-break: break-word; }
details.project { margin: 12px 0; }
details.project summary { font-size: 1.2rem; }

/* Långa prompter: kopieringsknappen ovanför texten så att raderna får plats */
.code.wrap pre { padding-top: 44px; padding-right: 18px; }
@media (max-width: 640px) {
  ol.steps > li { padding-left: 46px; }
  ol.steps > li::before { width: 32px; height: 32px; }
  ol.steps > li::after { left: 15px; top: 34px; }
  .code pre { font-size: 0.85rem; padding-left: 12px; }
  .code.wrap pre { padding-right: 12px; }
  details.alt { padding: 12px 14px; }
}
