/*
Theme Name: Backwall
Theme URI: https://backwall.cn
Author: Backwall
Description: An editorial theme for Backwall interviews. Paper, ink, and photography first.
Version: 1.0.5
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: backwall
*/

@font-face {
  font-family: "DM Sans";
  src: url("fonts/DMSans-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("fonts/DMSans-Italic-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #FAF6F5;
  --ink: #1A0D10;
  --soft: #4A3540;
  --mute: #8E7682;
  --line: #F0E4E6;
  --accent: #E75A12;
  --pad: clamp(20px, 5vw, 72px);
  --measure: 680px;
  --max: 1440px;
}

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

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--pad);
  top: -100px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 100;
}

.skip-link:focus {
  top: 12px;
}

.site {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1 0 auto;
}

/* Header
   ------------------------------------------------------------------ */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 28px var(--pad) 26px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
}

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

.wordmark-square {
  width: 7px;
  height: 7px;
  background: var(--accent);
  display: inline-block;
  flex: 0 0 7px;
  position: relative;
  top: -1px;
}

.wordmark-name {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 32px;
  font-size: 14px;
  color: var(--soft);
}

.site-nav a {
  color: var(--soft);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

/* Home intro
   ------------------------------------------------------------------ */
.intro {
  padding: 56px var(--pad) 40px;
  max-width: calc(var(--pad) * 2 + 920px);
}

.intro p {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.45;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink);
}

/* Featured interview
   ------------------------------------------------------------------ */
.feature {
  padding: 0 var(--pad) 72px;
}

.feature-photo,
.feature-photo img {
  display: block;
  width: 100%;
}

.feature-photo img {
  height: 620px;
  object-fit: cover;
  object-position: center 38%;
  background: var(--line);
}

.feature-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding-top: 22px;
  align-items: end;
}

.kicker {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--mute);
  margin: 0 0 10px;
  text-transform: none;
}

.feature-title {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.28;
  font-weight: 700;
  max-width: 980px;
  letter-spacing: 0.01em;
}

.feature-title a:hover {
  color: var(--ink);
}

.date {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.08em;
  white-space: nowrap;
  padding-bottom: 6px;
}

/* Interview grid
   ------------------------------------------------------------------ */
.grid-head {
  padding: 8px var(--pad) 20px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--line);
  gap: 16px;
}

.grid-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.grid-head .count {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.08em;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 36px 28px;
  padding: 8px var(--pad) 80px;
}

.card {
  display: block;
  color: inherit;
  min-width: 0;
}

.card-photo,
.card-photo img {
  display: block;
  width: 100%;
}

.card-photo img {
  height: 280px;
  object-fit: cover;
  object-position: center 38%;
  background: var(--line);
}

.card-photo.placeholder {
  height: 280px;
  background: var(--line);
}

.card .kicker {
  margin: 14px 0 8px;
}

.card-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
}

/* Single / page
   ------------------------------------------------------------------ */
.hero {
  padding: 0;
}

.hero img {
  width: 100%;
  height: 720px;
  object-fit: cover;
  object-position: center 35%;
  display: block;
  background: var(--line);
}

.lead,
.page-lead {
  width: min(100%, calc(var(--measure) + 48px));
  margin: 56px auto 0;
  padding: 0 24px;
}

.lead h1,
.page-lead h1,
.archive-title {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.meta {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--mute);
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}

.entry-content,
.page-content {
  width: min(100%, calc(var(--measure) + 48px));
  margin: 40px auto 72px;
  padding: 0 24px;
  font-size: 18px;
  line-height: 1.85;
  color: var(--ink);
}

.entry-content > *:first-child,
.page-content > *:first-child {
  margin-top: 0;
}

.entry-content p,
.page-content p {
  margin: 0 0 1.15em;
}

.entry-content h2,
.page-content h2 {
  font-size: 22px;
  margin: 42px 0 16px;
  font-weight: 700;
  line-height: 1.35;
}

.entry-content h3,
.page-content h3 {
  font-size: 20px;
  margin: 36px 0 14px;
  font-weight: 700;
  line-height: 1.35;
}

.entry-content a,
.page-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #C9B4BA;
}

.entry-content a:hover,
.page-content a:hover {
  text-decoration-color: var(--ink);
}

.entry-content blockquote,
.page-content blockquote,
.entry-content .quote {
  margin: 36px 0;
  padding: 8px 0 8px 22px;
  border-left: 2px solid var(--accent);
  border-right: 0;
  border-top: 0;
  border-bottom: 0;
  font-size: 22px;
  line-height: 1.55;
  font-weight: 400;
  background: none;
  box-shadow: none;
  color: var(--ink);
}

.entry-content blockquote p,
.page-content blockquote p {
  margin: 0 0 0.6em;
}

.entry-content blockquote p:last-child,
.page-content blockquote p:last-child {
  margin-bottom: 0;
}

.entry-content figure,
.page-content figure,
.entry-content .wp-block-image,
.page-content .wp-block-image {
  margin: 2.2em 0;
  max-width: 100%;
}

.entry-content img,
.page-content img,
.entry-content .wp-block-image img,
.page-content .wp-block-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  box-shadow: none;
}

.entry-content figcaption,
.page-content figcaption,
.entry-content .wp-element-caption {
  margin-top: 10px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--mute);
  line-height: 1.5;
}

.entry-content ul,
.page-content ul,
.entry-content ol,
.page-content ol {
  margin: 0 0 1.15em;
  padding-left: 1.2em;
}

.entry-content li,
.page-content li {
  margin: 0 0 0.35em;
}

/* Section titles in interview bodies often arrive as a one-item list. */
.entry-content ol.wp-block-list:has(> li:only-child) {
  list-style: none;
  padding-left: 0;
  margin: 42px 0 16px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
}

.entry-content ol.wp-block-list:has(> li:only-child) li {
  margin: 0;
}

.entry-content strong em,
.entry-content em strong {
  font-style: italic;
  font-weight: 700;
}

/* Next interview
   ------------------------------------------------------------------ */
.next {
  border-top: 1px solid var(--line);
  padding: 36px var(--pad) 64px;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  align-items: center;
  color: inherit;
}

.next-photo,
.next-photo img {
  display: block;
  width: 160px;
}

.next-photo img,
.next-photo.placeholder {
  width: 160px;
  height: 112px;
  object-fit: cover;
  object-position: center 40%;
  background: var(--line);
}

.next .kicker {
  margin-bottom: 8px;
}

.next h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
}

/* Footer
   ------------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px var(--pad) 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  color: var(--mute);
  font-size: 12px;
  margin-top: auto;
}

.site-footer .footer-mark {
  font-family: "DM Sans", system-ui, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}

.footer-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-contact {
  color: var(--mute);
  text-decoration: none;
  letter-spacing: 0.02em;
  text-transform: none;
}

.footer-contact:hover,
.footer-contact:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-contact-label {
  font-family: "DM Sans", system-ui, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-right: 8px;
}

.footer-friends {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-friends-label {
  font-family: "DM Sans", system-ui, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}

.footer-friend {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  opacity: 0.92;
}

.footer-friend:hover,
.footer-friend:focus-visible {
  opacity: 1;
}

.footer-friend img {
  display: block;
  height: 20px;
  width: auto;
  max-width: 160px;
}

/* 404 / empty
   ------------------------------------------------------------------ */
.empty,
.not-found {
  width: min(100%, calc(var(--measure) + 48px));
  margin: 72px auto 96px;
  padding: 0 24px;
}

.empty h1,
.not-found h1 {
  font-size: 32px;
  line-height: 1.28;
  margin: 0 0 16px;
}

.empty p,
.not-found p {
  color: var(--soft);
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 1em;
}

.empty a,
.not-found a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.archive-head {
  padding: 48px var(--pad) 28px;
}

.archive-head .kicker {
  margin-bottom: 12px;
}

/* Responsive — tablet
   ------------------------------------------------------------------ */
@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .feature-photo img {
    height: 480px;
  }

  .hero img {
    height: 520px;
  }
}

/* Responsive — mobile, matching the editorial mockup
   ------------------------------------------------------------------ */
@media (max-width: 720px) {
  .site-header {
    padding: 18px 20px 16px;
  }

  .wordmark {
    gap: 8px;
  }

  .wordmark-square {
    width: 6px;
    height: 6px;
    flex-basis: 6px;
  }

  .wordmark-name {
    font-size: 10px;
    letter-spacing: 0.16em;
  }

  .site-nav {
    gap: 16px;
    font-size: 13px;
  }

  .intro {
    padding: 28px 20px 20px;
  }

  .feature {
    padding: 0 0 36px;
  }

  .feature-photo img {
    height: 440px;
  }

  .feature-meta {
    display: block;
    padding: 16px 20px 0;
  }

  .feature-title {
    font-size: 24px;
    line-height: 1.3;
  }

  .date {
    display: block;
    padding: 10px 0 0;
  }

  .grid-head {
    padding: 16px 20px 8px;
  }

  .grid {
    display: block;
    padding: 0 0 40px;
    border-top: 1px solid var(--line);
  }

  .card {
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    align-items: start;
  }

  .card-photo,
  .card-photo img,
  .card-photo.placeholder {
    width: 118px;
    height: 88px;
  }

  .card .kicker {
    margin: 0 0 6px;
  }

  .card-title {
    font-size: 15px;
  }

  .hero img {
    height: 440px;
  }

  .lead,
  .page-lead,
  .entry-content,
  .page-content,
  .empty,
  .not-found {
    margin-top: 36px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .lead h1,
  .page-lead h1 {
    font-size: 28px;
  }

  .entry-content,
  .page-content {
    font-size: 17px;
  }

  .entry-content blockquote,
  .page-content blockquote,
  .entry-content .quote {
    font-size: 20px;
  }

  .next {
    grid-template-columns: 118px 1fr;
    gap: 14px;
    padding: 24px 20px 48px;
  }

  .next-photo,
  .next-photo img,
  .next-photo.placeholder {
    width: 118px;
    height: 88px;
  }

  .site-footer {
    padding: 24px 20px 32px;
    flex-wrap: wrap;
    gap: 16px;
  }

  .archive-head {
    padding: 32px 20px 16px;
  }
}


/* Page SVG, comic frames, stats, and reader echoes
   ------------------------------------------------------------------ */
.page-content svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.page-content .media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 16px;
  margin: 2.2em 0;
}

.page-content .media-grid figure {
  margin: 0;
}

.page-content .stat-list {
  list-style: none;
  padding-left: 0;
  margin: 2em 0;
  border-top: 1px solid var(--line);
}

.page-content .stat-list li {
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(4.5em, auto) 1fr;
  gap: 16px;
  align-items: baseline;
}

.page-content .stat-list strong {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.page-content .echo {
  margin: 0 0 1.5em;
  padding: 0 0 1.5em;
  border-bottom: 1px solid var(--line);
}

.page-content .echo blockquote {
  margin: 0 0 0.5em;
  padding: 4px 0 4px 16px;
  font-size: 18px;
  line-height: 1.7;
}

.page-content .echo .kicker {
  margin: 0;
}

@media (max-width: 720px) {
  .page-content .media-grid {
    grid-template-columns: 1fr;
  }
}


/* Handbook tables, diagrams, and lesson accordions
   ------------------------------------------------------------------ */
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0 2em;
  font-size: 15px;
  line-height: 1.55;
}

.page-content th,
.page-content td {
  border-bottom: 1px solid var(--line);
  border-top: 0;
  border-left: 0;
  border-right: 0;
  text-align: left;
  vertical-align: top;
  padding: 10px 12px 10px 0;
  background: none;
}

.page-content th {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 400;
  color: var(--soft);
}

.page-content pre {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.45;
  overflow-x: auto;
  margin: 1.6em 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
}

.page-content pre.prompt {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.65;
}

.page-content details {
  margin: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.page-content details details {
  padding-left: 0;
}

.page-content summary {
  cursor: pointer;
  font-weight: 700;
  line-height: 1.45;
}

.page-content details > *:not(summary) {
  margin-top: 12px;
}
