/* The public pages (server/pages.py: the tools' pages, a shared picture, the community gallery), 2026-11-27: the site's
   Midnight look (web/styles.css), no script, phone first, right to left in Arabic (logical properties). */
:root {
  --bg: #0f1115; --surface: #171a21; --raised: #20242d; --text: #eceef2; --muted: #a3aab7; --border: #2b303b;
  --accent: #c8f04a; --accent-text: #12140f; --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }

.pg-top {
  display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap;
  padding: 12px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--border);
}
.pg-logo img { height: 30px; width: auto; }
.pg-langs { display: flex; gap: 4px 12px; flex-wrap: wrap; margin-inline-start: auto; font-size: 14px; }
.pg-langs a { color: var(--muted); text-decoration: none; }
.pg-langs a[aria-current] { color: var(--text); font-weight: 600; }
.pg-open {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text);
  font-size: 14px; white-space: nowrap;
}

.pg-main { max-width: 1040px; margin: 0 auto; padding: 0 16px 48px; }
.pg-hero { text-align: center; padding: 40px 0 24px; }
.pg-hero h1 { font-size: clamp(28px, 6vw, 44px); line-height: 1.15; margin: 0 0 14px; text-wrap: balance; }
.pg-intro { max-width: 680px; margin: 0 auto 22px; color: var(--muted); font-size: 18px; }
.pg-try {
  display: inline-block; padding: 13px 28px; border-radius: 999px; background: var(--accent); color: var(--accent-text);
  font-weight: 700; text-decoration: none; font-size: 17px;
}
.pg-try:hover { filter: brightness(1.06); }

.pg-example { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 6px; }
.pg-example.pg-one { grid-template-columns: minmax(0, 520px); justify-content: center; }
.pg-shot { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pg-shot img { width: 100%; }
.pg-shot.pg-clear img {   /* a transparent result on a checker */
  background: repeating-conic-gradient(#d6dae2 0% 25%, #eceef2 0% 50%) 0 0 / 24px 24px;
}
.pg-shot figcaption { padding: 8px 12px; color: var(--muted); font-size: 14px; }
.pg-asked { text-align: center; color: var(--muted); margin: 6px 0 0; }
.pg-asked q { color: var(--text); }

.pg-how, .pg-faq, .pg-more { margin-top: 44px; }
.pg-how h2, .pg-faq h2, .pg-more h2 { font-size: 24px; margin: 0 0 14px; }
.pg-how ol { padding-inline-start: 22px; margin: 0 0 20px; }
.pg-how li { margin: 6px 0; }
.pg-faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin: 8px 0; }
.pg-faq summary { cursor: pointer; font-weight: 600; }
.pg-faq p { margin: 8px 0 0; color: var(--muted); }

.pg-tools { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.pg-tools-big { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.pg-card {
  display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; color: var(--text); text-decoration: none;
}
.pg-card:hover { border-color: var(--muted); }
.pg-card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%;
  background: repeating-conic-gradient(#d6dae2 0% 25%, #eceef2 0% 50%) 0 0 / 20px 20px; }
.pg-card-name { padding: 10px 12px 4px; font-weight: 600; }
.pg-card-line { padding: 0 12px 12px; color: var(--muted); font-size: 14px; }
.pg-credit { margin-top: 36px; color: var(--muted); font-size: 13px; text-align: center; }

/* a shared picture (server/share.py) */
.pg-shared { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 28px; }
.pg-shared figure { margin: 0; max-width: min(100%, 720px); }
.pg-shared img { max-height: 70vh; width: auto; border-radius: var(--radius); }
.pg-shared .pg-clear img { background: repeating-conic-gradient(#d6dae2 0% 25%, #eceef2 0% 50%) 0 0 / 24px 24px; }
.pg-shared p { margin: 0; color: var(--muted); text-align: center; }

/* the community gallery (server/community.py) */
.pg-periods { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 0 0 18px; }
.pg-periods a { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); text-decoration: none; }
.pg-periods a[aria-current] { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.pg-posts { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.pg-post { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pg-post img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.pg-post p { margin: 0; padding: 8px 10px; color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.pg-empty { text-align: center; color: var(--muted); }

.pg-foot { border-top: 1px solid var(--border); padding: 22px 16px 32px; text-align: center; color: var(--muted); font-size: 14px; }
.pg-foot p { margin: 4px 0; }
.pg-foot-links a { color: var(--muted); }

@media (max-width: 560px) {
  .pg-example { grid-template-columns: 1fr; }
  .pg-hero { padding-top: 28px; }
  .pg-intro { font-size: 16px; }
}
