/*
 * Styles for the legal pages (politika-privatnosti, politika-kolacica).
 *
 * The homepage keeps its CSS inline; these pages are long-form text and share a stylesheet so the
 * two policies cannot drift apart visually. Tokens are copied from index.html deliberately rather
 * than imported — index.html has no external stylesheet to import from, and duplicating twelve
 * custom properties is cheaper than restructuring the homepage as part of a consent change.
 */

:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --accent-color: #0077b5;
  --text-primary: #1a1a2e;
  --text-secondary: #555;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --border-subtle: #e4e4e7;
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --border-radius: 12px;
}

[data-theme='dark'] {
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --bg-primary: #18181b;
  --bg-secondary: #27272a;
  --bg-card: #27272a;
  --border-subtle: #3f3f46;
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
}

/* Self-hosted so the page makes no third-party request. See scripts/build-fonts.js — the subset
   includes Latin Extended-A, which is what carries Č Ć Ž Š Đ. */
@font-face {
  font-family: 'Inter';
  src: url('../font/Inter-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.legal-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  padding: 3rem 1.5rem 2.5rem;
}

.legal-header .container {
  max-width: 820px;
  margin: 0 auto;
}

.legal-header a.back-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-block;
  margin-bottom: 1rem;
}

.legal-header a.back-link:hover {
  text-decoration: underline;
}

.legal-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.25;
}

.legal-header .updated {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}

main.legal {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

main.legal section {
  margin-bottom: 2.25rem;
}

main.legal h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

main.legal h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

main.legal p,
main.legal li {
  color: var(--text-secondary);
}

main.legal p + p {
  margin-top: 0.85rem;
}

main.legal ul,
main.legal ol {
  margin: 0.75rem 0 0 1.35rem;
}

main.legal li + li {
  margin-top: 0.5rem;
}

main.legal a {
  color: var(--accent-color);
}

[data-theme='dark'] main.legal a {
  color: #7dd3fc;
}

.legal-callout {
  background: var(--bg-secondary);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--border-radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  min-width: 34rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  color: var(--text-secondary);
}

th {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--bg-secondary);
}

.legal-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding: 2rem 1.5rem;
}

.legal-footer .container {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.legal-footer a {
  color: var(--text-secondary);
}

/* The withdrawal control must be as easy to reach as granting was, so it is a real button in the
   footer of every page rather than a link buried in the policy text. */
.footer-legal__btn {
  font: inherit;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

.footer-legal__btn:hover {
  color: var(--text-primary);
  border-color: var(--primary-color);
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

@media (max-width: 600px) {
  .legal-header h1 {
    font-size: 1.7rem;
  }

  main.legal {
    padding: 2rem 1.15rem 2.5rem;
  }
}
