/* ===========================================================
   Mayfair & Co. — Internal Manuals · shared stylesheet
   Lifts brand tokens from design-tokens.css and applies them
   to the manual layout (header, sidebar TOC, qa cards, etc.)
   =========================================================== */

@import url("design-tokens.css");

:root {
  --cat-cheat: var(--copper-700);
  --cat-faq: var(--sage-700);
  --cat-product: var(--wood-500);
  --cat-issue: var(--copper-800);
  --cat-template: var(--ink-700);
  --cat-policy: var(--espresso-800);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--copper-100); color: var(--ink-900); }
a {
  color: var(--ink-900);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-300);
  transition: border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
a:hover { color: var(--copper-700); border-color: var(--copper-700); }
a.bare, .qa-q-text a, .toc a, .copy-btn, .menu-toggle, nav a { border-bottom: 0; }
:focus-visible { outline: 2px solid var(--copper-700); outline-offset: 2px; }

/* ── HEADER ── */
.header {
  background: var(--espresso-800);
  color: var(--cream-100);
  padding: 28px clamp(20px, 4vw, 48px) 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--espresso-900);
}
.header-brand { display: flex; flex-direction: column; gap: 6px; }
.header-logo {
  font-family: var(--logo-font);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper-300);
}
.header h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.003em;
  line-height: 1.1;
  color: var(--cream-100);
}
.header h1 em { font-style: italic; font-weight: 400; color: var(--copper-300); }
.header-meta {
  margin-left: auto;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-300);
}
.version-badge {
  border: 1px solid rgba(246, 232, 220, 0.25);
  padding: 5px 12px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--copper-300);
}
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(246, 232, 220, 0.4);
  color: var(--cream-100);
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out);
}
.menu-toggle:hover { background: rgba(246, 232, 220, 0.08); }

/* Tagline ribbon */
.ribbon {
  background: var(--bg-tagline);
  color: var(--cream-100);
  text-align: center;
  padding: 9px 20px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.ribbon span { margin: 0 14px; opacity: 0.85; }
.ribbon .sep { opacity: 0.4; }

/* ── LAYOUT ── */
.shell { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 110px); }
.sidebar {
  background: var(--cream-100);
  border-right: 1px solid var(--ink-100);
  padding: 24px 0 32px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  align-self: start;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--ink-200); }
.main { padding: 48px clamp(24px, 5vw, 72px) 80px; max-width: 1040px; width: 100%; }

/* ── SEARCH + TOC ── */
.search-wrap { padding: 0 24px 20px; border-bottom: 1px solid var(--ink-100); margin-bottom: 14px; }
.search-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: 8px;
  display: block;
}
.search-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--ink-200);
  font-family: var(--font-sans);
  font-size: 13.5px;
  background: var(--paper);
  color: var(--ink-900);
  transition: border-color var(--dur-base) var(--ease-out);
}
.search-input::placeholder { color: var(--ink-400); font-style: italic; }
.search-input:focus {
  outline: none;
  border-color: var(--copper-700);
  box-shadow: 0 0 0 1px var(--copper-700);
}
.search-hint {
  font-size: 10.5px;
  color: var(--ink-400);
  margin-top: 8px;
  letter-spacing: 0.04em;
  font-style: italic;
}
.search-count {
  display: none;
  font-size: 10.5px;
  color: var(--copper-700);
  margin-top: 8px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.search-count.active { display: block; }

.toc { padding: 6px 0 24px; }
.toc-group { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(181, 170, 160, 0.25); }
.toc-group:last-child { border-bottom: 0; }
.toc-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px 8px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.toc-cat .dot { width: 6px; height: 6px; flex-shrink: 0; transform: rotate(45deg); background: var(--copper-700); }
.toc a {
  display: block;
  padding: 7px 24px 7px 40px;
  font-size: 13px;
  color: var(--ink-700);
  border-left: 2px solid transparent;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.toc a:hover { background: var(--cream-200); color: var(--ink-900); }
.toc a.active {
  background: var(--cream-200);
  color: var(--ink-900);
  border-left-color: var(--copper-700);
  font-weight: 500;
}

/* ── SECTIONS ── */
.section { margin-bottom: 72px; scroll-margin-top: 24px; }
.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--ink-200);
  align-items: start;
}
.section-dot {
  width: 4px;
  min-height: 48px;
  background: var(--cat-faq);
  align-self: stretch;
  flex-shrink: 0;
}
.section-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 8px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.4vw, 36px);
  font-weight: 500;
  color: var(--ink-900);
  line-height: 1.1;
  letter-spacing: -0.003em;
}
.section-desc { font-size: 14px; color: var(--ink-500); margin-top: 12px; max-width: 680px; line-height: 1.6; }
.subsection { margin: 36px 0 16px; }
.subsection-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink-900);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink-100);
}

/* ── CHEAT CARDS ── */
.cheat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  margin-bottom: 24px;
  background: var(--ink-100);
  border: 1px solid var(--ink-100);
}
.cheat-card {
  background: var(--paper);
  padding: 20px 22px;
  position: relative;
  transition: background var(--dur-base) var(--ease-out);
}
.cheat-card:hover { background: var(--cream-50); }
.cheat-card::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 0;
  width: 3px;
  height: 14px;
  background: var(--copper-700);
}
.cheat-card h4 {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 10px;
}
.cheat-card .val {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink-900);
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.cheat-card .sub { font-family: var(--font-sans); font-size: 12.5px; color: var(--ink-500); margin-top: 6px; line-height: 1.5; }

/* ── ALERTS ── */
.alert {
  background: var(--cream-50);
  border: 1px solid var(--ink-100);
  border-left: 3px solid var(--copper-700);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
  color: var(--ink-700);
  line-height: 1.6;
}
.alert strong { color: var(--ink-900); font-weight: 600; }
.alert.danger { border-left-color: var(--copper-800); background: var(--copper-100); }
.alert.danger strong { color: var(--copper-900); }
.alert.info { border-left-color: var(--sage-700); background: var(--sage-100); }
.alert.info strong { color: var(--sage-900); }

/* ── Q&A CARDS ── */
.qa-list { display: flex; flex-direction: column; gap: 14px; }
.qa {
  background: var(--paper);
  border: 1px solid var(--ink-100);
  overflow: hidden;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.qa:hover { border-color: var(--ink-200); box-shadow: var(--shadow-sm); }
.qa-q {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  background: var(--cream-100);
  border-bottom: 1px solid var(--ink-100);
}
.qa-q-text {
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--ink-900);
  font-size: 14px;
  flex: 1;
  line-height: 1.5;
  letter-spacing: 0.005em;
}
.qa-q-tag {
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper-700);
  padding: 3px 9px;
  border: 1px solid var(--copper-300);
  background: var(--copper-100);
  white-space: nowrap;
  flex-shrink: 0;
}
.qa-a { padding: 18px 20px 8px; }
.qa-a-text { font-size: 14px; color: var(--ink-700); white-space: pre-wrap; line-height: 1.7; }
.qa-a-text p { margin-bottom: 12px; }
.qa-a-text p:last-child { margin-bottom: 0; }
.qa-a-text strong { color: var(--ink-900); font-weight: 600; }
.qa-a-text em { font-style: italic; color: var(--ink-500); }
.qa-a-text a { color: var(--copper-700); border-bottom: 1px solid var(--copper-300); }
.qa-a-text a:hover { border-bottom-color: var(--copper-700); }
.qa-note {
  display: block;
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-left: 2px solid var(--copper-700);
  padding: 10px 14px;
  margin: 10px 0;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--ink-500);
  font-style: italic;
  line-height: 1.55;
}
.qa-actions { display: flex; justify-content: flex-end; padding: 0 20px 16px; gap: 8px; }
.copy-btn {
  background: var(--sage-700);
  border: 0;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px 18px;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out);
}
.copy-btn:hover { background: var(--sage-800); }
.copy-btn.copied { background: var(--copper-700); }
.copy-btn.copied:hover { background: var(--copper-800); }

/* ── TABLES ── */
.product-table, .roles-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--ink-100);
  font-size: 13.5px;
  margin-bottom: 24px;
}
.product-table thead, .roles-table thead { background: var(--cream-100); }
.product-table th, .roles-table th {
  text-align: left;
  padding: 14px 14px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-500);
  border-bottom: 1px solid var(--ink-200);
  white-space: nowrap;
}
.roles-table th { background: var(--espresso-800); color: var(--cream-100); }
.product-table td, .roles-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--ink-100);
  vertical-align: top;
  line-height: 1.5;
}
.product-table tr:last-child td, .roles-table tr:last-child td { border-bottom: none; }
.product-table tr:hover td { background: var(--cream-50); }
.product-table .name { font-weight: 500; color: var(--ink-900); }
.product-table .name small { display: block; font-weight: 400; color: var(--ink-400); font-size: 11.5px; margin-top: 3px; text-transform: none; letter-spacing: 0; font-style: italic; }
.product-table .price { font-family: var(--font-sans); font-weight: 400; color: var(--ink-900); text-align: right; white-space: nowrap; font-feature-settings: "tnum"; }
.product-table .dim { color: var(--ink-500); font-size: 12.5px; white-space: nowrap; font-feature-settings: "tnum"; }
.product-table .empty { color: var(--ink-300); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 24px; }

/* ── SEARCH HIDE ── */
.hidden { display: none !important; }
.no-results {
  display: none;
  padding: 28px;
  text-align: center;
  color: var(--ink-400);
  font-style: italic;
  background: var(--cream-50);
  border: 1px solid var(--ink-100);
  font-family: var(--font-serif);
  font-size: 15px;
}
.section.has-no-match > .qa-list,
.section.has-no-match .table-scroll,
.section.has-no-match .product-table,
.section.has-no-match > .cheat-grid,
.section.has-no-match > .alert,
.section.has-no-match > ul,
.section.has-no-match > .roles-table { display: none; }
.section.has-no-match .no-results { display: block; }

/* ── FOOTER ── */
.footer { border-top: 1px solid var(--ink-200); margin-top: 64px; padding: 32px 0 0; font-size: 12.5px; color: var(--ink-500); line-height: 1.7; }
.footer p { margin-bottom: 6px; }
.footer a { color: var(--ink-700); border-color: var(--ink-300); }
.footer code { background: var(--cream-100); padding: 2px 8px; font-family: "SF Mono", Menlo, monospace; font-size: 11.5px; }

code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--cream-100);
  padding: 1px 6px;
  color: var(--copper-800);
}

/* Lists in policy sections — copper dash bullets */
.section ul {
  list-style: none;
  padding-left: 0;
  font-size: 14px;
  color: var(--ink-700);
  line-height: 1.85;
}
.section ul li { padding-left: 24px; position: relative; margin-bottom: 6px; }
.section ul li::before { content: ""; position: absolute; left: 0; top: 13px; width: 8px; height: 1px; background: var(--copper-700); }
.section ul li strong { color: var(--ink-900); font-weight: 600; }

/* ── LANDING PAGE (index) ── */
.landing { max-width: 880px; margin: 0 auto; padding: 64px clamp(24px, 5vw, 48px) 80px; }
.landing-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  color: var(--ink-900);
  letter-spacing: -0.005em;
  line-height: 1.05;
  margin-bottom: 14px;
}
.landing-intro { font-size: 17px; color: var(--ink-500); line-height: 1.6; max-width: 620px; margin-bottom: 48px; }
.manuals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--ink-100); border: 1px solid var(--ink-100); }
.manual-card {
  background: var(--paper);
  padding: 28px 30px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background var(--dur-base) var(--ease-out);
  text-decoration: none;
  color: inherit;
  border: 0;
}
.manual-card:hover { background: var(--cream-50); }
.manual-card .eyebrow {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.manual-card .name { font-family: var(--font-serif); font-size: 22px; font-weight: 500; color: var(--ink-900); line-height: 1.2; letter-spacing: -0.003em; }
.manual-card .desc { font-size: 13.5px; color: var(--ink-500); line-height: 1.55; }
.manual-card .meta { font-size: 11px; color: var(--ink-400); letter-spacing: 0.04em; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--ink-100); }

/* ── RESPONSIVE ── */
.scrim { display: none; position: fixed; inset: 0; background: rgba(26, 22, 18, 0.55); z-index: 150; }
.scrim.open { display: block; }
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 300px;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform var(--dur-base) var(--ease-out);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: inline-block; }
  .main { padding: 36px 22px 60px; }
  .header { padding: 22px 20px; }
  .header-meta { font-size: 10px; gap: 12px; }
  .cheat-grid { grid-template-columns: 1fr 1fr; }
  .section { margin-bottom: 56px; }
}
@media (max-width: 520px) {
  .cheat-grid { grid-template-columns: 1fr; }
  .ribbon { font-size: 10px; letter-spacing: 0.2em; }
  .ribbon span { margin: 0 8px; }
  .qa-q { flex-direction: column; align-items: stretch; }
  .qa-q-tag { align-self: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
