/*
 * ClickDoo's public pages (https://clickdoo.app): one column, the system's fonts (no web
 * fonts), light and dark from the browser's prefers-color-scheme. The site's CSP is
 * `style-src 'self'`, so every style lives in this file: no <style> and no style="".
 * Brand colours are the web app's (#cc4400 orange, #3f4a54 grey, #9aa5b1 grey in dark).
 */

:root {
  color-scheme: light dark;
  --brand: #cc4400;
  --brand-hover: #b33c00;
  --on-brand: #ffffff;
  --grey: #3f4a54;
  --text: #1f2933;
  --muted: #5b6670;
  --bg: #ffffff;
  --surface: #f6f7f9;
  --border: #e3e6ea;
  --link: #cc4400;
  /* Links on the grey panels (contents, notes, footer): #cc4400 there is 4.46:1. */
  --link-on-surface: #b33c00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grey: #9aa5b1;
    --text: #e6e9ee;
    --muted: #b8c1cc;
    --bg: #1c2536;
    --surface: #232e42;
    --border: #34405a;
    --link: #ff8a4c;
    --link-on-surface: #ff8a4c;
  }
}

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

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

/* A column as tall as the window, so the footer stays at the bottom of short pages. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", "Leelawadee UI",
    Thonburi, Tahoma, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

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

.toc a,
.note a,
.panel a,
.site-footer a {
  color: var(--link-on-surface);
}

a:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip:focus {
  left: 16px;
  top: 8px;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 2px solid var(--link);
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header: the logo on the left, the sign-in link and the language switch on the right. */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
}

.brand {
  display: inline-flex;
  flex-shrink: 0;
}

.brand img {
  width: 85px;
  height: 64px;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem 1rem;
  font-size: 0.95rem;
}

.nav a {
  color: var(--text);
  text-decoration: none;
}

.nav a:hover {
  color: var(--link);
  text-decoration: underline;
}

.nav .lang {
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

main {
  flex: 1 0 auto;
  padding: 2rem 0 3rem;
}

h1,
h2,
h3 {
  line-height: 1.35;
  color: var(--text);
}

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

h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.35rem;
}

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

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

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

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

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

/* Home page. */

.hero {
  padding: 1.5rem 0 1rem;
}

.hero h1 {
  font-size: 2.25rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border: 2px solid var(--brand);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
}

.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
}

.btn-secondary:hover {
  color: var(--link);
}

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.features li {
  margin: 0;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand);
  border-radius: 10px;
}

.features h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.features p {
  margin: 0;
  color: var(--muted);
}

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

.panel h2 {
  margin-top: 0;
}

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

/* Policy pages. */

.doc-meta {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

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

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

.toc ol {
  margin: 0;
}

.note {
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--brand);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}

/* Footer: the company, then links to every page. */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer .wrap {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.company {
  margin: 0 0 1rem;
  font-style: normal;
}

.company p {
  margin: 0;
}

.company .company-name {
  color: var(--text);
  font-weight: 600;
}

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

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

.copyright {
  margin: 0;
}

@media (min-width: 640px) {
  h1 {
    font-size: 2.25rem;
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  .features {
    grid-template-columns: 1fr 1fr;
  }
}
