/*
 * Trust pages (Methodology, About, Free to use, Editorial policy, Data
 * downloads, Privacy, Cookies), from the Pen frames "J · Trust page template ·
 * Methodology" (aYmGR) and "J · Mobile · Trust page template · Methodology"
 * (Y0YJE). The body is the page's own blocks; d2/trust.php wraps the changelog.
 */

/* ---- Head (MEoom): padding 40/64/28, 760 column centred, gap 12, bottom rule ---- */
.d2-thead { display: flex; flex-direction: column; align-items: center; padding: 40px 64px 28px; box-shadow: inset 0 -1px 0 var(--line); }
.d2-thead__inner { width: 760px; max-width: 100%; display: flex; flex-direction: column; gap: 12px; }
.d2-thead__eyebrow { align-self: flex-start; font: 400 11px/14px var(--font-mono); letter-spacing: 1.6px; color: var(--accent); }
.d2-thead__title { align-self: flex-start; font: 400 52px/52px var(--font-heading); letter-spacing: -0.6px; color: var(--ink); font-variation-settings: "opsz" 18; }
.d2-thead__lede { font-size: 18px; line-height: 27px; color: var(--ink-secondary); }
.d2-thead__meta { align-self: flex-start; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.d2-thead__meta > * { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--ink-secondary); }
.d2 .d2-thead__meta a:hover { color: var(--ink); }
.d2-thead__mmeta { display: none; }

/* ---- Body (XSROk): rail 220 + 48 + content 720, centred, padding 36/64/56 ---- */
.d2-tbody { display: flex; justify-content: center; align-items: flex-start; gap: 48px; padding: 36px 64px 56px; }
.d2-ttoc { flex: none; width: 220px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; position: sticky; top: calc(var(--nav-h) + 24px); }
.d2-ttoc__label { font: 400 10px/13px var(--font-mono); letter-spacing: 1.3px; color: var(--ink-muted); }
.d2-ttoc__item { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 17px; color: var(--ink-secondary); }
.d2-ttoc__item i { flex: none; width: 2px; height: 16px; background: var(--line); }
.d2-ttoc__item[aria-current] { color: var(--ink); }
.d2-ttoc__item[aria-current] i { background: var(--accent); }
.d2 .d2-ttoc__item:hover { color: var(--ink); }
.d2-tmtoc { display: none; }

/* ---- Content (gA9R8): 720 column, gap 20 ---- */
.d2-tcontent { flex: 0 1 720px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.d2-tcontent h2 { align-self: flex-start; font: 400 28px/28px var(--font-heading); color: var(--ink); font-variation-settings: "opsz" 18; scroll-margin-top: calc(var(--nav-h) + 24px); }
.d2-tcontent h3 { font: 600 18px/24px var(--font-body); color: var(--ink); }
.d2-tcontent > p, .d2-tcontent > ul, .d2-tcontent > ol, .d2-tchangelog > p { font-size: 16px; line-height: 27px; color: var(--article-ink); }
.d2-tcontent > ul, .d2-tcontent > ol { padding-left: 22px; list-style: revert; }
.d2-tcontent > p a, .d2-tcontent > ul a, .d2-tcontent > ol a, .d2-tchangelog > p a, .d2-tcontent td a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.d2-tcontent strong { font-weight: 600; color: var(--ink); }

/* Method table (D0b1p), from a core table: term 150, meaning, how often; rows 46 */
.d2-tcontent .wp-block-table { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.d2-tcontent .wp-block-table table { display: block; width: 100%; border-collapse: separate; border-spacing: 0; border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.d2-tcontent .wp-block-table :is(thead, tbody, tfoot) { display: block; }
.d2-tcontent .wp-block-table tr { display: grid; grid-template-columns: 150px minmax(0, 1fr); grid-auto-columns: auto; grid-auto-flow: column; column-gap: 16px; padding: 14px 18px; box-shadow: inset 0 -1px 0 var(--line); }
.d2-tcontent .wp-block-table :is(td, th) { padding: 0; border: 0; text-align: left; font: 400 14px/18px var(--font-body); color: var(--ink-secondary); }
.d2-tcontent .wp-block-table td:first-child { font-weight: 600; color: var(--ink); }
.d2-tcontent .wp-block-table td:nth-child(3) { font: 400 12px/16px var(--font-mono); text-align: right; white-space: nowrap; }
.d2-tcontent .wp-block-table thead tr { background: var(--surface-alt); }
.d2-tcontent .wp-block-table th { font-size: 12px; line-height: 16px; font-weight: 600; }
.d2-tcontent .wp-block-table figcaption { font-size: 12px; line-height: 16px; color: var(--ink-muted); }

/* "In short" list style (key facts in the Free to use copy) */
.d2-tcontent > ul.is-style-in-short { display: flex; flex-direction: column; gap: 10px; padding: 20px; list-style: none; border-radius: 10px; background: var(--surface-alt); }
.d2-tcontent > ul.is-style-in-short::before { content: "IN SHORT"; font: 400 10px/13px var(--font-mono); letter-spacing: 1.4px; color: var(--accent); }
.d2-tcontent > ul.is-style-in-short li { padding-left: 26px; font-size: 14px; line-height: 1.5; color: var(--ink);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231F7A3D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat 0 0 / 16px 16px; }

/* Changelog (AxOPn): the last H2 section; rows of date 110, version 50, change */
.d2-tchangelog { display: flex; flex-direction: column; gap: 20px; }
.d2-tchangelog .wp-block-table table { border-radius: 0; background: none; box-shadow: none; }
.d2-tchangelog .wp-block-table tr { grid-template-columns: 110px 50px minmax(0, 1fr); padding: 12px 0; }
.d2 .d2-tchangelog .wp-block-table td { font: 400 14px/18px var(--font-body); color: var(--ink-secondary); text-align: left; white-space: normal; }
.d2 .d2-tchangelog .wp-block-table td:first-child { font: 400 12px/16px var(--font-mono); color: var(--ink-secondary); }
.d2 .d2-tchangelog .wp-block-table td:nth-child(2):not(:last-child) { font: 400 12px/16px var(--font-mono); color: var(--accent); }
.d2-tchangelog .wp-block-table td:nth-child(2):last-child { grid-column: 2 / -1; }

/* Report box (Cj5Be) */
.d2-tcontact { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px; border-radius: 8px; background: var(--surface-alt); font-size: 13px; line-height: 17px; color: var(--ink-secondary); }
.d2-tcontact svg { width: 15px; height: 15px; margin-top: 1px; }

/* Tablet: narrower rail; the content column gives way */
@media (min-width: 761px) and (max-width: 1100px) {
  .d2-thead { padding: 40px 24px 28px; }
  .d2-tbody { gap: 32px; padding: 36px 24px 56px; }
  .d2-ttoc { width: 180px; }
}

/* ---- Mobile (Y0YJE) ---- */
@media (max-width: 760px) {
  .d2-thead { align-items: stretch; padding: 20px 16px 18px; background: var(--surface-alt); }
  .d2-thead__inner { width: auto; gap: 10px; }
  .d2-thead__eyebrow { font-size: 10px; line-height: 13px; letter-spacing: 1.4px; }
  .d2-thead__title { align-self: stretch; font-size: 34px; line-height: 1.15; letter-spacing: -0.4px; }
  .d2-thead__lede { font-size: 15px; line-height: 1.45; }
  .d2-thead__meta { display: none; }
  .d2-thead__mmeta { align-self: flex-start; display: flex; align-items: center; gap: 12px; height: 16px; }
  .d2-thead__mmeta span { font: 400 10px/13px var(--font-mono); color: var(--ink-muted); }
  .d2-thead__mmeta a { font: 500 12px/16px var(--font-body); color: var(--accent); }

  .d2-tbody { display: block; padding: 14px 16px 24px; }
  .d2-ttoc { display: none; }
  .d2-tcontent { gap: 14px; }
  .d2-tmtoc { display: block; margin-bottom: 4px; border-radius: 8px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
  .d2-tmtoc summary { display: flex; justify-content: space-between; align-items: center; height: 36px; padding: 10px 14px; list-style: none; cursor: pointer; }
  .d2-tmtoc summary::-webkit-details-marker { display: none; }
  .d2-tmtoc summary span { font: 400 10px/13px var(--font-mono); letter-spacing: 1.3px; color: var(--ink-muted); }
  .d2-tmtoc[open] summary svg { transform: rotate(180deg); }
  .d2-tmtoc nav { display: flex; flex-direction: column; padding: 0 14px 8px; box-shadow: inset 0 1px 0 var(--line); }
  .d2-tmtoc nav a { padding: 8px 0; font-size: 14px; line-height: 18px; color: var(--ink-secondary); }

  .d2-tcontent h2 { align-self: stretch; font-size: 24px; line-height: 1.15; }
  .d2-tcontent > p, .d2-tcontent > ul, .d2-tcontent > ol, .d2-tchangelog > p { font-size: 15px; line-height: 1.55; color: var(--ink); }

  /* Method table, stacked: term and how often on one line, meaning below */
  .d2-tcontent .wp-block-table table { border-radius: 8px; }
  .d2-tcontent .wp-block-table tr { grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: row; row-gap: 3px; padding: 10px 14px; box-shadow: none; }
  .d2-tcontent .wp-block-table tr + tr { box-shadow: inset 0 1px 0 var(--line); }
  .d2-tcontent .wp-block-table td:first-child { grid-row: 1; grid-column: 1; font-weight: 500; }
  .d2-tcontent .wp-block-table td:nth-child(2) { grid-row: 2; grid-column: 1 / -1; font-size: 13px; line-height: 1.45; }
  .d2-tcontent .wp-block-table td:nth-child(3) { grid-row: 1; grid-column: 2; font-size: 10px; line-height: 13px; color: var(--ink-muted); }

  .d2-tchangelog { gap: 14px; }
  .d2-tchangelog .wp-block-table table { border-radius: 0; }
  .d2-tchangelog .wp-block-table tbody { display: flex; flex-direction: column; gap: 14px; }
  .d2-tchangelog .wp-block-table tr { grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 2px; padding: 8px 0; box-shadow: inset 0 1px 0 var(--line); }
  .d2 .d2-tchangelog .wp-block-table td:first-child, .d2 .d2-tchangelog .wp-block-table td:nth-child(2):not(:last-child) { grid-row: 1; font-size: 11px; line-height: 14px; color: var(--ink-muted); }
  .d2 .d2-tchangelog .wp-block-table td:first-child { grid-column: 1; }
  .d2 .d2-tchangelog .wp-block-table td:nth-child(2):not(:last-child) { grid-column: 2; }
  .d2 .d2-tchangelog .wp-block-table td:last-child { grid-row: 2; grid-column: 1 / -1; font-size: 14px; line-height: 1.45; color: var(--ink); }

  .d2-tcontact { padding: 14px; line-height: 19px; color: var(--ink); }
  .d2-tcontact svg { width: 16px; height: 16px; margin-top: 0; flex: none; }
}
