/* GB Studio 4.2 Reference — extends morphoice.com styles */

@font-face {
  font-family: "Morphoice Regular";
  src: url('//www.morphoice.com/css/Morphoice-Regular.woff');
  font-display: swap;
}

:root {
  --bg:          #ffffff;
  --bg-card:     #f8f5fc;
  --bg-code:     #f3eef8;
  --bg-nav:      #faf8fd;
  --border:      #e8e0f0;
  --border-light:#d5c9e6;
  --text:        #462f65;
  --text-muted:  #6a528b;
  --text-dim:    #9a8bb8;
  --accent:      #e317b0;
  --accent-hover:#e72dc6;
  --accent-dim:  rgba(227, 23, 176, 0.08);
  --accent-glow: rgba(227, 23, 176, 0.15);
  --cyan:        #6f42c1;
  --cyan-dim:    rgba(111, 66, 193, 0.08);
  --green:       #28a76e;
  --orange:      #d4950a;
  --red:         #dc3545;
  --purple:      #40265d;
  --purple-dark: #40265d;
  --nav-w:       280px;
  --topbar-h:    74px;
  --font-sans:   'Titillium Web', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:   'JetBrains Mono', 'SFMono-Regular', 'Cascadia Code', 'Fira Code', Consolas, monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.morphoice { font-family: "Morphoice Regular"; }

/* ── Center hr.divider (morphoice.com doesn't set auto margins) ── */
hr.divider {
  margin-left: auto;
  margin-right: auto;
}

/* ── Gameboy Hero Masthead ── */
header.gameboy {
  background-color: var(--purple-dark);
}

/* ── Content Wrapper (doc subpages with sidebar) ── */
.doc-wrapper {
  display: flex; margin-top: var(--topbar-h); flex: 1;
}

/* ── Side Navigation ── */
nav.sidebar {
  position: fixed; top: var(--topbar-h); left: 0; width: var(--nav-w); height: calc(100vh - var(--topbar-h));
  overflow-y: auto; background: var(--bg-nav); border-right: 1px solid var(--border);
  padding: 1.25rem 0; z-index: 100;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
nav.sidebar .logo {
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
nav.sidebar .logo h1 {
  font-size: 1.05rem; font-weight: 700; color: var(--accent);
  letter-spacing: 0.06em; text-transform: uppercase;
}
nav.sidebar .logo span { font-size: 0.85rem; color: var(--text-muted); display: block; margin-top: 0.1rem; }

nav.sidebar ul { list-style: none; }
nav.sidebar > ul > li { margin-bottom: 0.15rem; }
nav.sidebar > ul > li > a {
  display: block; padding: 0.45rem 1.25rem; color: var(--text-muted);
  text-decoration: none; font-size: 0.95rem; font-weight: 600;
  letter-spacing: 0.03em;
  transition: color 0.15s, background 0.15s;
}
nav.sidebar > ul > li > a:hover { color: var(--purple); background: var(--accent-dim); }
nav.sidebar > ul > li > a.active {
  color: var(--accent); border-left: 3px solid var(--accent);
  padding-left: calc(1.25rem - 3px); background: var(--accent-dim);
}

nav.sidebar > ul > li > ul { margin-bottom: 0.5rem; }
nav.sidebar > ul > li > ul > li > a {
  display: block; padding: 0.15rem 1.25rem 0.15rem 2.25rem; color: var(--text-dim);
  text-decoration: none; font-size: 0.85rem; transition: color 0.15s, background 0.15s;
}
nav.sidebar > ul > li > ul > li > a:hover { color: var(--cyan); background: var(--cyan-dim); }
nav.sidebar > ul > li > ul > li > a.active { color: var(--cyan); }

/* ── Main Content (doc subpages) ── */
main {
  margin-left: var(--nav-w); flex: 1; max-width: 1100px;
  padding: 2.5rem 3rem 5rem;
  font-size: 1.25rem;
}

/* ── Typography ── */
h1 {
  font-size: 2.6rem; margin-bottom: 0.5rem; font-weight: 700;
  color: var(--purple);
}
h1 .gradient {
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
h2 {
  font-size: 1.85rem; margin: 2.5rem 0 0.75rem; padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border); color: var(--purple);
}
h3 { font-size: 1.5rem; margin: 1.75rem 0 0.5rem; color: var(--purple); }
h4 {
  font-size: 1.2rem; margin: 1.25rem 0 0.4rem; color: var(--text-muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
p { margin: 0.5rem 0; }
ul, ol { margin: 0.5rem 0 0.5rem 1.5rem; }
li { margin: 0.25rem 0; }

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

strong { color: var(--purple); }

/* ── Code ── */
code {
  font-family: var(--font-mono); font-size: 0.92em;
  background: var(--bg-code); padding: 0.15em 0.45em;
  border-radius: 4px; border: 1px solid var(--border);
  color: var(--cyan);
}
pre {
  background: var(--bg-code); border: 1px solid var(--border);
  border-radius: 6px; padding: 1.25rem 1.5rem; overflow-x: auto;
  margin: 0.75rem 0; line-height: 1.55;
}
pre code {
  background: none; border: none; padding: 0;
  font-size: 1.05rem; color: var(--text);
}

/* ── Tables ── */
table {
  width: 100%; border-collapse: collapse; margin: 0.75rem 0;
}
th {
  text-align: left; padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--border-light);
  color: var(--accent); font-weight: 600; font-size: 1rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}
td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
tr:hover td { background: var(--accent-dim); }
td code { font-size: 0.9em; }

/* ── Callouts ── */
.callout {
  border-left: 3px solid; padding: 1rem 1.25rem; margin: 1rem 0;
  border-radius: 0 6px 6px 0; background: var(--bg-card);
}
.callout-info  { border-color: var(--cyan); }
.callout-warn  { border-color: var(--orange); }
.callout-danger { border-color: var(--red); }
.callout-title { font-weight: 600; font-size: 1.1rem; margin-bottom: 0.3rem; }
.callout-info .callout-title { color: var(--cyan); }
.callout-warn .callout-title { color: var(--orange); }
.callout-danger .callout-title { color: var(--red); }

/* ── Hero (text-only, doc subpages) ── */
.hero {
  margin-bottom: 2rem; padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 2.8rem; }
.hero p { color: var(--text-muted); }

/* ── Page cards (index) ── */
.page-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem; margin: 1.5rem 0;
}
.page-card {
  background: #fff; border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px; padding: 1.5rem 1.5rem 1.5rem 4.5rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  text-decoration: none; display: block; color: var(--text);
  position: relative;
}
.page-card:hover {
  border-color: var(--accent); box-shadow: 0 4px 20px var(--accent-glow);
  text-decoration: none; transform: translateY(-2px);
}
.page-card i {
  position: absolute; top: 1.65rem; left: 1.25rem;
  font-size: 2rem; color: var(--accent); line-height: 1;
}
.page-card h3 {
  font-size: 1.5rem; margin: 0 0 0.4rem; color: #111; font-weight: 700;
}
.page-card p { font-size: 1.05rem; color: var(--text-muted); margin: 0; line-height: 1.45; }

/* ── Search ── */
.search-box {
  margin: 1.5rem 0; position: relative;
}
.search-box input {
  width: 100%; padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 1.15rem;
  font-family: var(--font-sans); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.search-box input::placeholder { color: var(--text-dim); }
.search-box::before {
  content: "\1F50D"; position: absolute; left: 0.85rem; top: 50%;
  transform: translateY(-50%); font-size: 1.15rem; opacity: 0.4;
}
.search-results { margin-top: 1rem; }
.search-result {
  display: block; padding: 0.85rem 1.25rem; margin-bottom: 0.5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; text-decoration: none; color: var(--text);
  transition: border-color 0.15s;
}
.search-result:hover { border-color: var(--accent); text-decoration: none; }
.search-result .title { font-weight: 600; color: var(--accent); font-size: 1.15rem; }
.search-result .context { font-size: 1.05rem; color: var(--text-muted); margin-top: 0.2rem; }
.search-result mark { background: var(--accent-dim); color: var(--accent); padding: 0.1em 0.2em; border-radius: 2px; }

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 1.05rem; color: var(--text-dim); margin-bottom: 1.5rem;
  background: none; padding: 0;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 0.4rem; }

/* ── Footer ── */
footer.gameboy-footer {
  margin-top: 4rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 0.95rem;
}
footer.gameboy-footer a { color: var(--text-muted); }
footer.gameboy-footer a:hover { color: var(--accent); }

/* ── Nav bottom link ── */
.nav-morphoice {
  padding: 1rem 1.25rem; margin-top: 1rem;
  border-top: 1px solid var(--border);
}
.nav-morphoice a {
  color: var(--text-dim); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  text-decoration: none; transition: color 0.15s;
}
.nav-morphoice a:hover { color: var(--accent); text-decoration: none; }

/* ── Logo link ── */
nav.sidebar .logo a { text-decoration: none; }
nav.sidebar .logo a:hover { text-decoration: none; }

/* ── Afterburn Promo ── */
.afterburn-promo {
  margin: 3rem 0; padding: 2rem;
  background: linear-gradient(135deg, var(--bg-card), rgba(227, 23, 176, 0.05));
  border: 1px solid var(--border); border-radius: 10px;
}
.afterburn-promo h2 {
  border-bottom: none; margin: 0 0 1.5rem; padding: 0;
  font-size: 1.6rem;
}
.promo-content {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  align-items: center;
}
.promo-text p { color: var(--text-muted); margin-bottom: 0.75rem; }
.promo-text strong { color: var(--accent); }
.promo-links { margin-top: 1.25rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.promo-btn {
  display: inline-block; padding: 0.6rem 1.25rem;
  background: var(--accent); color: #fff; border-radius: 6px;
  font-size: 1rem; font-weight: 600; text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.promo-btn:hover {
  background: var(--accent-hover); box-shadow: 0 0 15px var(--accent-glow);
  text-decoration: none; color: #fff;
}
.promo-btn-secondary {
  background: transparent; border: 1px solid var(--accent);
  color: var(--accent); border-radius: 6px;
}
.promo-btn-secondary:hover {
  background: var(--accent-dim); color: var(--accent);
}
.promo-screenshots img {
  width: 100%; border-radius: 8px; border: 1px solid var(--border);
}

/* ── Mobile hamburger ── */
.sidebar-toggle {
  display: none; background: none; border: none; color: var(--purple);
  font-size: 1.5rem; cursor: pointer; padding: 0.25rem 0.5rem;
  margin-right: 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar-toggle { display: block; }
  nav.sidebar { display: none; left: 0; }
  nav.sidebar.open { display: block; background: var(--bg); }
  main { margin-left: 0; padding: 1.5rem; }
  .page-grid { grid-template-columns: 1fr; }
  .promo-content { grid-template-columns: 1fr; }
  .promo-screenshots { order: -1; }
}
