/* =========================================================
   Jonas Prylbod – gemensam stil för startsida och verktyg
   Mörkt tema är standard. Ljust tema: <html data-theme="light">
   ========================================================= */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/assets/fonts/manrope-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/assets/fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #0c0d12;
  --surface: #11121a;
  --surface-2: #1b1d27;
  --surface-3: #15161f;
  --line: #262833;
  --line-strong: #343744;
  --text: #f3f2ee;
  --muted: #b7b6c0;
  --muted-2: #9897a3;
  --accent: #ff7a3d;          /* kaffeknapp, märkning */
  --accent-ink: #0c0d12;
  --link: #ffb08a;
  --link-hover: #ffd2bd;
  --badge-bg: rgba(255, 122, 61, .14);
  --glow-1: rgba(226, 97, 27, .30);
  --glow-2: rgba(31, 150, 170, .28);
  --ok: #4fd18b; --warn: #f2b33d; --bad: #ff6b5e;
  --radius: 22px;
  --font: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --surface-3: #ffffff;
  --line: #e2e0d8;
  --line-strong: #cfccc2;
  --text: #15151a;
  --muted: #55545e;
  --muted-2: #6a6974;
  --accent: #ff7a3d;
  --accent-ink: #15151a;
  --link: #b4461a;
  --link-hover: #7f2e0e;
  --badge-bg: rgba(255, 122, 61, .16);
  --glow-1: rgba(255, 150, 90, .30);
  --glow-2: rgba(70, 170, 190, .22);
  --ok: #1f7a4a; --warn: #9a6200; --bad: #b3261e;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.6 var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(520px 420px at 38% 80px, var(--glow-1), transparent 70%),
    radial-gradient(520px 420px at 64% 140px, var(--glow-2), transparent 70%);
  background-repeat: no-repeat;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img, svg { display: block; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Sidhuvud ---------- */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 22px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 18px 7px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 15px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}
.brand:hover { color: var(--text); border-color: var(--line-strong); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.btn-coffee {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 15px; text-decoration: none;
}
.btn-coffee:hover { color: var(--accent-ink); filter: brightness(1.06); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn .moon { display: none; }
:root[data-theme="light"] .icon-btn .sun { display: none; }
:root[data-theme="light"] .icon-btn .moon { display: block; }

/* ---------- Layout ---------- */
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.section { padding-bottom: 112px; }
.section-title {
  margin: 0 0 14px; text-align: center;
  font-size: clamp(34px, 5vw, 46px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1;
}
.section-sub {
  margin: 0 auto 32px; max-width: 460px; text-align: center;
  font-size: 16px; color: var(--muted);
}

/* ---------- Hero ---------- */
.hero { padding: 72px 0 96px; text-align: center; }
.hero h1 {
  margin: 0 auto 32px; max-width: 760px;
  font-size: clamp(48px, 9.5vw, 96px); line-height: .98; font-weight: 800; letter-spacing: -.05em;
}
.lede { margin: 0 auto; max-width: 520px; text-align: left; font-size: 19px; color: var(--muted); }

/* ---------- Kategorifilter ---------- */
.filters-wrap { display: flex; justify-content: center; margin-bottom: 48px; }
.filters {
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 5px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 999px; background: transparent; color: var(--text);
  font: 700 15px var(--font); cursor: pointer;
}
.chip:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.chip[aria-pressed="true"] { background: var(--surface-2); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cat, var(--accent)); }
.chip .count { font-size: 13px; font-weight: 600; color: var(--muted-2); }

/* ---------- Hyllor (en kolumn per kategori) ---------- */
.shelves {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px; align-items: start;
}
.shelf { display: flex; flex-direction: column; gap: 16px; }
.shelf[hidden] { display: none; }
.shelf-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 0 4px 12px; border-bottom: 2px solid var(--cat);
}
.shelf-head h3 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.shelf-head span { font-size: 14px; color: var(--muted); text-align: right; }

/* ---------- Kort (verktyg och sajter) ---------- */
.card {
  --cat-ink: var(--cat, var(--text));
  display: flex; flex-direction: column; padding: 22px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--text); text-decoration: none;
  transition: border-color .15s ease;
}
:root[data-theme="light"] .card { --cat-ink: color-mix(in srgb, var(--cat, var(--text)) 55%, #000); }
.card:hover { color: var(--text); border-color: var(--line-strong); }
.card:hover .card-cta { color: var(--link-hover); }
.card-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.tile {
  flex: 0 0 auto; width: 94px; height: 94px; border-radius: 20px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; color: var(--cat-ink);
}
:root[data-theme="light"] .tile { background: color-mix(in srgb, var(--cat, #888) 16%, #fff); }
.tile svg { width: 42px; height: 42px; }
.tile.has-img { overflow: hidden; background: transparent; }
.tile.has-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card h4 { margin: 0 0 10px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.card-head h4:only-child { margin: 0; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px;
  background: var(--badge-bg); color: var(--link);
}
.badge.ext { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }
.badge.new { background: var(--accent); color: var(--accent-ink); }
.badge.locked {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 1px solid var(--line-strong); color: var(--muted);
}
.badge.locked svg { width: 12px; height: 12px; }
.card p { margin: 0 0 22px; font-size: 15px; line-height: 1.65; color: var(--muted); }
.card-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.card-cta { font-weight: 700; font-size: 15px; color: var(--link); }

.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }

.tip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 24px; padding: 22px 26px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.tip strong { display: block; font-size: 18px; margin-bottom: 4px; }
.tip p { margin: 0; font-size: 15px; color: var(--muted); }
.tip a { font-weight: 700; }

.empty { color: var(--muted); grid-column: 1 / -1; text-align: center; }

/* ---------- Om mig ---------- */
.about { display: flex; flex-wrap: wrap; gap: 18px; padding-bottom: 96px; }
.about-text { flex: 1 1 380px; padding: 40px; border-radius: 26px; background: var(--surface-3); border: 1px solid var(--line); }
.about-label { display: inline-block; font-size: 14px; font-weight: 600; color: var(--link); margin-bottom: 22px; }
.about h2 { margin: 0 0 20px; font-size: clamp(28px, 4vw, 38px); line-height: 1.08; font-weight: 800; letter-spacing: -.03em; }
.about p { margin: 0 0 14px; color: var(--muted); }
.about .note { margin: 0; font-size: 14px; color: var(--muted-2); }
.about-photo {
  flex: 1 1 380px; min-height: 420px; border-radius: 26px; overflow: hidden;
  background: var(--surface-2); border: 1px dashed var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2); font-size: 15px; font-weight: 600; text-align: center; padding: 24px;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-photo.has-img { padding: 0; border-style: solid; }

/* ---------- Sidfot ---------- */
.foot {
  max-width: 1060px; margin: 0 auto; padding: 24px 24px 40px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  border-top: 1px solid var(--line); font-size: 14px; color: var(--muted-2);
}
.foot-brand { display: inline-flex; align-items: center; gap: 10px; }

/* =========================================================
   Verktygssidor (tools/*)
   ========================================================= */
.tool { max-width: 760px; margin: 0 auto; padding: 8px 24px 64px; }
.tool h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.02; font-weight: 800; letter-spacing: -.04em; margin: 24px 0 12px; }
.tool .intro { color: var(--muted); font-size: 18px; margin: 0 0 32px; max-width: 34em; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--muted); }
.field input, .field select {
  font: 500 16px var(--font); padding: 11px 12px; min-height: 44px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); width: 100%;
}
.unit { position: relative; }
.unit input { padding-right: 3.4rem; }
.unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--muted-2); pointer-events: none; }

.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.result { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--bg); }
.result .k { font-size: 13px; font-weight: 600; color: var(--muted-2); }
.result .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.result.ok   { border-color: var(--ok); }   .result.ok .v   { color: var(--ok); }
.result.warn { border-color: var(--warn); } .result.warn .v { color: var(--warn); }
.result.bad  { border-color: var(--bad); }  .result.bad .v  { color: var(--bad); }

details.howto { margin-top: 16px; padding: 18px 24px; border: 1px solid var(--line); border-radius: var(--radius); }
details.howto summary { cursor: pointer; font-weight: 700; }
details.howto p { color: var(--muted); }
.formula {
  display: block; white-space: pre; overflow-x: auto; font: 14px/1.6 var(--mono);
  background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 12px 14px; margin: 10px 0;
}
.disclaimer { font-size: 14px; color: var(--muted); border-left: 3px solid var(--warn); padding-left: 12px; margin-top: 24px; }
.muted { color: var(--muted); }

/* Länklista (privat/index.html) */
.linklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.linklist li {
  border: 1px solid var(--line); border-left: 3px solid var(--cat, var(--line-strong));
  border-radius: 14px; padding: 14px 18px; background: var(--bg);
}
.linklist li.empty { border-left-color: var(--line); color: var(--muted); text-align: center; }
.linklist a { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text); text-decoration: none; font-size: 18px; }
.linklist a:hover strong { color: var(--link-hover); }
.linklist .tag { font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 9px; }
.linklist p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }

/* Sajtkort: långa domännamn får plats */
.card-head > div { min-width: 0; }
.card h4 { overflow-wrap: break-word; }
.sites .tile { width: 64px; height: 64px; border-radius: 16px; }
.sites .tile svg { width: 30px; height: 30px; }
.sites .card h4 { font-size: 19px; }
