/* Articles index and category pages in the Signature design (docs/SIGNATURE-PAGES.md) */
html[data-look="signature"]{
  /* Head: title, sub line, Book a call */
  .jn-top .s-head{margin-bottom:1.5rem}
  .jn-back{margin-bottom:0.5rem}
  .jn-back a{display:inline-block;padding-block:0.375rem;color:inherit}
  .jn-back a:hover{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:0.18em}

  /* Topic chips (links styled as the shared .s-chips buttons), then Client stories */
  .jn-nav{display:flex;flex-wrap:wrap;align-items:center;gap:1rem 1.5rem}
  .jn-chips{min-width:0;max-width:100%}
  .jn-chips a{display:inline-flex;align-items:center;justify-content:center;max-width:100%;min-height:2.375rem;padding:0 1rem;border:1px solid var(--rule);border-radius:999px;background:#fff;color:var(--ink);font:500 0.875rem/1 var(--sans);text-decoration:none;white-space:nowrap;transition:background .25s,color .25s,border-color .25s}
  .jn-chips a:hover{border-color:var(--ink)}
  .jn-chips a[aria-current=page]{background:var(--ink);color:#fff;border-color:var(--ink)}

  /* The latest article; its picture column is capped at 48rem so it is never shown wider than 768 pixels */
  .jn-feature{display:grid;grid-template-columns:min(48rem,100% * 1.1 / 2.1) minmax(0,1fr);margin-top:3rem;overflow:hidden;border-radius:var(--r-lg);background:#fff;color:var(--ink)}
  .jn-feature-ph{display:block;overflow:hidden;aspect-ratio:3/2;background:var(--stone)}
  .jn-feature-ph img{display:block;width:100%;height:100%;object-fit:cover}
  .jn-feature:hover .jn-feature-ph img{transform:scale(1.04)}
  .jn-feature-t{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;padding:clamp(1.5rem,4vw,3.5rem)}
  .jn-feature .s-eyebrow{margin-bottom:0.75rem}
  .jn-feature-h{margin:0;font:300 clamp(1.75rem,3vw,2.75rem)/1.1 var(--serif);letter-spacing:-.02em;text-wrap:balance}
  .jn-feature:hover .jn-feature-h{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:0.18em}
  .jn-feature .jn-date{margin-top:1rem}
  .jn-feature .s-more{margin-top:1.5rem}

  .jn-date{display:block;font-size:0.875rem;color:var(--mid)}

  /* Cards: the same values as the shared "Keep reading" cards (.ar-cards) */
  .jn-cards{--jn-row-gap:clamp(1.75rem,3vw,2.75rem);--jn-col-gap:clamp(1rem,2vw,1.75rem);display:grid;grid-template-columns:minmax(0,1fr);gap:var(--jn-row-gap) var(--jn-col-gap);margin:0;padding:0;list-style:none}
  .jn-card>a{display:flex;flex-direction:column;height:100%;color:var(--ink)}
  .jn-card-ph{display:block;overflow:hidden;margin-bottom:1.125rem;aspect-ratio:3/2;border-radius:var(--r-lg);background:var(--stone)}
  .jn-card-ph img{display:block;width:100%;height:100%;object-fit:cover}
  .jn-card>a:hover .jn-card-ph img{transform:scale(1.04)}
  .jn-card .s-eyebrow{margin-bottom:0.5rem}
  .jn-card-h{margin:0;font:300 clamp(1.375rem,1.9vw,1.75rem)/1.15 var(--serif);letter-spacing:-.012em;text-wrap:balance}
  .jn-card>a:hover .jn-card-h{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:0.18em}
  .jn-card .jn-date{margin-top:0.625rem}

  /* Text card: no picture (or one too small to show), so the title sits on a stone panel; it grows rather than clips */
  .jn-card-panel{display:flex;flex-direction:column;justify-content:space-between;gap:1.5rem;margin-bottom:1.125rem;padding:1.5rem;aspect-ratio:3/2;border-radius:var(--r-lg);background:var(--stone)}
  .jn-card-panel .s-eyebrow{margin-bottom:0}
  .jn-card-panel .jn-card-h{margin-top:auto}
  .jn-card-t .jn-date{margin-top:0}

  /* Show more articles */
  .jn-more-row{display:flex;justify-content:center;margin-top:3rem}
  .jn-more-row[hidden]{display:none}
  .jn-more{height:3rem;padding:0 1.75rem;border:1px solid var(--ink);border-radius:999px;background:#fff;color:var(--ink);font:500 0.9375rem/1 var(--sans);cursor:pointer}
  .jn-more:hover,.jn-more:focus-visible{background:var(--ink);color:#fff}

  @media (prefers-reduced-motion:no-preference){
    .jn-feature-ph img,.jn-card-ph img{transition:transform 1s cubic-bezier(.16,1,.3,1)}
    .jn-more{transition:background .25s,color .25s}
  }

  /* Large text on a phone (see look-signature.css): a long topic wraps inside its chip, and titles step down so no word breaks */
  @media (max-width:17.5em){
    .jn-chips a{padding:0.5rem 0.625rem;line-height:1.2;white-space:normal;text-align:center}
    .jn-feature-t{padding:1rem}
    .jn-card-panel{padding:1rem 0.5rem}
    .jn-card-panel .jn-card-h{font-size:clamp(1rem,8.5vw,1.5rem)}
    .jn-feature-h,.jn-card-h{font-size:clamp(1.0625rem,10vw,1.5rem);line-height:1.15}
    .jn-more{height:auto;min-height:3rem;padding:0.5rem 1.25rem;line-height:1.2}
  }

  @media (max-width:47.99em){
    .jn-feature{grid-template-columns:minmax(0,1fr)}
    .jn-feature-t{padding:1.5rem}
  }

  /* Two across. The list ends deliberately: one card left over becomes a full-width row */
  @media (min-width:35em) and (max-width:56.24em){
    .jn-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
    .jn-card:last-child:nth-child(odd){grid-column:1/-1}
    .jn-card:not(.jn-card-t):last-child:nth-child(odd)>a{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:1fr auto auto auto 1fr;column-gap:var(--jn-col-gap);align-content:center}
  }

  /* Three across on a six-track grid, so the end of the list can be a lone row or a pair of halves */
  @media (min-width:56.25em){
    .jn-cards{grid-template-columns:repeat(6,minmax(0,1fr))}
    .jn-card{grid-column:span 2}
    .jn-card:last-child:nth-child(3n+1){grid-column:1/-1}
    .jn-card:not(.jn-card-t):last-child:nth-child(3n+1)>a{display:grid;grid-template-columns:calc((100% - 2 * var(--jn-col-gap)) / 3) minmax(0,1fr);grid-template-rows:1fr auto auto auto 1fr;column-gap:var(--jn-col-gap);align-content:center}
    .jn-card:not(.jn-card-t):last-child:nth-child(3n+1) .jn-card-h{font-size:clamp(1.75rem,2.6vw,2.5rem);max-width:22em}
    .jn-card:nth-last-child(2):nth-child(3n+1),.jn-card:last-child:nth-child(3n+2){grid-column:span 3}
    .jn-card:not(.jn-card-t):nth-last-child(2):nth-child(3n+1)>a,.jn-card:not(.jn-card-t):last-child:nth-child(3n+2)>a{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:1fr auto auto auto 1fr;column-gap:1.5rem;align-content:center}
  }

  /* Horizontal end rows: picture on the left across every row, eyebrow, title and date grouped in the middle on the right */
  @media (min-width:35em) and (max-width:56.24em){
    .jn-card:not(.jn-card-t):last-child:nth-child(odd)>a{
      >.jn-card-ph{grid-column:1;grid-row:1/-1;margin-bottom:0;align-self:center}
      >:not(.jn-card-ph){grid-column:2}
      >.s-eyebrow{grid-row:2}
      >.jn-card-h{grid-row:3}
      >.jn-date{grid-row:4}
    }
  }
  @media (min-width:56.25em){
    :is(.jn-card:last-child:nth-child(3n+1),.jn-card:nth-last-child(2):nth-child(3n+1),.jn-card:last-child:nth-child(3n+2)):not(.jn-card-t)>a{
      >.jn-card-ph{grid-column:1;grid-row:1/-1;margin-bottom:0;align-self:center}
      >:not(.jn-card-ph){grid-column:2}
      >.s-eyebrow{grid-row:2}
      >.jn-card-h{grid-row:3}
      >.jn-date{grid-row:4}
    }
  }
  /* A text card at the end spans the same columns but stays upright, without the fixed ratio */
  @media (min-width:35em) and (max-width:56.24em){
    .jn-card-t:last-child:nth-child(odd) .jn-card-panel{aspect-ratio:auto;min-height:10rem}
  }
  @media (min-width:56.25em){
    .jn-card-t:last-child:nth-child(3n+1) .jn-card-panel,.jn-card-t:nth-last-child(2):nth-child(3n+1) .jn-card-panel,.jn-card-t:last-child:nth-child(3n+2) .jn-card-panel{aspect-ratio:auto;min-height:10rem}
  }

  /* Sort, and search on the long lists. Shown by sig-journal.js only: with scripts off the list is simply newest first */
  .jn-tools{display:flex;gap:0.75rem;align-items:center;justify-content:flex-end;margin-top:1.25rem}
  .jn-tools[hidden],.jn-sort[hidden],.jn-clear[hidden],.jn-result[hidden],.jn-cards[hidden]{display:none}
  .jn-sort{appearance:none;-webkit-appearance:none;flex:none;max-width:100%;height:2.375rem;margin:0;padding:0 2.25rem 0 1rem;border:1px solid var(--rule);border-radius:999px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%23212121' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat right 1rem center/0.6875rem auto;color:var(--ink);font:500 0.875rem/1 var(--sans);cursor:pointer}
  .jn-sort:hover{border-color:var(--ink)}
  /* Sort alone (short lists): it shares a row with Client stories, under the topics */
  .jn-nav .jn-sort{margin-left:auto}
  .jn-nav:has(.jn-sort:not([hidden])) .jn-chips{flex-basis:100%}
  .jn-search{position:relative;flex:1 1 auto;min-width:0;max-width:26rem;margin-right:auto}
  .jn-search input{appearance:none;-webkit-appearance:none;display:block;width:100%;height:2.375rem;margin:0;padding:0 2.5rem;border:1px solid var(--rule);border-radius:999px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23212121' stroke-width='1.3'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E") no-repeat 0.875rem center/1rem auto;color:var(--ink);font:400 1rem/1.2 var(--sans)}
  .jn-search input::placeholder{color:var(--mid);opacity:1}
  .jn-search input::-webkit-search-cancel-button,.jn-search input::-webkit-search-decoration{-webkit-appearance:none;appearance:none}
  .jn-search input:hover,.jn-search input:focus{border-color:var(--ink)}
  .jn-clear{position:absolute;top:0;right:0;display:grid;place-items:center;width:2.375rem;height:2.375rem;padding:0;border:0;border-radius:999px;background:none;color:var(--ink);cursor:pointer}
  .jn-clear svg{width:0.75rem;height:0.75rem}
  /* While the list is sorted or searched the latest-article card steps aside, so the stone band closes up */
  .jn-top[data-jn-plain]{padding-bottom:clamp(2rem,4vw,3rem)}
  .jn-top[data-jn-plain]+.jn-list{padding-top:clamp(2rem,4vw,3rem)}
  .jn-result{margin:0 0 1.5rem;font-size:0.875rem;color:var(--mid)}
  .jn-result[data-none]{margin:0;font-size:1.0625rem}
  @media (max-width:23em){
    .jn-nav:has(.jn-sort:not([hidden])){column-gap:0.5rem}
    .jn-tools{flex-wrap:wrap}
    .jn-search{flex-basis:100%;max-width:none}
  }
  @media (max-width:17.5em){
    .jn-sort{padding:0 1.5rem 0 0.5rem;background-position:right 0.5rem center;font-size:0.75rem}
    .jn-search input{padding-left:0.75rem;background-image:none;font-size:0.75rem}
    .jn-search input:placeholder-shown{padding-right:0.5rem}
  }
}
