/* broaryd.se – gemensam stilmall */

/* Sidan visas alltid i mörkt tema */
:root {
  color-scheme: dark;
  --bg: #141a17;
  --surface: #1c2420;
  --text: #e6ebe7;
  --muted: #9fb0a6;
  --accent: #8cc4a3;
  --accent-soft: #24332b;
  --line: #2f3b35;
  --warn-bg: #33301f;
  --warn-text: #e8d79b;
  --radius: 10px;
  --maxw: 960px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.25;
  font-weight: 600;
}
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin: 0 0 .4em; }
h2 { font-size: 1.5rem; margin: 2em 0 .5em; }
h3 { font-size: 1.15rem; margin: 0 0 .3em; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* Sidhuvud */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  font-family: Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img { flex: none; display: block; border-radius: 7px; }
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
nav a {
  display: block;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: .95rem;
}
nav a:hover { background: var(--accent-soft); }
nav a[aria-current="page"] { background: var(--accent); color: var(--surface); }

/* Innehåll */
main { padding: 40px 0 64px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 42em; }

.hero {
  background: linear-gradient(160deg, var(--accent-soft), transparent 70%);
  border-bottom: 1px solid var(--line);
  padding: 56px 0 40px;
}
.hero p { max-width: 40em; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.facts strong { display: block; font-size: 1.35rem; font-family: Georgia, serif; }
.facts span { color: var(--muted); font-size: .9rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

/* Bred skärm: fyra kort i bredd, löptext hålls läsbar */
@media (min-width: 1200px) {
  :root { --maxw: 1240px; }
  .cards { grid-template-columns: repeat(4, 1fr); }
  main .wrap > p, .hero p { max-width: 46em; }
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.card p { margin: .3em 0; }
.card ul { margin: .3em 0; padding-left: 1.2em; }
.card li { margin: .25em 0; }

/* "Mer info"-knapp: utfälld ruta tar hela bredden så övriga kort behåller sin storlek */
.more-info summary {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: .9rem;
  cursor: pointer;
  list-style: none;
}
.more-info summary::-webkit-details-marker { display: none; }
.more-info summary::after { content: " ▾"; }
.more-info[open] summary::after { content: " ▴"; }
.more-info summary:hover { border-color: var(--accent); }
.more-info[open] summary { margin-bottom: 6px; }
.card:has(.more-info[open]) { grid-column: 1 / -1; }
.more-info p, .more-info ul { max-width: 46em; }
.card .meta { color: var(--muted); font-size: .9rem; }
.card .links { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .95rem; }
a.card-link { text-decoration: none; color: inherit; transition: border-color .15s; }
a.card-link:hover { border-color: var(--accent); }
a.card-link .more { color: var(--accent); margin-top: auto; padding-top: 10px; }

.tag {
  display: inline-block;
  font-size: .78rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 8px;
  align-self: flex-start;
}

/* Tidslinje */
.timeline { list-style: none; margin: 16px 0 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 22px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}
.timeline .year { font-weight: 700; color: var(--accent); display: block; }

/* Projektlista */
.project {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 14px;
}
.project h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.status {
  font-family: system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.status.done { color: var(--accent); }
.status.ongoing { color: #e0b15a; }
.status.idea { color: var(--muted); }

blockquote {
  margin: 16px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.note {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .95rem;
  margin: 24px 0;
}

.sources { font-size: .9rem; color: var(--muted); }
.sources a { word-break: break-word; }

/* Sidfot */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 24px 0;
  font-size: .9rem;
  color: var(--muted);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
