/* ─────────────────────────────────────────────────────────────
   Reading Partners — Tutor Guide
   Mobile-first. Base styles target phones; wider layouts are
   layered on with min-width media queries.
───────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Doyle";
  src: url("assets/fonts/Doyle-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Doyle";
  src: url("assets/fonts/Doyle-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* ── RP UI Library primitives (same values as @make-kits/rp-ui-library)
        Figma name "color/greyscale/900" → --rp-greyscale-900, etc. ── */
  --rp-white: #ffffff;
  --rp-greyscale-900: #262a2e;
  --rp-greyscale-800: #4d5154;
  --rp-greyscale-700: #72767a;
  --rp-greyscale-400: #b1b3b5;
  --rp-greyscale-300: #c4c6c8;
  --rp-greyscale-100: #ebeced;
  --rp-blue-700: #27588c;
  --rp-blue-600: #295b91;
  --rp-blue-500: #3777bb;
  --rp-blue-100: #ebf1f8;
  --rp-blue-50: #f5f8fc;
  --rp-orange-700: #8c3d00;
  --rp-orange-600: #b45300;
  --rp-orange-500: #f48120;
  --rp-orange-200: #fcdab4;
  --rp-orange-100: #fef3e6;
  --rp-green-600: #026d1f;
  --rp-green-500: #027f23;
  --rp-green-50: #edf9ee;
  --rp-red-500: #b10b02;
  --rp-red-50: #fdefed;
  --rp-navy: #17313b; /* header / FAQ panel (brand dark teal) */

  /* ── RP UI Library semantic tokens ── */
  --text-default: var(--rp-greyscale-900);
  --text-heading: var(--rp-greyscale-800);
  --text-muted: var(--rp-greyscale-700);
  --text-link: var(--rp-blue-600);
  --text-on-color: var(--rp-white);
  --text-warning: var(--rp-orange-700);
  --surface-page: var(--rp-blue-50);
  --surface-white: var(--rp-white);
  --surface-primary: var(--rp-orange-500);
  --surface-primary-light: var(--rp-orange-100);
  --surface-primary-hover: var(--rp-orange-700);
  --surface-button: var(--rp-orange-600); /* darker than primary so white text passes AA */
  --surface-accent: var(--rp-blue-500);
  --surface-accent-light: var(--rp-blue-100);
  --surface-success-light: var(--rp-green-50);
  --surface-error-light: var(--rp-red-50);
  --border-default: var(--rp-greyscale-300);
  --border-focused: var(--rp-blue-500);
  --border-success: var(--rp-green-500);
  --border-error: var(--rp-red-500);
  --icon-default: #26292e; /* play icons + numbered steps */

  /* ── Aliases used throughout this stylesheet ── */
  --navy: var(--rp-navy);
  --orange: var(--surface-primary);
  --orange-dark: var(--text-warning);
  --blue: var(--surface-accent);
  --blue-dark: var(--rp-blue-700);
  --ink: var(--text-default);
  --heading: var(--text-heading);
  --muted: var(--text-muted);
  --line: var(--border-default);
  --page: var(--surface-page);
  --card: var(--surface-white);

  /* Callouts: background / accent / label */
  --inperson-bg: var(--surface-primary-light);
  --info-bg: var(--surface-accent-light);
  --important-bg: var(--surface-error-light);
  --important: var(--border-error);
  --tip-bg: var(--surface-success-light);
  --tip: var(--border-success);
  --tip-text: var(--rp-green-600);
  --note-bg: var(--rp-greyscale-100);
  --note: var(--rp-greyscale-400);

  --shadow: 0 5px 10px rgba(161, 183, 198, 0.3);
  --radius: 16px;

  --font-display: "Doyle", Georgia, serif;
  --font-body: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: 16px;
  --content-max: 1160px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px; /* clears the sticky mobile menu */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--text-link);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--blue);
}
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

p {
  margin: 0 0 1em;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ── Header ───────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: #fff;
  padding: 36px var(--gutter) 44px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/img/stars-pattern.jpg") center / auto 100% repeat-x;
  opacity: 0.5;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  max-width: var(--content-max);
  margin: 0 auto;
}
.hero__logo {
  width: min(240px, 70%);
  margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.1;
  margin: 0 0 14px;
}
.hero p {
  max-width: 800px;
  color: #dbe4e8;
  font-size: clamp(1.125rem, 3.2vw, 1.3125rem); /* 18px → 21px */
  line-height: 1.55;
  margin: 0;
}

/* ── Layout shell ─────────────────────────────────────────── */
.shell {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter) 48px;
}

main {
  min-width: 0;
}

/* ── Table of contents ────────────────────────────────────── */
/* Phones/tablets: sticky collapsible menu at the top */
.toc-mobile {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 calc(var(--gutter) * -1);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(38, 41, 46, 0.06);
}
.toc-mobile summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 var(--gutter);
  font-weight: 700;
  font-size: 0.95rem;
}
.toc-mobile summary::-webkit-details-marker {
  display: none;
}
.toc-mobile summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.2s;
}
.toc-mobile[open] summary::after {
  transform: rotate(-135deg) translateY(-3px);
}
.toc-mobile .toc {
  padding: 0 var(--gutter) 12px;
  max-height: 70vh;
  overflow-y: auto;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 10px;
  border-radius: 9px;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  text-decoration: none;
}
.toc a:hover {
  background: var(--page);
}
.toc a.is-active {
  background: var(--inperson-bg);
}
.toc .n {
  flex: 0 0 1.2em;
  color: var(--orange);
  font-weight: 800;
}

/* Desktop: sticky sidebar */
.toc-desktop {
  display: none;
}

/* ── Sections ─────────────────────────────────────────────── */
.section {
  padding-top: 40px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 5.5vw, 2.125rem);
  line-height: 1.15;
  color: var(--heading);
}
.section-num {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.45em;
  height: 1.45em;
  border-radius: 10px;
  background: var(--heading);
  color: var(--text-on-color);
  font-family: var(--font-body);
  font-size: 0.8em;
  font-weight: 700;
  margin-top: -0.05em;
}

h3 {
  font-size: clamp(1.15rem, 3.8vw, 1.3rem);
  line-height: 1.35;
  margin: 32px 0 12px;
  color: var(--heading);
}

.lead {
  font-size: 1.0625rem;
}

/* ── Lists ────────────────────────────────────────────────── */
.bullets {
  margin: 0 0 1em;
  padding-left: 1.3em;
}
.bullets li {
  margin-bottom: 0.6em;
  padding-left: 0.2em;
}
.bullets li::marker {
  color: var(--navy);
}
.bullets .bullets {
  margin-top: 0.6em;
}

/* Numbered steps with round orange badges */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0 0 1em;
  padding: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  margin-bottom: 16px;
  min-height: 32px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--icon-default);
  color: var(--text-on-color);
  font-weight: 700;
  font-size: 0.95rem;
  display: grid;
  place-items: center;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card > :last-child {
  margin-bottom: 0;
}
.card--online {
  border-top: 5px solid var(--blue);
}
.card--inperson {
  border-top: 5px solid var(--orange);
}
.card__label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.card--online .card__label {
  color: var(--blue);
}
.card--inperson .card__label {
  color: var(--orange-dark);
}
.card h3,
.card h4 {
  margin: 0 0 8px;
}
.card h4 {
  font-size: 1.1rem;
  color: var(--heading);
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 20px 0;
}

/* ── Callouts ─────────────────────────────────────────────── */
.callout {
  border-left: 5px solid var(--note);
  background: var(--note-bg);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 20px 0;
}
.callout > :last-child {
  margin-bottom: 0;
}
.callout__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.callout--inperson {
  background: var(--inperson-bg);
  border-color: var(--orange);
}
.callout--inperson .callout__label {
  color: var(--orange-dark);
}
.callout--info {
  background: var(--info-bg);
  border-color: var(--blue);
}
.callout--important {
  background: var(--important-bg);
  border-color: var(--important);
}
.callout--important strong:first-child {
  color: var(--important);
}
.callout--tip {
  background: var(--tip-bg);
  border-color: var(--tip);
}
.callout--tip strong:first-child {
  color: var(--tip-text);
}

/* ── Screenshots ──────────────────────────────────────────── */
.shot {
  margin: 20px 0;
}
.shot img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #dbe4e8;
  box-shadow: var(--shadow);
  background: #fff;
}
.shot--narrow img {
  max-width: 380px;
  margin: 0 auto;
}
.shots {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 20px 0;
}
.shots .shot {
  margin: 0;
}

/* Text beside images (collapses to a stack on phones) */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* ── Video tutorials ──────────────────────────────────────── */
.eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 24px 0 10px;
}
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.link-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.link-list a:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
}
.link-list a::before {
  content: "";
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--icon-default)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 7v10l8-5z'/%3E%3C/svg%3E")
    center / 18px no-repeat;
}

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
  margin-top: 12px;
}
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── FAQ banner ───────────────────────────────────────────── */
.faq {
  margin-top: 48px;
  background: var(--navy);
  color: #fff;
  border-radius: 20px;
  padding: 32px 20px;
  text-align: center;
}
.faq h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2rem);
  margin: 0 0 8px;
}
.faq p {
  max-width: 32rem;
  margin: 0 auto 20px;
  color: #dbe4e8;
  font-size: 1.125rem;
}
/* RP UI Library primary button */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 26px;
  border-radius: 10px;
  background: var(--surface-button);
  color: var(--text-on-color);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color 0.15s;
}
.button:hover {
  background: var(--surface-primary-hover);
  color: var(--text-on-color);
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  padding: 20px var(--gutter);
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}
.footer span {
  display: block;
}

/* ═════════════════════════════════════════════════════════════
   ≥ 640px — small tablets
═════════════════════════════════════════════════════════════ */
@media (min-width: 640px) {
  :root {
    --gutter: 24px;
  }
  .grid-2,
  .link-list,
  .shots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card {
    padding: 24px;
  }
  .footer span {
    display: inline;
  }
  .footer span + span::before {
    content: "  |  ";
    white-space: pre;
  }
}

/* ═════════════════════════════════════════════════════════════
   ≥ 900px — text beside screenshots
═════════════════════════════════════════════════════════════ */
@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 32px;
  }
  .split .shots {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 0;
  }
}

/* ═════════════════════════════════════════════════════════════
   ≥ 1080px — desktop: sidebar TOC
═════════════════════════════════════════════════════════════ */
@media (min-width: 1080px) {
  :root {
    --gutter: 40px;
  }
  html {
    scroll-padding-top: 24px;
  }
  .hero {
    padding-top: 58px;
    padding-bottom: 62px;
  }
  .shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 48px;
    padding-top: 40px;
  }
  .toc-mobile {
    display: none;
  }
  .toc-desktop {
    display: block;
    position: sticky;
    top: 24px;
    align-self: start;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 1px 1.5px rgba(38, 41, 46, 0.05);
  }
  .toc-desktop .toc-heading {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 4px 10px 8px;
  }
  .section:first-child {
    padding-top: 0;
  }
  .faq {
    padding: 43px 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
