/* Hit The Roof — shared stylesheet for long-form content (guides,
   technical references, case studies, glossary).

   Tokens and typography match the existing static guides in /public/guides.html
   so the library looks like one coherent site. Kept deliberately small:
   no frameworks, no custom properties beyond the palette, no JS. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #141b2b;
  --red: #D6263B;
  --amber: #f0a500;
  --white: #ffffff;
  --light-bg: #f5f6f8;
  --text: #2c3040;
  --text-light: #5a5f72;
  --border: #e0e2e8;

  /* Accents used by the content libraries. Declared here so the whole
     palette lives in one place, per the file header contract. */
  --example-bg: #fffaf0;
  --example-border: #f3d88a;
  --stub-bg: #fff3cd;
  --stub-text: #8a6d1c;
  --defined-term-bg: #f1f4ff;
  --defined-term-border: #d7def0;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  padding-top: 56px; /* offset for fixed .site-nav */
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.25;
  color: var(--navy);
}

a { color: var(--red); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--amber); }

/* Nav — matches the React SPA SiteHeader (white, fixed, red triangle logo). */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-nav .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.site-nav .logo:hover { color: var(--navy); }
.site-nav .logo .logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--red);
  color: var(--white);
  border-radius: 7px;
  font-size: 0.85rem;
  line-height: 1;
}
.site-nav .logo .logo-text { color: var(--navy); }
.site-nav .nav-links {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.site-nav .nav-links a {
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.site-nav .nav-links a:hover {
  color: var(--navy);
  background: rgba(20, 27, 43, 0.05);
}
.site-nav .nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.site-nav .nav-cta .nav-login {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
}
.site-nav .nav-cta .nav-login:hover {
  color: var(--navy);
  background: rgba(20, 27, 43, 0.05);
}
.site-nav .nav-cta .nav-signup {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  background: var(--red);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif;
}
.site-nav .nav-cta .nav-signup:hover {
  color: var(--white);
  background: #b81f31;
}

/* Mobile: hide secondary nav-links, keep logo + CTA */
@media (max-width: 880px) {
  .site-nav .nav-links { display: none; }
}
@media (max-width: 480px) {
  .site-nav { padding: 0 0.85rem; }
  .site-nav .nav-cta .nav-login { display: none; }
  .site-nav .logo .logo-text { display: none; }
}

/* Article header */
.article-header {
  background: var(--navy);
  color: var(--white);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}
.article-header .breadcrumb {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 1rem;
}
.article-header .breadcrumb a { color: var(--amber); }
.article-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  color: var(--white);
  max-width: 780px;
  margin: 0 auto 0.75rem;
}
.article-header .subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.8);
  max-width: 680px;
  margin: 0 auto;
}
.article-header .meta {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
}
.article-header .meta strong { color: rgba(255,255,255,0.8); font-weight: 500; }

/* Article body */
.article-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.article-body h2 {
  font-size: 1.45rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--amber);
  display: inline-block;
}
.article-body h3 {
  font-size: 1.15rem;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}
.article-body p { margin-bottom: 1rem; font-size: 1rem; }
.article-body ul, .article-body ol { margin: 0.75rem 0 1.25rem 1.5rem; }
.article-body li { margin-bottom: 0.5rem; font-size: 1rem; }
.article-body strong { color: var(--navy); }
.article-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--amber);
  background: var(--light-bg);
  color: var(--text);
  font-size: 1rem;
}
.article-body blockquote p { margin: 0 0 0.5rem; }
.article-body blockquote p:last-child { margin-bottom: 0; }

/* Quick-answer callout */
.callout {
  background: var(--light-bg);
  border-left: 4px solid var(--amber);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
}
.callout p { margin-bottom: 0.5rem; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--navy); }
.callout-red { border-left-color: var(--red); }
.callout-navy { border-left-color: var(--navy); }

/* Worked example block */
.worked-example {
  background: var(--example-bg);
  border: 1px solid var(--example-border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.worked-example h3 { margin-top: 0; }

/* Sources list */
.sources ol { margin-left: 1.25rem; }
.sources li { font-size: 0.95rem; color: var(--text-light); }
.sources li a { word-break: break-word; }

/* Related */
.related-guides {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.related-guides h2 { border-bottom: none; margin-top: 0; }
.related-guides ul { list-style: none; margin-left: 0; }
.related-guides li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.related-guides li:last-child { border-bottom: none; }
.related-guides a { font-weight: 600; }

/* Changelog */
.changelog {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-light);
}
.changelog h3 { font-size: 0.95rem; margin-bottom: 0.5rem; color: var(--text); }
.changelog ul { list-style: none; margin-left: 0; }
.changelog li { padding: 0.15rem 0; font-size: 0.85rem; }

/* Index / listing pages */
.library-intro {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1rem;
}
.library-intro p { font-size: 1.05rem; color: var(--text-light); }

.library-list {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  list-style: none;
}
.library-list li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.library-list li:last-child { border-bottom: none; }
.library-list .tier-tag {
  display: inline-block;
  background: var(--amber);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.5rem;
  vertical-align: middle;
}
.library-list .tier-tag.tier-2 { background: var(--light-bg); color: var(--text); }
.library-list .tier-tag.tier-3 { background: var(--border); color: var(--text); }
.library-list .status-tag {
  display: inline-block;
  background: var(--light-bg);
  color: var(--text-light);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.5rem;
  vertical-align: middle;
}
.library-list .status-tag.stub { background: var(--stub-bg); color: var(--stub-text); }
.library-list a.title { font-weight: 600; font-size: 1.1rem; }
.library-list p { font-size: 0.95rem; color: var(--text-light); margin-top: 0.25rem; }

/* Glossary */
.glossary {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.glossary-toc {
  background: var(--light-bg);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1.5rem 0 2rem;
  font-size: 0.9rem;
}
.glossary-toc a { margin-right: 0.75rem; display: inline-block; padding: 0.1rem 0; }
.glossary-entry {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 1rem;
}
.glossary-entry:last-child { border-bottom: none; }
.glossary-entry h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.glossary-entry .short-form {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
}
.glossary-entry p { margin-bottom: 0.5rem; }
.glossary-entry .see-also {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* CTA */
.cta-card {
  background: var(--navy);
  color: var(--white);
  padding: 1.5rem 1.75rem;
  border-radius: 10px;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cta-card h3 { color: var(--white); font-size: 1.1rem; margin: 0; }
.cta-card p { margin: 0; color: rgba(255,255,255,0.8); font-size: 0.95rem; }
.cta-card a {
  color: var(--amber);
  font-weight: 600;
  align-self: flex-start;
  border-bottom: 1px solid transparent;
}
.cta-card a:hover { border-bottom-color: var(--amber); }

/* Footer — mirrors the React SPA SiteFooter (navy bg, 4-column nav). */
.site-footer {
  background: #020617; /* slate-950 */
  color: rgba(255,255,255,0.55);
  padding: 3rem 1.5rem 1.5rem;
  font-size: 0.85rem;
}
.site-footer .footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
@media (min-width: 640px) {
  .site-footer .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 2.5rem; }
}
@media (min-width: 1024px) {
  .site-footer .footer-grid { grid-template-columns: repeat(5, 1fr); }
}
.site-footer .footer-brand {
  grid-column: span 2;
}
@media (min-width: 1024px) {
  .site-footer .footer-brand { grid-column: span 1; }
}
.site-footer .footer-brand .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}
.site-footer .footer-brand .logo-mark {
  width: 36px;
  height: 36px;
  background: var(--red);
  color: var(--white);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
}
.site-footer .footer-brand .logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
  letter-spacing: -0.01em;
}
.site-footer .footer-brand p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.55);
  max-width: 320px;
}
.site-footer h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 1rem;
}
.site-footer .footer-col nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.site-footer .footer-col nav a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.4);
  padding: 0.35rem 0;
  transition: color 0.15s;
}
.site-footer .footer-col nav a:hover { color: var(--white); }
.site-footer .footer-bottom {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
}
@media (min-width: 640px) {
  .site-footer .footer-bottom { flex-direction: row; }
}
.site-footer .footer-bottom .built-by { color: rgba(255,255,255,0.3); }

/* Small status bar at the top of the article body */
.status-bar {
  background: var(--light-bg);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  color: var(--text-light);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.status-bar strong { color: var(--navy); }

/* Definition term block for technical references */
.defined-term {
  background: var(--defined-term-bg);
  border: 1px solid var(--defined-term-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}
.defined-term .dt-name { font-weight: 700; color: var(--navy); }
.defined-term .dt-alt { color: var(--text-light); font-weight: 500; }

/* Table */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.article-body th, .article-body td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.article-body th {
  background: var(--light-bg);
  color: var(--navy);
  font-weight: 600;
}
