/* anobii-legal — self-contained styles, no external dependencies */

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

:root {
  --color-bg: #ffffff;
  --color-surface: #f8f7f5;
  --color-border: #e4e0d8;
  --color-text: #1a1a18;
  --color-text-muted: #6b6860;
  --color-accent: #c0392b;
  --color-accent-hover: #96281b;
  --color-link: #2c6e9c;
  --color-link-hover: #1a4a6e;
  --color-active: #c0392b;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --max-width: 780px;
  --radius: 4px;
  --radius-button: 8px;
}

html {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */

header {
  background: var(--color-text);
  color: #fff;
  padding: 0 1.5rem;
}

.header-inner {
  max-width: calc(var(--max-width) + 3rem);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0;
}

.logo {
  text-decoration: none;
  flex-shrink: 0;
}

.logo-anobii {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.logo-legal {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  margin-left: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Language dropdown ── */

.lang-dropdown {
  position: relative;
  margin-left: auto;
}

.lang-dropdown summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: rgba(255,255,255,0.85);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-button);
  transition: color 0.15s, background 0.15s;
}

.lang-dropdown summary::-webkit-details-marker {
  display: none;
}

.lang-dropdown summary::after {
  content: "";
  width: 0.4em;
  height: 0.4em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
  transition: transform 0.15s;
}

.lang-dropdown[open] summary::after {
  transform: translateY(0.1em) rotate(-135deg);
}

.lang-dropdown summary:hover,
.lang-dropdown[open] summary {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.lang-dropdown ul {
  list-style: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.375rem);
  z-index: 10;
  min-width: 9rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius-button) + 0.25rem);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  padding: 0.25rem;
}

.lang-dropdown li a {
  display: block;
  white-space: nowrap;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-button);
}

.lang-dropdown li a:hover {
  background: var(--color-surface);
}

.lang-dropdown li a.active {
  color: var(--color-active);
  font-weight: 600;
  background: rgba(192, 57, 43, 0.08);
}

/* ── Page tabs ── */

.tabs-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 1.5rem;
}

.page-tabs {
  max-width: calc(var(--max-width) + 3rem);
  margin: 0 auto;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.page-tabs a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  white-space: nowrap;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-button);
  transition: color 0.15s, background 0.15s;
}

.page-tabs a:hover {
  color: var(--color-text);
  background: rgba(26, 26, 24, 0.06);
}

.page-tabs a.active {
  color: var(--color-text);
  font-weight: 600;
  background: rgba(26, 26, 24, 0.1);
}

/* ── Fallback banner ── */

.fallback-banner {
  background: #fef9e7;
  border: 1px solid #f0d060;
  border-radius: var(--radius);
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #7a6000;
  margin-bottom: 2rem;
}

/* ── Main content ── */

main {
  padding: 2.5rem 1.5rem 4rem;
}

.content {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Legal HTML content styles (content injected from anobii.com) */

.content h1,
.content h2,
.content h3 {
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.content h1 { font-size: 1.75rem; margin-top: 0; }
.content h2 { font-size: 1.25rem; color: var(--color-text); }
.content h3 { font-size: 1rem; }

.content p {
  margin-bottom: 1rem;
  color: var(--color-text);
}

.content ul,
.content ol {
  margin: 0.75rem 0 1rem 1.5rem;
}

.content li {
  margin-bottom: 0.375rem;
}

.content a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.content a:hover {
  color: var(--color-link-hover);
}

.content strong,
.content b {
  font-weight: 600;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}

.content th,
.content td {
  text-align: left;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
}

.content th {
  background: var(--color-surface);
  font-weight: 600;
}

.content tr:nth-child(even) td {
  background: var(--color-surface);
}

/* ── Footer ── */

footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.footer-inner {
  max-width: calc(var(--max-width) + 3rem);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

footer a {
  color: var(--color-text-muted);
}

footer a:hover {
  color: var(--color-text);
}

.footer-version {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.5;
}

/* ── Responsive ── */

@media (max-width: 600px) {
  .header-inner {
    gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .tabs-bar {
    padding: 0 0.5rem;
  }

  .page-tabs a {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
  }

  .content h1 { font-size: 1.375rem; }
  .content h2 { font-size: 1.125rem; }

  main {
    padding: 1.5rem 1rem 3rem;
  }
}
