/* Mini Cooper Service Center — technical case study layout.
   One stylesheet, no framework. Bump ASSET_VERSION in tools/build.py on change. */

:root {
  --ink: #14181d;
  --ink-soft: #4a5461;
  --line: #dfe4ea;
  --bg: #ffffff;
  --bg-soft: #f5f7f9;
  --accent: #b8262c;        /* MINI red */
  --accent-dark: #8d1c21;
  --code-bg: #101418;
  --code-ink: #7fe08a;
  --radius: 8px;
  --wrap: 74rem;
  --measure: 44rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

a { color: var(--accent-dark); }
a:hover { color: var(--accent); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.85rem, 1.2rem + 2.2vw, 2.75rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.3rem, 1.05rem + 0.9vw, 1.7rem); margin: 2.5rem 0 .75rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }

p, li { max-width: var(--measure); }
.case-study table, .case-study .cards, .cards { max-width: none; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: .6rem 1rem; z-index: 10;
}
.skip:focus { left: 0; }

/* header ------------------------------------------------------------------ */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 5;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding: .85rem 0;
}
.brand { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--ink); }
.site-header nav { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.site-header nav a { text-decoration: none; color: var(--ink-soft); font-size: .95rem; }
.site-header nav a:hover { color: var(--accent); }
.nav-cta {
  background: var(--accent); color: #fff !important; padding: .45rem .9rem;
  border-radius: var(--radius); font-weight: 600;
}

/* hero -------------------------------------------------------------------- */
.hero { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 3.5rem 0; }
.hero h1 { max-width: 20ch; }
.lede { font-size: 1.15rem; color: var(--ink-soft); }
.button {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  padding: .7rem 1.3rem; border-radius: var(--radius); font-weight: 600; margin-right: .5rem;
}
.button.ghost { background: transparent; color: var(--accent-dark); border: 1px solid var(--line); }

.credibility { background: var(--ink); color: #fff; padding: 1.5rem 0; }
.credibility ul { list-style: none; display: flex; gap: 2.5rem; flex-wrap: wrap; margin: 0; padding: 0; }
.credibility li { max-width: none; }
.credibility strong { display: block; font-size: 1.9rem; line-height: 1; }

/* cards ------------------------------------------------------------------- */
.cards {
  display: grid; gap: 1.25rem; margin: 1.5rem 0 2rem;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
}
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem; }
.card h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.card-link { text-decoration: none; color: var(--ink); }
.card-link:hover h3 { color: var(--accent); }
.card-vehicle { color: var(--ink-soft); font-size: .9rem; margin: 0 0 .5rem; }
.card-summary { font-size: .95rem; }
.more { font-weight: 600; font-size: .9rem; text-decoration: none; }

/* case study -------------------------------------------------------------- */
.breadcrumb { font-size: .85rem; color: var(--ink-soft); margin: 1.5rem 0 1rem; }
.case-study { padding-bottom: 3rem; }
.byline { color: var(--ink-soft); font-size: .95rem; }
.byline .dot { margin: 0 .4rem; }

.summary {
  background: var(--bg-soft); border-left: 4px solid var(--accent);
  padding: 1.1rem 1.35rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5rem 0;
}
.summary h2 { margin-top: 0; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; }
.summary p { max-width: none; margin-bottom: 0; }

.glance {
  display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin: 1.5rem 0;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}
.glance > div { background: var(--bg); padding: .85rem 1rem; }
.glance dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.glance dd { margin: .2rem 0 0; font-weight: 600; }
.stars { color: var(--accent); letter-spacing: .1em; }

.codes { display: flex; flex-wrap: wrap; gap: .5rem; max-width: none; }
.code {
  font: 600 .95rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--code-bg); color: var(--code-ink);
  padding: .45rem .7rem; border-radius: 5px; text-decoration: none; display: inline-block;
}
.codes.big .code { font-size: 1.15rem; padding: .6rem .95rem; }
.code:hover { color: #fff; }

table.spec { border-collapse: collapse; width: 100%; max-width: 34rem; margin: .5rem 0; }
table.spec th, table.spec td { border: 1px solid var(--line); padding: .5rem .75rem; text-align: left; }
table.spec th { background: var(--bg-soft); width: 11rem; font-weight: 600; }

.case-study table:not(.spec) { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .95rem; }
.case-study table:not(.spec) th, .case-study table:not(.spec) td {
  border: 1px solid var(--line); padding: .45rem .7rem; text-align: left;
}
.case-study table:not(.spec) th { background: var(--bg-soft); }

.case-study img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
figure { margin: 1.5rem 0; }
figcaption { font-size: .9rem; color: var(--ink-soft); margin-top: .4rem; }

/* timeline ---------------------------------------------------------------- */
.timeline { list-style: none; margin: 1rem 0; padding: 0 0 0 1.25rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.25rem 1rem; max-width: var(--measure); }
.timeline li::before {
  content: ""; position: absolute; left: -1.7rem; top: .45rem;
  width: .7rem; height: .7rem; border-radius: 50%; background: var(--ink-soft);
  box-shadow: 0 0 0 3px var(--bg);
}
.timeline .t-repair::before, .timeline .t-verification::before { background: var(--accent); }
.t-date { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.t-label {
  display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
  padding: .05rem .5rem; margin-right: .4rem;
}
.t-event { font-weight: 500; }

/* notes, lessons ---------------------------------------------------------- */
.s-technician-notes, .s-lessons-learned {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .25rem 1.35rem 1rem;
}
.s-lessons-learned li { font-weight: 500; }

.parts { list-style: none; padding: 0; }
.parts li { border-bottom: 1px solid var(--line); padding: .55rem 0; max-width: var(--measure); }
.oe, .tag {
  font-size: .8rem; color: var(--ink-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: .05rem .55rem; margin-left: .5rem;
}

blockquote {
  margin: 1rem 0; padding: .75rem 1.25rem; border-left: 4px solid var(--accent);
  background: var(--bg-soft); font-style: italic;
}

details { border-bottom: 1px solid var(--line); padding: .6rem 0; max-width: var(--measure); }
summary { cursor: pointer; font-weight: 600; }

.stats ul, .related ul { list-style: none; padding: 0; }
.stats li { border-bottom: 1px solid var(--line); padding: .5rem 0; }
.facet h3 { margin-bottom: .25rem; }
.facet > ul > li { margin-bottom: .6rem; }
.others { margin: .25rem 0 0 1rem; font-size: .92rem; }
.count {
  font-size: .78rem; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: .05rem .5rem; color: var(--ink-soft);
}
ul.inline { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; max-width: none; }
ul.inline li { max-width: none; }

.search { margin: 1.5rem 0; max-width: var(--measure); }
.search label { display: block; font-size: .85rem; color: var(--ink-soft); margin-bottom: .35rem; }
.search input {
  width: 100%; font: inherit; padding: .7rem .9rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft);
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--bg); }

.author-block { border-top: 2px solid var(--line); padding-top: 1rem; }
.lessons { list-style: none; padding: 0; }
.lessons li { border-left: 3px solid var(--accent); padding: .1rem 0 .1rem 1rem; margin-bottom: 1.25rem; }

/* cta / footer ------------------------------------------------------------ */
.cta { background: var(--ink); color: #fff; padding: 3rem 0; margin-top: 3rem; }
.cta h2 { margin-top: 0; }
.cta a { color: #fff; }
.cta-phone { font-size: 1.5rem; font-weight: 700; text-decoration: none; }
.qualifiers { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; max-width: none; }
.qualifiers li { max-width: none; }
.qualifiers li::before { content: "✔ "; color: var(--accent); font-weight: 700; }
.fine { font-size: .85rem; color: var(--ink-soft); }
.cta .fine { color: #98a2ae; }

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; font-size: .95rem; }
.site-footer p { max-width: none; margin: .25rem 0; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
