/* Shared styles for the static Support, Privacy and Terms pages.
   Colors mirror src/styles/theme.css; the pages default to dark like the app
   and switch to light when the app's saved theme (tarot-theme) is "light". */

:root {
  color-scheme: dark;
  --bg: #0F0E13;
  --surface: #1C1A22;
  --text: #E8E6E3;
  --muted: #CCC5B9;
  --accent: #D4B896;
  --accent-hover: #E8DAC3;
  --border: rgba(232, 218, 195, 0.22);
  --border-subtle: rgba(232, 218, 195, 0.1);
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

:root.light {
  color-scheme: light;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --muted: #555555;
  --accent: #7D623B;
  --accent-hover: #5F4A2C;
  --border: rgba(125, 98, 59, 0.24);
  --border-subtle: rgba(125, 98, 59, 0.12);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent-hover);
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

.site-header,
.site-footer,
main {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: max(1.25rem, env(safe-area-inset-top));
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--accent);
}

.brand,
.site-nav a,
.site-footer a,
.toc a,
.contact-email a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.35em;
}

main {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 6vw, 2.625rem);
  letter-spacing: -0.01em;
}

h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.5rem;
  scroll-margin-top: 1.5rem;
}

h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.1875rem;
  scroll-margin-top: 1.5rem;
}

p,
ul,
ol,
dl,
table {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.4rem;
}

strong {
  font-weight: 600;
}

.meta {
  margin-bottom: 2rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.lede {
  font-size: 1.125rem;
  color: var(--text);
}

.panel {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
}

.panel > :first-child {
  margin-top: 0;
}

.panel > :last-child {
  margin-bottom: 0;
}

.panel h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.toc {
  margin: 2rem 0 0;
}

.toc h2 {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  columns: 2 16rem;
  column-gap: 2rem;
}

.toc li {
  break-inside: avoid;
}

.toc a {
  display: flex;
  padding: 0.5rem 0;
}

.contact-email {
  font-size: 1.1875rem;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

caption {
  text-align: left;
  font-weight: 600;
  padding-bottom: 0.5rem;
}

th,
td {
  padding: 0.75rem 0.75rem 0.75rem 0;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--border-subtle);
}

th[scope="col"] {
  font-weight: 600;
  color: var(--muted);
  border-bottom-color: var(--border);
}

tbody th {
  font-weight: 600;
  width: 38%;
}

td:last-child,
th:last-child {
  padding-right: 0;
}

dt {
  font-weight: 600;
}

dd {
  margin: 0.25rem 0 1rem;
}

.site-footer {
  padding-top: 1.5rem;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0;
}

.site-footer a {
  padding: 0.25rem 0;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 30rem) {
  tbody th {
    width: 42%;
  }

  .panel {
    padding: 1rem 1.125rem;
  }
}

@media print {
  :root,
  :root.light {
    --bg: #FFFFFF;
    --surface: #FFFFFF;
    --text: #000000;
    --muted: #333333;
    --accent: #000000;
    --border: #999999;
    --border-subtle: #CCCCCC;
  }

  .skip-link,
  .site-nav,
  .toc {
    display: none;
  }
}
