/* Article pages and language hubs (generated by scripts/articles). Shares the header look of style.css. */
:root {
  --art-bg: #fdf6f1;
  --art-ink: #3b2f2a;
  --art-muted: #7a6a62;
  --art-line: #efd9cc;
  --art-card: #fff8f3;
  --art-accent: #c76b4a;
  --art-warn: #fff1d6;
  --art-tip: #e7f6ec;
  --art-note: #fdeadd;
  --art-tip-line: #4fa36b;
  --art-warn-line: #d9a02e;
  --art-on-accent: #fff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --art-bg: #1e1816;
    --art-ink: #f4e9e2;
    --art-muted: #c7b5ab;
    --art-line: #4d3d37;
    --art-card: #2a2320;
    --art-accent: #f0a383;
    --art-warn: #3d3122;
    --art-tip: #1f3327;
    --art-note: #35271f;
    --art-tip-line: #6cc48a;
    --art-warn-line: #e0b04c;
    --art-on-accent: #1e1816;
  }
}
:root[data-theme="dark"] {
  --art-bg: #1e1816;
  --art-ink: #f4e9e2;
  --art-muted: #c7b5ab;
  --art-line: #4d3d37;
  --art-card: #2a2320;
  --art-accent: #f0a383;
  --art-warn: #3d3122;
  --art-tip: #1f3327;
  --art-note: #35271f;
  --art-tip-line: #6cc48a;
  --art-warn-line: #e0b04c;
  --art-on-accent: #1e1816;
}
body.article-page {
  background: var(--art-bg);
  color: var(--art-ink);
  margin: 0;
  font: 17px/1.75 system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans SC", "Noto Sans Thai", sans-serif;
  overflow-x: hidden;
}
/* Own header classes: the home page's .nav is position:fixed and would cover the article. */
.article-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  box-sizing: border-box;
}
html:has(body.article-page) { background: var(--art-bg); }   /* style.css paints html cream; follow the theme */
/* The wordmark is dark brown: a cream chip keeps it readable in dark mode (invisible in light mode). */
.article-brand { background: #fff3ea; border-radius: 12px; padding: 4px 10px; display: block; }
.article-brand img { height: 28px; width: auto; display: block; }
.article-links { display: flex; gap: 16px; font-size: 15px; font-weight: 600; }
.article-links a { color: var(--art-ink); text-decoration: none; }
.article-links a:hover { color: var(--art-accent); }
.article-main { max-width: 760px; margin: 0 auto; padding: 8px 16px 48px; box-sizing: border-box; }
.article-main img { max-width: 100%; height: auto; border-radius: 14px; }
.article h1 { font-size: clamp(26px, 6vw, 34px); line-height: 1.3; margin: 6px 0 8px; }
.article h2 { font-size: clamp(21px, 5vw, 25px); line-height: 1.4; margin: 48px 0 14px; scroll-margin-top: 16px; }
.article h3 { font-size: 18px; line-height: 1.5; margin: 28px 0 10px; }
/* style.css sets every paragraph margin to 0 for the home page: articles need the space back */
.article p { margin: 0 0 18px; }
.article a { color: var(--art-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.article .crumbs a, .article .app-shots a, .article .get-app a, .article .toc a { text-decoration: none; }
.article .crumbs, .hub .crumbs { font-size: 14px; color: var(--art-muted); margin: 0; }
.article .meta { font-size: 14px; color: var(--art-muted); margin: 0 0 16px; }
.article .answer {
  background: var(--art-card);
  border-left: 4px solid var(--art-accent);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 20px 0 24px;
  font-weight: 600;
}
.article figure { margin: 24px 0; }
/* The brand scenes are transparent PNG/WebP cut-outs, so they get a warm sunset backdrop. */
.article figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center bottom;
  background: linear-gradient(180deg, #ffe9d8 0%, #f9c9a8 100%);
}
.article figcaption { font-size: 14px; color: var(--art-muted); margin-top: 6px; }
.article .article-hero { margin: 0 0 16px; }

/* contents list */
.article .toc { border: 1px solid var(--art-line); border-radius: 12px; padding: 14px 18px; margin: 0 0 28px; font-size: 16px; }
.article .toc-title { font-weight: 700; margin: 0 0 6px; }
.article .toc ol { margin: 0; padding-left: 1.4em; }
.article .toc li { margin: 4px 0; }

/* lists and steps */
.article ul, .article ol { margin: 0 0 20px; padding-left: 1.4em; }
.article li { margin: 0 0 10px; padding-left: 2px; }
.article li::marker { color: var(--art-accent); font-weight: 700; }
.article .steps { list-style: none; counter-reset: step; padding: 0; }
.article .steps li { counter-increment: step; position: relative; padding: 0 0 0 46px; margin: 0 0 18px; min-height: 32px; }
.article .steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--art-accent); color: var(--art-on-accent);
  font-size: 16px; font-weight: 700; line-height: 1;
}
.article .steps .step-name { display: block; line-height: 32px; }

/* tables: up to three columns stay a table; from four on, a phone shows one card per row */
.article .table-wrap { overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch; }
.article table { border-collapse: collapse; width: 100%; font-size: 16px; }
.article th, .article td { border: 1px solid var(--art-line); padding: 10px 12px; text-align: left; vertical-align: top; }
.article th { background: var(--art-card); white-space: nowrap; }
.article td:first-child { font-weight: 600; white-space: nowrap; }

/* notes */
.article .callout { border-radius: 12px; border-left: 4px solid var(--art-accent); padding: 14px 18px; margin: 22px 0; background: var(--art-note); }
.article .callout-tip { background: var(--art-tip); border-left-color: var(--art-tip-line); }
.article .callout-warning { background: var(--art-warn); border-left-color: var(--art-warn-line); }

/* the three phones (pictures with the phone drawn in): one row as wide as the text, no words */
.article .app-shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 44px 0; }
.article .app-shots figure { margin: 0; }
.article .app-shots figure a { display: block; }
.article .app-shots figure img {
  display: block; width: 100%; height: auto; aspect-ratio: 600 / 1242; border-radius: 0; background: none;
  filter: drop-shadow(0 14px 20px rgba(70, 40, 20, .22));
}

/* store buttons */
.article .get-app { text-align: center; margin: 40px 0 28px; }
.article .get-app p { font-weight: 700; margin: 0 0 12px; }
.article .get-app-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.article .get-app a { display: block; line-height: 0; }
.article .get-app img { height: 48px; width: auto; border-radius: 0; }

.article .about-dotilo, .article .health {
  border: 1px solid var(--art-line);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 28px 0;
  font-size: 15px;
  color: var(--art-muted);
}
.article .about-dotilo p, .article .health p { margin: 0; }
.article details { border: 1px solid var(--art-line); border-radius: 12px; background: var(--art-card); padding: 0 16px; margin: 0 0 10px; }
.article summary { cursor: pointer; font-weight: 600; padding: 14px 0; }
.article details p { margin: 0; padding: 0 0 16px; }

@media (max-width: 600px) {
  .article h2 { margin-top: 40px; }
  .article .table-cards table, .article .table-cards tbody, .article .table-cards tr, .article .table-cards td { display: block; }
  .article .table-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .article .table-cards tr { border: 1px solid var(--art-line); border-radius: 12px; background: var(--art-card); padding: 12px 14px; margin: 0 0 12px; }
  .article .table-cards td { border: 0; padding: 3px 0; white-space: normal; }
  .article .table-cards td:first-child { font-size: 17px; }
  .article .table-cards td:not(:first-child)::before { content: attr(data-label) " · "; color: var(--art-muted); }
  .article .table-wrap:not(.table-cards) table { font-size: 15px; }
  .article .table-wrap:not(.table-cards) th, .article .table-wrap:not(.table-cards) td { padding: 9px 8px; }
  .article .app-shots { gap: 8px; margin: 36px 0; }
  .article .app-shots figure img { filter: drop-shadow(0 6px 10px rgba(70, 40, 20, .2)); }
}
/* Language hub: a grid of cards, thumbnail on top, then title and description. */
.article-main:has(.hub), body:has(.hub) .article-nav { max-width: 1040px; }   /* header lines up with the grid */
.hub .hub-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.hub .hub-card {
  display: block;
  height: 100%;
  background: var(--art-card);
  border: 1px solid var(--art-line);
  border-radius: 16px;
  overflow: hidden;
  color: var(--art-ink);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.hub .hub-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(120, 70, 40, .14); }
.hub .hub-card:focus-visible { outline: 3px solid var(--art-accent); outline-offset: 2px; }
.hub .hub-card-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background: linear-gradient(180deg, #ffe9d8 0%, #f9c9a8 100%);
}
.hub .hub-card-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; border-radius: 0; }
.hub .hub-card-body { display: block; padding: 14px 16px 18px; }
.hub .hub-card h2 { font-size: 18px; line-height: 1.4; margin: 0 0 6px; color: var(--art-ink); }
.hub .hub-card p {
  margin: 0;
  color: var(--art-muted);
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hub .empty { color: var(--art-muted); }
@media (prefers-reduced-motion: reduce) {
  .hub .hub-card { transition: none; }
  .hub .hub-card:hover { transform: none; }
}
.article-foot { text-align: center; font-size: 14px; color: var(--art-muted); padding: 24px 16px 40px; }
.article-foot a { color: var(--art-muted); }
@media (max-width: 480px) {
  .article-links { gap: 12px; font-size: 14px; }
}
