/*
 * Selenay legal site (spec 05 §5.10). The only stylesheet: the CSP
 * (spec 04 §1.4) allows styles from this origin only, so no inline styles,
 * no <style> blocks and no web fonts (font-src falls back to 'none').
 * Colours are the Rasathane palette (PRODUCT.md §7); text contrast is at
 * least 4.5:1 in both schemes.
 */

:root {
  color-scheme: light dark;
  --bg: #efe6d2;          /* Parşömen */
  --surface: #f7f1e4;
  --text: #1a1b2e;        /* Mürekkep */
  --muted: #4a4b5e;
  --accent: #9e3826;      /* Zincifre, darkened for small text on parchment */
  --link: #142a55;        /* Lacivert */
  --rule: #cdbf9f;
  --mark: #9a7a2e;        /* Yaldız, darkened for the star on parchment */
  --button-bg: #142a55;
  --button-text: #efe6d2;
  --focus: #b8432c;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #142a55;
    --surface: #1b3366;
    --text: #efe6d2;
    --muted: #cfc6b2;
    --accent: #f0937a;
    --link: #d6b25e;
    --rule: #3a5182;
    --mark: #d6b25e;
    --button-bg: #d6b25e;
    --button-text: #1a1b2e;
    --focus: #f0937a;
  }
}

*,
*::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(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.375rem;
}

.skip:focus {
  left: 0.5rem;
  z-index: 10;
}

/* Header and footer */

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

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.375rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.star {
  width: 1.5rem;
  height: 1.5rem;
  fill: var(--mark);
  flex: none;
}

.lang a {
  font-size: 0.9375rem;
}

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

.site-footer {
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

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

.site-footer p {
  margin: 0.25rem 0;
}

/* Text */

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin: 0 0 0.75rem;
  font-size: 1.875rem;
}

h2 {
  margin: 2.25rem 0 0.75rem;
  padding-top: 0.25rem;
  font-size: 1.375rem;
}

h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.125rem;
}

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

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

li {
  margin: 0.25rem 0;
}

li > ul,
li > ol {
  margin: 0.25rem 0 0;
}

.lead {
  font-size: 1.125rem;
}

.muted {
  color: var(--muted);
}

small,
.small {
  font-size: 0.875rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9375em;
  overflow-wrap: anywhere;
}

/* Version block at the top of the legal pages */

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.meta div {
  display: flex;
  gap: 0.375rem;
}

.meta dt {
  font-weight: 600;
}

.meta dt::after {
  content: ":";
}

.meta dd {
  margin: 0;
}

/* Table of contents */

.toc {
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
}

.toc h2 {
  margin: 0 0 0.5rem;
  padding: 0;
  font-size: 1rem;
}

.toc ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  columns: 2 16rem;
  column-gap: 1.5rem;
}

.toc li {
  margin: 0.125rem 0;
  break-inside: avoid;
}

/* Boxes */

.box {
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 0.5rem;
}

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

.box h3 {
  margin-top: 0;
}

.consent {
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
}

.consent p {
  margin: 0 0 0.5rem;
}

.consent .statement {
  margin: 0;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--rule);
}

/* Definition lists for identity blocks */

.identity {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
}

.identity div {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  padding: 0.125rem 0;
}

.identity dt {
  font-weight: 600;
}

.identity dt::after {
  content: ":";
}

.identity dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Tables: stacked into cards on narrow screens */

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

caption {
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: left;
}

th,
td {
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

thead th {
  background: var(--surface);
  font-weight: 600;
}

td.key {
  font-weight: 600;
}

/* Wide tables (many columns of prose) are cards at every width */

table.cards,
table.cards caption,
table.cards tbody,
table.cards tr,
table.cards td {
  display: block;
  width: 100%;
}

table.cards thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

table.cards tr {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
}

table.cards td {
  padding: 0.25rem 0;
  border: 0;
}

table.cards td::before {
  content: attr(data-label);
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

@media (max-width: 44rem) {
  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack td {
    display: block;
    width: 100%;
  }

  table.stack caption {
    display: block;
    width: 100%;
  }

  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  table.stack tr {
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 0.5rem;
  }

  table.stack td {
    padding: 0.25rem 0;
    border: 0;
  }

  table.stack td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 600;
  }
}

/* Store links (text buttons, not the stores' badge artwork) */

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.stores li {
  margin: 0;
}

.stores a {
  display: inline-flex;
  flex-direction: column;
  min-width: 11rem;
  min-height: 3rem;
  padding: 0.5rem 1rem;
  background: var(--button-bg);
  color: var(--button-text);
  border-radius: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.stores a span {
  font-size: 0.75rem;
  font-weight: 400;
}

.stores a:focus-visible {
  outline-offset: 3px;
}

.steps {
  padding-left: 1.5rem;
}

.steps > li {
  margin: 0.5rem 0;
}

.steps .stores {
  margin: 0.5rem 0 0.75rem;
}

hr {
  height: 0;
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  a {
    color: #000;
  }

  .skip,
  .lang,
  .toc,
  .site-footer ul {
    display: none;
  }

  .box,
  .consent,
  .identity,
  thead th {
    background: none;
  }
}
