/* python.yoavram.com: one stylesheet for every page. No framework, no scripts.
   Colours are tokens on :root; the dark theme follows the visitor's system setting. */

:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --tint: #eef3f6;
  --fg: #1b1d1f;
  --muted: #565d64;
  --line: #d9d9d1;
  --accent: #0a5c8a;
  --row-1: #0a5c8a;
  --row-2: #0b6a55;
  --row-3: #6f3f9e;
  --feature: #b34700;
  --feature-bg: #fff6ec;
  --on-accent: #ffffff;
  --todo: #ffe98a;
  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121416;
    --surface: #1a1d20;
    --tint: #171d22;
    --fg: #e8e9ea;
    --muted: #9aa1a8;
    --line: #2d3236;
    --accent: #5ab4e5;
    --row-1: #5ab4e5;
    --row-2: #4fcfa6;
    --row-3: #b9a0f0;
    --feature: #ffb067;
    --feature-bg: #2a2119;
    --on-accent: #0b1114;
    --todo: #5c4d00;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}

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

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
}

h3 {
  font-size: 1.2rem;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 40rem) {
  .wrap {
    padding: 0 1.5rem;
  }
}

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

.skip:focus {
  left: 0;
}

/* header */

.site-header {
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  color: var(--fg);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

/* a short descriptor on narrow screens, the full one where it fits next to the navigation */
.brand .tag {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85rem;
}

.brand .wide {
  display: none;
}

@media (min-width: 74rem) {
  .brand .wide {
    display: inline;
  }

  .brand .narrow {
    display: none;
  }

  .brand .tag {
    font-size: 0.95rem;
  }
}

/* header navigation */

.site-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

.site-header li a {
  display: inline-block;
  padding: 0.35rem 0;
}

/* menu: on phones the links fold behind a Menu button (checkbox, no script); the breakpoint is where the links no longer fit beside the title */

.menu-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.menu-button {
  display: none;
}

@media (max-width: 55.99rem) {
  .bar {
    column-gap: 0.75rem;
  }

  .menu-button {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border: 2px solid var(--accent);
    border-radius: 0.5rem;
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
  }

  .menu-toggle:focus-visible + .menu-button {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
  }

  .menu-toggle:checked + .menu-button {
    background: var(--accent);
    color: var(--on-accent);
  }

  .site-header nav {
    display: none;
    flex-basis: 100%;
  }

  .menu-toggle:checked ~ nav {
    display: block;
  }

  .site-header ul {
    flex-direction: column;
    gap: 0;
  }

  .site-header li a {
    display: block;
    padding: 0.6rem 0;
    border-top: 1px solid var(--line);
  }
}

/* buttons */

.btn {
  display: inline-block;
  min-height: 2.75rem;
  padding: 0.65rem 1.25rem;
  border: 2px solid var(--accent);
  border-radius: 0.5rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-secondary {
  color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.addr {
  font-weight: 600;
  user-select: all;
}

/* hero */

.hero {
  padding: 2rem 0 2.25rem;
}

.hero h1 {
  max-width: 24em;
  font-size: clamp(1.7rem, 1.1rem + 2.6vw, 3rem);
  line-height: 1.15;
  margin-bottom: 0.6em;
}

.hero .sub {
  max-width: 56em;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.hero .sub + .actions {
  margin-top: 1.25rem;
}

/* clients */

.clients {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.25rem 0;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.clients ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-weight: 600;
}

/* sections */

.section {
  padding: 3rem 0;
}

.section.alt {
  background: var(--tint);
}

.intro {
  max-width: var(--measure);
  color: var(--muted);
}

/* module cards */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 0 1rem;
}

.custom + .cards {
  margin-top: 1.5rem;
}

/* one column until there is room for three, so no row ends with a lone card */
@media (min-width: 56rem) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* each row of cards has its own colour */
.row-1 { --row: var(--row-1); }
.row-2 { --row: var(--row-2); }
.row-3 { --row: var(--row-3); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--row, var(--accent));
  border-radius: 0.75rem;
}

/* the title is the link; its ::after stretches the click target over the whole card */
.card h3 a {
  color: var(--row, var(--accent));
  text-decoration: none;
}

.card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0.75rem;
}

.card h3 {
  color: var(--row, var(--accent));
}

/* only cards whose title is a link react to the pointer */
.card:has(h3 a):hover {
  border-color: var(--row, var(--accent));
}

.card:hover h3 a {
  text-decoration: underline;
}

.card h3 a:focus-visible {
  outline: none;
}

.card h3 a:focus-visible::after {
  outline: 3px solid var(--row, var(--accent));
  outline-offset: 2px;
}

.card .for {
  color: var(--muted);
  font-style: italic;
  margin-bottom: 0.75rem;
}

.card ul {
  padding-left: 1.2rem;
}

.card li + li {
  margin-top: 0.25rem;
}

.card .meta {
  margin: auto 0 0;
  padding-top: 0.75rem;
  font-size: 0.95rem;
}

.custom {
  margin-top: -0.25rem;
  color: var(--muted);
}

/* keep the workshops intro on one line where there is room */
#workshops .intro {
  max-width: none;
}

/* programmes */

.programmes {
  list-style: none;
  padding: 0;
  max-width: var(--measure);
}

.programmes li {
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 4px solid var(--accent);
}

.programmes li + li {
  margin-top: 1rem;
}

/* a row of two cards uses two equal columns */
@media (min-width: 56rem) {
  .cards.two {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* the featured workshop: a wide card on its own row, in a colour the other rows do not use */
.cards.featured {
  --row: var(--feature);
}

@media (min-width: 56rem) {
  .cards.featured {
    grid-template-columns: 1fr;
  }
}

.card-featured {
  background: var(--feature-bg);
  border: 2px solid var(--feature);
  border-top-width: 6px;
  padding: 1.5rem;
}

.card-featured h3 {
  font-size: 1.5rem;
}

.card-featured .badge {
  align-self: flex-start;
  justify-self: start;
  margin: 0 0 0.5rem;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  background: var(--feature);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-featured .for {
  font-size: 1.05rem;
}

@media (min-width: 56rem) {
  .card-featured {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    grid-template-rows: auto auto auto 1fr;
    column-gap: 2.5rem;
  }

  .card-featured > * {
    grid-column: 1;
  }

  .card-featured ul {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: center;
    font-size: 1.05rem;
  }

  .card-featured .meta {
    align-self: end;
    margin-top: 0;
  }
}

/* how I teach */

.points {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem 1.25rem;
  list-style: none;
  padding: 0;
}

@media (min-width: 36rem) {
  .points {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 56rem) {
  .points {
    grid-template-columns: repeat(3, 1fr);
  }
}

.points li {
  padding-top: 0.75rem;
  border-top: 4px solid var(--accent);
}

.points strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

/* repos */

.repos {
  max-width: var(--measure);
  padding-left: 1.2rem;
}

.repos li + li {
  margin-top: 0.5rem;
}

/* testimonials: one block. Without JavaScript it is a row you can swipe or scroll
   sideways; /js/gallery.js adds the previous, pause and next buttons and the auto-advance. */

.testimonials {
  max-width: 50rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.controls[hidden] {
  display: none;
}

.gal-btn {
  min-height: 2.75rem;
  padding: 0.4rem 1rem;
  border: 2px solid var(--accent);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.gal-btn:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.gal-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.95rem;
}

.gallery {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.track {
  display: flex;
  align-items: center;
}

.quote {
  flex: 0 0 100%;
  margin: 0;
  padding: 1.5rem 1.25rem;
  scroll-snap-align: start;
}

@media (min-width: 40rem) {
  .quote {
    padding: 1.75rem 2rem;
  }
}

.quote blockquote {
  margin: 0;
  padding-left: 1rem;
  border-left: 4px solid var(--accent);
}

.quote blockquote p {
  margin: 0 0 0.75rem;
}

.quote figcaption {
  margin-top: 0.75rem;
  padding-left: 1rem;
  color: var(--muted);
}

.quote figcaption strong {
  color: var(--fg);
}

/* with the script: slide instead of scroll */
.enhanced .gallery {
  overflow: hidden;
  scroll-snap-type: none;
}

.enhanced .track {
  transition: transform 0.6s ease;
}

@media (prefers-reduced-motion: reduce) {
  .enhanced .track {
    transition: none;
  }
}

/* about */

.about {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem 2rem;
}

.portrait {
  width: 9rem;
  border-radius: 0.75rem;
}

@media (min-width: 40rem) {
  .portrait {
    width: 14rem;
  }
}

.about > div {
  flex: 1 1 18rem;
}

.about ul {
  padding-left: 1.2rem;
  font-size: 1.1rem;
}

.about .actions {
  margin-top: 1.25rem;
}

.about li + li {
  margin-top: 0.5rem;
}

/* contact */

.contact .actions {
  margin: 1.25rem 0;
}

.small {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: var(--measure);
}

/* footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .break {
  display: none;
}

@media (max-width: 39.99rem) {
  footer.site-footer {
    font-size: 0.9rem;
  }

  footer.site-footer ul {
    column-gap: 1rem;
  }

  .site-footer .break {
    display: block;
    flex-basis: 100%;
    height: 0;
  }
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* module pages */

.page {
  max-width: calc(var(--measure) + 3rem);
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.crumb {
  font-size: 0.95rem;
}

.page h1 {
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem);
}

.page .for {
  color: var(--muted);
  font-size: 1.15rem;
  font-style: italic;
}

.page section {
  margin-top: 2rem;
}

.page ul,
.page ol {
  padding-left: 1.4rem;
}

.page li + li {
  margin-top: 0.35rem;
}

.pull {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 4px solid var(--accent);
  font-size: 1.15rem;
}

.pull p {
  margin: 0 0 0.5rem;
}

.pull footer {
  color: var(--muted);
  font-size: 0.95rem;
}

.cta {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* placeholders for content still owed by the author */

mark.todo {
  background: var(--todo);
  color: var(--fg);
  padding: 0 0.3em;
  border-radius: 0.2em;
  font-size: 0.9em;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
