/* Triver Privacy Policy site styles.
   Design: clean legal document, ocean-blue accent, light/dark via
   prefers-color-scheme, works at 375px, print-friendly. */

:root {
  --color-bg: #f7f9fb;
  --color-surface: #ffffff;
  --color-text: #1b232c;
  --color-text-muted: #545e6a;
  --color-border: #d8e0e8;
  --color-accent: #0a6cbf;
  --color-accent-contrast: #ffffff;
  --color-table-header: #eaf2fa;
  --color-table-zebra: #f3f7fb;
  --color-notice-bg: #eef6ff;
  --color-notice-border: #0a6cbf;
  --color-link: #0a6cbf;
  --color-link-visited: #0854a3;
  --font-sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Hiragino Sans", "PingFang SC", "PingFang TC", "Microsoft JhengHei",
    "Noto Sans CJK", sans-serif;
  --content-max-width: 760px;
  --toc-width: 240px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #10151b;
    --color-surface: #171e26;
    --color-text: #e7edf3;
    --color-text-muted: #a3b0bd;
    --color-border: #2c3844;
    --color-accent: #5db4f2;
    --color-accent-contrast: #0b1620;
    --color-table-header: #1d2a36;
    --color-table-zebra: #182129;
    --color-notice-bg: #16232f;
    --color-notice-border: #5db4f2;
    --color-link: #5db4f2;
    --color-link-visited: #8fcaf5;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: var(--color-link);
}

a:visited {
  color: var(--color-link-visited);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  padding: 0.5em 1em;
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.75rem 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
  text-decoration: none;
}

.lang-nav {
  position: relative;
}

.lang-switcher summary {
  cursor: pointer;
  list-style: none;
  padding: 0.4em 0.8em;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--color-text);
  white-space: nowrap;
}

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

.lang-switcher[open] summary {
  border-color: var(--color-accent);
}

.lang-switcher ul {
  position: absolute;
  right: 0;
  margin-top: 0.4em;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.4em 0;
  min-width: 10em;
  list-style: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.lang-switcher li a {
  display: block;
  padding: 0.5em 1em;
  text-decoration: none;
  color: var(--color-text);
}

.lang-switcher li a:hover,
.lang-switcher li a:focus {
  background: var(--color-table-header);
}

.lang-switcher li a[aria-current="true"] {
  color: var(--color-accent);
  font-weight: 700;
}

/* Layout */

.content-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem 16px 3rem;
  display: block;
}

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

.toc-aside {
  margin-bottom: 1.5rem;
}

.toc-sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.25rem 1rem 0.75rem;
}

.toc-sidebar summary {
  cursor: pointer;
  font-weight: 700;
  padding: 0.75rem 0;
}

.toc-list {
  margin: 0;
  padding-left: 1.25rem;
}

.toc-list li {
  margin: 0.35rem 0;
}

.toc-list a {
  text-decoration: none;
}

.toc-list a:hover {
  text-decoration: underline;
}

@media (min-width: 1024px) {
  .content-shell {
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
  }

  .toc-aside {
    flex: 0 0 var(--toc-width);
    position: sticky;
    top: 5rem;
    margin-bottom: 0;
  }

  main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: var(--content-max-width);
    margin: 0;
  }
}

/* Article typography */

.policy-article h1 {
  font-size: 1.75rem;
  line-height: 1.35;
  margin: 0 0 0.5rem;
}

.policy-article h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
  scroll-margin-top: 5rem;
}

.policy-article h2:first-of-type {
  border-top: none;
}

.policy-article h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
  scroll-margin-top: 5rem;
}

.policy-article p,
.policy-article ul,
.policy-article ol {
  color: var(--color-text);
}

.policy-article ul,
.policy-article ol {
  padding-left: 1.4rem;
}

.policy-article li {
  margin: 0.35rem 0;
}

.policy-article blockquote {
  margin: 1.25rem 0;
  padding: 0.9rem 1.1rem;
  background: var(--color-notice-bg);
  border-left: 4px solid var(--color-notice-border);
  border-radius: 4px;
  color: var(--color-text);
}

.policy-article blockquote p {
  margin: 0;
}

.policy-article hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

.policy-article code {
  font-size: 0.9em;
  background: var(--color-table-header);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Tables */

.table-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.policy-article table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  font-size: 0.95rem;
}

.policy-article th,
.policy-article td {
  border: 1px solid var(--color-border);
  padding: 0.6em 0.8em;
  text-align: left;
  vertical-align: top;
  min-width: 7em;
  overflow-wrap: anywhere;
}

:lang(ko) .policy-article th,
:lang(ko) .policy-article td {
  word-break: keep-all;
}

.policy-article thead th {
  background: var(--color-table-header);
  font-weight: 700;
}

.policy-article tbody tr:nth-child(even) {
  background: var(--color-table-zebra);
}

/* Footer */

.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0.4em 0;
}

/* Detect / 404 pages */

.detect-page main,
.not-found-page main {
  max-width: 480px;
  margin: 4rem auto;
  padding: 0 16px;
  text-align: center;
}

.lang-fallback {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.lang-fallback a {
  display: inline-block;
  padding: 0.5em 1em;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--color-text);
}

/* Print */

@media print {
  .site-header,
  .toc-aside,
  .lang-nav,
  .site-footer {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .content-shell {
    display: block;
    max-width: none;
    padding: 0;
  }

  main {
    max-width: none;
  }

  a {
    color: #000000;
    text-decoration: underline;
  }

  .table-wrapper {
    border-color: #000000;
    overflow: visible;
  }

  .policy-article th,
  .policy-article td {
    border-color: #000000;
  }
}
