/* ==========================================================================
   Architecture Decisions (ADRs) - Editorial Light Theme Frame & Cards
   File: assets/css/decisions.css
   ========================================================================== */

/* Page Header & Intro Layout */
.ds-intro {
  padding-top: clamp(28px, 4vw, 44px);
  padding-bottom: clamp(24px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
}

.ds-intro h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 12px 0 16px;
  color: var(--ink);
}

.ds-intro .lead {
  max-width: 74ch;
  font-size: clamp(15.5px, 1.8vw, 17.5px);
  line-height: 1.6;
  color: var(--ink-dim);
  margin-bottom: 24px;
}

/* Legend / Key */
.ds-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius, 6px);
  margin: 0 0 20px;
  font-size: 12px;
  color: var(--ink-dim);
}

.ds-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.k-dec {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.08em;
  font-size: 10.5px;
}

.k-alt {
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  font-size: 10.5px;
}

.k-why {
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  font-size: 10.5px;
}

.k-cost {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 10.5px;
}

/* Category Jump Bar / Filter Pills (Min 44x44px touch targets) */
.ds-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 0;
  align-items: center;
}

.jump-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius, 6px);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.jump-pill:hover,
.jump-pill:focus-visible {
  border-color: var(--accent);
  background: var(--accent-faint);
  color: var(--accent);
  text-decoration: none;
}

.jump-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.jump-idx {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  margin-right: 8px;
  font-weight: 700;
}

/* Section Structure */
.dec-section {
  padding: 48px 0 24px;
  border-bottom: 1px solid var(--line);
}

.dec-section:last-of-type {
  border-bottom: none;
}

.sec-kicker {
  display: inline-block;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
  font-weight: 600;
}

.section-head h2 {
  font-size: clamp(24px, 3.5vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  margin: 4px 0 12px;
}

.ds-lead {
  margin: 0 0 24px;
  max-width: 74ch;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-dim);
}

/* Sticky Header Scroll Clearance (65px header + 16px offset = 81px) */
#system-topology,
#production-operations,
#shaped,
#production,
.dec-card,
[id^="adr-"] {
  scroll-margin-top: calc(var(--header-h, 65px) + 16px);
}

/* Card Header & Badge */
.dec-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.adr-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 2px);
  padding: 2px 7px;
  letter-spacing: 0.04em;
}

/* Card Container: Surface White, Hairline Border, Radius 6px, Zero Heavy Shadows */
.dec-card {
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--line, #E4E4E7);
  border-radius: var(--radius, 6px);
  box-shadow: none;
  padding: 22px 22px 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.dec-card:hover {
  border-color: var(--line-strong, #D4D4D8);
}

.dec-card:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-faint);
}

.dec-card h3 {
  font-size: 16.5px;
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

/* Interactive Fold Button: Min 44x44px touch target on mobile */
.dec-fold {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm, 2px);
  padding: 8px 12px;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dec-fold:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-faint);
}

.dec-fold:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 761px) {
  .dec-fold {
    display: none;
  }
}

/* Definition List Grid within ADR Cards */
.dec-card dl {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px 14px;
  align-items: baseline;
  margin: 0;
}

.dec-wide dl {
  grid-template-columns: 104px minmax(0, 1fr) 104px minmax(0, 1fr);
}

@media (max-width: 860px) {
  .dec-wide dl {
    grid-template-columns: 104px minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .dec-card {
    padding: 18px 16px 14px;
  }
  .dec-card dl {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px 10px;
  }
}

/* Four Distinct Section Treatments */
.dec-card dt {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 3px;
  margin: 0;
}

.dec-card dd {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0;
}

/* 1. Decision: Bold Ink */
.dec-card dt:nth-of-type(1),
.dec-card dt.field-decision {
  color: var(--ink);
  font-weight: 700;
}

.dec-card dd:nth-of-type(1),
.dec-card dd.val-decision {
  color: var(--ink);
  font-weight: 600;
}

/* 2. Alternative Rejected: Muted strike */
.dec-card dt:nth-of-type(2),
.dec-card dt.field-alternative {
  color: var(--ink-faint);
}

.dec-card dd:nth-of-type(2),
.dec-card dd.val-alternative {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

/* 3. Engineering Rationale: Explanatory text */
.dec-card dt:nth-of-type(3),
.dec-card dt.field-why {
  color: var(--ink-dim);
}

.dec-card dd:nth-of-type(3),
.dec-card dd.val-why {
  color: var(--ink-dim);
  line-height: 1.6;
}

/* 4. Real Cost Paid: Warning / Rust Accent Tag */
.dec-card dt:nth-of-type(4),
.dec-card dt.field-cost {
  color: var(--accent);
  font-weight: 700;
}

.dec-card dd:nth-of-type(4),
.dec-card dd.val-cost {
  color: var(--ink);
  background: var(--accent-faint);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm, 2px);
  padding: 6px 10px;
  line-height: 1.55;
}

/* Outgoing Cross-Navigation & Footnotes */
.ds-end {
  padding: 48px 0 40px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}

.cross-nav-box {
  margin-bottom: 24px;
}

.cross-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.cross-nav-links .btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.care-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-faint);
  max-width: 74ch;
  margin: 0;
}
