/* /codes: the sketch-code cheat sheet. Layout and type come from /doors/assets/kerf-doors.css and the
   search bar from /learn/assets/learn.css. Prints on A4 (Print it, or the PDF beside it). */
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cprint-head { display: none; }
.cnote-card { background: var(--brand-ink); color: var(--brand-paper); border-radius: 4px; padding: 26px 28px 28px; }
.cnc-eb { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; color: var(--brand-amber-bright); }
.cnc-rect { margin: 14px 0 22px; border: 1.5px solid #f7f4f1; border-radius: 2px; min-height: 120px; display: flex; align-items: center; justify-content: center;
  background-image: linear-gradient(#2b2b2e 1px, transparent 1px), linear-gradient(90deg, #2b2b2e 1px, transparent 1px); background-size: 16px 16px; }
.cnc-rect .fm { font-size: 22px; font-weight: 600; color: #fff; background: var(--brand-ink); padding: 4px 10px; }
.cnc-reads { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cnc-reads li { font-size: 14px; background: #2b2b2e; border-radius: 3px; padding: 7px 10px; }
.cfam { margin-top: 44px; scroll-margin-top: 16px; }
.cf-head { display: flex; align-items: baseline; gap: 12px; }
.cf-n { font-size: 13px; font-weight: 600; letter-spacing: .14em; color: var(--brand-amber-text); }
.cf-t { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.cf-c { font-size: 12px; color: var(--brand-graphite); border: 1px solid var(--brand-line); border-radius: 999px; padding: 2px 8px; }
.cf-i { font-size: 14px; line-height: 1.5; color: var(--brand-ink-soft); margin: 6px 0 0; }
.ctable { margin-top: 16px; background: #fff; border: 1px solid var(--brand-line); border-radius: 4px; overflow: hidden; }
.crow { display: grid; grid-template-columns: 270px 190px minmax(0,1fr) 78px; gap: 18px; align-items: baseline; padding: 13px 18px; border-top: 1px solid #efe9e2; }
.crow > div { line-height: 1.5; }
.chead { align-items: center; }
.crow:first-child { border-top: 0; }
.crow:not(.chead):hover { background: #fbf8f5; }
.chead { background: var(--brand-paper-deep); padding-top: 9px; padding-bottom: 9px; }
.chead > div { font: 600 10.5px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--brand-graphite); }
html[lang="ar"] .chead > div { font-family: var(--font-ui); font-size: 12px; letter-spacing: 0; text-transform: none; }
.c-code { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.c-words { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }
.c-code .fm { font-size: 16px; font-weight: 600; color: var(--brand-ink); letter-spacing: .02em; overflow-wrap: anywhere; }
.c-words .fm + .fm { position: relative; }
.c-code .c-more { font-size: 15px; color: var(--brand-graphite); }
.c-code .c-note, .c-code .c-plain { font-size: 14px; color: var(--brand-ink-soft); }
.cfam-mark .c-code > span { font-family: var(--font-ui); font-size: 15px; letter-spacing: 0; }
.ctag { font: 600 9.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; padding: 4px 6px; border-radius: 2px; white-space: nowrap; }
.ctag-new { background: var(--brand-amber); color: var(--brand-ink); }
.ctag-keep { background: #e3ede4; color: #2f5a36; }
.ctag-old { background: #ece9e5; color: #6b6660; }
html[lang="ar"] .ctag { font-family: var(--font-ui); font-size: 11px; letter-spacing: 0; text-transform: none; }
.clegend { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 18px; font-size: 13.5px; color: var(--brand-ink-soft); }
.clegend > span { display: inline-flex; align-items: center; gap: 8px; }
.c-also .fm { font-size: 12.5px; line-height: 1.5; color: var(--brand-graphite); overflow-wrap: anywhere; }
.c-also .c-bare { font-size: 13px; color: var(--brand-graphite); }
.cfam-mark .c-also > span { font-family: var(--font-ui); font-size: 13.5px; }
.c-what { font-size: 14.5px; line-height: 1.5; color: var(--brand-ink); }
.c-what .fm { font-size: 13px; font-weight: 600; color: var(--brand-ink); background: var(--brand-paper-deep); padding: 1px 5px; border-radius: 2px; white-space: nowrap; }
.c-what a { color: var(--brand-amber-text); text-decoration: underline; }
.cf-note { font-size: 13.5px; line-height: 1.55; color: var(--brand-ink-soft); margin: 12px 0 0; max-width: 60em; }
.cf-note .fm { font-size: 12.5px; font-weight: 600; background: var(--brand-paper-deep); padding: 1px 5px; border-radius: 2px; white-space: nowrap; }
.r-lede { font-size: 15px; line-height: 1.6; color: var(--brand-ink-soft); margin: 14px 0 0; max-width: 40em; }
.r-lede .fm { font-size: 13px; font-weight: 600; background: var(--brand-paper-deep); padding: 1px 5px; border-radius: 2px; }
.r-txt .cnote { margin: 2px 6px 2px 0; }
.r-txt .fm:not(.cnote), .r-no .fm:not(.cnote) { font-size: 13px; font-weight: 600; }
.r-no { font-size: 14.5px; line-height: 1.7; color: var(--brand-ink); margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--brand-line); }
.r-no .cnote { margin: 2px 6px 2px 0; }
.mtable { margin-top: 28px; background: #fff; border: 1px solid var(--brand-line); border-radius: 4px; overflow: hidden; }
.mrow { display: grid; grid-template-columns: 240px minmax(0,1fr) minmax(0,1fr); gap: 18px; align-items: baseline; padding: 13px 18px; border-top: 1px solid #efe9e2; }
.mrow:first-child { border-top: 0; }
.mhead { background: var(--brand-paper-deep); padding-top: 9px; padding-bottom: 9px; }
.mhead > div { font: 600 10.5px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--brand-graphite); }
html[lang="ar"] .mhead > div { font-family: var(--font-ui); font-size: 12px; letter-spacing: 0; text-transform: none; }
.m-write { display: flex; flex-wrap: wrap; gap: 6px; }
.m-before { font-size: 14px; line-height: 1.5; color: #a0442a; }
.m-after { font-size: 14px; line-height: 1.5; color: #2f5a36; }
.cnote { display: inline-block; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--brand-ink); background: var(--brand-amber-soft); border: 1px dashed #e8b48f; border-radius: 2px; padding: 3px 8px; }
.c-short a { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--brand-amber-text); border: 1px solid var(--brand-line); border-radius: 999px; padding: 4px 10px; }
.c-short a:hover { border-color: var(--brand-ink); color: var(--brand-ink); }
.crow[hidden], .cfam[hidden] { display: none !important; }
html[dir="rtl"] .c-code .fm, html[dir="rtl"] .c-also .fm, html[dir="rtl"] .cnote, html[dir="rtl"] .x-rect .fm, html[dir="rtl"] .cnc-rect .fm, html[dir="rtl"] .c-what .fm, html[dir="rtl"] .cf-note .fm, html[dir="rtl"] .r-lede .fm, html[dir="rtl"] .r-txt .fm, html[dir="rtl"] .r-no .fm { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .c-words { direction: ltr; }
html[dir="rtl"] .ctag { direction: rtl; }
html[dir="rtl"] .r-txt .cnote, html[dir="rtl"] .r-no .cnote { margin: 2px 0 2px 6px; }
html[dir="rtl"] .cfam-mark .c-code > span, html[dir="rtl"] .cfam-mark .c-also > span { direction: rtl; unicode-bidi: normal; }
.rgrid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; margin-top: 32px; }
.rcard { border-top: 3px solid var(--brand-amber); padding-top: 16px; }
.r-n { font-size: 12px; font-weight: 600; letter-spacing: .14em; color: var(--brand-amber-text); }
.r-t { font-size: 21px; font-weight: 700; letter-spacing: -.01em; margin: 6px 0 0; }
.r-txt { font-size: 14.5px; line-height: 1.55; color: var(--brand-ink-soft); margin: 8px 0 0; }
.r-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.r-arrow { color: var(--brand-graphite); }
.r-reads { font-size: 13.5px; color: var(--brand-ink); font-weight: 600; }
.rp-box { display: grid; grid-template-columns: 1fr 1px 1fr; align-items: center; justify-items: center; gap: 10px; margin-top: 12px; padding: 18px 12px;
  border: 1.5px solid var(--brand-ink); border-radius: 2px; background: #fff; }
.rp-line { width: 0; height: 56px; border-left: 2px dashed var(--brand-amber); }
.rp-cap { font-size: 13px; color: var(--brand-graphite); margin: 8px 0 0; }
.xgrid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; margin-top: 32px; }
.xcard { background: #fff; border: 1px solid var(--brand-line); border-radius: 4px; padding: 18px; }
.x-rect { border: 1.5px solid var(--brand-ink); border-radius: 2px; min-height: 78px; display: flex; align-items: center; justify-content: center; padding: 10px;
  background-image: linear-gradient(#f1ece6 1px, transparent 1px), linear-gradient(90deg, #f1ece6 1px, transparent 1px); background-size: 14px 14px; }
.x-rect .fm { font-size: 15px; font-weight: 600; background: #fff; padding: 2px 8px; text-align: center; }
.x-reads { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.x-reads li::before { content: "✓ "; color: var(--brand-amber-text); font-weight: 700; }
.cclose-links { display: flex; flex-direction: column; gap: 12px; }
@media screen and (max-width: 1100px) {
  .crow { grid-template-columns: 220px 150px minmax(0,1fr) 70px; gap: 14px; }
  .rgrid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media screen and (max-width: 900px) {
  .chead, .mhead { display: none; }
  .crow { grid-template-columns: minmax(0,1fr) auto; gap: 6px 12px; padding: 14px 16px; }
  .c-code { grid-column: 1; }
  .c-short { grid-column: 2; grid-row: 1; }
  .c-also, .c-what { grid-column: 1 / -1; }
  .c-also:empty, .c-short:empty { display: none; }
  .mrow { grid-template-columns: minmax(0,1fr); gap: 6px; padding: 14px 16px; }
  .m-before::before { content: "Before: "; font-weight: 600; }
  .m-after::before { content: "Now: "; font-weight: 600; }
  html[lang="ar"] .m-before::before { content: "قبل: "; }
  html[lang="ar"] .m-after::before { content: "الآن: "; }
  .rgrid, .xgrid { grid-template-columns: minmax(0,1fr); }
  .cf-t { font-size: 24px; }
}
@media print {
  @page { size: A4; margin: 11mm 10mm 12mm; }
  html, body { background: #fff !important; }
  header, .cbar, footer, .cintro, .cfilter, #cnone, .c-short, .chead > div:last-child, .cclose-links, .skip { display: none !important; }
  main > section:last-child { display: none !important; }
  .cprint-head { display: flex !important; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #e0712c; padding: 0 0 6px; margin: 0 0 4px; }
  .cprint-head .fb { font-size: 15px; font-weight: 700; letter-spacing: .08em; }
  .cprint-head .fm { font-size: 9px; color: #6b6660; }
  section { border: 0 !important; background: #fff !important; }
  [data-r~="sec"] { padding: 0 !important; }
  .crow[hidden], .cfam[hidden] { display: grid !important; }
  .cfam[hidden] { display: block !important; }
  .cfam { margin-top: 6px; break-inside: auto; }
  .cf-head { gap: 8px; }
  .cf-n { font-size: 9px; }
  .cf-t { font-size: 13px; }
  .cf-c, .cf-i { display: none; }
  .ctable { margin-top: 4px; border-radius: 0; border-color: #d8d2ca; }
  .crow { grid-template-columns: 52mm 30mm minmax(0,1fr); gap: 8px; padding: 2.4px 8px; break-inside: avoid; }
  .crow > div { line-height: 1.3; font-size: 8px; }
  .chead { display: grid !important; padding: 3px 8px; }
  .chead > div { font-size: 7px; }
  .c-code { gap: 3px 5px; }
  .c-words { gap: 2px 6px; }
  .c-code .fm { font-size: 9px; }
  .c-code .c-note, .c-code .c-plain, .c-code .c-more { font-size: 7.8px; }
  .ctag { font-size: 5.5px; padding: 2px 3px; letter-spacing: .08em; }
  html[lang="ar"] .ctag { font-size: 7px; padding: 1px 3px; }
  .clegend { margin-top: 0; font-size: 7.6px; gap: 4px 12px; }
  .c-also .fm, .c-also .c-bare { font-size: 7.5px; line-height: 1.35; }
  .c-what { font-size: 8.3px; line-height: 1.35; }
  .c-what .fm, .cf-note .fm, .r-lede .fm { font-size: 7.5px; padding: 0 2px; }
  .c-what a { text-decoration: none; }
  .cf-note { font-size: 7.6px; line-height: 1.35; margin-top: 3px; max-width: none; }
  .cfam-mark .c-code > span { font-size: 9px; }
  .cfam-mark .c-also > span { font-size: 8px; }
  .cnote { font-size: 8px; padding: 0 4px; }
  .crules { margin-top: 4px; }
  .crules > div > .fm:first-child, .crules h2, .r-lede { display: none; }
  .rgrid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-top: 0; }
  .rcard { border-top-width: 2px; padding-top: 4px; break-inside: avoid; }
  .r-n { font-size: 7px; } .r-t { font-size: 9.5px; margin-top: 2px; } .r-txt { font-size: 7.6px; line-height: 1.5; margin-top: 3px; }
  .r-txt .cnote, .r-no .cnote { font-size: 7.2px; padding: 0 3px; margin: 1px 3px 1px 0; }
  .r-txt .fm:not(.cnote), .r-no .fm:not(.cnote) { font-size: 7.4px; }
  .r-no { font-size: 7.6px; line-height: 1.5; margin-top: 5px; padding-top: 4px; }
  .cmist { margin-top: 8px; break-inside: auto; }
  .cmist > div > .fm:first-child, .cmist .r-lede { display: none; }
  .cmist h2 { font-size: 12px !important; margin: 0 !important; }
  .mtable { margin-top: 4px; border-radius: 0; border-color: #d8d2ca; }
  .mrow { grid-template-columns: 40mm minmax(0,1fr) minmax(0,1fr); gap: 8px; padding: 3px 8px; break-inside: avoid; }
  .mhead { padding: 3px 8px; } .mhead > div { font-size: 7px; }
  .m-before, .m-after { font-size: 7.8px; line-height: 1.35; }
  .m-write .cnote { font-size: 7.5px; padding: 0 3px; }
  .cex { margin-top: 6px; break-inside: avoid; }
  .mrow { padding-top: 2.2px; padding-bottom: 2.2px; }
  .cex [data-r~="split"] { display: block !important; }
  .cex [data-r~="split"] p, .cex [data-r~="split"] .fm { display: none; }
  .cex h2 { font-size: 12px !important; margin: 0 !important; }
  .xgrid { grid-template-columns: repeat(6, minmax(0,1fr)); gap: 6px; margin-top: 5px; }
  .xcard { padding: 6px; border-color: #d8d2ca; }
  .x-rect { min-height: 30px; padding: 4px; } .x-rect .fm { font-size: 8px; }
  .x-reads { margin-top: 5px; gap: 2px; font-size: 7.4px; }
  a { color: inherit !important; }
}
