/* Porjaijaa reading settings (components/brands/porjaijaa/accessibility-menu.tsx).
   The boot script in the root layout sets data-pj-size, data-pj-font and
   data-pj-contrast on <html> before the first paint. */

/* ── The menu ─────────────────────────────────────────────────────────── */
html[data-site="porjaijaa"] .pj-a11y { position: relative; }
html[data-site="porjaijaa"] .pj-a11y-button { display: grid; place-items: center; width: 34px; height: 34px; color: var(--pj-muted-ink); border-radius: 999px; transition: background .15s, color .15s; }
html[data-site="porjaijaa"] .pj-a11y-button:hover,
html[data-site="porjaijaa"] .pj-a11y-button[aria-expanded="true"] { color: var(--pj-ink); background: var(--pj-sage-soft); }
html[data-site="porjaijaa"] .pj-a11y-button:focus-visible { outline: 3px solid #9b6333; outline-offset: 2px; }
html[data-site="porjaijaa"] .pj-a11y-panel { position: absolute; z-index: 60; top: calc(100% + 10px); right: -8px; width: min(300px, calc(100vw - 32px)); padding: 16px 16px 12px; color: var(--pj-ink); font-family: var(--pj-text); background: var(--pj-cream); border: 1.5px solid var(--pj-line); border-radius: 16px; box-shadow: 0 14px 30px rgb(71 57 45 / 18%); }
html[data-site="porjaijaa"] .pj-a11y-title { margin: 0 0 10px; font-family: var(--pj-hand); font-size: 20px; }
html[data-site="porjaijaa"] .pj-a11y-row { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; border: 0; }
html[data-site="porjaijaa"] .pj-a11y-row > span,
html[data-site="porjaijaa"] .pj-a11y-row legend { margin-bottom: 6px; padding: 0; font-size: 13.5px; font-weight: 500; color: var(--pj-muted-ink); }
html[data-site="porjaijaa"] .pj-a11y-stepper { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; }
html[data-site="porjaijaa"] .pj-a11y-stepper output { text-align: center; font-size: 15px; font-weight: 600; }
html[data-site="porjaijaa"] .pj-a11y-stepper button,
html[data-site="porjaijaa"] .pj-a11y-choices button { min-height: 40px; color: var(--pj-ink); background: var(--pj-paper-2); border: 1.5px solid var(--pj-line); border-radius: 12px; font-size: 14px; transition: background .15s, border-color .15s; }
html[data-site="porjaijaa"] .pj-a11y-stepper button { display: grid; place-items: center; }
html[data-site="porjaijaa"] .pj-a11y-stepper button:disabled { opacity: .45; cursor: not-allowed; }
html[data-site="porjaijaa"] .pj-a11y-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
html[data-site="porjaijaa"] .pj-a11y-choices button[aria-pressed="true"] { color: #fdfbf7; background: var(--pj-moss); border-color: var(--pj-moss); }
html[data-site="porjaijaa"].dark .pj-a11y-choices button[aria-pressed="true"] { color: #20251f; }
html[data-site="porjaijaa"] .pj-a11y-panel button:focus-visible { outline: 3px solid #9b6333; outline-offset: 2px; }
html[data-site="porjaijaa"] .pj-a11y-reset { display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px; font-size: 13px; color: var(--pj-muted-ink); text-decoration: underline; text-underline-offset: 4px; }

/* ── Size: the admin "Page size" (data-pj-zoom, default 80%) times the visitor's own
   text-size choice. Zoom the page regions, not the whole body, so 100vh layouts stay put. ── */
html[data-site="porjaijaa"] { --pj-zoom: .8; --pj-user-zoom: 1; }
html[data-site="porjaijaa"][data-pj-zoom="70"] { --pj-zoom: .7; }
html[data-site="porjaijaa"][data-pj-zoom="90"] { --pj-zoom: .9; }
html[data-site="porjaijaa"][data-pj-zoom="100"] { --pj-zoom: 1; }
html[data-site="porjaijaa"][data-pj-size="0"] { --pj-user-zoom: .9; }
html[data-site="porjaijaa"][data-pj-size="2"] { --pj-user-zoom: 1.12; }
html[data-site="porjaijaa"][data-pj-size="3"] { --pj-user-zoom: 1.25; }
html[data-site="porjaijaa"][data-pj-size="4"] { --pj-user-zoom: 1.4; }
html[data-site="porjaijaa"] :is(#porjaijaa-content, .pjl > *) { zoom: calc(var(--pj-zoom) * var(--pj-user-zoom)); }
html[data-site="porjaijaa"] :is(.porjaijaa-topbar, .porjaijaa-sidebar > :not(.porjaijaa-menu), .porjaijaa-menu > *, .porjaijaa-auth > div) { zoom: var(--pj-zoom); }

/* ── Easy-to-read font: plain fonts everywhere instead of the handwriting ones. ── */
html[data-site="porjaijaa"][data-pj-font="readable"] body {
  --pj-hand: var(--pj-th-face), var(--font-porjaijaa), sans-serif !important;
  --pj-label: var(--pj-th-face), var(--font-porjaijaa), sans-serif !important;
  --pj-text: var(--pj-th-face), var(--font-porjaijaa), sans-serif !important;
  --pj-brand: var(--pj-th-face), var(--font-porjaijaa), sans-serif !important;
}
html[data-site="porjaijaa"][data-pj-font="readable"] :is(.pj-kicker, .pg-eyebrow) { letter-spacing: .04em; }

/* ── High contrast: darker ink, firmer lines, plain paper (light), and the reverse in dark. ── */
html[data-site="porjaijaa"][data-pj-contrast="high"] {
  --foreground: #1c140e;
  --card-foreground: #1c140e;
  --popover-foreground: #1c140e;
  --muted-foreground: #33281f;
  --border: #7c6c57;
  --input: #7c6c57;
  --primary: #33502c;
  --pj-ink: #1c140e;
  --pj-muted-ink: #33281f;
  --pj-cocoa: #4a3a2c;
  --pj-line: #7c6c57;
  --pj-moss: #33502c;
  --pj-leaf: #2f5a2b;
  --pj-shadow-sage: #23381f;
  --pj-paper: #fbf8f1;
  --pj-paper-2: #fffdf8;
  --pj-cream: #ffffff;
  --color-zinc-400: #3f3f46;
  --color-zinc-500: #27272a;
  --color-zinc-600: #18181b;
  --color-indigo-500: #33502c;
  --color-indigo-600: #33502c;
  --color-indigo-700: #263d21;
}
html[data-site="porjaijaa"].dark[data-pj-contrast="high"] {
  --foreground: #ffffff;
  --card-foreground: #ffffff;
  --popover-foreground: #ffffff;
  --muted-foreground: #ece8dc;
  --border: #a7b59c;
  --input: #a7b59c;
  --primary: #c8e6b6;
  --pj-ink: #ffffff;
  --pj-muted-ink: #ece8dc;
  --pj-cocoa: #ead2b8;
  --pj-line: #a7b59c;
  --pj-moss: #c8e6b6;
  --pj-leaf: #b8dca8;
  --pj-paper: #0e120d;
  --pj-paper-2: #151a14;
  --pj-cream: #1a2018;
  --color-zinc-400: #e4e4e7;
  --color-zinc-500: #f4f4f5;
  --color-zinc-600: #fafafa;
}
html[data-site="porjaijaa"][data-pj-contrast="high"] body { background: var(--pj-paper); }
html[data-site="porjaijaa"][data-pj-contrast="high"] .pg {
  --pg-ink: var(--pj-ink);
  --pg-muted: var(--pj-muted-ink);
  --pg-line: var(--pj-line);
  --pg-green: var(--pj-moss);
}
/* Text that the soft theme tints by hand gets the strong ink instead. */
/* (Light mode only: the dark theme already repaints these, and some notes stay paper-light there.) */
html[data-site="porjaijaa"]:not(.dark)[data-pj-contrast="high"] :is(.porjaijaa-content, .pjl) :is(p, li, small, span, label, figcaption, summary, legend, dd, dt, td, th) { color: var(--pj-ink); }
html[data-site="porjaijaa"][data-pj-contrast="high"] :is(.porjaijaa-content, .pjl) :is(.pj-kicker, .pg-eyebrow, .pg-fine, .pg-tarot-fine, .pg-tarot-comeback, .pg-tarot-date) { color: var(--pj-muted-ink); }
html[data-site="porjaijaa"][data-pj-contrast="high"] :is(.pg-button, .pjl-btn:not(.pjl-btn-ghost)) { color: #ffffff; background: var(--pj-moss); border-color: var(--pj-moss); }
html[data-site="porjaijaa"].dark[data-pj-contrast="high"] :is(.pg-button, .pjl-btn:not(.pjl-btn-ghost)) { color: #0e120d; }
html[data-site="porjaijaa"][data-pj-contrast="high"] :is(.pj-paper, .pj-sticky, .pg-cat-choices label, .pg-cat-story, .pg-tarot-note) { box-shadow: 0 0 0 1.5px var(--pj-line); }
html[data-site="porjaijaa"][data-pj-contrast="high"] body :is(.pj-sticky, .pj-sticky-pink, .pj-sticky-sage) { color: #1c140e; }
html[data-site="porjaijaa"][data-pj-contrast="high"] body :is(.pj-sticky, .pj-sticky-pink, .pj-sticky-sage) :is(p, span, strong, b) { color: #1c140e; }
html[data-site="porjaijaa"][data-pj-contrast="high"] a:focus-visible,
html[data-site="porjaijaa"][data-pj-contrast="high"] button:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
/* Cards that stay paper-white in dark mode keep dark ink on them. */
html[data-site="porjaijaa"][data-pj-contrast="high"] :is(.pg-tarot-face, .pg-spread-card) :is(p, span) { color: #1c140e; }
html[data-site="porjaijaa"][data-pj-contrast="high"] .pg-tarot-moon { color: #ecd890; }
html[data-site="porjaijaa"].dark[data-pj-contrast="high"] :is(.pj-room-sign, .pj-room-sign span, .pj-doormat) { color: #0e120d; }
html[data-site="porjaijaa"][data-pj-contrast="high"] .pjl-door small { color: #8a2a22; }
html[data-site="porjaijaa"].dark[data-pj-contrast="high"] .pjl-door small { color: #ffb4a8; }
