/* Matje story: a tiler's worksheet page. Clay accent, a reading column, a tile-grid strip over the title, numbered
   steps as ruled lines, a three-column sum table, phone pictures in a pair. Chromium 67 safe (no flex gap, clamp,
   inset or aspect-ratio). */
@font-face { font-family: 'MTJ UI'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/inter-latin.woff2') format('woff2'); }
@font-face { font-family: 'MTJ Display'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('/assets/fonts/space-grotesk-latin.woff2') format('woff2'); }
body.page-matje {
  --accent: #E8A06A; --accent-ink: #2B1507; --accent-soft: rgba(232, 160, 106, .12);
  --head: 'MTJ Display', 'Segoe UI', Roboto, Arial, sans-serif;
  --body: 'MTJ UI', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Frame */
.page-matje main .wrap { max-width: 820px; }
.page-matje main > .wrap:first-child { padding-top: 40px; }
.page-matje .crumb { margin: 0 0 28px; font-size: 14px; }
.page-matje .crumb a { color: var(--muted); text-decoration: none; }
.page-matje .crumb a:before { content: "\2190"; margin-right: 8px; }
.page-matje .crumb a:hover { color: var(--accent); }
.page-matje .story-app { margin-bottom: 36px; }
.page-matje main strong { color: var(--text); font-weight: 600; }
.mtj-a, .page-matje .mtj-end a:not(.btn) { color: var(--text); text-decoration: underline; -webkit-text-decoration-color: var(--accent); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.mtj-a:hover, .page-matje .mtj-end a:not(.btn):hover { color: var(--accent); }

/* Title block with a strip of tiles on top */
.mtj-hero { position: relative; padding: 34px 0 36px; border-bottom: 1px solid var(--hair-2); }
.mtj-hero:before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 12px; background-color: var(--accent-soft); background-image: -webkit-linear-gradient(left, var(--accent) 0, var(--accent) 12px, transparent 12px, transparent 16px); background-image: linear-gradient(to right, var(--accent) 0, var(--accent) 12px, transparent 12px, transparent 16px); background-size: 16px 12px; background-repeat: repeat-x; }
.mtj-eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: .14em; color: var(--accent); }
.mtj-hero h1 { margin: 0 0 18px; font-size: 31px; line-height: 1.16; }
.mtj-lead { margin: 0; font-size: 18px; line-height: 1.6; color: var(--text-2); }

/* Sections */
.mtj-section { padding-top: 40px; }
.mtj-section > .wrap:after { content: ""; display: table; clear: both; }
.mtj-h2 { margin: 0 0 16px; font-size: 24px; line-height: 1.25; }
.mtj-p { margin: 0 0 18px; color: var(--text-2); }
.mtj-small { margin: 0 0 18px; font-size: 14px; line-height: 1.6; color: var(--muted); }

/* Steps: ruled lines with a big number in the margin */
.mtj-steps { list-style: none; margin: 6px 0 26px; padding: 0; counter-reset: mtjstep; border-top: 1px solid var(--hair-2); }
.mtj-steps li { position: relative; counter-increment: mtjstep; margin: 0; padding: 16px 0 16px 52px; color: var(--text-2); border-bottom: 1px solid var(--hair-2); }
.mtj-steps li:before { content: counter(mtjstep); position: absolute; left: 0; top: 12px; width: 36px; font: 700 28px/1.2 var(--head); color: var(--accent); }

/* The sum table: fits a 390 px phone, no sideways scroll */
.mtj-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 6px 0 22px; font-size: 14px; line-height: 1.4; border: 1px solid var(--hair-2); }
.mtj-table th, .mtj-table td { padding: 11px 8px; text-align: left; vertical-align: top; border-top: 1px solid var(--hair); }
.mtj-table thead th { background: var(--accent-soft); color: var(--text); font-weight: 600; border-top: 0; border-bottom: 2px solid var(--accent); }
.mtj-table tbody th { width: 34%; color: var(--text); font-weight: 600; }
.mtj-table td { color: var(--text-2); border-left: 1px dashed var(--hair); }
.mtj-table tbody tr:last-child td, .mtj-table tbody tr:last-child th { background: var(--surface); color: var(--text); font-weight: 600; }

/* Rules and limits: a clay square marker */
.mtj-rule { list-style: none; margin: 6px 0 24px; padding: 0; }
.mtj-rule li { position: relative; margin: 0 0 12px; padding-left: 26px; color: var(--text-2); }
.mtj-rule li:before { content: ""; position: absolute; left: 2px; top: .55em; width: 9px; height: 9px; background: var(--accent); }

/* Pictures */
.mtj-pair { margin: 24px 0 28px; }
.mtj-pair:after { content: ""; display: table; clear: both; }
.mtj-fig { margin: 0 auto 28px; max-width: 280px; text-align: center; }
.mtj-img { display: block; width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--hair-2); }
.mtj-cap { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--muted); text-align: left; }
.mtj-single { margin-top: 24px; }

/* Limits box and the close */
.mtj-limits { margin-top: 8px; padding: 26px 22px 8px; border: 1px solid var(--hair-2); border-top: 4px solid var(--accent); border-radius: 12px; background: var(--surface); }
.mtj-limits .mtj-h2 { font-size: 22px; }
.mtj-end { margin: 40px 0 48px; }
.mtj-end .btn { margin: 0 18px 12px 0; vertical-align: middle; }
.page-matje .mtj-end a:not(.btn) { display: inline-block; margin-bottom: 12px; vertical-align: middle; }

@media (min-width: 640px) {
  .mtj-pair .mtj-fig { float: left; width: 46%; max-width: 300px; margin: 0 4% 8px 0; }
  .mtj-pair .mtj-fig + .mtj-fig { margin-right: 0; }
  .mtj-table { font-size: 15px; }
  .mtj-table th, .mtj-table td { padding: 12px 14px; }
}
@media (min-width: 900px) {
  .page-matje main > .wrap:first-child { padding-top: 64px; }
  .mtj-hero h1 { font-size: 42px; }
  .mtj-lead { font-size: 20px; }
  .mtj-section { padding-top: 56px; }
  .mtj-h2 { font-size: 28px; }
  .mtj-limits { padding: 30px 32px 10px; }
}
