/* The measuring guide (planmytrim.com/measuring-guide), on top of styles.css. The page and its two PDFs come from
   tools/guide/measuring-guide.src.html: edit that, then run python3 tools/make_guide.py (see the README there). */

/* Sizes come in three versions: both units for the web page, inches only for the US PDF, metric only for the A4 PDF. */
.ui,.uc{display:none}
body.units-in .ub,body.units-cm .ub{display:none}
body.units-in .ui,body.units-cm .uc{display:inline}
body.units-in .uc-b,body.units-cm .ui-b{display:none}
.print-only{display:none}

.g-doc{max-width:76ch;gap:14px}
.g-lede{font-size:17px;line-height:1.55}
.g-doc ol{margin:0;padding-left:1.4em;display:flex;flex-direction:column;gap:6px}
.g-doc ol li::marker{font-weight:800}

/* download card */
.g-get{background:var(--surface);border:2px solid var(--ink);border-radius:14px;box-shadow:4px 4px 0 var(--ink);padding:16px 18px;display:flex;flex-direction:column;gap:4px;margin-block:4px 6px}
.g-get-h{font-family:var(--f-hand);font-size:27px;line-height:1.05;color:var(--eyebrow)}
.g-get-btns{display:flex;flex-wrap:wrap;gap:12px;margin-top:10px}
.g-get-btns .btn{flex-direction:column;gap:0;line-height:1.2;padding-block:8px;white-space:normal;text-align:center}
.g-small{font-size:12.5px;font-weight:500;opacity:.85}

/* sketches: white card, ink outline, hard shadow, held up with coral painter's tape */
.g-fig{position:relative;margin:14px auto 8px;max-width:620px;width:100%;background:#fff;border:2px solid var(--ink);border-radius:12px;box-shadow:var(--hard);padding:10px}
.g-fig::before,.g-fig::after{content:"";position:absolute;top:-13px;width:96px;height:24px;background:var(--oak);opacity:.88;clip-path:var(--tape-clip);pointer-events:none}
.g-fig::before{left:34px;transform:rotate(-5deg)}
.g-fig::after{right:40px;transform:rotate(4deg)}
.g-fig-sm{max-width:540px;margin-inline:auto;width:100%}
.g-art{display:block;width:100%;height:auto}
.g-fig figcaption{font-size:13.5px;color:var(--muted);text-align:center;margin-top:6px}

/* contents */
.g-toc{columns:2;column-gap:28px;display:block!important;background:var(--tape-soft);border:2px solid var(--ink);border-radius:12px;padding:12px 16px 12px 36px!important}
.g-toc li{margin-block:3px;break-inside:avoid}

.g-sec{display:flex;flex-direction:column;gap:12px;padding-top:6px}
.g-step{font-family:var(--f-hand);font-size:26px;line-height:1;color:var(--eyebrow);margin:18px 0 -14px}
.g-h3{font-size:18.5px;font-weight:800;letter-spacing:-.02em;margin-top:6px}

/* where each number goes in the planner */
.g-field{background:var(--tape-soft);border:2px solid var(--ink);border-radius:12px;padding:10px 14px;font-weight:600}
.g-field .hand{display:block;font-size:22px;line-height:1;margin-bottom:2px}
.g-tip{border-left:4px solid var(--oak);padding:4px 0 4px 12px}
.g-tip .hand{font-size:21px}

/* lists with drawn boxes and crosses */
.g-check,.g-x{list-style:none;padding-left:0!important}
.g-check li,.g-x li{position:relative;padding-left:30px}
.g-check li::before{content:"";position:absolute;left:2px;top:4px;width:15px;height:15px;border:2px solid var(--ink);border-radius:3px;background:#fff;transform:rotate(-3deg)}
.g-x li::before{content:"\2715";position:absolute;left:2px;top:0;font-weight:800;color:var(--oak);font-size:17px}

/* next steps */
.g-next h2{margin-top:26px}
.g-styles{display:flex;flex-wrap:wrap;gap:10px 12px}
.g-plan{background:var(--lav);border:3px solid var(--ink);border-radius:18px;box-shadow:8px 8px 0 var(--ink);padding:18px 20px;display:flex;flex-direction:column;gap:10px;margin-top:14px}
.g-plan-h{font-family:var(--f-hand);font-weight:400;font-size:32px;line-height:1;color:var(--eyebrow);letter-spacing:0}
.g-plan .g-check li::before{background:var(--lav)}
.g-plan-price{font-size:16px}
.g-launch{font-family:var(--f-hand);font-size:22px;line-height:1;color:var(--eyebrow)}
.g-fine{font-size:13px;color:var(--muted);margin-top:18px}

@media (max-width: 600px){
  .g-toc{columns:1}
  .g-fig{padding:6px}
  .g-fig::before,.g-fig::after{width:70px;height:20px;top:-11px}
  .g-get-btns .btn{flex:1 1 100%}
}

/* the PDFs: white paper, no buttons or page links, and nothing split across pages */
@media print{
  @page{margin:14mm 14mm 16mm}
  body{background:#fff;padding:0;font-size:13.5px}
  .screen-only{display:none!important}
  .print-only{display:block}
  .top{padding-top:0;margin-bottom:12px}
  .g-print-url{font-family:var(--f-hand);font-size:22px;color:var(--eyebrow)}
  .g-doc{max-width:none;margin-top:0}
  .doc h1{font-size:44px}
  .g-lede{font-size:15px}
  a{color:inherit;text-decoration:none}
  .g-fig,.g-field,.g-plan,.g-check,.g-x,.g-doc ol,.g-tip{break-inside:avoid}
  .g-doc h2,.g-h3,.g-step{break-after:avoid}
  /* Chrome splits flex layouts badly across pages, so the PDF lays the guide out as plain blocks. */
  .g-doc,.g-sec{display:block}
  .g-doc > * + *,.g-sec > * + *{margin-top:10px}
  .g-step{margin:16px 0 0}
  .g-doc h2{margin-top:2px}
  .g-fig{display:block;box-shadow:3px 3px 0 var(--ink);margin:18px auto 6px;max-width:470px;padding:6px}
  .g-fig-sm{max-width:390px}
  /* Tape that pokes above a figure would print at the foot of the page before, so in the PDF it sits on the card's edge. */
  .g-fig::before,.g-fig::after{width:70px;height:18px;top:0}
  .g-plan{display:block;box-shadow:4px 4px 0 var(--ink)}
  .g-plan > * + *{margin-top:8px}
  .g-print-cta{font-size:17px}
  #next{break-before:page}
}
