/* Repairability Assessment: scholarly explainer stylesheet */
/* VTC token set. Gold is accent-only in light mode; gold links in dark mode. */

:root {
  color-scheme: light dark;
  --ink: #111111;
  --navy: #0F2452;
  --gold: #FABF12;
  --gold-dark: #C99B0E;
  --slate: #4B5563;
  --hairline: #D1D5DB;
  --cream: #FBF6E9;
  --paper: #FFFFFF;
  --maxw: 46rem;
  /* Semantic tokens: light mode */
  --page-bg: var(--cream);
  --text: var(--ink);
  --heading: var(--navy);
  --link: var(--navy);
  --muted: var(--slate);
  --surface: var(--paper);
  --line: var(--hairline);
  --edge: var(--navy);
  --focus: var(--navy);
}

/* Authored dark mode: controlled dark gray, never a browser inversion */
@media (prefers-color-scheme: dark) {
  :root {
    --page-bg: #1E1E1E;
    --text: #E8E4DA;
    --heading: #FBF6E9;
    --link: #FABF12;
    --muted: #B9B4A9;
    --surface: #2A2A2A;
    --line: #3F3F3F;
    --edge: #FABF12;
    --focus: #FABF12;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1.65;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: #FFFFFF;
  padding: 0.6rem 1rem;
  z-index: 100;
  font-family: 'Trebuchet MS', Arial, sans-serif;
}
.skip-link:focus {
  left: 0;
}

/* Focus visibility */
a:focus-visible,
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Header: navy masthead ribbon with the eagle, per the document chrome.
   Gold rule sits INSIDE the navy at ~75% of the band height, with empty
   navy continuing below it (mirrors .body-hdr / .body-hdr-rule in V9). */
.masthead {
  background: var(--navy);
  padding-bottom: 20px;
}
.masthead::after {
  content: "";
  display: block;
  height: 4px;
  background: var(--gold);
}
.site-title-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}
.masthead-eagle {
  width: 52px;
  height: auto;
  flex: 0 0 auto;
}
.site-title {
  margin: 0;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream);
  font-size: 1.5rem;
  text-align: center;
  text-wrap: balance;
}
/* Long-title variant: full paper title in one run, stepped down to hold two lines.
   Wrap padding tightens so the two-line band matches the single-line band height. */
.site-title--long {
  font-size: 1.22rem;
}
.gold-band { display: none; } /* superseded: gold rule now lives inside the ribbons */

/* Navigation */
.site-nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.site-nav li {
  display: flex;
  flex: 1;
}
.site-nav a {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  color: var(--link);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(15, 36, 82, 0.12);
  padding: 12px 8px;
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.18s ease;
}
.site-nav a:hover {
  box-shadow: 0 4px 10px rgba(15, 36, 82, 0.22);
  transform: translateY(-1px);
}
.site-nav a:hover::after {
  transform: scaleX(1);
}
.site-nav a[aria-current="page"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(0, 0, 0, 0.12)), var(--link);
  border-color: var(--link);
  color: var(--page-bg);
  box-shadow: 0 2px 6px rgba(15, 36, 82, 0.28);
}
.site-nav a[aria-current="page"]::after {
  background: var(--gold);
  transform: scaleX(1);
}
@media (max-width: 560px) {
  .site-nav ul { flex-direction: column; }
}

/* Main */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

h1 {
  font-family: 'Trebuchet MS', Arial, sans-serif;
  color: var(--heading);
  text-transform: uppercase;
  font-size: 2rem;
  line-height: 1.2;
  margin: 1rem 0 0.75rem;
}

h2 {
  font-family: 'Trebuchet MS', Arial, sans-serif;
  color: var(--heading);
  text-transform: uppercase;
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 2.25rem 0 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--gold);
}

p {
  margin: 0 0 1.1rem;
  text-align: justify;
}

.lead {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.byline {
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  margin: -0.25rem 0 1.5rem;
  line-height: 1.5;
}

/* Links in prose */
main a {
  color: var(--link);
  text-decoration: underline;
}
main a:hover {
  color: var(--link);
  text-decoration-color: var(--gold-dark);
  text-decoration-thickness: 2px;
}

/* Blockquotes for verbatim source quotes: Report of Findings treatment
   (lifted field, gold rule on the right edge, italic justified text) */
blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1.25rem;
  border-right: 3px solid var(--gold);
  background: var(--surface);
}
blockquote p {
  font-style: italic;
  margin: 0 0 0.5rem;
}
blockquote p:last-child { margin-bottom: 0; }
blockquote .cite {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* Lists */
ul.plain, ol.plain {
  margin: 0 0 1.1rem;
  padding-left: 1.4rem;
}
ul.plain li, ol.plain li {
  margin-bottom: 0.5rem;
}

/* Definition-style linked entries (applications) */
.applications {
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
}
.applications li {
  border: 1px solid var(--line);
  border-left: 3px solid var(--edge);
  background: var(--surface);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.85rem;
}
.applications a {
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-weight: bold;
  color: var(--link);
  text-decoration: underline;
  font-size: 1.05rem;
}
.applications a:hover {
  color: var(--link);
  text-decoration-color: var(--gold-dark);
  text-decoration-thickness: 2px;
}
.applications .desc {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Reference / citation entries */
.reference {
  border: 1px solid var(--line);
  border-left: 3px solid var(--edge);
  background: var(--surface);
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
}
.reference .cite-text {
  margin: 0 0 0.5rem;
}
.reference .doi {
  margin: 0;
  font-size: 0.95rem;
}

/* Footer: navy ribbon bookend mirroring the masthead. Gold rule sits
   INSIDE the navy, ~75% from the bottom (empty navy above it, text below),
   per .body-ftr / .body-ftr .rule in V9. */
.site-footer {
  background: var(--navy);
  padding-top: 20px;
  margin-top: 2.5rem;
}
.site-footer::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--gold);
}
.footer-rule { display: none; }
.attribution {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.4rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.85rem;
}
.attribution img {
  width: 52px;
  height: auto;
  flex: 0 0 auto;
}
.attribution .attr-text {
  font-size: 0.9rem;
  color: var(--cream);
  line-height: 1.5;
}
.attribution .attr-text a {
  color: var(--cream);
  text-decoration: underline;
}
.attribution .attr-text a:hover {
  color: var(--cream);
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
}
.attribution .copyright {
  display: block;
  margin-top: 0.15rem;
}

@media (max-width: 480px) {
  body { font-size: 17px; }
  .site-title { font-size: 1.2rem; }
  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.2rem; }
  main { padding-left: 1rem; padding-right: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
