/* ============================================================
   SWITCHBOARD DOCUMENT SYSTEM — shared.css
   Used by: index.html, guide.html, design-system.html,
            brand-guidelines.html
   ============================================================ */

/* ── ADOBE FONTS (Amifer) ─────────────────────── */
/* Loaded via <link> in each HTML file:
   <link rel="stylesheet" href="https://use.typekit.net/qqt5rkg.css"> */

/* ── TOKENS ──────────────────────────────────── */
:root {
  --brand:        #360568;
  --purple:       #7209B7;
  --salmon:       #FF595E;
  --red:          #A90000;
  --background:   #F9F5E3;
  --oldlace:      #F9F5E3;
  --black:        #190825;
  --white:        #FFFFFF;
  --news-bg:      #FBE7C1;

  --font-display: amifer, Georgia, serif;
  --font-body:    poppins, sans-serif;

  --page-bg:      #FDFAF4;
  --rule:         rgba(54,5,104,0.12);
  --muted:        rgba(25,8,37,0.45);

  --radius:       10px;
  --radius-l:     16px;
  --shadow:       0 2px 12px rgba(54,5,104,0.08);
}

/* ── RESET ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--page-bg);
  color: var(--black);
  line-height: 1.7;
  font-size: 15px;
}

/* ============================================================
   SHARED: COVER / HERO
   ============================================================ */
.sb-cover {
  min-height: 100vh;
  background: var(--brand);
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 3.5rem;
  position: relative;
  overflow: hidden;
}

.sb-hero {
  background: var(--brand);
  padding: 4rem 3.5rem 5rem;
  position: relative;
  overflow: hidden;
}

/* Grain texture — applied to both cover and hero */
.sb-cover::before,
.sb-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  background-size: 256px;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
}

/* Salmon radial glow */
.sb-cover::after,
.sb-hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 65vw;
  height: 65vw;
  background: radial-gradient(circle, rgba(255,89,94,0.22) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* Cover inner content */
.sb-cover-body { position: relative; z-index: 1; }

.sb-cover-eyebrow,
.sb-hero-eyebrow {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(249,245,227,0.45);
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sb-cover-eyebrow::before,
.sb-hero-eyebrow::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: rgba(249,245,227,0.3);
  flex-shrink: 0;
}

.sb-cover h1,
.sb-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6.5vw, 6rem);
  font-weight: 700;
  line-height: 1.02;
  color: var(--oldlace);
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.sb-cover h1 em,
.sb-hero h1 em {
  font-style: italic;
  color: var(--salmon);
}

.sb-cover-sub,
.sb-hero-sub {
  font-size: 0.95rem;
  font-weight: 300;
  color: rgba(249,245,227,0.55);
  margin-top: 1.25rem;
  max-width: 440px;
  line-height: 1.75;
  position: relative;
  z-index: 1;
}

.sb-cover-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 2rem;
  border-top: 1px solid rgba(249,245,227,0.1);
  flex-wrap: wrap;
  gap: 1rem;
}

.sb-cover-meta {
  font-size: 0.72rem;
  color: rgba(249,245,227,0.3);
  line-height: 1.9;
}

.sb-cover-for {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: 0.85rem;
  color: rgba(249,245,227,0.3);
  text-align: right;
}

/* Hero inner */
.sb-hero-inner {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ============================================================
   SHARED: LOGO
   ============================================================ */
.sb-logo {
  display: block;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

.sb-logo svg { display: block; }

/* ============================================================
   SHARED: TABLE OF CONTENTS
   ============================================================ */
.sb-toc-wrap {
  background: var(--background);
  padding: 3.5rem;
  border-bottom: 1px solid var(--rule);
}

.sb-toc-inner { max-width: 900px; margin: 0 auto; }

.sb-toc-heading {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 1.5rem;
}

.sb-toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 0.55rem;
}

.sb-toc-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  background: var(--white);
  transition: border-color 0.2s, color 0.2s;
}

.sb-toc-item:hover {
  border-color: var(--salmon);
  color: var(--brand);
}

.sb-toc-num {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--salmon);
  opacity: 0.7;
  min-width: 1.2rem;
}

/* ============================================================
   SHARED: PAGE LAYOUT
   ============================================================ */
.sb-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 5rem 3.5rem 8rem;
}

/* ============================================================
   SHARED: CHAPTER STRUCTURE
   ============================================================ */
.sb-chapter {
  border-top: 1px solid var(--rule);
  padding-top: 5rem;
  margin-top: 5rem;
}

.sb-chapter:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.sb-chapter-eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.sb-chapter-num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  color: rgba(54,5,104,0.07);
  line-height: 1;
  font-style: italic;
  flex-shrink: 0;
}

.sb-chapter-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--salmon);
}

h2.sb-chapter-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: var(--brand);
  line-height: 1.15;
  margin-bottom: 2rem;
}

/* ============================================================
   SHARED: BODY TEXT
   ============================================================ */
.sb-page p,
.sb-page li {
  color: var(--muted);
  font-weight: 300;
  line-height: 1.75;
}

.sb-page p { margin-bottom: 1.1rem; }
.sb-page p:last-child { margin-bottom: 0; }

.sb-page h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand);
  margin: 2.5rem 0 0.75rem;
}

.sb-page strong { color: var(--black); font-weight: 600; }
.sb-page em { font-style: italic; }
.sb-page a { color: var(--purple); text-decoration: none; }
.sb-page a:hover { text-decoration: underline; }

.sb-page ul,
.sb-page ol {
  margin: 0.75rem 0 1.1rem 1.5rem;
}

.sb-page li { margin-bottom: 0.45rem; }

/* ============================================================
   SHARED: CALLOUTS
   ============================================================ */
.sb-callout {
  border-left: 3px solid var(--brand);
  padding: 1.25rem 1.5rem;
  background: rgba(54,5,104,0.04);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 2rem 0;
}

.sb-callout p { color: var(--muted); margin-bottom: 0.4rem; }
.sb-callout p:last-child { margin-bottom: 0; }

.sb-callout-title {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.sb-callout.tip {
  border-color: #C27803;
  background: rgba(194,120,3,0.04);
}

.sb-callout.tip .sb-callout-title { color: #C27803; }

/* ============================================================
   SHARED: FEATURE CARDS
   ============================================================ */
.sb-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.sb-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sb-card:hover {
  border-color: rgba(255,89,94,0.3);
  box-shadow: var(--shadow);
}

.sb-card-icon { font-size: 1.4rem; margin-bottom: 0.75rem; }

.sb-card h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 0.4rem;
  letter-spacing: 0;
  text-transform: none;
}

.sb-card p { font-size: 0.8rem; color: var(--muted); margin: 0; }

/* ============================================================
   SHARED: STEPS
   ============================================================ */
.sb-steps { margin: 2rem 0; }

.sb-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: start;
}

.sb-step-num {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--salmon);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--salmon);
  flex-shrink: 0;
}

.sb-step-body h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0.4rem 0 0.2rem;
  letter-spacing: 0;
  text-transform: none;
}

.sb-step-body p { font-size: 0.875rem; margin-bottom: 0; color: var(--muted); font-weight: 300; }

/* ============================================================
   SHARED: CODE
   ============================================================ */
code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  background: var(--background);
  color: var(--brand);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--rule);
}

/* ============================================================
   SHARED: TABLES
   ============================================================ */
.sb-table-wrap {
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--rule);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--white);
}

th {
  text-align: left;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--oldlace);
  font-weight: 600;
  padding: 0.85rem 1rem;
  background: var(--brand);
}

td {
  padding: 0.72rem 1rem;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  vertical-align: top;
  line-height: 1.55;
  font-weight: 300;
}

tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: rgba(54,5,104,0.02); }
td strong { color: var(--black); font-weight: 600; }
td em { color: var(--muted); }

/* ============================================================
   SHARED: BACK LINK
   ============================================================ */
.sb-back {
  font-size: 0.75rem;
  color: rgba(25,8,37,0.28);
  text-decoration: none;
  display: inline-block;
  margin-top: 3rem;
  transition: color 0.15s;
}

.sb-back:hover { color: var(--salmon); text-decoration: none; }

/* ============================================================
   SHARED: SECTION LABEL
   ============================================================ */
.sb-section-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--salmon);
  margin-bottom: 1.5rem;
}

/* ============================================================
   SHARED: FOOTER
   ============================================================ */
.sb-footer {
  background: var(--brand);
  padding: 2.25rem 3.5rem;
  position: relative;
  overflow: hidden;
}

.sb-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-size: 256px;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.sb-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.sb-footer p {
  font-size: 0.75rem;
  color: rgba(249,245,227,0.32);
  line-height: 1.8;
  font-weight: 300;
}

.sb-footer strong { color: rgba(249,245,227,0.55); font-weight: 500; }

/* ============================================================
   INDEX PAGE SPECIFIC
   ============================================================ */
.sb-doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.sb-doc-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 1px solid var(--rule);
  text-decoration: none;
  background: var(--white);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sb-doc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(54,5,104,0.12);
  border-color: rgba(54,5,104,0.22);
}

.sb-doc-thumb {
  height: 155px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
}

.sb-doc-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.07'/%3E%3C/svg%3E");
  background-size: 256px;
  mix-blend-mode: overlay;
}

.sb-doc-thumb-guide   { background: linear-gradient(163deg, var(--brand) 13.85%, var(--purple) 78.97%); }
.sb-doc-thumb-system  { background: linear-gradient(163deg, var(--brand) 13.85%, var(--salmon) 78.97%); }
.sb-doc-thumb-brand   { background: linear-gradient(163deg, var(--purple) 0%, var(--salmon) 100%); }

.sb-doc-thumb-label {
  position: relative;
  z-index: 1;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(249,245,227,0.6);
  background: rgba(0,0,0,0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.sb-doc-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sb-doc-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

.sb-doc-desc {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1.25rem;
}

.sb-doc-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
  transition: gap 0.2s ease;
}

.sb-doc-card:hover .sb-doc-cta { gap: 0.8rem; }

.sb-doc-arrow {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--salmon);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  flex-shrink: 0;
  transition: background 0.2s;
}

.sb-doc-card:hover .sb-doc-arrow { background: var(--brand); }

.sb-info-strip {
  background: var(--background);
  border-radius: var(--radius-l);
  padding: 2rem 2.5rem;
  border: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.sb-info-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--salmon);
  margin-bottom: 0.4rem;
}

.sb-info-value {
  font-size: 0.875rem;
  color: var(--black);
  font-weight: 300;
  line-height: 1.7;
}

.sb-info-value a { color: var(--brand); text-decoration: none; font-weight: 500; }
.sb-info-value a:hover { text-decoration: underline; }

/* ============================================================
   DESIGN SYSTEM SPECIFIC (ds- prefix for its own chrome)
   ============================================================ */
.ds-bg:     #f0ece0;
.ds-border: #d4c9b0;
.ds-label:  #888;
.ds-code:   #e8e2d4;
.ds-sec:    #ddd6c4;

/* These are kept inline in design-system.html as they
   reference design system chrome variables, not brand tokens */

/* ============================================================
   BRAND GUIDELINES SPECIFIC
   ============================================================ */
.bg-preview-rule { border: 1px solid var(--rule); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 760px) {
  .sb-cover,
  .sb-hero,
  .sb-toc-wrap,
  .sb-page,
  .sb-footer { padding-left: 1.5rem; padding-right: 1.5rem; }

  .sb-cover-footer { flex-direction: column; align-items: flex-start; }
  .sb-doc-grid { grid-template-columns: 1fr; }
  .sb-info-strip { grid-template-columns: 1fr; gap: 1.25rem; }
  .sb-footer-inner { flex-direction: column; align-items: flex-start; }

  .sb-cover h1,
  .sb-hero h1 { font-size: clamp(2rem, 8vw, 3rem); }
}
