/*
 * Asking Page — askingpage.com static site.
 * One stylesheet, no web fonts, no external requests.
 * Palette mirrors the app (lib/core/theme/core_colors.dart):
 *   ink #201E1D, paper #F3F2F2, Ask Magenta #D6006C (brand), Ask Cyan #006786
 *   (links / tappable); dark values are the app's dark palette
 *   (magenta #FF90B1, cyan #66C9E8, surface #2D2B2B, divider #444141).
 */

:root {
  --bg: #f3f2f2;
  --surface: #ffffff;
  --text: #201e1d;
  --text-2: #605d5d;
  --line: #d7d3d3;
  --brand: #d6006c;
  --brand-tint: #fff1f4;
  --link: #006786;
  --link-hover: #004961;
  --on-brand: #ffffff;
  --ph-bg: #ffe45c;
  --ph-text: #201e1d;
  --ph-line: #8a6d00;
  --note-bg: #fff8d6;
  --note-line: #c9a400;
  --focus: #006786;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", "Leelawadee UI",
    "Thonburi", "Sukhumvit Set", "Sarabun", Tahoma, "Helvetica Neue", Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #201e1d;
    --surface: #2d2b2b;
    --text: #f3f2f2;
    --text-2: #bab6b6;
    --line: #444141;
    --brand: #ff90b1;
    --brand-tint: #4b1528;
    --link: #66c9e8;
    --link-hover: #99e0ff;
    --on-brand: #201e1d;
    --note-bg: #3a3310;
    --note-line: #a88b00;
    --focus: #99e0ff;
  }
}

*,
*::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);
  font-size: 1rem;
  line-height: 1.75; /* Thai needs generous leading for stacked vowel/tone marks */
  overflow-wrap: break-word;
}

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

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

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

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 1rem;
  z-index: 10;
}

.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ---------- layout ---------- */

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

.narrow {
  max-width: 46rem;
}

main {
  padding: 1.5rem 0 3rem;
}

/* ---------- header / footer ---------- */

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

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  margin-right: auto;
}

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

.mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.mark svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.site-nav {
  order: 3;
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}

@media (min-width: 48rem) {
  .site-nav {
    order: 2;
    flex-basis: auto;
  }
  .lang-switch {
    order: 3;
  }
}

.site-nav a,
.lang-switch {
  color: var(--text);
  text-decoration: none;
  padding: 0.35rem 0;
  font-size: 0.95rem;
}

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

.site-nav a[aria-current="page"] {
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--brand);
}

.brand {
  order: 1;
}

.lang-switch {
  order: 2;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.85rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  color: var(--text-2);
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
  margin-bottom: 0.5rem;
}

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

/* ---------- landing ---------- */

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

.hero-icon-wrap {
  margin-bottom: 1.25rem;
}

.hero-app-icon {
  display: block;
  width: 5rem;
  height: 5rem;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(214, 0, 108, 0.22);
}

.hero h1 {
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

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

.hero .lead {
  font-size: 1.15rem;
  max-width: 40rem;
  margin: 0 0 1rem;
}

.pill {
  display: inline-block;
  border: 1px solid var(--brand);
  color: var(--text);
  background: var(--brand-tint);
  border-radius: 999px;
  padding: 0.2rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 1.5rem 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.card h2 {
  font-size: 1.1rem;
  margin: 0 0 0.4rem;
  padding-top: 0.15rem;
  border-top: 3px solid var(--brand);
  border-radius: 0;
  display: inline-block;
}

.card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.card li + li {
  margin-top: 0.25rem;
}

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

.links a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.links a small {
  display: block;
  font-weight: 400;
  color: var(--text-2);
}

.links a:hover {
  border-color: var(--link);
  color: var(--link);
}

@media (min-width: 40rem) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
  .links {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 56rem) {
  .links {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- long-form pages (legal, support, feedback) ---------- */

.doc h1 {
  font-size: clamp(1.6rem, 5.5vw, 2.2rem);
  line-height: 1.35;
  margin: 0.5rem 0 1rem;
}

.doc h2 {
  font-size: 1.3rem;
  line-height: 1.45;
  margin: 2.2rem 0 0.6rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1rem;
}

.doc h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.4rem;
  scroll-margin-top: 1rem;
}

.doc p,
.doc ul,
.doc ol {
  margin: 0.75rem 0;
}

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

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

.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 1.1rem 0.9rem;
  margin: 1.25rem 0;
}

.toc strong {
  display: block;
  margin-bottom: 0.25rem;
}

.toc ol,
.toc ul {
  margin: 0;
  padding-left: 1.2rem;
  columns: 1;
}

.toc li {
  margin: 0.15rem 0;
}

.toc a {
  padding: 0.1rem 0;
}

@media (min-width: 40rem) {
  .toc ol,
  .toc ul {
    columns: 2;
    column-gap: 2rem;
  }
  .toc li {
    break-inside: avoid;
  }
}

.note {
  background: var(--note-bg);
  border: 1px solid var(--note-line);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.note p {
  margin: 0.2rem 0;
}

.callout {
  background: var(--brand-tint);
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.6rem 1rem;
  margin: 1rem 0;
}

.callout p {
  margin: 0.25rem 0;
}

.cta {
  display: inline-block;
  background: var(--link);
  color: var(--bg);
  text-decoration: none;
  font-weight: 700;
  padding: 0.65rem 1.2rem;
  border-radius: 10px;
  margin: 0.5rem 0;
}

.cta:hover {
  background: var(--link-hover);
  color: var(--bg);
}

.meta {
  color: var(--text-2);
  font-size: 0.95rem;
}

/* ---------- tables ---------- */

.table-wrap {
  margin: 1rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.6;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
}

th {
  background: var(--brand-tint);
}

/* Narrow screens: each row becomes a labelled block instead of scrolling sideways. */
@media (max-width: 40rem) {
  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }
  thead {
    position: absolute;
    left: -999px;
  }
  tr {
    border-bottom: 3px solid var(--line);
  }
  td {
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-2);
  }
}

/* ---------- placeholders: must be impossible to miss ---------- */

mark.ph {
  background: var(--ph-bg);
  color: var(--ph-text);
  outline: 2px dashed var(--ph-line);
  outline-offset: 1px;
  border-radius: 3px;
  padding: 0 0.2em;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9em;
  font-weight: 700;
  overflow-wrap: anywhere;
}

code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.92em;
}

@media print {
  .site-header,
  .site-footer,
  .toc,
  .skip {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
}
