/* CraftForms — documents: articles, legal pages, comparisons, blog lists.
   Layout: a waybill head, then a calm reading column on the floor. */

.doc {
  padding-block: clamp(24px, 3.4vw, 44px) clamp(72px, 8vw, 120px);
}

/* ===================== WAYBILL ===================== */

.waybill {
  position: relative;
  border-radius: var(--die);
  background: var(--stock);
  box-shadow: var(--shadow-label);
}

.waybill__stub {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 0 clamp(18px, 2.6vw, 32px);
  border-bottom: 2px dashed var(--rule);
}

.waybill__stub::before,
.waybill__stub::after {
  content: "";
  position: absolute;
  bottom: -9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--floor);
}

.waybill__stub::before {
  left: -8px;
}

.waybill__stub::after {
  right: -8px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.crumbs a {
  color: var(--ink-2);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.crumbs [aria-current] {
  color: var(--green-ink);
  font-stretch: 90%;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.waybill__stub .barcode {
  width: 140px;
  height: 22px;
  flex: none;
}

.waybill__main {
  display: grid;
  gap: 24px;
  padding: clamp(22px, 3vw, 40px) clamp(18px, 2.6vw, 32px) clamp(18px, 2.4vw, 28px);
}

.waybill__title h1 {
  font-size: clamp(2.125rem, 1.3rem + 3vw, 4rem);
  font-stretch: 106%;
  font-weight: 830;
  letter-spacing: -0.032em;
  line-height: 0.98;
  max-width: 22ch;
}

.waybill__dek {
  margin-top: 18px;
  max-width: 62ch;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
}

.waybill__photo {
  margin: 0;
  align-self: start;
}

.waybill__photo img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  outline: 1px solid var(--rule);
  outline-offset: -1px;
}

.waybill__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 2px solid var(--ink);
}

.waybill__fields > div {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px clamp(18px, 2.6vw, 32px) 16px;
  border-bottom: 1px dashed var(--rule);
}

.waybill__fields > div:nth-child(odd) {
  border-right: 1px dashed var(--rule);
}

.waybill__fields dt {
  font-size: 0.75rem;
  font-weight: 750;
  font-stretch: 72%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.waybill__fields dd {
  margin: 0;
  font-weight: 650;
  line-height: 1.35;
}

.waybill__fields dd.mono {
  font-size: 0.9375rem;
  font-weight: 600;
}

.waybill__fields .waybill__wide {
  grid-column: 1 / -1;
  border-right: 0;
}

.waybill__fields > div:last-child {
  border-bottom: 0;
}

.route-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.route-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  font-stretch: 86%;
  text-decoration: none;
}

.route-tag:hover {
  background: var(--amber);
  border-color: var(--amber);
}

@media (min-width: 900px) {
  .waybill__main--photo {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    gap: 40px;
  }

  .waybill__fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .waybill__fields > div {
    border-bottom: 0;
    border-right: 1px dashed var(--rule);
  }

  .waybill__fields > div:last-child {
    border-right: 0;
  }

  .waybill__fields .waybill__wide {
    grid-column: auto;
  }

  .waybill__fields--5 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 2fr);
  }
}

/* ===================== READING LAYOUT ===================== */

.doc__body {
  display: grid;
  gap: 32px;
  margin-top: clamp(32px, 4vw, 56px);
}

.contents {
  align-self: start;
  padding: 18px 20px;
  border-radius: var(--die);
  background: var(--floor-2);
}

.contents h2 {
  font-size: 0.8125rem;
  font-weight: 750;
  font-stretch: 72%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.contents ol {
  display: grid;
  gap: 2px;
  margin-top: 10px;
}

.contents a {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--rule-strong);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  color: var(--ink-2);
}

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

.contents a[aria-current="true"] {
  border-left-color: var(--green);
  color: var(--ink);
}

@media (min-width: 1180px) {
  .doc__body--toc {
    grid-template-columns: 260px minmax(0, 66ch);
    gap: 64px;
    justify-content: start;
  }

  .doc__body--toc .contents {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow: auto;
    background: transparent;
    padding: 0;
  }

  .doc__body:not(.doc__body--toc) {
    padding-left: 324px;
  }
}

/* ===================== PROSE ===================== */

.prose {
  min-width: 0;
  max-width: 66ch;
  font-size: 1.125rem;
  line-height: 1.68;
  color: var(--ink);
}

.prose > * + * {
  margin-top: 1.05em;
}

.prose h2 {
  margin-top: 2.2em;
  padding-top: 0.9em;
  border-top: 2px dashed var(--rule);
  font-size: clamp(1.5rem, 1.25rem + 0.9vw, 2rem);
  font-stretch: 104%;
  font-weight: 800;
  letter-spacing: -0.022em;
  line-height: 1.12;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.prose h3 {
  margin-top: 1.8em;
  font-size: 1.3125rem;
  font-weight: 780;
  letter-spacing: -0.012em;
  line-height: 1.25;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.prose h4 {
  margin-top: 1.6em;
  font-size: 1.0625rem;
  font-weight: 780;
  line-height: 1.3;
}

.prose h2 + *,
.prose h3 + *,
.prose h4 + * {
  margin-top: 0.6em;
}

.prose > :first-child {
  margin-top: 0;
}

.prose a {
  color: var(--green-ink);
  font-weight: 600;
  text-decoration-color: color-mix(in oklch, var(--green-ink) 45%, transparent);
}

.prose a:hover {
  color: var(--ink);
  text-decoration-color: var(--amber);
}

.prose strong {
  font-weight: 720;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose ul {
  list-style: none;
  padding-left: 0;
}

.prose ul > li {
  position: relative;
  padding-left: 1.3em;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 0.1em;
  top: 0.68em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--green);
}

.prose ol {
  list-style: decimal;
}

.prose ol > li::marker {
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 700;
  color: var(--green-ink);
}

.prose li + li {
  margin-top: 0.45em;
}

.prose li > ul,
.prose li > ol {
  margin-top: 0.45em;
}

.prose hr {
  height: 0;
  margin-block: 2.2em;
  border: 0;
  border-top: 2px dashed var(--rule);
}

.prose hr + h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose blockquote {
  margin-inline: 0;
  padding: 16px 20px;
  border-radius: var(--die);
  background: var(--green-tint);
  color: oklch(0.28 0.05 152);
}

.prose blockquote > * + * {
  margin-top: 0.7em;
}

.prose code {
  padding: 0.12em 0.36em;
  border-radius: 5px;
  background: var(--floor-2);
  font-family: var(--font-mono);
  font-size: 0.82em;
  font-stretch: 87.5%;
  overflow-wrap: anywhere;
}

.prose pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: var(--die);
  background: var(--ink);
  color: oklch(0.93 0.015 150);
  font-size: 0.875rem;
  line-height: 1.6;
  tab-size: 2;
  scrollbar-color: oklch(0.45 0.03 152) var(--ink);
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
  white-space: pre;
}

.prose figure {
  margin-inline: 0;
}

.prose img {
  height: auto;
  border-radius: 8px;
  outline: 1px solid var(--rule);
  outline-offset: -1px;
}

.prose figure.aligncenter img,
.prose .aligncenter img {
  margin-inline: auto;
}

.prose figcaption {
  margin-top: 10px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-3);
}

.prose .row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.prose .row > * {
  margin: 0;
}

.prose .stack > * + * {
  margin-top: 12px;
}

.prose .embed {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--die);
  background: var(--ink);
}

.prose .embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.prose .table {
  overflow-x: auto;
  border-radius: var(--die);
  background: var(--stock);
  box-shadow: var(--shadow-label);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.prose th,
.prose td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px dashed var(--rule);
}

.prose thead th {
  border-bottom: 2px solid var(--ink);
  font-size: 0.8125rem;
  font-weight: 780;
  font-stretch: 80%;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.prose tbody tr:last-child td {
  border-bottom: 0;
}

/* ===================== END OF DOCUMENT ===================== */

.doc__end {
  display: grid;
  gap: 40px;
  margin-top: clamp(48px, 6vw, 80px);
}

.delivered {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 28px;
  padding-top: 28px;
  border-top: 2px solid var(--ink);
}

.delivered .stamp {
  transform: rotate(-6deg);
  opacity: 0.94;
  mix-blend-mode: multiply;
}

.delivered .stamp__word {
  font-size: 1.75rem;
}

.delivered p {
  max-width: 46ch;
  color: var(--ink-2);
}

.delivered p a {
  font-weight: 700;
  color: var(--ink);
}

.next-reads h2 {
  font-size: var(--step-2);
  letter-spacing: -0.02em;
}

.next-reads ul {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.fwd-label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
  height: 100%;
  padding: 16px 18px;
  border-radius: var(--die);
  background: var(--stock);
  box-shadow: var(--shadow-label);
  text-decoration: none;
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}

.fwd-label:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--amber), var(--shadow-label);
}

.fwd-label__arrow {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green-tint);
  color: var(--green-ink);
}

.fwd-label__arrow svg {
  width: 18px;
  height: 18px;
}

.fwd-label__meta {
  font-size: 0.75rem;
  font-weight: 750;
  font-stretch: 72%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.fwd-label__title {
  font-size: 1.0625rem;
  font-weight: 760;
  line-height: 1.25;
}

@media (min-width: 760px) {
  .next-reads ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cta-strip {
  display: grid;
  gap: 20px;
  align-items: center;
  padding: clamp(22px, 3vw, 36px);
  border-radius: var(--die);
  background: var(--green);
}

.cta-strip h2 {
  font-size: var(--step-2);
  font-stretch: 104%;
  letter-spacing: -0.02em;
}

.cta-strip p {
  margin-top: 8px;
  max-width: 52ch;
  color: var(--on-band);
}

.cta-strip__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta-strip .btn:not(.btn--amber) {
  border-color: var(--ink);
}

@media (min-width: 900px) {
  .cta-strip {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (min-width: 1180px) {
  .doc__end--offset {
    padding-left: 324px;
  }
}

/* ===================== LISTS (blog, category, tag) ===================== */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.filters a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9375rem;
  font-stretch: 90%;
  text-decoration: none;
}

.filters a .mono {
  font-size: 0.75rem;
  color: var(--ink-3);
}

.filters a:hover {
  background: var(--floor-2);
}

.filters a[aria-current="page"] {
  background: var(--ink);
  color: var(--stock);
}

.filters a[aria-current="page"] .mono {
  color: oklch(0.8 0.02 150);
}

.post-rows {
  margin-top: clamp(32px, 4vw, 48px);
  border-top: 2px solid var(--ink);
}

.post-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px 28px;
  padding-block: 24px;
  border-bottom: 1px dashed var(--rule-strong);
}

.post-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.post-row__meta time {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-3);
}

.post-row__cat {
  font-size: 0.8125rem;
  color: var(--green-ink);
}

.post-row h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 780;
  letter-spacing: -0.016em;
  line-height: 1.2;
}

.post-row h2 a {
  text-decoration: none;
}

.post-row h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.post-row:hover h2 a {
  text-decoration: underline;
  text-decoration-color: var(--amber);
}

.post-row p {
  margin-top: 8px;
  max-width: 70ch;
  color: var(--ink-2);
}

.post-row__thumb {
  display: none;
}

.post-row__thumb img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  outline: 1px solid var(--rule);
  outline-offset: -1px;
}

@media (min-width: 760px) {
  .post-row {
    grid-template-columns: 140px minmax(0, 1fr) 200px;
    align-items: start;
  }

  .post-row__meta {
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
  }

  .post-row__thumb {
    display: block;
  }
}

.list-empty {
  padding: 32px 0;
  color: var(--ink-2);
}

/* ===================== COMPARISON ===================== */

.compare-table {
  margin-top: clamp(32px, 4vw, 48px);
  overflow-x: auto;
  border-radius: var(--die);
  background: var(--stock);
  box-shadow: var(--shadow-label);
}

.compare-table table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.compare-table thead th {
  position: sticky;
  top: 0;
  padding: 16px clamp(14px, 2.2vw, 24px);
  border-bottom: 2px solid var(--ink);
  background: var(--stock);
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 800;
  font-stretch: 80%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compare-table thead th + th {
  width: 22%;
  text-align: center;
}

.compare-table .compare__us {
  color: var(--green-ink);
}

.compare-table tbody th,
.compare-table tbody td {
  padding: 12px clamp(14px, 2.2vw, 24px);
  border-bottom: 1px dashed var(--rule);
  text-align: left;
  font-weight: 600;
  line-height: 1.35;
}

.compare-table tbody td {
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-2);
}

.compare-table tbody tr:hover {
  background: color-mix(in oklch, var(--green-tint) 45%, var(--stock));
}

.compare-table .compare__group th {
  padding-top: 22px;
  border-bottom: 2px solid var(--ink);
  font-size: 0.8125rem;
  font-weight: 800;
  font-stretch: 78%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-ink);
}

.compare-table .compare__group:hover {
  background: none;
}

.compare-table .yes {
  width: 24px;
  height: 24px;
  margin-inline: auto;
  padding: 3px;
  border-radius: 50%;
  background: var(--green);
  color: var(--stock);
}

.compare-table .no {
  color: var(--ink-3);
}

.compare-table .soon {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 780;
  font-stretch: 72%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.compare-summary {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.compare-summary section {
  padding: clamp(20px, 2.6vw, 30px);
  border-radius: var(--die);
  background: var(--stock);
  box-shadow: var(--shadow-label);
}

.compare-summary section:first-child {
  background: var(--green-tint);
  box-shadow: none;
}

.compare-summary h2 {
  font-size: var(--step-2);
  letter-spacing: -0.02em;
}

.compare-summary ul {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.compare-summary li {
  position: relative;
  padding-left: 22px;
  line-height: 1.45;
}

.compare-summary li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--ink);
}

.compare-summary section:first-child li::before {
  background: var(--green);
}

@media (min-width: 900px) {
  .compare-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.compare-intro {
  max-width: 72ch;
  margin-top: clamp(28px, 3.4vw, 44px);
  font-size: 1.125rem;
  line-height: 1.68;
}

.compare-intro > * + * {
  margin-top: 1em;
}

@media (max-width: 639px) {
  .crumbs [aria-current],
  .crumbs [aria-current] ~ *,
  .crumbs span[aria-hidden="true"]:last-of-type {
    display: none;
  }

  .waybill__stub .barcode {
    width: 96px;
  }
}

.compare-summary {
  scroll-margin-top: calc(var(--header-h) + 20px);
}

@media (min-width: 1180px) {
  .doc__body--toc .contents {
    padding-left: 2px;
  }
}

/* review fixes: unfilled quotes, label-stock summary, meta after title, rule-based contents, mobile comparison */
.prose blockquote {
  padding: 4px 0 4px 22px;
  border-radius: 0;
  background: none;
  color: var(--ink-2);
  position: relative;
}

.prose blockquote::before {
  content: "“";
  position: absolute;
  left: 0;
  top: -0.1em;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--green-ink);
}

.compare-summary section:first-child {
  background: var(--stock);
  box-shadow: var(--shadow-label);
}

.fwd-label__meta {
  grid-row: 2;
}

.fwd-label__title {
  grid-row: 1;
}

.contents a {
  border-left: 1px solid var(--rule-strong);
}

.contents a:hover {
  border-left-color: var(--rule-strong);
}

.contents a[aria-current="true"] {
  border-left-color: var(--rule-strong);
  font-weight: 780;
  color: var(--ink);
}

@media (max-width: 639px) {
  .compare-table table {
    min-width: 0;
    table-layout: fixed;
  }

  .compare-table thead th + th {
    width: 88px;
    padding-inline: 4px;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    overflow-wrap: normal;
  }

  .compare-table tbody th {
    padding-inline: 12px 6px;
    font-size: 0.875rem;
  }

  .compare-table tbody td {
    padding-inline: 4px;
    font-size: 0.75rem;
  }
}

.fwd-label--solo .fwd-label__title {
  grid-row: 1 / span 2;
}

/* comparison: a tick that carries a qualifier ("✓ Elite", "✓ paid") */
.compare__note {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-3);
}

.compare-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.875rem;
  color: var(--ink-3);
}
