/*
Theme Name:  Filature
Description: A luxury editorial magazine theme for fiber arts. Asymmetrical masonry, didone display typography, and a natural-dye category system (Peat, Madder, Woad, Weld).
Author:      Your Studio
Version:     1.0.0
Text Domain: filature
*/

/* ============================================================
   1. DESIGN TOKENS — "the dye house"
   Every pillar owns a natural-dye color. Cards inherit it
   through the custom property --dye, set by .pillar--{slug}.
   ============================================================ */
:root {
  /* grounds & ink */
  --paper:        #EDE9DF;   /* undyed flax */
  --paper-deep:   #E4DFD2;   /* washed linen, for inset panels */
  --ink:          #211D16;   /* peat-black */
  --ink-soft:     rgba(33, 29, 22, 0.66);
  --thread:       rgba(33, 29, 22, 0.22);  /* hairline rules */

  /* the four dye lots */
  --dye-peat:     #4C5540;   /* Field Notes  — sourcing logs */
  --dye-madder:   #7C2F2B;   /* Critiques    — book reviews  */
  --dye-woad:     #33456E;   /* Profiles     — designers     */
  --dye-weld:     #93700F;   /* Mastery      — TKGA/CGOA     */

  --dye:          var(--ink); /* fallback, overridden per pillar */

  /* type */
  --display: "Bodoni Moda", "Bodoni MT", Didot, serif;
  --body:    "Newsreader", Georgia, serif;
  --utility: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;

  /* rhythm */
  --gutter: clamp(1.25rem, 2.5vw, 2.5rem);
  --measure: 34em;
}

/* pillar → dye binding (works on cards, archive bodies, nav) */
.pillar--field-notes { --dye: var(--dye-peat); }
.pillar--critiques   { --dye: var(--dye-madder); }
.pillar--profiles    { --dye: var(--dye-woad); }
.pillar--mastery     { --dye: var(--dye-weld); }

/* ============================================================
   2. BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-feature-settings: "liga", "kern";
}

img { display: block; max-width: 100%; height: auto; }

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--dye, var(--ink));
  outline-offset: 3px;
}

.site {
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ============================================================
   3. MASTHEAD — set like a title page, not a navbar
   ============================================================ */
.masthead {
  padding-block: 1.5rem 0;
  border-bottom: 1px solid var(--ink);
}

.masthead__over {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--utility);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--thread);
}

.masthead__title {
  margin: 0;
  padding-block: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem);
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(3.25rem, 11vw, 9.5rem);
  line-height: 0.9;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.masthead__title a { display: block; }

/* Pillar navigation: four dye lots, labelled like skein bands */
.pillar-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}

.pillar-nav a {
  --dye: var(--ink);
  position: relative;
  display: block;
  padding: 0.9rem 0.5rem 0.9rem 1.4rem;
  font-family: var(--utility);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-left: 1px solid var(--thread);
}

.pillar-nav a:first-child { border-left: 0; }

.pillar-nav a::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  transform: translateY(-50%);
  background: var(--dye);
}

.pillar-nav a span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-transform: none;
  font-weight: 400;
}

.pillar-nav a:hover { background: color-mix(in srgb, var(--dye) 8%, var(--paper)); }

/* ============================================================
   4. HERO — the featured story as an opening spread
   ============================================================ */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 0 var(--gutter);
  padding-block: clamp(2rem, 5vw, 4.5rem) clamp(2.5rem, 6vw, 5rem);
  border-bottom: 1px solid var(--ink);
}

.hero__folio {
  position: absolute;
  top: clamp(2rem, 5vw, 4.5rem);
  left: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--utility);
  font-size: 0.6875rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero__media {
  grid-column: 6 / 13;
  grid-row: 1;
  overflow: hidden;
}

.hero__media img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
}

.hero__text {
  grid-column: 1 / 8;
  grid-row: 1;
  position: relative;
  z-index: 2;
  padding-left: clamp(1.75rem, 3vw, 3rem); /* clears the vertical folio */
  padding-bottom: clamp(0.5rem, 2vw, 1.5rem);
}

.hero__title {
  margin: 0.6rem 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.4rem, 5.6vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  /* the overlap: type crosses onto the photograph */
  text-wrap: balance;
}

.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--dye);
}

.hero__title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 0.12em;
  text-decoration-color: var(--dye);
}

.hero__standfirst {
  max-width: 26em;
  margin-top: 1.1rem;
  font-size: 1.125rem;
  font-style: italic;
  color: var(--ink-soft);
  background: var(--paper); /* keeps it legible where it meets the photo */
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ============================================================
   5. DYE-LOT EYEBROW — shared card & hero label
   ============================================================ */
.dyelot {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.dyelot::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  background: var(--dye);
}

.dyelot b { font-weight: 500; color: var(--dye); }
.dyelot span { color: var(--ink-soft); font-weight: 400; }

/* ============================================================
   6. THE MASONRY — asymmetrical, staggered, dense-flow grid
   Card sizes cycle in a rhythm of five:
   L(7) + M(5) = 12   |   S(4) + NOTE(3) + M(5) = 12
   ============================================================ */
.masonry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 1.4rem;
}

.masonry-head h2 {
  margin: 0;
  font-family: var(--utility);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.masonry-head p {
  margin: 0;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.masonry {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-flow: dense;
  align-items: start;
  gap: clamp(2.5rem, 5vw, 4.5rem) var(--gutter);
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

/* size rhythm */
.card--l    { grid-column: span 7; }
.card--m    { grid-column: span 5; }
.card--s    { grid-column: span 4; }
.card--note { grid-column: span 3; }

/* the stagger: alternate cards drop, so rows never read as rows */
.masonry > *:nth-child(5n + 2) { margin-top: clamp(2rem, 5vw, 4.5rem); }
.masonry > *:nth-child(5n + 4) { margin-top: clamp(1.5rem, 3.5vw, 3rem); }

/* image aspect per size, so verticals and landscapes interleave */
.card--l .card__media img    { aspect-ratio: 16 / 10; }
.card--m .card__media img    { aspect-ratio: 4 / 5; }
.card--s .card__media img    { aspect-ratio: 1 / 1; }

/* ============================================================
   7. CARD ANATOMY — every card wears a selvedge
   The signature element: a woven grosgrain edge in the
   pillar's dye, running the full left side of the card.
   ============================================================ */
.card {
  position: relative;
  padding-left: 1.4rem;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 9px;
  background: repeating-linear-gradient(
    180deg,
    var(--dye) 0 4px,
    color-mix(in srgb, var(--dye) 45%, var(--paper)) 4px 7px
  );
}

.card__media {
  overflow: hidden;
  margin-bottom: 1rem;
}

.card__media img {
  width: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.card:hover .card__media img { transform: scale(1.035); }

.card__title {
  margin: 0.55rem 0 0;
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.card--l .card__title    { font-size: clamp(1.7rem, 2.9vw, 2.7rem); }
.card--m .card__title    { font-size: clamp(1.45rem, 2.2vw, 2rem); }
.card--s .card__title    { font-size: clamp(1.3rem, 1.9vw, 1.6rem); }
.card--note .card__title { font-size: clamp(1.25rem, 1.8vw, 1.5rem); }

.card__title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.14em;
  text-decoration-color: var(--dye);
}

.card__excerpt {
  max-width: var(--measure);
  margin: 0.7rem 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.card--s .card__excerpt { display: none; } /* small cards stay terse */

.card__meta {
  margin-top: 0.85rem;
  font-family: var(--utility);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* NOTE card: no image — an inset, dye-tinted marginalia panel */
.card--note {
  padding: 1.5rem 1.4rem 1.6rem 1.8rem;
  background: color-mix(in srgb, var(--dye) 7%, var(--paper-deep));
}

.card--note .card__excerpt {
  display: block;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink);
}

/* ============================================================
   8. COLOPHON FOOTER
   ============================================================ */
.colophon {
  border-top: 1px solid var(--ink);
  padding-block: 2rem 3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--utility);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ============================================================
   9. RESPONSIVE LOOM — 12 cols → 6 cols → single warp
   ============================================================ */
@media (max-width: 1080px) {
  .masonry { grid-template-columns: repeat(6, 1fr); }

  .card--l    { grid-column: span 6; }
  .card--m    { grid-column: span 3; }
  .card--s    { grid-column: span 3; }
  .card--note { grid-column: span 3; }

  .masonry > *:nth-child(5n + 2),
  .masonry > *:nth-child(5n + 4) { margin-top: 0; }
  .masonry > *:nth-child(4n + 3) { margin-top: clamp(1.5rem, 4vw, 3rem); }

  .hero__media { grid-column: 4 / 13; }
  .hero__text  { grid-column: 1 / 9; }
}

@media (max-width: 680px) {
  .masthead__over { flex-direction: column; gap: 0.35rem; }

  .pillar-nav { grid-template-columns: 1fr 1fr; }
  .pillar-nav a { border-left: 0; border-top: 1px solid var(--thread); }
  .pillar-nav a:nth-child(-n + 2) { border-top: 0; }
  .pillar-nav a:nth-child(even) { border-left: 1px solid var(--thread); }
  .pillar-nav a:last-child:nth-child(odd) { grid-column: 1 / -1; border-left: 0; }

  .hero { display: block; padding-top: 1.5rem; }
  .hero__folio { display: none; }
  .hero__text { padding-left: 0; padding-bottom: 0; }
  .hero__title { font-size: clamp(2.1rem, 9vw, 2.8rem); }
  .hero__media { margin-top: 1.25rem; }

  .masonry { grid-template-columns: 1fr; gap: 2.75rem; }
  .card--l, .card--m, .card--s, .card--note { grid-column: span 1; }
  .masonry > * { margin-top: 0 !important; }
  .card--s .card__excerpt { display: block; }
  .card--m .card__media img,
  .card--s .card__media img { aspect-ratio: 16 / 11; }
}

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

/* ============================================================
   10. LOT BAND — category archive header
   The archive opens as an oversized skein band: the pillar's
   dye tints the ground, its selvedge runs the full top edge,
   and the specification row reads like a yarn label.
   ============================================================ */
.lot-band {
  position: relative;
  margin-inline: calc(var(--gutter) * -1);
  padding: clamp(2.75rem, 6vw, 5.5rem) var(--gutter) clamp(2rem, 5vw, 4rem);
  background: color-mix(in srgb, var(--dye) 9%, var(--paper-deep));
}

.lot-band::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 9px;
  background: repeating-linear-gradient(
    90deg,
    var(--dye) 0 4px,
    color-mix(in srgb, var(--dye) 45%, var(--paper)) 4px 7px
  );
}

.lot-band__over {
  margin: 0;
  font-family: var(--utility);
  font-size: 0.6875rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.lot-band__title {
  margin: 0.4rem 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(3rem, 9vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
}

/* the dye signs the title: its full stop is set in the lot color */
.lot-band__title .dot { color: var(--dye); }

.lot-band__tagline {
  margin: 0.9rem 0 0;
  font-style: italic;
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  color: var(--dye);
}

.lot-band__spec {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.4rem;
  margin: 1.6rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid color-mix(in srgb, var(--dye) 35%, var(--thread));
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.lot-band__spec .swatch {
  width: 0.7rem;
  height: 0.7rem;
  background: var(--dye);
}

.lot-band__desc {
  max-width: var(--measure);
  margin: 1.4rem 0 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

/* compact masthead used on archive & interior pages */
.masthead--compact .masthead__title {
  padding-block: clamp(0.9rem, 2vw, 1.5rem);
  font-size: clamp(2rem, 5vw, 3.5rem);
}

/* current pillar in the nav gets a filled, dyed state */
.pillar-nav a[aria-current="page"] {
  background: var(--dye);
  color: var(--paper);
}
.pillar-nav a[aria-current="page"] span { color: color-mix(in srgb, var(--paper) 75%, var(--dye)); }
.pillar-nav a[aria-current="page"]::before { background: var(--paper); }

/* ============================================================
   11. PAGINATION & EMPTY STATE
   ============================================================ */
.lot-pagination {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.4rem;
  margin-bottom: clamp(2rem, 5vw, 4rem);
  border-top: 1px solid var(--ink);
  font-family: var(--utility);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.lot-pagination a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--dye);
}

.lot-pagination .nav-next { margin-left: auto; text-align: right; }

.lot-empty {
  padding-block: clamp(3rem, 8vw, 6rem);
  text-align: center;
}

.lot-empty h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.lot-empty p {
  margin: 0.8rem auto 0;
  max-width: 30em;
  font-style: italic;
  color: var(--ink-soft);
}

@media (max-width: 680px) {
  .lot-band__spec { gap: 0.5rem 1rem; }
}

/* ============================================================
   12. ARTICLE — the lot band continues into the reading page
   ============================================================ */
.lot-band--article { padding-bottom: clamp(1.8rem, 4vw, 3rem); }

.lot-band--article .lot-band__title {
  max-width: 16em;
  font-size: clamp(2.4rem, 5.5vw, 4.75rem);
  line-height: 1.0;
  text-wrap: balance;
}

.article-standfirst {
  max-width: 30em;
  margin: 1.1rem 0 0;
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  font-style: italic;
  color: var(--ink-soft);
}

/* the featured image runs flush beneath the band, full bleed */
.plate {
  margin: 0 calc(var(--gutter) * -1);
}

.plate img {
  width: 100%;
  height: auto;
  display: block;
}

.plate figcaption {
  padding: 0.8rem var(--gutter) 0;
  font-family: var(--utility);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ============================================================
   13. PROSE — long-form typography
   ============================================================ */
.prose {
  max-width: 68ch;
  margin: clamp(2.5rem, 6vw, 4.5rem) auto 0;
  font-size: 1.125rem;
  line-height: 1.7;
}

.prose > p { margin: 0 0 1.4em; }

/* the drop cap wears the dye */
.prose > p:first-child::first-letter {
  float: left;
  font-family: var(--display);
  font-weight: 500;
  font-size: 4.4em;
  line-height: 0.78;
  padding: 0.04em 0.12em 0 0;
  color: var(--dye);
}

.prose h2,
.prose h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.12;
  margin: 2em 0 0.6em;
}

.prose h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.prose h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.15em;
  text-decoration-color: var(--dye);
}

.prose a:hover { color: var(--dye); }

/* pull quotes wear the selvedge */
.prose blockquote {
  position: relative;
  margin: 2.2em 0;
  padding: 0.2em 0 0.2em 1.6rem;
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.45;
}

.prose blockquote::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 9px;
  background: repeating-linear-gradient(
    180deg,
    var(--dye) 0 4px,
    color-mix(in srgb, var(--dye) 45%, var(--paper)) 4px 7px
  );
}

.prose blockquote cite {
  display: block;
  margin-top: 0.7em;
  font-family: var(--utility);
  font-style: normal;
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.prose figure { margin: 2.2em 0; }
.prose figure img { width: 100%; height: auto; display: block; }

.prose figcaption {
  padding-top: 0.7rem;
  font-family: var(--utility);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.prose ul,
.prose ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--dye); }

/* a section break is a dye swatch */
.prose hr {
  width: 0.7rem;
  height: 0.7rem;
  margin: 2.6em auto;
  border: 0;
  background: var(--dye);
}

/* Gutenberg wide/full alignments */
.prose .alignwide { margin-inline: calc((68ch - 90vw) / 2); max-width: 90vw; }
.prose .alignfull { margin-inline: calc(50% - 50vw); max-width: 100vw; }

/* the end mark: a magazine-style closing swatch */
.endmark {
  max-width: 68ch;
  margin: 0 auto;
}

.endmark::after {
  content: "";
  display: block;
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 1rem;
  background: var(--dye);
}

/* ============================================================
   14. ARTICLE END MATTER — tags, adjacent posts, related lot
   ============================================================ */
.article-tags {
  max-width: 68ch;
  margin: 2.2rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.article-tags a {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--thread);
  font-family: var(--utility);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.article-tags a:hover {
  border-color: var(--dye);
  color: var(--dye);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-block: 1.6rem;
  border-top: 1px solid var(--ink);
}

.post-nav__label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.post-nav__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.15;
}

.post-nav a:hover .post-nav__title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.14em;
  text-decoration-color: var(--dye);
}

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

/* related: three cards from the same dye lot */
.lot-related {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem) var(--gutter);
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

.lot-related > .card { grid-column: span 1; }
.lot-related .card__media img { aspect-ratio: 4 / 5; }

@media (max-width: 1080px) {
  .prose .alignwide { margin-inline: 0; max-width: 100%; }
}

@media (max-width: 680px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav__next { text-align: left; }
  .lot-related { grid-template-columns: 1fr; }
}

/* ============================================================
   15. SEARCH & 404 — the undyed pages
   Search results and errors cross all four lots, so they run
   in ink: --dye falls back to its default and the lot band,
   dot, and swatches render undyed. Thematically: raw fleece.
   ============================================================ */
.search-form {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  max-width: 34em;
  margin-top: 1.6rem;
  border-bottom: 2px solid var(--ink);
}

.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0;
  background: transparent;
  border: 0;
  font-family: var(--body);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink);
}

.search-form input[type="search"]::placeholder { color: var(--ink-soft); }

.search-form input[type="search"]:focus-visible {
  outline: 2px solid var(--dye, var(--ink));
  outline-offset: 3px;
}

.search-form button {
  border: 0;
  padding: 0 1.4rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}

.search-form button:hover { background: var(--dye); }

/* 404: the dropped stitch */
.dropped-stitch {
  padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 5vw, 4rem);
}

.dropped-stitch__over {
  margin: 0;
  font-family: var(--utility);
  font-size: 0.6875rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.dropped-stitch__title {
  margin: 0.4rem 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.8rem, 8vw, 6.5rem);
  line-height: 1.0;
  letter-spacing: -0.01em;
  max-width: 14em;
  text-wrap: balance;
}

.dropped-stitch__title .dot { color: var(--dye); }

.dropped-stitch__copy {
  max-width: 32em;
  margin: 1.2rem 0 0;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-soft);
}

@media (max-width: 680px) {
  .search-form { flex-direction: column; border-bottom: 0; gap: 0.9rem; }
  .search-form input[type="search"] { border-bottom: 2px solid var(--ink); }
  .search-form button { padding: 0.8rem 1.4rem; }
}

/* ============================================================
   16. THE WORKBASKET — works in progress (custom post type)
   A fifth dye lot: Logwood, the natural purple. Projects carry
   a specification sheet, a maker-credit panel, and a progress
   bar built from the same grosgrain as the selvedges — the
   ribbon literally fills as the project grows.
   ============================================================ */
:root { --dye-logwood: #55405E; }
.pillar--workbasket { --dye: var(--dye-logwood); }

/* progress bar: the selvedge, filling */
.progress { margin-top: 0.9rem; }

.progress__label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.progress__label b { font-weight: 500; color: var(--dye); }

.progress__track {
  height: 12px;
  background: var(--paper-deep);
  border: 1px solid var(--thread);
}

.progress__fill {
  height: 100%;
  max-width: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--dye) 0 4px,
    color-mix(in srgb, var(--dye) 45%, var(--paper)) 4px 7px
  );
}

/* project cards */
.card__byline {
  margin: 0.5rem 0 0;
  font-style: italic;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

.card__yarn {
  margin: 0.35rem 0 0;
  font-family: var(--utility);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.workbasket-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2.5rem, 5vw, 4rem) var(--gutter);
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3rem, 7vw, 6rem);
}

.workbasket-grid > .card { grid-column: span 1; }
.workbasket-grid .card__media img { aspect-ratio: 4 / 5; }

/* the specification sheet: a pattern band as a table */
.spec-sheet {
  max-width: 68ch;
  margin: clamp(2.5rem, 6vw, 4rem) auto 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.spec-sheet__head {
  margin: 0;
  padding: 1rem 0 0.9rem;
  border-bottom: 1px solid var(--thread);
  font-family: var(--utility);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.spec-sheet dl { margin: 0; }

.spec-sheet .spec-row {
  display: grid;
  grid-template-columns: 11em 1fr;
  gap: var(--gutter);
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--thread);
}

.spec-sheet .spec-row:last-child { border-bottom: 0; }

.spec-sheet dt {
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 0.2em;
}

.spec-sheet dd {
  margin: 0;
  font-size: 1.05rem;
}

.spec-sheet dd a {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.15em;
  text-decoration-color: var(--dye);
}

.spec-sheet dd a:hover { color: var(--dye); }

/* showcasing the maker: the credit panel */
.creator-credit {
  position: relative;
  max-width: 68ch;
  margin: clamp(1.8rem, 4vw, 2.5rem) auto 0;
  padding: 1.6rem 1.6rem 1.7rem 2rem;
  background: color-mix(in srgb, var(--dye) 7%, var(--paper-deep));
}

.creator-credit::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 9px;
  background: repeating-linear-gradient(
    180deg,
    var(--dye) 0 4px,
    color-mix(in srgb, var(--dye) 45%, var(--paper)) 4px 7px
  );
}

.creator-credit__over {
  margin: 0;
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.creator-credit__name {
  margin: 0.4rem 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.1;
}

.creator-credit__pattern {
  margin: 0.4rem 0 0;
  font-style: italic;
  color: var(--ink-soft);
}

.creator-credit__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  margin-top: 1rem;
}

.creator-credit__links a {
  font-family: var(--utility);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  text-decoration-color: var(--dye);
}

.creator-credit__links a:hover { color: var(--dye); }

/* single-project: give the band its own progress readout */
.lot-band .progress { max-width: 30em; margin-top: 1.4rem; }

@media (max-width: 1080px) {
  .workbasket-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .workbasket-grid { grid-template-columns: 1fr; }
  .spec-sheet .spec-row { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* ============================================================
   17. THE PATTERN LEDGER — v0 of the Concierge (no AI)
   A filterable index of every pattern the magazine has touched.
   The Ledger crosses all lots, so like search it runs undyed —
   ink on flax — while each entry's craft chip carries color.
   ============================================================ */

/* filter bar: a specification row you can operate */
.ledger-filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 1.6rem;
}

.ledger-filters label {
  display: block;
  font-family: var(--utility);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.ledger-filters select {
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--ink);
}

.ledger-filters select:focus-visible {
  outline: 2px solid var(--dye, var(--ink));
  outline-offset: 2px;
}

.ledger-filters button {
  border: 0;
  padding: 0.7rem 1.3rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}

.ledger-filters button:hover { background: var(--dye, var(--ink)); }

.ledger-filters .ledger-reset {
  align-self: center;
  padding-bottom: 0.7rem;
  font-family: var(--utility);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.ledger-count {
  margin: 1.8rem 0 0;
  font-style: italic;
  color: var(--ink-soft);
}

/* term chips on cards and singles */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.chips span,
.chips a {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--thread);
  font-family: var(--utility);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.chips a:hover { border-color: var(--dye); color: var(--dye); }

/* external "view pattern" link on ledger cards */
.card__external {
  display: inline-block;
  margin-top: 0.8rem;
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  text-decoration-color: var(--dye);
}

.card__external:hover { color: var(--dye); }

@media (max-width: 1080px) {
  .ledger-filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .ledger-filters { grid-template-columns: 1fr; }
  .ledger-filters button { width: 100%; }
}
