/* The Closetboard Journal. Built on the site's styles.css (fonts, colours,
   nav, buttons, boards, tape and stickers); this adds the Journal's home,
   category pages and articles: an editorial page in the same black and
   white, with real outfit boards for pictures. */

.j-page {
  background: var(--bg);
}

/* Tilted boards, tape and stickers never push the page sideways. */
.j-page main {
  overflow-x: clip;
}

/* Reading progress, just under the nav. */
.j-progress {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--nav-h);
  z-index: 49;
  height: 2px;
  pointer-events: none;
}

.j-progress span {
  display: block;
  height: 100%;
  background: var(--ink);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  font-size: 12px;
  color: var(--ink-2);
}

.crumbs a {
  text-decoration: none;
}

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

/* ---------- the Journal's home and categories ---------- */

.j-hero {
  padding-top: calc(var(--nav-h) + clamp(48px, 7vw, 96px));
}

.j-title {
  font-size: clamp(60px, 10vw, 148px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
}

.j-title i {
  font-style: italic;
}

.j-deck {
  margin: 0;
  max-width: 54ch;
  color: var(--ink-2);
  font-size: clamp(17px, 1.6vw, 20px);
}

.j-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
}

.j-chips a {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  text-decoration: none;
  font-size: 12.5px;
  transition: background 0.2s, color 0.2s;
}

.j-chips a:hover {
  background: var(--soft-2);
}

.j-chips a.on {
  background: var(--black);
  color: #fff;
}

.j-h2 {
  font-size: clamp(40px, 4.6vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.j-start {
  padding-top: clamp(56px, 7vw, 96px);
}

.j-start .j-h2 {
  margin-bottom: 28px;
}

.j-start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px 24px;
}

.j-cat {
  padding-top: clamp(64px, 8vw, 110px);
}

.j-cat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.j-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 36px 22px;
}

/* A card: the article's outfit on a board, pinned on a soft panel. */
.j-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
}

.j-card-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1.02;
  border-radius: 22px;
  background: var(--soft);
  margin-bottom: 8px;
  overflow: hidden;
}

.j-card.big .j-card-media {
  aspect-ratio: 4 / 3.4;
}

.j-board {
  width: 64%;
  transform: rotate(-2.5deg);
  box-shadow: 0 0 0 1px var(--line), 0 22px 40px -22px rgba(0, 0, 0, 0.35);
  transition: transform 0.6s var(--spring), box-shadow 0.4s;
}

.j-card.big .j-board {
  width: 52%;
}

.j-card:nth-child(even) .j-board {
  transform: rotate(2deg);
}

.j-card:hover .j-board {
  transform: rotate(0) translateY(-6px) scale(1.03);
  box-shadow: 0 0 0 1px var(--line), 0 30px 50px -24px rgba(0, 0, 0, 0.4);
}

.j-board .tape {
  width: 44px;
  height: 13px;
}

.j-board .tape.l {
  left: -11px;
  top: 7px;
}

.j-board .tape.r {
  right: -11px;
  top: 7px;
}

.j-card-cat {
  font-size: 11px;
  color: var(--ink-2);
}

.j-card-title {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.06;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.j-card.big .j-card-title {
  font-size: 31px;
}

.j-card:hover .j-card-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.j-card-deck {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.45;
}

.j-card-meta {
  font-size: 11px;
  color: var(--ink-3);
}

/* ---------- articles ---------- */

.a-head {
  padding-top: calc(var(--nav-h) + clamp(40px, 6vw, 80px));
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.a-title {
  font-size: clamp(44px, 5.6vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 22px;
  max-width: 17ch;
  text-wrap: balance;
}

.a-deck {
  margin: 0 0 22px;
  max-width: 46ch;
  color: var(--ink-2);
  font-size: clamp(18px, 1.7vw, 21px);
  line-height: 1.45;
}

.a-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  font-size: 12px;
  color: var(--ink-2);
}

.a-head-board {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

.hero-board {
  width: min(360px, 100%);
  transform: rotate(2.5deg);
  box-shadow: 0 0 0 1px var(--line), 0 40px 70px -40px rgba(0, 0, 0, 0.45);
}

.hero-board .sticker {
  width: 78px;
  height: 78px;
  font-size: 10px;
}

.a-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 700px);
  justify-content: center;
  gap: clamp(40px, 6vw, 88px);
  padding-top: clamp(40px, 6vw, 80px);
  padding-bottom: clamp(56px, 7vw, 96px);
}

/* The table of contents: beside the article on wide screens, a card above it on small ones. */
.a-toc {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
  align-self: start;
  font-size: 14px;
}

.a-toc summary {
  list-style: none;
  cursor: default;
  font-size: 11.5px;
  color: var(--ink-2);
  margin-bottom: 12px;
}

.a-toc summary::-webkit-details-marker {
  display: none;
}

.a-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
  display: grid;
  gap: 2px;
}

.a-toc li {
  counter-increment: toc;
}

.a-toc a {
  display: flex;
  gap: 10px;
  padding: 6px 0 6px 12px;
  border-left: 2px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
  line-height: 1.35;
  transition: color 0.2s, border-color 0.2s;
}

.a-toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 11px;
  padding-top: 2px;
  color: var(--ink-3);
}

.a-toc a:hover,
.a-toc a[aria-current='true'] {
  color: var(--ink);
  border-color: var(--ink);
}

.a-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 11.5px;
  color: var(--ink-2);
}

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

.a-share svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 1099px) {
  .a-layout {
    grid-template-columns: minmax(0, 700px);
  }

  .a-toc {
    position: static;
    background: var(--soft);
    border-radius: 18px;
    padding: 16px 20px;
  }

  .a-toc summary {
    cursor: pointer;
    margin: 0;
    display: flex;
    justify-content: space-between;
  }

  .a-toc summary::after {
    content: '+';
    font-size: 16px;
    font-weight: 400;
    font-stretch: 100%;
    line-height: 1;
  }

  .a-toc details[open] summary {
    margin-bottom: 12px;
  }

  .a-toc details[open] summary::after {
    content: '–';
  }

  .a-share {
    margin-top: 14px;
  }
}

/* The writing. */
.a-body {
  font-size: 18px;
  line-height: 1.7;
  color: #1d1d1d;
  min-width: 0;
}

.a-body > p:first-child {
  font-size: 20px;
  line-height: 1.6;
  color: var(--ink);
}

.a-body p {
  margin: 0 0 1.15em;
}

.a-body h2 {
  font-size: clamp(32px, 3.4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.018em;
  margin: 2.1em 0 0.55em;
  scroll-margin-top: calc(var(--nav-h) + 24px);
  text-wrap: balance;
}

.a-body h3 {
  font-family: var(--sans);
  font-weight: 650;
  font-size: 20px;
  line-height: 1.3;
  margin: 1.8em 0 0.45em;
}

.a-body ul,
.a-body ol {
  margin: 0 0 1.3em;
  padding-left: 1.3em;
}

.a-body li {
  margin: 0.45em 0;
  padding-left: 0.2em;
}

.a-body ul li::marker {
  color: var(--ink-3);
}

.a-body ol li::marker {
  font-stretch: 75%;
  font-weight: 700;
  color: var(--ink);
}

.a-body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(11, 11, 11, 0.35);
  transition: text-decoration-color 0.2s;
}

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

.a-body strong {
  font-weight: 650;
  color: var(--ink);
}

.a-body blockquote {
  margin: 1.8em 0;
  padding: 2px 0 2px 24px;
  border-left: 2px solid var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 27px;
  line-height: 1.25;
  color: var(--ink);
}

.a-body blockquote p {
  margin: 0;
}

.a-body .table-wrap {
  margin: 1.6em 0 1.8em;
  overflow-x: auto;
}

.a-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  line-height: 1.45;
}

.a-body th,
.a-body td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--line);
  min-width: 120px;
}

.a-body th {
  font-stretch: 75%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11.5px;
  color: var(--ink-2);
  border-bottom: 2px solid var(--ink);
}

.a-body aside {
  margin: 1.8em 0;
  padding: 22px 24px;
  border-radius: 20px;
  font-size: 16.5px;
  line-height: 1.6;
}

.a-body aside p:last-child {
  margin-bottom: 0;
}

.a-body aside::before {
  display: block;
  margin-bottom: 8px;
  font-stretch: 75%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 11.5px;
}

.a-body .tip {
  background: var(--soft);
}

.a-body .tip::before {
  content: 'Tip';
  color: var(--ink-2);
}

.a-body .app-note {
  background: var(--black);
  color: #e9e9e7;
}

.a-body .app-note::before {
  content: 'In Closetboard';
  color: var(--on-black-2);
}

.a-body .app-note a,
.a-body .app-note strong {
  color: #fff;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

.a-body .app-note .app-note-cta {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-weight: 600;
  text-decoration: none;
}

.a-body .app-note .app-note-cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease);
}

.a-body .app-note .app-note-cta:hover svg {
  transform: translateX(4px);
}

.a-body .takeaways {
  margin: 1.6em 0 2em;
  padding: 22px 24px 18px;
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.takeaways-label {
  margin: 0 0 10px !important;
  font-size: 11.5px;
  color: var(--ink-2);
}

.takeaways ul {
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;
}

.takeaways li {
  display: flex;
  gap: 12px;
  margin: 0 0 10px !important;
  padding: 0 !important;
  font-size: 16.5px;
  line-height: 1.5;
}

.takeaways li svg {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  margin-top: 1px;
}

/* Outfit boards inside the writing. */
.outfit-fig {
  margin: 2.4em auto;
  max-width: 400px;
  text-align: center;
}

.fig-board {
  transform: rotate(-1.5deg);
  box-shadow: 0 0 0 1px var(--line), 0 30px 54px -32px rgba(0, 0, 0, 0.4);
}

.outfit-fig:nth-of-type(even) .fig-board {
  transform: rotate(1.5deg);
}

.outfit-fig figcaption {
  margin: 22px auto 0;
  max-width: 38ch;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* Questions and sources at the end. */
.a-faq {
  margin-top: 3.2em;
}

.a-faq .faq-list {
  border-top: 1px solid var(--line);
}

.a-faq details {
  border-bottom: 1px solid var(--line);
  interpolate-size: allow-keywords;
}

.a-faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.2;
}

.a-faq summary::-webkit-details-marker {
  display: none;
}

.a-faq details::details-content {
  height: 0;
  overflow: clip;
  transition: height 0.4s var(--ease), content-visibility 0.4s allow-discrete;
}

.a-faq details[open]::details-content {
  height: auto;
}

.a-faq .ans p {
  margin: 0;
  padding: 0 48px 22px 0;
  font-size: 17px;
  color: var(--ink-2);
}

.a-sources {
  margin-top: 3em;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

.a-sources h2 {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.07em;
  margin: 0 0 12px;
}

.a-sources ol {
  padding-left: 1.4em;
  margin: 0;
}

.a-sources a {
  color: var(--ink-2);
}

/* ---------- the call to action and related reads ---------- */

.j-cta {
  padding: 0 var(--gutter);
}

.j-cta-in {
  max-width: 1160px;
  margin: 0 auto;
  border-radius: 32px;
  background: var(--black);
  color: #fff;
  text-align: center;
  padding: clamp(48px, 7vw, 88px) 24px;
}

.j-cta .eyebrow {
  justify-content: center;
  color: var(--on-black-2);
}

.j-cta-title {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.j-cta-title i {
  font-style: italic;
}

.j-cta-text {
  margin: 0 auto 30px;
  max-width: 42ch;
  color: var(--on-black-2);
  font-size: 17px;
}

.j-related {
  padding-top: clamp(64px, 8vw, 110px);
  padding-bottom: clamp(64px, 8vw, 110px);
}

.j-related h2 {
  font-size: clamp(36px, 4vw, 52px);
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.j-related .link-arrow {
  margin-top: 36px;
}

.j-page > main > .j-cta:last-child {
  margin-bottom: clamp(64px, 8vw, 110px);
}

.j-page main > section.j-cat + .j-cta,
.j-page main > section.j-start + .j-cta {
  margin-top: clamp(64px, 8vw, 110px);
}

/* ---------- smaller screens ---------- */

@media (max-width: 960px) {
  .j-start-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .a-head {
    grid-template-columns: 1fr;
  }

  .a-head-board {
    padding: 4px 0 0;
  }

  .hero-board {
    width: min(280px, 72vw);
  }
}

@media (max-width: 600px) {
  .j-title {
    font-size: 64px;
  }

  /* Topics on one line you can slide. */
  .j-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-left: calc(var(--gutter) * -1);
    margin-right: calc(var(--gutter) * -1);
    padding: 0 var(--gutter);
    scrollbar-width: none;
  }

  .j-chips::-webkit-scrollbar {
    display: none;
  }

  .j-chips a {
    flex: none;
  }

  /* Start here: a row you swipe. */
  .j-start-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 6px;
    scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
  }

  .j-start-grid::-webkit-scrollbar {
    display: none;
  }

  .j-start-grid .j-card {
    flex: 0 0 80%;
    scroll-snap-align: start;
  }

  .j-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 12px;
  }

  .j-card-media {
    border-radius: 16px;
  }

  .j-card-title {
    font-size: 19px;
  }

  .j-card.big .j-card-title {
    font-size: 25px;
  }

  .j-board .tape {
    width: 30px;
    height: 9px;
  }

  .j-board .tape.l {
    left: -8px;
    top: 5px;
  }

  .j-board .tape.r {
    right: -8px;
    top: 5px;
  }

  .a-title {
    font-size: 42px;
  }

  .a-body {
    font-size: 17px;
  }

  .a-body > p:first-child {
    font-size: 18.5px;
  }

  .a-body h2 {
    font-size: 31px;
  }

  .a-body blockquote {
    font-size: 23px;
  }

  .a-faq summary {
    font-size: 20px;
  }

  .a-faq .ans p {
    padding-right: 0;
  }

  .a-body table {
    font-size: 14.5px;
  }

  .a-body th,
  .a-body td {
    min-width: 0;
    padding-right: 12px;
  }

  .a-body td:first-child {
    white-space: nowrap;
  }

  .j-cta-in {
    border-radius: 24px;
  }

  .j-related .j-grid > :nth-child(3) {
    display: none;
  }
}
