/* Teaching & resources page (blog.html). A nod to my Neovim setup (Vim's
   classic "blue" colorscheme and the alpha dashboard logo) kept to an
   accent: a few colors, monospace for labels and headings, a readable
   sans for everything you read. */

/* Colors, type and base styles are in theme.css. */

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 48px;
  padding-top: 44px;
  padding-bottom: 36px;
}

.brand {
  flex: none;
  text-decoration: none !important;
}
.logo {
  margin: 0;
  color: var(--heading);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 7.5px;
  line-height: 1.05;
}
.logo-narrow {
  display: none;
}

.intro {
  flex: 1 1 320px;
  max-width: 560px;
}
.intro h1 {
  margin: 0 0 6px;
  color: var(--heading);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.3;
}
.intro p {
  margin: 0 0 10px;
  color: var(--muted);
}
.intro-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin: 0;
}
.artist-link {
  font-family: var(--mono);
  font-size: 0.9rem;
}

/* a little space at the end of the page */
main.wrap {
  padding-bottom: 64px;
}

/* ---------- featured walkthrough ---------- */

.featured {
  padding: 32px 0 36px;
}
.featured[hidden] {
  display: none;
}
.featured-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.featured-head h2 {
  margin: 0;
  color: var(--heading);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.1rem;
}
.featured-nav {
  display: flex;
  gap: 8px;
}
.featured-nav button {
  width: 38px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1rem;
  cursor: pointer;
}
.featured-nav button:hover {
  border-color: var(--accent);
}

/* slides sit on top of each other; the current one fades in */
.slides {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  touch-action: pan-y;
}
.slide {
  display: grid;
  grid-area: 1 / 1;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.45s ease,
    visibility 0.45s;
}
.slide.is-current {
  opacity: 1;
  visibility: visible;
}

/* the image fills its half however tall the text is */
.slide-img {
  position: relative;
  display: block;
  min-height: 380px;
  overflow: hidden;
  background: var(--img-bg);
}
.slide-img img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 6s ease-out;
}
.slide.is-current .slide-img img {
  transform: scale(1);
}
/* small pixel-art covers (Game Boy Camera) stay crisp when enlarged */
.slide-img img.pixel {
  image-rendering: pixelated;
}

.slide-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 36px;
  border-left: 1px solid var(--line);
}
.slide-step {
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.85rem;
}
.slide-step b {
  color: var(--heading);
  font-size: 1.6rem;
  font-weight: 700;
}
.slide-body h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.25;
}
.slide-desc {
  /* four lines at most, so every slide is the same height */
  display: -webkit-box;
  margin: 0 0 16px;
  overflow: hidden;
  color: var(--muted);
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.slide-tags {
  margin: 0 0 20px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.82rem;
}
.slide-read {
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--highlight);
  color: var(--on-highlight) !important;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none !important;
}
.slide-read:hover {
  filter: brightness(1.08);
}

/* numbered steps, each with a bar that fills while its slide is up */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.steps button {
  width: 100%;
  padding: 8px 0 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}
.steps button span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.steps button::before {
  content: '';
  display: block;
  height: 3px;
  margin-bottom: 8px;
  border-radius: 2px;
  background: linear-gradient(var(--heading), var(--heading)) 0 0 / var(--fill, 0%) 100% no-repeat, var(--line);
}
.steps button[aria-current='true'] {
  color: var(--text);
}
.steps button:hover {
  color: var(--text);
}

/* ---------- search + filters ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin: 0 -28px;
  padding: 16px 28px;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--line);
}

.search {
  display: flex;
  flex: 1 1 280px;
  align-items: center;
  gap: 10px;
  max-width: 460px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}
.search:focus-within {
  border-color: var(--accent);
}
.search-caret {
  color: var(--heading);
  font-family: var(--mono);
  font-weight: 700;
}
#search {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
#search::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
#search:focus {
  outline: none;
}

.filters {
  display: flex;
  gap: 6px;
}
.filters button {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  cursor: pointer;
}
.filters button:hover {
  border-color: var(--accent);
}
.filters button[aria-pressed='true'] {
  border-color: var(--highlight);
  background: var(--highlight);
  color: var(--on-highlight);
  font-weight: 700;
}

/* ---------- sections + cards ---------- */

.group {
  padding-top: 36px;
  scroll-margin-top: 80px;
}
.group[hidden] {
  display: none;
}
.group h2 {
  margin: 0 0 18px;
  color: var(--heading);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.1rem;
}
.group-count {
  color: var(--muted);
  font-weight: 400;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none !important;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.15s;
}
.card:hover,
.card:focus-visible {
  border-color: var(--heading);
  background: var(--panel-hover);
  transform: translateY(-2px);
}
.card[hidden] {
  display: none;
}

/* guide cards: a link to the page plus a PDF download link */
.card-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  color: inherit;
  text-decoration: none !important;
}
.card-pdf {
  align-self: flex-start;
  margin: 0 16px 16px;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--highlight);
  color: var(--on-highlight) !important;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none !important;
}
.card-pdf:hover {
  filter: brightness(1.08);
}
.card-pdf small {
  font-weight: 400;
  opacity: 0.75;
}

.card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: var(--img-bg);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px 16px 16px;
}
.card-meta {
  margin: 0 0 6px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}
.card h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.3;
}
.card p {
  /* three lines at most, so the cards line up */
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.5;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.empty {
  margin: 36px 0;
  color: var(--muted);
  font-family: var(--mono);
}

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .wrap {
    padding: 0 16px;
  }
  .toolbar {
    margin: 0 -16px;
    padding: 12px 16px;
  }
  .header-inner {
    padding-top: 28px;
    padding-bottom: 24px;
  }
  .logo-wide {
    display: none;
  }
  .logo-narrow {
    display: block;
    font-size: 6.5px;
  }
  .search {
    max-width: none;
  }
}

@media (max-width: 860px) {
  .slide {
    grid-template-columns: 1fr;
    /* slides share the tallest one's height; leave the slack at the bottom */
    align-content: start;
  }
  .slide-img {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }
  .slide-body {
    padding: 20px 20px 24px;
    border-top: 1px solid var(--line);
    border-left: none;
  }
  .slide-body h3 {
    font-size: 1.25rem;
  }
  .steps button span {
    display: none; /* just the bars on small screens */
  }
}

@media (max-width: 520px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .slide,
  .slide-img img {
    transition: none;
    transform: none;
  }
}
