/* ==========================================================================
   Mobius — document pages (owner, 2026-11-30)
   Terms of service, Privacy Policy, Legal notice, Contact: the pages behind
   the footer links, in the same quiet look as the rest of the site.
   Loaded only on those pages; functions.php puts .mbx-doc and
   .mbx-doc--<page> on <body>. Styling only: the wording stays as written in
   the editor, so the pages stay editable there as before.
   ========================================================================== */

body.mbx-doc {
  --doc-ice-soft: color-mix(in srgb, var(--mbx-ice) 8%, transparent);
  --doc-rail: 300px;                      /* width of the section-title column */
  --doc-edge: max(24px, env(safe-area-inset-left, 0px));
}

/* a faint light from the top left, as if a clip were playing just off the page */
body.mbx-doc .entry-content { margin-block-start: 0 !important; background: radial-gradient(900px 340px at 16% 0%, var(--doc-ice-soft), transparent 70%); }

/* the page's one outer group: our own width, air above and below */
body.mbx-doc .entry-content > .wp-block-group {
  box-sizing: border-box; max-width: calc(1180px + 2 * var(--doc-edge)); margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) var(--doc-edge) clamp(80px, 10vw, 140px) !important;
}
/* spacer blocks and empty paragraphs set the old rhythm; this sheet sets its own */
body.mbx-doc .entry-content > .wp-block-group > .wp-block-spacer,
body.mbx-doc .entry-content > .wp-block-group > p:empty { display: none; }

/* ---------- page title ---------- */
body.mbx-doc .entry-content h1,
body.mbx-doc--privacy-policy .entry-content > .wp-block-group > h2:first-child {
  font-family: var(--mbx-serif); font-weight: 300; font-size: clamp(42px, 6vw, 76px); line-height: 1.04; letter-spacing: -.01em;
  color: var(--ms-heading); margin: 0; max-width: 16em;
}
html[lang^="ja"] body.mbx-doc .entry-content h1 { font-size: clamp(34px, 4.6vw, 58px); line-height: 1.25; }

/* ---------- Terms of service, Privacy Policy: titles left, text right ---------- */
.mbx-doc--terms-of-service .entry-content > .wp-block-group,
.mbx-doc--privacy-policy .entry-content > .wp-block-group {
  display: grid; grid-template-columns: var(--doc-rail) minmax(0, 1fr); row-gap: 16px; align-items: start;
}
:is(.mbx-doc--terms-of-service, .mbx-doc--privacy-policy) .entry-content > .wp-block-group > * {
  grid-column: 2; margin: 0 !important; max-width: 46rem !important;
}
/* the small line above the title */
.mbx-doc--terms-of-service .entry-content > .wp-block-group > h3:first-child {
  grid-column: 1 / -1; font-family: var(--mbx-sans); font-size: 11.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--mbx-ice);
}
:is(.mbx-doc--terms-of-service, .mbx-doc--privacy-policy) .entry-content > .wp-block-group > h1,
.mbx-doc--privacy-policy .entry-content > .wp-block-group > h2:first-child { grid-column: 1 / -1; max-width: 16em !important; }

/* section titles: a hairline across the page, the title in the left column and
   the text beside it. The title row has no height of its own, so the first
   paragraph starts level with it. */
.mbx-doc--terms-of-service .entry-content > .wp-block-group > :is(h2, h3:not(:first-child), h4),
.mbx-doc--privacy-policy .entry-content > .wp-block-group > :is(h2:not(:first-child), h3, h4, p.has-large-font-size) {
  grid-column: 1 / -1; box-sizing: content-box; height: 0; overflow: visible;
  max-width: none !important; margin-top: clamp(28px, 4vw, 44px) !important; padding: 43px calc(100% - var(--doc-rail) + 36px) 0 0; border-top: 1px solid var(--ms-line);
  font-family: var(--mbx-serif); font-size: 25px !important; font-weight: 400; line-height: 1.22; letter-spacing: 0; color: var(--ms-heading);
}
/* Privacy Policy: its titles run to three lines, so whatever follows one is at least that tall */
.mbx-doc--privacy-policy .entry-content > .wp-block-group > :is(h2:not(:first-child), h3, h4, p.has-large-font-size) + :is(p:not(.has-large-font-size), ul, ol),
.mbx-doc--privacy-policy .entry-content > .wp-block-group > :is(h2:not(:first-child), h3, h4, p.has-large-font-size) + .wp-block-spacer + :is(p:not(.has-large-font-size), ul, ol),
.mbx-doc--privacy-policy .entry-content > .wp-block-group > p.has-large-font-size + .wp-block-spacer + p:empty + p { min-height: 88px; }

/* the text itself: regular weight, comfortable measure */
:is(.mbx-doc--terms-of-service, .mbx-doc--privacy-policy) .entry-content :is(p, li) { font-size: 16px !important; line-height: 1.78; color: var(--ms-text); }
:is(.mbx-doc--terms-of-service, .mbx-doc--privacy-policy) .entry-content :is(p, li, h2, h3, h4) strong { font-weight: inherit; }
:is(.mbx-doc--terms-of-service, .mbx-doc--privacy-policy) .entry-content :is(ul, ol) { padding-left: 1.3em; display: grid; gap: 8px; }
:is(.mbx-doc--terms-of-service, .mbx-doc--privacy-policy) .entry-content li::marker { color: var(--ms-text-dim); }
:is(.mbx-doc--terms-of-service, .mbx-doc--privacy-policy) .entry-content li > :is(ul, ol) { margin-top: 8px; }

@media (max-width: 900px) {
  .mbx-doc--terms-of-service .entry-content > .wp-block-group,
  .mbx-doc--privacy-policy .entry-content > .wp-block-group { grid-template-columns: minmax(0, 1fr); }
  :is(.mbx-doc--terms-of-service, .mbx-doc--privacy-policy) .entry-content > .wp-block-group > * { grid-column: 1; }
  .mbx-doc--terms-of-service .entry-content > .wp-block-group > :is(h2, h3:not(:first-child), h4),
  .mbx-doc--privacy-policy .entry-content > .wp-block-group > :is(h2:not(:first-child), h3, h4, p.has-large-font-size) { height: auto; padding: 26px 0 4px; font-size: 23px !important; }
  :is(.mbx-doc--terms-of-service, .mbx-doc--privacy-policy) .entry-content > .wp-block-group > * { min-height: 0 !important; }
  :is(.mbx-doc--terms-of-service, .mbx-doc--privacy-policy) .entry-content :is(p, li) { font-size: 15.5px !important; line-height: 1.72; }
}

/* ---------- Legal notice: the two tables as quiet fact sheets ---------- */
.mbx-doc--legal-notice .entry-content > .wp-block-group > * { max-width: 980px !important; margin-left: 0 !important; margin-right: 0 !important; }
.mbx-doc--legal-notice .entry-content h1 { font-size: clamp(32px, 4.4vw, 54px); line-height: 1.2; }
.mbx-doc--legal-notice .entry-content h2 { font-family: var(--mbx-serif); font-weight: 300; font-size: clamp(30px, 4vw, 48px); line-height: 1.12; color: var(--ms-heading); margin: clamp(72px, 9vw, 120px) 0 0; }
.mbx-doc--legal-notice .entry-content .wp-block-table { margin: clamp(26px, 4vw, 44px) 0 0; overflow: visible; }
.mbx-doc--legal-notice .entry-content table { width: 100%; border: 0; border-collapse: collapse; }
.mbx-doc--legal-notice .entry-content td { border: 0; border-bottom: 1px solid var(--ms-line); padding: 19px 0; vertical-align: top; font-size: 15px; line-height: 1.75; color: var(--ms-text); word-break: normal; overflow-wrap: anywhere; }
.mbx-doc--legal-notice .entry-content tr:first-child td { border-top: 1px solid var(--ms-line-strong); }
.mbx-doc--legal-notice .entry-content td:first-child { width: 250px; padding-right: 36px; padding-top: 22px; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ms-text-dim); overflow-wrap: normal; }
.mbx-doc--legal-notice .entry-content td:first-child strong { font-weight: 500; }
.mbx-doc--legal-notice .entry-content .wp-block-table:first-of-type td:first-child { font-size: 12.5px; letter-spacing: .1em; }   /* the Japanese labels */
@media (max-width: 700px) {
  .mbx-doc--legal-notice .entry-content td { display: block; padding: 0 0 18px; }
  .mbx-doc--legal-notice .entry-content td:first-child { width: auto; border-bottom: 0; padding: 18px 0 6px; }
  .mbx-doc--legal-notice .entry-content tr:first-child td:last-child { border-top: 0; }
}

/* ---------- Contact: the invitation left, the form in a panel right ---------- */
.mbx-doc--contact .entry-content > .wp-block-group {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px); grid-template-rows: auto 1fr; column-gap: clamp(40px, 8vw, 120px); align-items: start;
}
.mbx-doc--contact .entry-content > .wp-block-group > * { grid-column: 1; margin: 0 !important; max-width: none !important; }
.mbx-doc--contact .entry-content > .wp-block-group > p { margin-top: 26px !important; max-width: 30rem !important; font-size: clamp(17px, 1.7vw, 20px); font-weight: 300; line-height: 1.65; color: var(--ms-text); }
.mbx-doc--contact .entry-content > .wp-block-group > .wpcf7 {
  grid-column: 2; grid-row: 1 / span 2; background: color-mix(in srgb, var(--ms-surface) 65%, transparent); border: 1px solid var(--ms-line); border-radius: 14px; padding: clamp(24px, 3.4vw, 40px);
}
.mbx-doc--contact .wpcf7 form p { margin: 0 0 20px; }
.mbx-doc--contact .wpcf7 form p:last-of-type { margin: 28px 0 0; }
.mbx-doc--contact .wpcf7 label { display: block; font-size: 11.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ms-text-dim); }
.mbx-doc--contact .wpcf7 label br { display: none; }
.mbx-doc--contact .wpcf7 .wpcf7-form-control-wrap { display: block; margin-top: 9px; }
.mbx-doc--contact .wpcf7 :is(input:not([type="submit"]), textarea) { box-sizing: border-box; width: 100%; max-width: 100%; letter-spacing: 0; text-transform: none; transition: border-color .25s; }
.mbx-doc--contact .wpcf7 textarea { height: 170px; resize: vertical; line-height: 1.6; }
.mbx-doc--contact .wpcf7 input[type="submit"] { min-width: 160px; min-height: 48px; cursor: pointer; transition: background .25s, transform .25s; }
.mbx-doc--contact .wpcf7 input[type="submit"]:hover { transform: translateY(-1px); }
.mbx-doc--contact .wpcf7 .wpcf7-not-valid-tip { margin-top: 6px; font-size: 12.5px; letter-spacing: 0; text-transform: none; }
.mbx-doc--contact .wpcf7 form .wpcf7-response-output { margin: 22px 0 0; padding: 12px 16px; border-radius: 10px; border-color: var(--ms-line-strong); font-size: 14px; color: var(--ms-text); }
@media (max-width: 860px) {
  .mbx-doc--contact .entry-content > .wp-block-group { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .mbx-doc--contact .entry-content > .wp-block-group > .wpcf7 { grid-column: 1; grid-row: auto; margin-top: 36px !important; }
}

@media (prefers-reduced-motion: reduce) { .mbx-doc--contact .wpcf7 input[type="submit"]:hover { transform: none; } }

/* ---------- Japanese ---------- */
html[lang^="ja"] body.mbx-doc--privacy-policy .entry-content > .wp-block-group > h2:first-child { font-size: clamp(30px, 4vw, 50px); line-height: 1.3; max-width: 20em; }
html[lang^="ja"] :is(.mbx-doc--terms-of-service, .mbx-doc--privacy-policy) .entry-content :is(p:not(.has-large-font-size), li) { line-height: 1.95; }
html[lang^="ja"] .mbx-doc--terms-of-service .entry-content > .wp-block-group > :is(h2, h3:not(:first-child), h4),
html[lang^="ja"] .mbx-doc--privacy-policy .entry-content > .wp-block-group > :is(h2:not(:first-child), h3, h4, p.has-large-font-size) { font-size: 21px !important; line-height: 1.45; font-variant-numeric: lining-nums; }
