/* Practice page (ETA-534). The shared stylesheet owns all tokens. */

/* Keep the lesson closer together than the site's marketing sections. */
#main > .page-header { padding: clamp(2rem, 5vw, 3rem) 0 1.5rem; }
#main > section { padding: clamp(2rem, 4vw, 3rem) 0; }

/* Long words must reflow when text is enlarged on a narrow screen. */
#main { overflow-wrap: anywhere; }

.try-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.try-device-picker {
  max-width: var(--reading);
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--card-bg-2);
}
.try-device-label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .5rem; }
.try-device-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.try-device-button,
.try-inline-button {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 44px;
  padding: .45rem .7rem;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-control, 8px);
  background: var(--card-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}
.try-device-button svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.try-device-button[aria-pressed="true"] { border-color: var(--accent-copy); color: var(--accent-copy); box-shadow: inset 0 0 0 1px var(--accent-copy); }

.try-practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  max-width: var(--reading);
}
.try-progress,
.try-inline-article {
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
}
/* Completion text is 15px: use a darker light-mode green to clear 4.5:1. */
.try-progress { --status-included: #218238; }
@media (prefers-color-scheme: dark) {
  .try-progress { --status-included: #30d158; }
}
.try-progress-title { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; line-height: 1.3; margin: 0 0 1.5rem; }
.try-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2rem; }
.try-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 0 .8rem; align-items: start; }
.try-step-icon { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); }
.try-step-icon svg { width: 22px; height: 22px; display: block; }
.try-step .try-icon-done { display: none; }
.try-step.is-done .try-icon-todo { display: none; }
.try-step.is-done .try-icon-done { display: block; }
.try-step.is-done .try-step-icon { color: var(--status-included); }
.try-step-body { min-width: 0; }
.try-step-title { font-size: 1rem; line-height: 1.35; margin: .1rem 0 .5rem; }
.try-step-body p { font-size: .9375rem; line-height: 1.6; color: var(--text-secondary); margin: 0; }
.try-step-body p + p { margin-top: .75rem; }
.try-device-instructions[hidden] { display: none; }
.try-device-instructions > * + * { margin-top: .75rem; }
.try-non-safari { margin-top: 1rem; color: var(--text-primary); }
.try-inline-button { display: flex; width: fit-content; max-width: 100%; margin-top: 1rem; padding: .65rem 1rem; min-height: 44px; font-size: .9375rem; font-weight: 600; line-height: 1.35; text-align: left; color: var(--accent-copy); border-color: var(--accent-copy); }
.try-inline-button[hidden], .try-non-safari[hidden] { display: none; }
.try-inline-button:hover { background: var(--card-bg-2); }
.try-inline-button:focus-visible, .try-device-button:focus-visible { outline: 3px solid var(--accent-copy); outline-offset: 3px; }
.try-step-body .try-action-help { margin-top: .5rem; font-size: .8125rem; }
.try-step-body .try-copy-status { font-size: .8125rem; margin-top: .5rem; }
.try-step-body .try-copy-status:empty { margin-top: 0; }
.try-non-safari { padding: 1rem; border: 1px solid var(--hairline); border-radius: var(--radius-md); }
.try-step-done { display: none; font-weight: 500; color: var(--status-included) !important; margin-top: .75rem !important; }
.try-step.is-done .try-step-done { display: block; }

.try-inline-article { margin: 1rem 0 0; background: var(--card-bg-2); }
.try-inline-article .section-eyebrow { display: block; margin: 0 0 .5rem; }
.try-inline-article h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
.try-step-body .try-inline-article p { font-size: 1rem; line-height: 1.6; }
.try-copy-fallback { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

/* Permission paragraphs are reading text, rather than separate section intros. */
#permission .section-intro { margin: 0; line-height: 1.6; }
#permission .section-intro + .section-intro { margin-top: 1rem; }

/* Teach Library basics on demand, beside the step where they become useful. */
.try-guide-entry { display: block; margin-top: .75rem; padding: .5rem 0; min-height: 44px; color: var(--accent-copy); background: none; border: 0; font: inherit; font-size: .9375rem; line-height: 1.5; text-align: left; cursor: pointer; }
.try-guide-entry[hidden], .try-library-guide[hidden] { display: none; }
.try-library-guide { margin-top: 1rem; border-top: 1px solid var(--hairline); scroll-margin-top: 6rem; }
/* Equivalent supporting actions keep the same type and target size. */
.try-guide-entry,
.try-library-guide summary,
.try-safari-guide summary,
.try-safari-recovery summary {
  min-height: 44px;
  box-sizing: border-box;
  padding: .5rem 0;
  color: var(--accent-copy);
  font: inherit;
  font-size: .9375rem;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
}
.try-safari-guide summary:focus-visible,
.try-safari-recovery summary:focus-visible { outline: 3px solid var(--accent-copy); outline-offset: 3px; }
.try-safari-frames { display: grid; gap: 1rem; max-width: 400px; padding-top: .5rem; }
.try-safari-frames figure { min-width: 0; margin: 0; }
.try-safari-frames figcaption { margin-top: .5rem; color: var(--text-secondary); font-size: .875rem; line-height: 1.5; }
.try-safari-number { color: var(--accent-copy); font-variant-numeric: tabular-nums; }
.try-safari-crop { position: relative; overflow: hidden; border: 1px solid var(--hairline); border-radius: var(--radius-md); background: var(--card-bg-2); }
/* Crops preserve real Safari pixels from the accompanying simulator captures. */
.try-safari-crop img { position: absolute; display: block; height: auto; max-width: none; }
.try-safari-iphone-toolbar { aspect-ratio: 1056 / 210; }
.try-safari-iphone-toolbar img { width: 114.2045%; left: -7.1023%; top: 0; transform: translateY(-90.0076%); }
.try-safari-iphone-menu { aspect-ratio: 1158 / 940; }
.try-safari-iphone-menu img { width: 104.1451%; left: -2.0725%; top: 0; transform: translateY(-62.5477%); }
.try-safari-ipad-toolbar { aspect-ratio: 760 / 120; }
.try-safari-ipad-toolbar img { width: 271.5789%; left: -85.5263%; top: 0; transform: translateY(-1.8895%); }
.try-safari-ipad-menu { aspect-ratio: 758 / 394; }
.try-safari-ipad-menu img { width: 272.2955%; left: -119.7889%; top: 0; transform: translateY(-6.1773%); }
.try-safari-recovery > p { padding: .25rem 0 .5rem; }
.try-library-guide summary:focus-visible, .try-guide-entry:focus-visible { outline: 3px solid var(--accent-copy); outline-offset: 3px; }
.try-guide-content { display: grid; gap: 1.25rem; padding: .25rem 0 0; }
.try-library-example { margin: 0; }
.try-library-example[hidden] { display: none; }
.try-library-example[data-library-device="iphone"] { max-width: 390px; justify-self: center; }
.try-library-example img { display: block; width: 100%; height: auto; }
.try-library-example figcaption { margin-top: .75rem; color: var(--text-secondary); font-size: .8125rem; line-height: 1.6; }
.try-library-basics { display: grid; gap: 1rem; margin: 0; }
.try-library-basics dt { margin: 0 0 .25rem; font-weight: 600; font-size: .9375rem; line-height: 1.5; }
.try-library-basics dd { margin: 0; color: var(--text-secondary); font-size: .9375rem; line-height: 1.6; }

@media (max-width: 720px) {
  .try-practice-layout { grid-template-columns: 1fr; }
  .try-step { grid-template-columns: 22px minmax(0, 1fr); gap: 8px; }
  .try-device-picker, .try-progress, .try-inline-article, .try-non-safari { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .try-device-button, .try-inline-button { transition: none; }
}
