/* ============================================================
   briscola — Shared Stylesheet
   Light (default) + Dark mode via [data-theme="dark"]
   Palette inherited from xpong for family look
   ============================================================ */

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

:root {
  --bg:           #f8f9fa;
  --surface:      #ffffff;
  --border:       #a2a9b1;
  --border-light: #eaecf0;
  --text:         #202122;
  --text-muted:   #54595d;
  --text-light:   #72777d;
  --link:         #3366cc;
  --link-hover:   #6a8fd8;
  --accent:       #3366cc;
  --header-bg:    #ffffff;
  --toc-bg:       #f8f9fa;
  --badge-bg:     #eaecf0;
  --font-serif:   'Linux Libertine','Georgia','Times New Roman',serif;
  --font-sans:    'Linux Biolinum','Helvetica Neue',Arial,sans-serif;
  --font-mono:    'Courier New',monospace;
  --shadow:       0 1px 4px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --bg:           #18191a;
  --surface:      #242526;
  --border:       #3a3b3c;
  --border-light: #2d2e2f;
  --text:         #e4e6ea;
  --text-muted:   #b0b3b8;
  --text-light:   #8a8d91;
  --link:         #7aabf7;
  --link-hover:   #aac8ff;
  --accent:       #7aabf7;
  --header-bg:    #242526;
  --toc-bg:       #1e1f20;
  --badge-bg:     #3a3b3c;
  --shadow:       0 1px 4px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  transition: background .2s, color .2s;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--link-hover); }

#br-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  transition: background .2s, border-color .2s;
}
#br-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 0;
}

#br-logo {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: bold;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  margin-right: 24px;
}
#br-logo:hover { text-decoration: none; }

#br-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.br-nav-link {
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--text-muted);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.br-nav-link:hover {
  background: var(--border-light);
  color: var(--text);
  text-decoration: none;
}
.br-nav-link.active {
  background: var(--accent);
  color: #fff;
}
.br-btn-disabled { opacity: .5; cursor: default; }
.br-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  background: var(--badge-bg);
  color: var(--text-muted);
  margin-left: 4px;
}

#br-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

#br-burger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-size: 18px;
  padding: 2px 8px;
  cursor: pointer;
}

#br-lang-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  outline: none;
}
#br-lang-select:hover { border-color: var(--accent); }
#br-lang-select:focus { border-color: var(--accent); }

#br-theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: background .15s;
  line-height: 1;
}
#br-theme-toggle:hover { background: var(--border-light); }

#br-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

#br-footer {
  border-top: 1px solid var(--border);
  background: var(--toc-bg);
  padding: 16px 0;
  margin-top: 48px;
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
}
#br-footer a { color: var(--text-light); }
#br-footer a:hover { color: var(--link); }

.br-hero {
  text-align: center;
  padding: 56px 24px 48px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 40px;
}
.br-hero-logo {
  font-family: var(--font-serif);
  font-size: 52px;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.br-hero-icon { width: 64px; height: 64px; flex-shrink: 0; }
.br-hero-lab {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.br-hero-tagline {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-style: italic;
}
.br-hero-desc {
  max-width: 680px;
  margin: 0 auto 36px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  font-family: var(--font-serif);
}

@media (max-width: 700px) {
  .br-hero-logo { font-size: 36px; }
  .br-hero { padding: 32px 16px 28px; }
  #br-nav { display: none; }
  #br-burger { display: block; padding: 4px 12px; font-size: 20px; }
  #br-logo { font-size: 17px; margin-right: 8px; }
  #br-lang-select { font-size: 11px; }
  #br-header-controls { gap: 5px; }
  #br-header-inner { padding: 0 8px; position: relative; }
  #br-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 8px 16px;
    gap: 4px;
  }
  #br-nav.open .br-nav-link { padding: 10px 12px; font-size: 15px; }
}
