/* ============================================================
   ThaiLetters.com — shared site styles
   Footer, cookie-consent UI, and legal/document pages.
   ============================================================ */

:root {
  --bg: #1a2e2e;
  --bg-deeper: #142323;
  --ink: #f4ead5;
  --ink-dim: rgba(244, 234, 213, 0.62);
  --ink-faint: rgba(244, 234, 213, 0.22);
  --accent: #e6a23c;
  --line: rgba(244, 234, 213, 0.14);
  --thai-font: 'Noto Serif Thai', serif;
}

/* ---------- Site footer (on the trainer) ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
}
.site-footer .sf-copy {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--ink-faint);
}
.site-footer .sf-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.site-footer .sf-links a,
.site-footer .sf-link-btn {
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}
.site-footer .sf-links a:hover,
.site-footer .sf-link-btn:hover { color: var(--accent); }
.site-footer .sf-link-btn:focus-visible,
.site-footer .sf-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

@media (max-width: 760px) {
  .site-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .site-footer .sf-links { gap: 14px; }
}

/* ---------- Cookie consent banner ---------- */
.cc-banner {
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px));
  background: var(--bg-deeper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  padding: 20px 22px;
  color: var(--ink);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
}
.cc-banner h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 17px;
  margin: 0 0 6px;
  color: var(--ink);
}
.cc-banner p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0 0 14px;
}
.cc-banner p a { color: var(--accent); text-decoration: none; }
.cc-banner p a:hover { text-decoration: underline; }
.cc-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.cc-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--ink-faint);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, filter 0.18s ease;
}
.cc-btn:hover { border-color: var(--accent); color: var(--accent); }
.cc-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg-deeper); }
.cc-btn.primary:hover { filter: brightness(1.08); color: var(--bg-deeper); }
.cc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Cookie settings modal ---------- */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: none;
  place-items: center;
  background: rgba(10, 18, 18, 0.72);
  backdrop-filter: blur(6px);
  padding: 18px;
}
.cc-modal.open { display: grid; }
.cc-modal-card {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-deeper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  color: var(--ink);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
}
.cc-modal-card h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 6px;
}
.cc-modal-card > p {
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.55;
  margin: 0 0 18px;
}
.cc-cat {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.cc-cat:last-of-type { border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.cc-cat-text strong { display: block; font-size: 14px; margin-bottom: 3px; }
.cc-cat-text span { font-size: 12px; color: var(--ink-dim); line-height: 1.5; }

/* toggle switch */
.cc-switch { position: relative; flex: none; width: 46px; height: 26px; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cc-track {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--ink-faint);
  border-radius: 999px;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.cc-track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink-dim);
  transition: transform 0.18s ease, background 0.18s ease;
}
.cc-switch input:checked + .cc-track { background: rgba(230,162,60,0.3); border-color: var(--accent); }
.cc-switch input:checked + .cc-track::after { transform: translateX(20px); background: var(--accent); }
.cc-switch input:disabled + .cc-track { opacity: 0.6; }
.cc-switch input:focus-visible + .cc-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.cc-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ============================================================
   Legal / document pages
   ============================================================ */
body.doc {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at top, rgba(230, 162, 60, 0.06), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(20, 35, 35, 0.6), transparent 70%);
  color: var(--ink);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  margin: 0;
  min-height: 100vh;
  line-height: 1.65;
}
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--bg-deeper);
  padding: 10px 16px; border-radius: 0 0 8px 0;
  font-size: 13px; font-weight: 600; z-index: 50;
}
.skip-link:focus { left: 0; }

.doc-wrap { max-width: 820px; margin: 0 auto; padding: 32px 24px 80px; }

.doc-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-bottom: 22px; margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.doc-top .brand {
  font-family: 'Fraunces', serif; font-style: italic; font-weight: 300;
  font-size: 18px; color: var(--ink-dim); text-decoration: none;
}
.doc-top .brand .thai-label { font-family: var(--thai-font); font-style: normal; color: var(--accent); }
.doc-top .back {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-dim); text-decoration: none;
}
.doc-top .back:hover { color: var(--accent); }

.eyebrow {
  font-family: 'Fraunces', serif; font-style: italic;
  font-size: 13px; color: var(--accent); letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.doc-wrap h1 {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(34px, 5vw, 52px); line-height: 1.05;
  margin: 0 0 10px;
}
.doc-meta { font-size: 13px; color: var(--ink-faint); margin-bottom: 30px; }

.doc-wrap h2 {
  font-family: 'Fraunces', serif; font-weight: 500;
  font-size: 22px; margin: 38px 0 12px; color: var(--ink);
}
.doc-wrap h3 {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 600;
  font-size: 15px; letter-spacing: 0.02em; margin: 22px 0 8px; color: var(--ink);
}
.doc-wrap p, .doc-wrap li { font-size: 15px; color: var(--ink-dim); }
.doc-wrap p { margin: 0 0 14px; }
.doc-wrap ul { margin: 0 0 16px; padding-left: 20px; }
.doc-wrap li { margin-bottom: 8px; }
.doc-wrap strong { color: var(--ink); font-weight: 600; }
.doc-wrap a { color: var(--accent); text-decoration: none; }
.doc-wrap a:hover { text-decoration: underline; }

.doc-wrap table {
  width: 100%; border-collapse: collapse; margin: 8px 0 22px; font-size: 14px;
}
.doc-wrap th, .doc-wrap td {
  text-align: left; padding: 10px 12px; border: 1px solid var(--line);
  vertical-align: top; color: var(--ink-dim);
}
.doc-wrap th { background: rgba(0,0,0,0.18); color: var(--ink); font-weight: 600; }

.doc-foot {
  margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.doc-foot .sf-copy { font-family: 'Fraunces', serif; font-style: italic; font-size: 12px; color: var(--ink-faint); }
.doc-foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.doc-foot a, .doc-foot .sf-link-btn {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-dim); text-decoration: none;
  background: none; border: none; padding: 0; cursor: pointer;
}
.doc-foot a:hover, .doc-foot .sf-link-btn:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .cc-track::after, .cc-btn, .cc-switch input + .cc-track { transition: none; }
}
