/* Shared stylesheet for legal pages (terms.html, privacy.html, cookies.html).
   index.html keeps its CSS embedded inline (single-file build, see NOTES.md);
   this file exists so the three legal pages don't triple-duplicate the same
   ~150 lines of header/footer/cookie-banner CSS. Tokens/rules here are kept in
   sync with index.html's inline <style> by hand. If the design system changes
   there (colors, spacing, fonts), mirror it here too. */

:root {
  color-scheme: light;
  --ink: #10151b;
  --ink-soft: #333c46;
  --paper: #f2f2ec;
  --paper-raised: #ffffff;
  --ledger: #1f5fae;
  --ledger-dark: #163f78;
  --ledger-light: #6fa3e0;
  --line: #d8d8ce;
  --muted: #5b6169;
  --focus: #163f78;
  --radius: 3px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Piazzolla', Georgia, serif; letter-spacing: -0.01em; margin: 0; }
p { text-wrap: pretty; }
a { color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--ledger); color: var(--paper); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 12px 18px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ===== Header ===== */
header.site {
  position: sticky; top: 0; z-index: 30;
  background: rgba(242,242,236,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 20px; }
.brand {
  font-family: 'Piazzolla', serif; font-weight: 600; font-size: 1.25rem;
  text-decoration: none; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 8px;
}
.brand .mark { width: 30px; height: 30px; display: block; }
nav.links { display: flex; gap: 24px; }
nav.links a {
  text-decoration: none; font-size: 0.9062rem; font-weight: 500; color: var(--ink-soft);
  padding: 4px 0; border-bottom: 1px solid transparent;
  transition: border-color 160ms ease-out, color 160ms ease-out;
}
nav.links a:hover { color: var(--ink); border-color: var(--ledger); }

/* Language switcher: EN / BG. Mirrors the styling in index.html's inline CSS. */
.lang-switch {
  display: inline-flex; align-items: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; letter-spacing: 0.04em;
}
.lang-switch a {
  text-decoration: none; color: var(--muted); padding: 0 7px;
  min-height: 44px; display: inline-flex; align-items: center;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease-out, border-color 160ms ease-out;
}
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="page"] { color: var(--ink); border-color: var(--ledger); }
.lang-switch .sep { color: var(--line); }

/* ===== Legal document body ===== */
.legal-doc { max-width: 74ch; padding: 64px 28px 96px; }
.legal-eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ledger-dark); margin: 0 0 10px;
}
.legal-doc h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 500; }
.legal-updated { color: var(--muted); font-size: 0.8438rem; margin-top: 10px; }
.legal-flag {
  margin: 28px 0; padding: 18px 20px; background: var(--paper-raised);
  border-left: 3px solid var(--ledger); border-radius: var(--radius);
  font-size: 0.875rem; color: var(--ink-soft);
}
.legal-doc h2 { font-size: 1.25rem; font-weight: 500; margin-top: 40px; margin-bottom: 12px; }
.legal-doc p { color: var(--ink-soft); margin: 0 0 14px; }
.legal-doc ul { color: var(--ink-soft); padding-left: 20px; }
.legal-doc li { margin-bottom: 8px; }
.legal-doc a { color: var(--ledger-dark); text-decoration: underline; text-underline-offset: 2px; }
.legal-table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: 0.875rem; }
.legal-table th, .legal-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.legal-table th {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.6875rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted); font-weight: 500;
}
.legal-btn {
  display: inline-flex; align-items: center; margin-top: 4px; background: var(--ledger); color: #fff;
  padding: 10px 18px; min-height: 44px; border-radius: var(--radius); text-decoration: none; font-size: 0.875rem;
  font-weight: 600; border: none; cursor: pointer; font-family: inherit;
}
.legal-btn:hover { background: var(--ledger-dark); }

/* ===== Footer ===== */
footer { border-top: 1px solid var(--line); padding: 48px 0 28px; color: var(--muted); font-size: 0.8125rem; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
  padding-bottom: 28px; border-bottom: 1px solid var(--line);
}
.footer-col h4 {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.6875rem; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; margin: 0 0 14px;
}
.footer-col p { margin: 0; max-width: 32ch; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 22px; font-size: 0.7812rem; }
footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
footer a:hover { color: var(--ink); }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer-col:first-child { grid-column: 1 / -1; }
  .footer-col:first-child p { max-width: 42ch; }
}

/* ===== Cookie consent banner ===== */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
  max-width: 560px; margin: 0 auto;
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius); padding: 22px 24px;
  box-shadow: 0 12px 32px rgba(16,21,27,0.28);
  display: none;
}
.cookie-banner.is-visible { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .cookie-banner.is-visible { animation: cookie-in 420ms cubic-bezier(0.16,1,0.3,1); }
}
@keyframes cookie-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.cookie-banner p { margin: 0 0 16px; font-size: 0.8438rem; color: #c7ccd1; max-width: 60ch; }
.cookie-banner p a { color: var(--ledger-light); text-decoration: underline; text-underline-offset: 2px; }
.cookie-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cookie-actions button {
  font: inherit; font-size: 0.8438rem; font-weight: 600; padding: 10px 18px;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius); cursor: pointer; border: 1px solid transparent;
}
.cookie-accept { background: var(--ledger); color: #fff; }
.cookie-accept:hover { background: var(--ledger-dark); }
.cookie-reject { background: transparent; color: var(--paper); border-color: rgba(242,242,236,0.35); }
.cookie-reject:hover { border-color: var(--paper); }
