/* The how-to guides at saidframe.com/guide (pages generated by web/guides/build.mjs). Read on the phone
   itself by someone who may not read much: large type, one step at a time, a big picture for each,
   the button to press named as it appears on screen. Logical properties throughout, so Arabic mirrors. */

.guide { font-size: 19px; }
.guide .brand { font-size: 19px; }

.guide-top {
  position: sticky; top: 0; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: rgba(11, 11, 12, 0.92); border-bottom: 1px solid var(--hairline);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.languages { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--graphite); }
.languages a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  color: var(--bone); font-size: 17px; font-weight: 600; text-decoration: none;
}
.languages a[aria-current] { background: var(--bone); color: var(--night); }
.languages a:not([aria-current]):hover { background: #2a2a2e; }
.languages a:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

.guide-page { max-width: 560px; margin: 0 auto; padding: 28px 16px 72px; }
.guide.wide .guide-page { max-width: 820px; }
.guide h1 { margin: 0 0 10px; font: 500 clamp(32px, 8vw, 44px)/1.12 var(--words); letter-spacing: -0.01em; text-wrap: balance; }
.lede { margin: 0 0 20px; color: var(--ash); font-size: 19px; }

.contents { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.contents a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--graphite); color: var(--bone); font-size: 16px; text-decoration: none;
}
.contents a:hover { background: #2a2a2e; }

.part { padding-top: 24px; scroll-margin-top: 80px; }
.part h2 { margin: 24px 0 8px; font: 500 30px/1.2 var(--words); }
.note { margin: 0 0 8px; color: var(--ash); }

.guide-steps { display: block; max-width: none; margin: 0; padding: 0; list-style: none; }
.step { padding: 24px 0 32px; border-bottom: 1px solid var(--hairline); }
.step:last-child { border-bottom: 0; }

.pic { margin: 0 auto 20px; }
.pic img, .pic svg { display: block; width: 100%; height: auto; }
/* A whole phone screen: big enough to see the ring, small enough that the words stay on screen. */
.pic.screen { width: min(100%, 300px, 46svh); }
.pic.screen img { border-radius: 30px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
.pic.crop { width: min(100%, 420px); }
.pic.crop img { border-radius: 18px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
.pic.wide img { border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
.pic.drawn { width: min(100%, 300px, 46svh); }
.guide.wide .pic.drawn:not(:has(svg[viewBox$=" 620"])), .pic.drawn:has(svg[viewBox$=" 340"]), .pic.drawn:has(svg[viewBox$=" 280"]) { width: min(100%, 520px); }

.do { display: flex; align-items: flex-start; gap: 14px; margin: 0; font-size: 24px; line-height: 1.38; font-weight: 500; }
.num {
  flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; margin-top: -2px;
  border-radius: 50%; background: var(--bone); color: var(--night); font-size: 20px; font-weight: 700;
}
.hint { margin: 10px 0 0; padding-inline-start: 54px; color: var(--ash); font-size: 19px; }
.warn {
  margin: 14px 0 0; padding: 12px 16px; border-radius: 14px;
  background: rgba(255, 90, 54, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 90, 54, 0.35); font-size: 19px; font-weight: 600;
}

/* A button's name, as it reads on the screen. */
.ui {
  display: inline-block; padding: 0 10px; border-radius: 10px; background: #2c2c30;
  color: var(--bone); font-weight: 600; line-height: 1.45;
}

.problems .step { padding: 24px 20px; margin: 16px 0; border: 0; border-radius: 22px; background: var(--graphite); }
.problems h3 { margin: 0 0 8px; font: 500 26px/1.2 var(--words); }
.problems .do { font-size: 21px; font-weight: 400; }
.problems .hint { padding-inline-start: 0; }

.guide-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--hairline); color: var(--ash); font-size: 17px; }
.guide-foot p { margin: 0 0 8px; }

/* Arabic letters: New York-like serifs have none, so headings use the interface face. */
[lang="ar"] .guide h1, [lang="ar"] .part h2, [lang="ar"] .problems h3 { font-family: var(--chrome); font-weight: 700; }
[lang="ar"] .do { line-height: 1.6; }

@media (min-width: 860px) {
  .guide.wide .step { display: grid; grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .languages a { padding: 0 11px; font-size: 16px; }
  .do { font-size: 22px; }
}
