/* ============================================================================
   Shared interior-page components for the architectural-trace system.
   The site reads as a drawing set: every page type is a kind of sheet.
   Used by work, services, writings, pages, and contact styles.
   ========================================================================== */

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

.page-header {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) clamp(1.5rem, 3vw, 2.5rem);
}

.page-header__kicker {
  margin-bottom: 1rem;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.page-header h1 {
  font-size: var(--text-h1);
  letter-spacing: -0.01em;
  max-width: 18em;
}

.page-header__standfirst {
  max-width: 38rem;
  margin-top: 1.25rem;
  font-size: var(--text-lede);
  line-height: 1.65;
  color: var(--ink);
  text-wrap: balance;
}

/* ------------------------------------------------- title block (dl strip) */

.titleblock {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0;
  margin: 0;
  border-block: 1px solid var(--hairline);
}

.titleblock > div {
  padding: 0.9rem 1.1rem;
  border-left: 1px solid var(--trace-faint);
}

.titleblock > div:first-child {
  border-left: 0;
  padding-left: 0;
}

.titleblock dt {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.titleblock dd {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  font-weight: 700;
}

/* ------------------------------------------------------- figures / images */

.trace-figure {
  margin: clamp(2rem, 5vw, 3.5rem) 0;
  counter-increment: figure;
}

.trace-figure img {
  width: 100%;
  border: 1px solid var(--hairline);
}

.trace-figure figcaption {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  margin-top: 0.75rem;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.trace-figure figcaption::before {
  content: "Fig. " counter(figure, decimal-leading-zero);
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ------------------------------------------------------------------ prose */

.prose {
  counter-reset: figure;
  max-width: 68ch;
  font-size: var(--text-base);
  line-height: 1.75;
  overflow-wrap: break-word;
}

.prose a {
  overflow-wrap: anywhere;
}

.prose h2,
.prose h3 {
  margin-top: 2.5em;
  margin-bottom: 0.75em;
}

.prose h2 {
  font-size: var(--text-h3);
}

.prose h3 {
  font-size: 1.25rem;
}

.prose p,
.prose ul,
.prose ol {
  margin-bottom: 1.25em;
}

.prose ul,
.prose ol {
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose blockquote {
  margin: 2.25em 0;
  padding-left: 1.5rem;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.6;
}

.prose hr {
  margin: 3em 0;
  border: 0;
  border-top: 1px solid var(--hairline);
}

.prose pre {
  margin: 1.5em 0;
  padding: 1.25rem;
  overflow-x: auto;
  background: var(--surface-dark);
  color: var(--paper-on-dark);
  font-size: 0.875rem;
  line-height: 1.6;
}

.prose code {
  font-size: 0.9em;
}

.prose img {
  border: 1px solid var(--hairline);
}

.prose .attachment__caption {
  margin-top: 0.5rem;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* -------------------------------------------------------------- pull quote */

.pull-quote {
  position: relative;
  margin: clamp(2.5rem, 6vw, 4rem) 0;
  padding-top: 2rem;
}

.pull-quote::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6rem;
  height: 3px;
  background: var(--accent);
}

.pull-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.375rem, 1.15rem + 1.1vw, 1.875rem);
  line-height: 1.5;
}

/* --------------------------------------------------------------- CTA band */

.cta-band {
  background: var(--accent);
  border-block: 1px solid rgba(13, 13, 13, 0.2);
}

.cta-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: clamp(1.75rem, 4vw, 2.75rem) var(--gutter);
}

.cta-band p {
  max-width: 44rem;
  font-size: var(--text-lede);
  text-wrap: balance;
}

.cta-band .button {
  background: var(--ink);
  color: var(--paper);
  border-color: transparent;
}

.cta-band .button:hover {
  background: var(--paper);
  color: var(--ink);
}

/* -------------------------------------------------- sheet-flip footer nav */

.sheet-nav {
  border-top: 1px solid var(--hairline);
}

.sheet-nav__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: clamp(1.75rem, 4vw, 2.5rem) var(--gutter);
}

.sheet-nav a {
  text-decoration: none;
}

.sheet-nav a:hover .sheet-nav__title {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}

.sheet-nav__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.sheet-nav__title {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.sheet-nav__next {
  text-align: right;
}

/* ---------------------------------------------- spec rows (numbered lists) */

.spec-rows {
  border-top: 1px solid var(--hairline);
}

.spec-row {
  border-bottom: 1px solid var(--hairline);
}

.spec-row > a {
  display: grid;
  grid-template-columns: 4rem minmax(0, 22rem) 1fr auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.5rem 0.25rem;
  text-decoration: none;
}

.spec-row__number {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.spec-row__title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  line-height: 1.15;
}

.spec-row__promise {
  font-size: var(--text-description);
  line-height: 1.6;
  color: var(--ink);
}

.spec-row__arrow {
  color: var(--accent);
  font-size: 1.25rem;
}

.spec-row > a:hover .spec-row__title {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}

@media (max-width: 767px) {
  .spec-row > a {
    grid-template-columns: 3rem 1fr auto;
  }

  .spec-row__promise {
    grid-column: 2;
  }
}

/* ------------------------------------------------------- ledger (writings) */

.ledger {
  border-top: 1px solid var(--hairline);
}

.ledger__entry {
  border-bottom: 1px solid var(--hairline);
}

.ledger__entry > a {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.4rem 0.25rem;
  text-decoration: none;
}

.ledger__date {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.ledger__title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.2;
}

.ledger__deck {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-body);
  font-size: var(--text-description);
  line-height: 1.6;
  color: var(--ink);
}

.ledger__tag {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.ledger__entry > a:hover .ledger__title {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}

@media (max-width: 767px) {
  .ledger__entry > a {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* ------------------------------------------------------------- form sheet */

.form-sheet label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.form-sheet input[type="text"],
.form-sheet input[type="email"],
.form-sheet input[type="password"],
.form-sheet textarea,
.form-sheet select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--ink-muted);
  border-radius: 3px;
}

.form-sheet input:focus-visible,
.form-sheet textarea:focus-visible,
.form-sheet select:focus-visible {
  outline: var(--focus-ring-width) solid var(--ink);
  outline-offset: 1px;
}

.form-sheet .input {
  margin-bottom: 1.5rem;
}

.form-sheet .error {
  display: block;
  margin-top: 0.35rem;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #8A2F0E;
}

.form-sheet .hint {
  display: block;
  margin-top: 0.35rem;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* flash messages */
.flash {
  max-width: var(--content-max);
  margin: 1rem auto 0;
  padding: 0.9rem 1.25rem;
  border: 1px solid var(--ink);
  background: var(--accent);
  font-weight: 700;
}

/* ----------------------------------------------------- video facade */

.video-facade {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: clamp(2rem, 5vw, 3.5rem) 0;
  border: 1px solid var(--hairline);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(to right, var(--trace-faint) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(to bottom, var(--trace-faint) 0 1px, transparent 1px 48px);
  overflow: hidden;
}

.video-facade iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-facade__button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  height: 100%;
  padding: 1rem;
}

.video-facade__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-facade__play {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  background: var(--accent);
  color: var(--ink);
  border: 1px solid var(--ink);
}

.video-facade__play svg {
  width: 1.75rem;
  height: 1.75rem;
}

.video-facade__label {
  position: relative;
  padding: 0.35rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: no-preference) {
  .video-facade__play {
    transition: background-color 160ms ease, color 160ms ease;
  }
}

.video-facade__button:hover .video-facade__play {
  background: var(--ink);
  color: var(--paper);
}

/* Keep the focus indicator inside the clipped video frame. */
.video-facade__button:focus-visible {
  outline-offset: -4px;
}

/* ------------------------------------------------------------- pagination */

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: clamp(2rem, 5vw, 3rem);
  font-variant-numeric: tabular-nums;
}

.pagination a,
.pagination span {
  display: inline-block;
  min-width: 2.4rem;
  padding: 0.45rem 0.6rem;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--trace-faint);
}

.pagination .current {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

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

/* ------------------------------------------------------------ breadcrumbs */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

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

.breadcrumb a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.6rem;
  color: var(--hairline);
}

.breadcrumb {
  list-style: none;
  padding: 0;
}

/* Reusable raster tear. Keep its scale fixed so fibers do not stretch with
   the sheet height. Overlap the white interior to avoid a hairline seam. */
.paper-edge {
  position: relative;
}

.paper-edge::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: -24px;
  width: 40px;
  background-image: url("/assets/torn-paper-edge-f699c5a5.png");
  background-repeat: repeat-y;
  background-size: 144px 432px;
  background-position: -52px top;
  pointer-events: none;
}
