/* ==========================================================================
   WEIHANGJI — layout layer (international editorial grid)
   Loads AFTER style.css on inner pages only. This file changes LAYOUT ONLY:
   grid density, vertical rhythm, card anatomy, table density, focus states.
   It does not change colour, typeface or copy — those belong to the visual layer.
   ========================================================================== */

/* ---------- 1. Page header: more air, tighter measure ---------------------- */
.page-head{
  padding-block:clamp(72px,7vw,112px) clamp(40px,4.2vw,68px);
}
.page-head__inner{
  grid-template-columns:minmax(0,7fr) minmax(0,5fr);
  gap:clamp(32px,4vw,64px);
  align-items:end;
}
.page-head .h1{text-wrap:balance}
.page-head .lead{max-width:54ch}
.page-head__meta{gap:0}
.page-head__meta div{padding:13px 0}
.page-head__meta strong{font-variant-numeric:tabular-nums}

/* ---------- 2. Vertical rhythm -------------------------------------------- */
.section{padding-block:clamp(72px,8vw,128px)}
.section--tight{padding-block:clamp(60px,6vw,104px)}
.sec-head{margin-bottom:clamp(40px,4.5vw,72px)}
.sec-head .h2{text-wrap:balance;max-width:26ch}

/* ---------- 3. Filter bar: one readable band ------------------------------ */
.filters{
  display:flex;flex-wrap:wrap;align-items:flex-end;
  gap:16px 20px;padding:22px 0;margin-bottom:clamp(28px,3vw,44px);
}
.filter{flex:1 1 148px;min-width:0}
.filter label{font-size:9px;letter-spacing:.16em}
.filter select{height:44px;width:100%}
/* 'Weight: high to low' rendered 136.8px inside 131px of space and was cut to
   'Weight: high to lo'. Tighter right padding plus 11.5px mono leaves 4px spare. */
.filter select{padding:0 16px 0 8px;font-size:11px}
.filters__count{margin-left:auto;padding-bottom:14px;font-variant-numeric:tabular-nums}
.filters__clear{padding-bottom:14px}

/* ---------- 4. Grid density: three across, not four ----------------------- */
/* Four 260px cards read as a marketplace listing. Three 349px cards read as
   a line sheet. This is the single largest change in perceived quality. */
.product-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:40px 28px}
@media (max-width:1099px){
  .product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:36px 24px}
}
@media (max-width:640px){
  .product-grid{grid-template-columns:1fr;gap:34px}
}

/* ---------- 5. Card anatomy: no box, hairline-led spec list --------------- */
.p-card{
  background:transparent;border:0;border-radius:0;
}
.p-card:hover{border-color:transparent}
.p-card__media{background:#F2F1ED}
.p-card__media img{object-position:center 42%}
.p-card__flash{top:12px;left:12px;padding:5px 8px;font-size:9px;letter-spacing:.12em}

.p-card__body{padding:18px 0 0;gap:0}
.p-card__top{padding-bottom:11px;border-bottom:1px solid var(--hairline)}
.p-card__code{letter-spacing:.1em}
/* Fixed two-line slots so the spec rows line up across a row of cards.
   Uneven card bottoms are the loudest "marketplace listing" tell. */
.p-card__title{
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
  margin:15px 0 7px;min-height:2.56em;
  font-size:17px;line-height:1.28;letter-spacing:-.012em;
  text-wrap:balance;
}
.p-card__meta{
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
  min-height:3.1em;margin-bottom:16px;font-size:12.5px;line-height:1.55;
}

/* 2x2 cramped cells -> four aligned label/value rows */
.p-card__specs{
  display:block;margin-top:auto;padding-top:0;
  border-top:0;
}
.p-card__specs div{
  display:flex;align-items:baseline;justify-content:space-between;gap:16px;
  padding:9px 0;border-bottom:1px solid var(--hairline);
}
.p-card__specs span{font-size:9.5px;letter-spacing:.13em}
.p-card__specs strong{
  font-size:12.5px;font-variant-numeric:tabular-nums;text-align:right;
}
.p-card .link-arrow{margin-top:18px}
.p-card:hover .p-card__title{text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:1px}

/* CTA tile keeps its panel — it is a deliberate interruption, not a product */
.p-card--cta{
  padding:36px 28px;border:1px solid var(--hairline-2);background:var(--ink-800);
  align-self:stretch;
}
.p-card--cta:hover{border-color:rgba(27,40,54,.34)}

/* Spec-only cards (catalog lines quoted by enquiry) need the panel back */
.p-card__media--spec{background:linear-gradient(160deg,#F4F3EF 0%,#E8E6E1 100%)}

/* ---------- 6. Tables: line-sheet density with breathing room -------------- */
table{min-width:820px}
caption{padding:18px 20px}
th{padding:16px 20px}
td{padding:16px 20px}
td:first-child{white-space:nowrap}
tbody tr{transition:background-color 120ms linear}
tbody tr:hover{background:rgba(27,40,54,.035)}

/* ---------- 7. Line cards (collections index): same system as p-cards ----- */
/* home-visual.css carries these rules but is only linked from index.html,
   so on collections the plate was unstyled and its number badge escaped to
   the top of the document. Defined here so collections stands on its own. */
.line-card{background:transparent;border:0}
.line-card:hover{border-color:transparent}
/* Landscape plates: an index page needs chapter tiles, not four full portraits.
   At 2-up, 4:5 made each tile 672px tall and the spec plates were mostly void. */
.line-card__media{aspect-ratio:3/2}
.line-card--spec .line-card__plate{
  position:relative;display:flex;flex-direction:column;justify-content:flex-start;
  aspect-ratio:3/2;padding:26px;gap:14px;
  background:
    repeating-linear-gradient(0deg,transparent 0 38px,rgba(27,40,54,.045) 38px 39px),
    linear-gradient(160deg,#F8F7F4 0%,#EDEAE4 100%);
}
.line-card--spec .line-card__no{
  position:static;align-self:flex-start;background:none;padding:0;color:var(--bone-400);
}
.line-card--spec .line-card__plate .micro{margin-top:14px}
.spec-list{display:flex;flex-direction:column}
.spec-list div{
  display:flex;align-items:baseline;justify-content:space-between;gap:12px;
  padding:9px 0;border-bottom:1px solid var(--hairline);
}
.spec-list div:last-child{border-bottom:0}
.spec-list span{font-family:var(--font-mono);font-size:12px;color:var(--bone-050)}
.spec-list em{font-style:normal;font-size:11px;line-height:1.4;color:var(--bone-400);text-align:right}
.line-card__body{padding:18px 0 0}
.line-card__title{font-size:19px;line-height:1.25;letter-spacing:-.01em;text-wrap:balance}
.line-card__text{font-size:13.5px;line-height:1.6}

/* ---------- 8. Focus and interaction polish -------------------------------- */
:focus-visible{outline:2px solid #1B2836;outline-offset:3px}
.btn:focus-visible,.filter select:focus-visible{outline-offset:2px}
.btn{transition:background-color var(--dur-fast) var(--ease),color var(--dur-fast) var(--ease),border-color var(--dur-fast) var(--ease)}

/* ---------- 8. Mobile: keep the filter band usable ------------------------- */
@media (max-width:700px){
  .filters{flex-wrap:nowrap;overflow-x:auto;gap:12px;padding:16px 0 18px;scrollbar-width:none}
  .filters::-webkit-scrollbar{display:none}
  .filter{flex:0 0 148px}
  .filters__count{margin-left:0;padding-bottom:14px;white-space:nowrap}
  .page-head__inner{grid-template-columns:1fr;gap:28px}
  .p-card__title{font-size:16.5px}
}

/* Native inputs carry a default intrinsic width (~20 characters). Inside a
   single-column mobile grid that forced the track to 356.78px inside a 335px
   container and pushed the whole form 2px past the viewport. */
.field input,
.field select,
.field textarea{min-width:0}
/* A textarea's default cols gives it a ~356px intrinsic width; as a grid item the
   field's automatic minimum then exceeds a 335px mobile container. */
.field{min-width:0}