/* The Bike that is a Car: site styles
   Colours and type carried over from the original Google Site:
   violet #8B00FF, Oswald for headings, Open Sans for text,
   and the four grade badge colours. */

:root {
  --violet: #8b00ff;
  --violet-deep: #4b0a8c;
  --violet-tint: #f3eaff;
  --ink: #1f1a2b;
  --ink-soft: #4a4458;
  --paper: #f6f8fc;
  --sky: #e3ebf6;
  --line: #ddd6ea;
  --white: #ffffff;

  --grade-p: #2563d0;
  --grade-j: #457f2c;
  --grade-i: #7a254f;
  --grade-fr: #b5620c;

  --display: "Oswald", "Arial Narrow", sans-serif;
  --text: "Open Sans", system-ui, sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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


body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--violet-deep); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.15; margin: 0 0 0.5em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: -999px; top: 0; background: var(--violet-deep); color: var(--white); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* Header */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; flex-wrap: wrap; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--ink); font-family: var(--display); font-size: 1.2rem; font-weight: 500; }
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.site-header ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-header nav a { text-decoration: none; color: var(--ink-soft); font-size: 0.95rem; padding: 0.35rem 0; border-bottom: 3px solid transparent; }
.site-header nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--violet); }

/* Mobile menu */
.menu-toggle { display: none; align-items: center; gap: 0.5rem; font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.9rem; cursor: pointer; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 1rem; height: 2px; background: currentColor; border-radius: 1px; position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -5px; }
.menu-icon::after { top: 5px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 44rem) {
  .header-row { flex-wrap: nowrap; }
  .js .menu-toggle { display: inline-flex; }
  .js #site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px -16px rgba(31, 26, 43, 0.35); z-index: 20; }
  .js #site-nav.open { display: block; }
  .js .site-header ul { flex-direction: column; gap: 0; padding: 0.25rem var(--gutter) 0.75rem; }
  .js .site-header nav a { display: block; padding: 0.75rem 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); color: var(--ink); }
  .js .site-header nav li:last-child a { border-bottom: 0; }
  .js .site-header nav a[aria-current="page"] { color: var(--violet-deep); font-weight: 600; border-bottom-color: var(--line); }
  .site-header { position: relative; }
}

/* Back to top */
.to-top { position: fixed; right: max(1rem, env(safe-area-inset-right, 0px)); bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 30; display: inline-flex; align-items: center; gap: 0.35rem; background: var(--ink); color: var(--white); text-decoration: none; font-size: 0.9rem; font-weight: 600; padding: 0.55rem 0.95rem; border-radius: 999px; box-shadow: 0 8px 20px -10px rgba(31, 26, 43, 0.6); opacity: 0; transform: translateY(0.5rem); pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

/* Buttons */
.button {
  display: inline-block; background: var(--violet); color: var(--white);
  font-weight: 600; text-decoration: none; padding: 0.7rem 1.2rem;
  border-radius: 999px; border: 2px solid var(--violet); line-height: 1.3;
}
.button.ghost { background: transparent; color: var(--violet-deep); }

/* Home: hero */
.hero { padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.hero h1 {
  text-wrap: balance;
  font-size: clamp(2.8rem, 6.4vw, 5rem); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.005em; line-height: 1.02; margin-bottom: 0.35em;
}
.hero h1::after { content: ""; display: block; width: 5.5rem; height: 0.5rem; background: var(--violet); margin-top: 0.35em; }
.hero-sub { font-size: 1.2rem; color: var(--ink-soft); max-width: 30ch; margin: 0 0 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-art { margin: 0; }
.hero-art img { width: 100%; border-radius: 6px; box-shadow: 0 18px 40px -24px rgba(75, 10, 140, 0.45); }

/* Home: intro band */
.intro { background: var(--violet); color: var(--white); padding: clamp(2.5rem, 7vw, 5rem) 0; }
.intro-grid { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(1rem, 4vw, 3rem); }
.intro h2 { font-size: clamp(2rem, 4vw, 2.75rem); text-transform: uppercase; font-weight: 500; }
.intro-text { max-width: 38rem; }
.intro-text p { margin: 0 0 1.1em; }
.intro-links { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.75rem !important; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.35); }
.intro-links a { color: var(--white); font-weight: 600; }

/* Badges */
.badges { display: inline-flex; gap: 0.3rem; flex-shrink: 0; }
.badge {
  display: inline-grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: 50%;
  color: var(--white); font-family: var(--text); font-weight: 700; font-size: 0.8rem; line-height: 1;
}
.badge-p { background: var(--grade-p); }
.badge-j { background: var(--grade-j); }
.badge-i { background: var(--grade-i); }
.badge-fr { background: var(--grade-fr); border-radius: 5px; font-size: 0.72rem; }

/* Home: activities */
.activities { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem); }
.activities-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 0.5rem; }
.activities h2 { font-size: clamp(2rem, 4vw, 2.75rem); text-transform: uppercase; margin: 0; }
.filter { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter button {
  display: inline-flex; align-items: center; gap: 0.45rem; font: inherit; font-size: 0.92rem;
  background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.35rem 0.85rem 0.35rem 0.45rem; cursor: pointer;
}
.filter button[data-filter="all"] { padding-left: 0.85rem; }
.filter button .badge { width: 1.35rem; height: 1.35rem; font-size: 0.68rem; }
.filter button[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.filter-status { min-height: 1.5em; color: var(--ink-soft); font-size: 0.92rem; margin: 0.5rem 0 0.75rem; }

.activity-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.activity-item { border-bottom: 1px solid var(--line); }
.activity-item a {
  display: grid; grid-template-columns: 4.25rem 1fr auto; gap: 0.25rem 1.25rem; align-items: start;
  padding: 1.25rem 0.75rem 1.3rem 0.25rem; text-decoration: none; color: var(--ink);
}
.num { font-family: var(--display); font-size: 2.6rem; font-weight: 500; line-height: 0.95; color: var(--violet); text-align: right; }
.item-body { display: flex; flex-direction: column; gap: 0.3rem; max-width: 46rem; }
.item-title { font-family: var(--display); font-size: 1.4rem; font-weight: 500; line-height: 1.2; }
.item-summary { color: var(--ink-soft); font-size: 0.98rem; line-height: 1.55; }
.activity-item .badges { padding-top: 0.25rem; }

/* Activity page */
.activity-head { background: var(--violet); color: var(--white); padding: 1.25rem 0 clamp(2rem, 5vw, 3rem); }
.crumb { margin: 0 0 1.25rem; font-size: 0.92rem; }
.crumb a { color: var(--white); }
.crumb a::before { content: "\2190\00a0"; }
.head-row { display: flex; gap: clamp(1rem, 3vw, 2rem); align-items: center; }
.big-num { font-family: var(--display); font-weight: 600; font-size: clamp(5rem, 14vw, 9rem); line-height: 0.8; color: var(--white); opacity: 0.9; }
.activity-head h1 { text-wrap: balance; font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 0.6rem; max-width: 22ch; }
.activity-head .badges { gap: 0.45rem; }
.activity-head .badge { box-shadow: 0 0 0 2px var(--white); }

.activity-body { display: grid; grid-template-columns: minmax(16rem, 21rem) 1fr; gap: clamp(1.5rem, 5vw, 4rem); padding-top: clamp(2rem, 5vw, 3rem); padding-bottom: 2rem; align-items: start; }
.activity-body.single { grid-template-columns: 1fr; }

.glance { background: var(--white); border: 1px solid var(--line); border-top: 6px solid var(--violet); border-radius: 6px; padding: 1.4rem 1.4rem 1.5rem; position: sticky; top: 1.25rem; }
.glance h2 { font-size: 1.15rem; color: var(--violet-deep); margin: 1.4rem 0 0.4rem; }
.glance h2:first-child { margin-top: 0; }
.glance p { margin: 0; }
.glance h3 { font-family: var(--text); font-size: 0.95rem; font-weight: 700; line-height: 1.4; margin: 0.9rem 0 0.25rem; }
.glance ul { margin: 0; padding-left: 1.1rem; font-size: 0.95rem; }
.glance .button { margin-top: 1.5rem; font-size: 0.92rem; }

.prose { max-width: 40rem; }
.prose h2 { font-size: 1.75rem; margin: 2.25rem 0 0.6rem; }
.prose > h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.35rem; }
.prose .lead { font-size: 1.2rem; }
.prose .note { color: var(--ink-soft); font-style: italic; }

.worksheet figure { margin: 1rem 0 1.25rem; background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 0.75rem; }
.worksheet figure img { width: 100%; }
.assessment { padding-top: 2rem; padding-bottom: 1rem; }
.assessment h2 { font-size: 1.75rem; padding-top: 2rem; border-top: 2px solid var(--ink); }
.sheet-embed { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--white); }
.sheet-embed iframe { width: 100%; height: 26rem; border: 0; display: block; }

.pager { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; padding-bottom: 3rem; margin-top: 1rem; }
.pager a { display: flex; flex-direction: column; text-decoration: none; max-width: 48%; font-family: var(--display); font-size: 1.15rem; line-height: 1.25; }
.pager a span { font-family: var(--text); font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.2rem; }
.pager .next { text-align: right; margin-left: auto; }

/* Worksheets */
.worksheet { margin: 0 0 2rem; }
.worksheet h3 { font-size: 1.3rem; margin: 0 0 0.4rem; }
.worksheet p { margin: 0 0 0.75rem; }
.doc-embed { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--white); margin: 0.75rem 0 1rem; }
.doc-embed iframe { display: block; width: 100%; height: 34rem; border: 0; }
.assess-worksheets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 0 2.5rem; margin-top: 1.5rem; }
.glance .downloads { list-style: none; padding: 0; margin: 0.25rem 0 0; }
.glance .downloads li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0; border-top: 1px solid var(--line); font-size: 0.95rem; }
.glance .downloads li:first-child { border-top: 0; }
.glance .downloads a { font-weight: 600; }
.glance .downloads span { color: var(--ink-soft); font-size: 0.8rem; }
.prose table { border-collapse: collapse; width: 100%; margin: 0.75rem 0 1.5rem; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.45rem 0.6rem; text-align: left; }
.prose thead th { background: var(--violet-tint); }
.table-scroll { overflow-x: auto; }
.blank { display: inline-block; width: 10rem; max-width: 40%; border-bottom: 1px solid currentColor; vertical-align: baseline; margin-right: 0.75rem; }

/* Activity extras */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.5rem 2rem; margin: 1.5rem 0; padding: 1.25rem 1.4rem; background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.resource-grid h3 { font-size: 1.15rem; color: var(--violet-deep); margin: 0 0 0.4rem; }
.resource-grid ul { margin: 0; }
.template-figure { margin: 1.75rem 0 0; max-width: 24rem; }
.template-figure img { width: 100%; border: 1px solid var(--line); border-radius: 4px; background: var(--white); }
.template-figure figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-top: 0.6rem; font-size: 0.95rem; color: var(--ink-soft); }
.button.small { font-size: 0.88rem; padding: 0.45rem 0.9rem; }
.sheet-link { font-size: 0.95rem; }
.sheet-embed iframe { height: 30rem; }

/* Simple page header (About, Story, Feedback) */
.page-head { background: var(--violet); color: var(--white); padding: clamp(2rem, 6vw, 3.5rem) 0; }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 600; text-transform: uppercase; text-wrap: balance; margin: 0; }

/* About */
.about-aliyah { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about-text h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.about-photos { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
.photo { margin: 0; }
.photo img { width: 100%; border-radius: 6px; border: 6px solid var(--white); box-shadow: 0 14px 30px -18px rgba(75, 10, 140, 0.55); }
.photo-a { grid-column: 1 / 3; grid-row: 1; width: 82%; }
.photo-b { grid-column: 2; grid-row: 2; margin-top: -28%; position: relative; justify-self: end; width: 100%; }

.read-more { padding: 0 0 clamp(2.5rem, 6vw, 4rem); }
.read-more h2 { font-size: 1.6rem; }
.link-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); max-width: 48rem; }
.link-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.15rem 1.5rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.link-list a { font-weight: 600; }
.link-list span { color: var(--ink-soft); font-size: 0.9rem; }

.note-from-sari { background: var(--sky); padding: clamp(2.5rem, 7vw, 5rem) 0; }
.letter { background: var(--white); max-width: 44rem; margin: 0 auto; padding: clamp(1.5rem, 5vw, 3.25rem); border-radius: 4px; box-shadow: 0 20px 40px -28px rgba(31, 26, 43, 0.5); }
.letter h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); color: var(--violet-deep); margin-bottom: 1rem; }
.letter p { margin: 0 0 1.05em; }
.signoff { margin-top: 1.75rem !important; margin-bottom: 0.25rem !important; }
.signatures { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 1rem; }
.signatures img { mix-blend-mode: multiply; height: 4.25rem; width: auto; }
.signatures .amp { font-family: var(--display); color: var(--ink-soft); font-size: 1.1rem; }

@media (max-width: 52rem) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photos { max-width: 30rem; }
}

/* Hover colours only where there is a real pointer, so taps on phones
   don't leave buttons stuck in their hover colour */
@media (hover: hover) {
  a:hover { color: var(--violet); }
  .crumb a:hover, .site-footer a:hover { color: var(--violet-tint); }
  .site-header nav a:hover { color: var(--violet-deep); }
  .to-top:hover { background: var(--violet-deep); color: var(--white); }
  .button:hover { background: var(--violet-deep); border-color: var(--violet-deep); color: var(--white); }
  .button.ghost:hover { background: var(--violet-tint); color: var(--violet-deep); }
  .intro-links a:hover { color: var(--violet-tint); }
  .filter button:hover { border-color: var(--violet); }
  .activity-item a:hover { background: var(--white); }
  .activity-item a:hover .item-title { color: var(--violet-deep); text-decoration: underline; text-underline-offset: 0.18em; }
}

/* Story */
.story-wrap { padding-block: clamp(2rem, 5vw, 3.5rem); display: grid; gap: 2.5rem; }
.story-origin { max-width: 40rem; }
.story-origin h2 { font-size: 1.6rem; }
.story-text { background: var(--white); max-width: 44rem; padding: clamp(1.5rem, 5vw, 3rem); border-radius: 4px; box-shadow: 0 20px 40px -28px rgba(31, 26, 43, 0.5); }
.story-text h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); color: var(--violet-deep); margin-bottom: 0.2rem; }
.story-text .byline { color: var(--ink-soft); margin: 0 0 1.5rem; font-style: italic; }
.story-text p:last-child { font-size: 1.1rem; line-height: 1.85; margin: 0; }

/* Feedback */
.feedback-wrap { padding-block: clamp(2rem, 5vw, 3.5rem); }
.feedback-intro { margin-bottom: 1.5rem; }
.form-embed { max-width: 48rem; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--white); }
.form-embed iframe { display: block; width: 100%; height: 70rem; border: 0; }
.form-link { font-size: 0.95rem; }

.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Footer */
.site-footer { background: var(--ink); color: #d8d3e3; padding: 2.25rem 0; font-size: 0.95rem; }
.footer-row p { margin: 0 0 0.4rem; max-width: 40rem; }
.site-footer a { color: var(--white); font-weight: 600; }
.site-footer .fine { color: #a59fb4; font-size: 0.85rem; margin-top: 0.75rem; }

/* Narrow screens */
@media (max-width: 52rem) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .intro-grid { grid-template-columns: 1fr; }
  .activity-body { grid-template-columns: 1fr; }
  .glance { position: static; }
}
@media (max-width: 36rem) {
  .site-header nav ul { gap: 0.15rem 1rem; }
  .activity-item a { grid-template-columns: 2.75rem 1fr; }
  .num { font-size: 2rem; }
  .activity-item .badges { grid-column: 2; padding-top: 0.35rem; }
  .head-row { align-items: flex-start; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
  .pager .next { text-align: left; margin-left: 0; }
}

/* Printing an activity for the classroom */
@media print {
  .to-top, .site-header, .site-footer, .pager, .crumb, .button, .skip, .filter { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .activity-head { background: none; color: #000; padding: 0 0 1rem; border-bottom: 2px solid #000; }
  .big-num { color: #000; font-size: 4rem; }
  .activity-body { grid-template-columns: 1fr; padding: 1rem 0; }
  .glance { position: static; border: 1px solid #999; }
  .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000; }
}
