/* mvest ADR — elegant light mode */

@import url("https://rsms.me/inter/inter.css");

:root {
  /* warm, low-contrast neutrals */
  --bg:           #fcfcfa;
  --bg-alt:       #f5f4ef;
  --bg-code:      #f3f2ed;
  --bg-elevated:  #ffffff;

  --fg:           #1a1a1a;
  --fg-soft:      #3f3f46;
  --fg-muted:     #71717a;
  --fg-subtle:    #a1a1aa;

  --border:        #e7e5e0;
  --border-strong: #d4d2cc;

  --accent:       #18181b;       /* charcoal — restrained, refined */
  --accent-soft:  #27272a;
  --link:         #1d4ed8;       /* deep blue, reserved for actual links */
  --link-hover:   #1e40af;

  --status-accepted:   #15803d;
  --status-proposed:   #a16207;
  --status-deprecated: #71717a;
  --status-superseded: #9f1239;

  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow:    0 1px 3px rgba(24, 24, 27, 0.05), 0 1px 2px rgba(24, 24, 27, 0.03);
  --shadow-md: 0 4px 12px rgba(24, 24, 27, 0.06), 0 2px 4px rgba(24, 24, 27, 0.03);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --max-width: 880px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@supports (font-variation-settings: normal) {
  :root { --font-sans: "Inter var", -apple-system, sans-serif; }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

/* --- Header --- */

header.adr-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
  margin-bottom: 3rem;
}

header.adr-header nav {
  margin-bottom: 2rem;
}

header.adr-header nav a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: -0.005em;
  transition: color 0.15s ease;
}

header.adr-header nav a:hover { color: var(--fg); }

header.adr-header h1 {
  margin: 0 0 1.5rem;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--fg);
}

dl.meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0;
  font-size: 0.9rem;
}

dl.meta dt {
  color: var(--fg-muted);
  font-weight: 500;
  letter-spacing: 0.005em;
}

dl.meta dd {
  margin: 0;
  color: var(--fg-soft);
}

/* --- Status badges --- */

.status {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.4;
}

.status.accepted   { background: #dcfce7; color: var(--status-accepted); }
.status.proposed   { background: #fef3c7; color: var(--status-proposed); }
.status.deprecated { background: #e4e4e7; color: var(--status-deprecated); }
.status.superseded { background: #ffe4e6; color: var(--status-superseded); }

/* --- Sections --- */

section { margin: 3.5rem 0; }

section > h2 {
  font-size: 1.4rem;
  margin: 0 0 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
}

section h3 {
  font-size: 1.05rem;
  margin: 2rem 0 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}

p {
  margin: 0.75rem 0;
  color: var(--fg-soft);
}

section > p:first-of-type {
  margin-top: 0;
}

/* --- Text styling --- */

strong {
  font-weight: 600;
  color: var(--fg);
}

em { color: var(--fg-soft); }

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--link-hover); }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-code);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--accent-soft);
  border: 1px solid var(--border);
}

pre {
  background: var(--bg-code);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  border: 1px solid var(--border);
}

pre code {
  background: transparent;
  padding: 0;
  border: 0;
  font-size: inherit;
}

/* --- Tables --- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

th, td {
  text-align: left;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--fg-soft);
}

th {
  background: var(--bg-alt);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-alt); transition: background 0.1s ease; }

/* --- Lists --- */

ul, ol {
  padding-left: 1.5rem;
  color: var(--fg-soft);
}

li {
  margin: 0.4rem 0;
}

ul.unstyled {
  list-style: none;
  padding: 0;
}

/* --- Callouts --- */

.callout {
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.callout.warn { border-left-color: var(--status-proposed); }
.callout.info { border-left-color: var(--link); }
.callout.success { border-left-color: var(--status-accepted); }

.callout p { margin: 0.4rem 0; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout strong:first-child { display: inline-block; margin-bottom: 0.3rem; }

/* --- Option cards --- */

.options-grid {
  display: grid;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.option {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}

.option:hover { box-shadow: var(--shadow); }

.option.chosen {
  border-color: var(--status-accepted);
  background: var(--bg-elevated);
  position: relative;
  box-shadow: var(--shadow-md);
}

.option.chosen::before {
  content: "✓ Gewählt";
  position: absolute;
  top: -0.7rem;
  right: 1.25rem;
  background: var(--status-accepted);
  color: white;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: var(--shadow-sm);
}

.option h4 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.option p {
  font-size: 0.92rem;
  margin: 0.5rem 0;
}

.option .pros,
.option .cons {
  margin: 0.4rem 0;
  padding-left: 1.3rem;
  position: relative;
}

.option .pros::before,
.option .cons::before {
  position: absolute;
  left: 0;
  font-weight: 700;
  font-family: var(--font-mono);
}

.option .pros::before { content: "+"; color: var(--status-accepted); }
.option .cons::before { content: "−"; color: var(--status-superseded); }

.option .pros { color: var(--fg-soft); }
.option .cons { color: var(--fg-soft); }

/* --- Mermaid diagram --- */

.mermaid {
  text-align: center;
  margin: 2rem 0;
  background: var(--bg-elevated);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* --- Footer --- */

footer.adr-footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--fg-muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

footer.adr-footer a { color: var(--fg-muted); }
footer.adr-footer a:hover { color: var(--fg); }

/* --- Index page --- */

.adr-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.adr-list li {
  display: grid;
  grid-template-columns: 5.5rem 7rem 1fr auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  transition: background 0.1s ease;
}

.adr-list li:hover { background: var(--bg-alt); }

.adr-list .id {
  font-family: var(--font-mono);
  color: var(--fg-muted);
  font-size: 0.85rem;
  letter-spacing: -0.005em;
}

.adr-list .title {
  font-weight: 500;
  color: var(--fg);
}

.adr-list a {
  display: contents;
  color: inherit;
}

.adr-list .date {
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .adr-list li {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.4rem 1rem;
  }
  .adr-list .status { grid-column: 1; grid-row: 1; justify-self: start; }
  .adr-list .title { grid-column: 1 / span 2; grid-row: 2; }
  .adr-list .id { grid-column: 2; grid-row: 1; }
  .adr-list .date { display: none; }

  .container { padding: 2rem 1.25rem 3rem; }
  header.adr-header h1 { font-size: 1.75rem; }
}

/* --- Selection --- */

::selection {
  background: #fde68a;
  color: var(--fg);
}
