/* ABOUTME: Styles for plain content pages and listing pages: title band, body column, card grids and filter chips. */
/* ABOUTME: Used by About, policies, contact, the tutorials index and What's New. */

.page-hero__inner {
  max-width: 900px;
}

.page-hero h1 {
  color: var(--plum);
  font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.6rem);
}

.page-hero .lead {
  max-width: 60ch;
  margin-bottom: 0;
}

.page__updated {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.page-body {
  padding-block: clamp(2rem, 1.5rem + 2vw, 3.5rem) clamp(3rem, 2rem + 3vw, 5rem);
}

.page-body.prose {
  max-width: 760px;
}

.page-body.wide {
  max-width: var(--wrap);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  font-weight: 700;
  color: var(--plum);
}

/* Listing sections */

.listing-section + .listing-section {
  margin-top: clamp(3rem, 2rem + 3vw, 4.5rem);
}

.listing-section > h2 {
  font-size: var(--step-2);
  color: var(--plum);
  margin-bottom: 1.25rem;
}

.listing-section > p {
  max-width: 62ch;
  color: var(--ink-soft);
}

.link-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.link-list a::after {
  content: "→";
  color: var(--rose);
  transition: transform 0.25s var(--ease);
}

.link-list a:hover {
  border-color: transparent;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--plum);
}

.link-list a:hover::after {
  transform: translateX(3px);
}

/* Puzzle cards on the tutorials index */

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 44vw), 1fr));
  gap: clamp(0.75rem, 0.5rem + 1vw, 1.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.puzzle-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}

.puzzle-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
  color: var(--ink);
}

.puzzle-card__image {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 1.25rem;
  background: var(--cream);
}

.puzzle-card__image img {
  max-height: 100%;
  width: auto;
  mix-blend-mode: multiply;
  transition: transform 0.5s var(--ease);
}

.puzzle-card:hover .puzzle-card__image img {
  transform: scale(1.05) rotate(-1.5deg);
}

.puzzle-card__body {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem 1.1rem;
}

.puzzle-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--plum);
}

.puzzle-card__meta {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* Filter chips */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: 600 0.92rem / 1.2 var(--font-body);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.chip:hover {
  border-color: var(--plum-300);
}

.chip[aria-pressed="true"] {
  background: var(--plum);
  border-color: var(--plum);
  color: var(--white);
}

.chip__count {
  font-weight: 500;
  opacity: 0.7;
  font-size: 0.85em;
}

/* What's New */

.news-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  align-items: center;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
  color: var(--ink);
  text-decoration: none;
}

.news-lead:hover {
  color: var(--ink);
}

.news-lead__image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 16 / 10;
  background: var(--cream);
}

.news-lead__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.news-lead:hover .news-lead__image img {
  transform: scale(1.03);
}

.news-lead time {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plum-600);
}

.news-lead h2 {
  margin: 0.5rem 0 0.75rem;
  color: var(--plum);
  font-size: var(--step-3);
}

.news-lead p {
  color: var(--ink-soft);
}

@media (max-width: 760px) {
  .news-lead {
    grid-template-columns: 1fr;
  }
}

.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-list > li[hidden] {
  display: none;
}

.news-list .news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.news-list .news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.news-card__image {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--cream);
}

.news-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card__image--contain img {
  object-fit: contain;
  padding: 1rem;
}

.news-card__body {
  display: grid;
  gap: 0.45rem;
  padding: 1.1rem 1.25rem 1.4rem;
}

.news-card__body time,
.news-card__kind {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plum-600);
}

.news-card__kind {
  color: var(--blue-700);
}

.news-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.25;
  color: var(--plum);
}

.news-card__summary {
  font-size: 0.93rem;
  line-height: 1.5;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-more {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

/* Calculators index */

.calculator-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.calculator-card {
  display: grid;
  gap: 0.5rem;
  height: 100%;
  padding: 1.75rem;
  border-radius: calc(var(--radius) * 1.2);
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}

.calculator-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
  color: var(--ink);
}

.calculator-card__glyph {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 0.5rem;
  border-radius: 14px;
  background: var(--plum);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.8rem;
}

.calculator-card strong {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--plum);
}

.calculator-card > span:not(.calculator-card__glyph):not(.text-link) {
  color: var(--ink-soft);
}

.calculator-card .text-link {
  justify-self: start;
  margin-top: 0.5rem;
}

/* About */

.about {
  display: grid;
  gap: clamp(2.5rem, 2rem + 2vw, 4rem);
}

.about .prose {
  max-width: 760px;
}

.about__intro p:first-of-type {
  font-size: var(--step-1);
}

.team {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 0.5rem + 2vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.team__member {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  text-align: center;
}

.team__member img {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--cream);
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px var(--line), var(--shadow-md);
}

.team__member strong {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--plum);
}

.team__member span {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

@media (max-width: 760px) {
  .team {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.about__signoff-intro {
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.55;
}

.about__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.prose .about__actions .button--ghost,
.prose .about__actions .button--ghost:hover {
  text-decoration: none;
}

.prose .about__actions .button--ghost {
  color: var(--plum);
}

.prose .about__actions .button--ghost:hover {
  color: var(--white);
}

/* Landing pages (Puzzle Express, The Killer Sudoku Challenge) */

.landing {
  display: grid;
  gap: clamp(3rem, 2rem + 4vw, 5.5rem);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  align-items: center;
}

.split--reverse > :first-child {
  order: 2;
}

.split__text h2 {
  color: var(--plum);
  font-size: var(--step-2);
}

.split__text h2:not(:first-child) {
  margin-top: 1.5em;
}

.split__image {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.split__image--plain {
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 24px 30px rgb(38 23 37 / 0.25));
}

.split__image--cover {
  display: block;
  max-width: 420px;
  justify-self: center;
  box-shadow: none;
  transition: transform 0.5s var(--ease);
}

.split__image--cover img {
  border-radius: 4px;
  box-shadow: var(--shadow-book);
}

.split__image--cover:hover {
  transform: translateY(-6px) rotate(-1.5deg);
}

.split__images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.split__images img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.split__images img:last-child {
  margin-top: 3rem;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
  }

  .split--reverse > :first-child {
    order: 0;
  }
}

.landing__band {
  padding: clamp(2rem, 1.5rem + 3vw, 3.5rem);
  border-radius: calc(var(--radius) * 1.4);
  background: var(--plum);
  background-image: radial-gradient(ellipse 60% 90% at 90% 20%, #6b2c65 0%, transparent 70%);
  color: rgb(255 255 255 / 0.88);
  text-align: center;
}

.landing__band h2 {
  color: var(--white);
}

.landing__band p {
  max-width: 64ch;
  margin-inline: auto;
}

.landing__band a {
  color: var(--rose-300);
}

.landing__band a:hover {
  color: var(--white);
}

.checklist {
  padding: 0 !important;
}

.checklist li {
  list-style: none;
  position: relative;
  padding-left: 2rem !important;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--plum) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 6.2 2.3 2.3 4.7-5'/%3E%3C/svg%3E") no-repeat center / 10px;
}

.prose .button {
  color: var(--white);
  text-decoration: none;
}

/* Not found */

.not-found {
  padding-block: clamp(3rem, 2rem + 5vw, 7rem);
  background: var(--cream);
}

.not-found__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  align-items: center;
}

.not-found h1 {
  color: var(--plum);
}

.not-found__grid {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  rotate: -4deg;
}

.not-found__grid span {
  display: grid;
  place-items: center;
  height: 72px;
  border-radius: 10px;
  background: var(--cream);
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--plum);
}

.not-found__links {
  margin-top: 2rem;
}

@media (max-width: 700px) {
  .not-found__inner {
    grid-template-columns: 1fr;
  }

  .not-found__grid {
    grid-template-columns: repeat(3, 56px);
  }

  .not-found__grid span {
    height: 56px;
    font-size: 1.7rem;
  }
}
