/* Shared margins and reading rhythm across the six project sheets. */
.case-study {
  --folio-body: .84375rem;
  --folio-leading: 1.62;
  --folio-caption: .71875rem;
  --folio-detail: .8125rem;
  --folio-heading-font: 400 clamp(1.0625rem, 2.1cqw, 1.3125rem)/1.22 SohneBreit, sans-serif;
  --folio-lead-font: 400 clamp(1rem, 2cqw, 1.1875rem)/1.35 var(--type);
  --folio-label-font: 550 var(--folio-detail)/1.38 var(--type);
  --folio-section: clamp(4.75rem, 13cqw, 8.75rem);
  --folio-inset-space: clamp(2.8rem, 7.7cqw, 5.5rem);
  --folio-column-gap: clamp(1.75rem, 7cqw, 4.5rem);
  --folio-related: clamp(1.65rem, 4.6cqw, 3.25rem);
}

.editorial-project-view.has-case-study .binder-page {
  padding: clamp(1.15rem, 2.6cqw, 2.1rem) clamp(1.25rem, 6.1cqw, 5.25rem) clamp(3.75rem, 7cqw, 6.25rem);
  row-gap: clamp(1.9rem, 4.6cqw, 3.6rem);
}

.editorial-project-view.has-case-study .project-file-slip {
  position: relative;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: .45rem;
  align-items: start;
  width: min(100%, 16rem);
  max-width: 100%;
  margin: 0;
  padding: .4rem .82rem .42rem .55rem;
  border: 0;
  background: linear-gradient(120deg, #faf8f1e6, #eeeae1df), var(--binder-fiber) center/220px, #f3f0e7;
  box-shadow: 0 1px 1px #4c433228, 1px 3px 4px -2px #4c43324d;
  color: #352c26;
  font: 700 .5625rem/1.2 "Paper Stamp Mono", monospace;
  letter-spacing: .03em;
  text-transform: uppercase;
  rotate: -.85deg;
  transform-origin: var(--clip-left, 94%) 0;
}
.editorial-project-view.has-case-study .project-file-slip .file-logo {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}
.project-file-slip .file-fields {
  display: grid;
  align-items: baseline;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: .1rem .4rem;
  margin: 0;
}
.project-file-slip .file-fields dt {
  color: #605a50;
  font: inherit;
  letter-spacing: inherit;
}
.project-file-slip .file-fields dd { margin: 0; overflow-wrap: anywhere; }
.file-star { margin-inline-end: .32em; font: 700 1.15em/0 system-ui, sans-serif; vertical-align: -.035em; }
.file-star--red { color: #bd3c32; }
.file-star--blue { color: #325db0; }

/* The front wire crosses the edge of the stock one third down the existing clip photograph. */
.project-file-slip > img.card-paperclip {
  position: absolute;
  z-index: 1;
  top: 0;
  left: var(--clip-left, 94%);
  width: 1.05rem;
  aspect-ratio: 78 / 140;
  height: auto;
  object-fit: contain;
  filter: contrast(1.1) drop-shadow(.3px .6px .55px #302b2280);
  translate: -16.67% -31.43%;
  rotate: var(--clip-turn, -14deg);
  transform-origin: 16.67% 31.43%;
  pointer-events: none;
}
html[data-theme="dark"] .editorial-project-view .binder-veil.project-file-slip {
  color: #eee9db;
  background: linear-gradient(126deg, #3d3c36f5, #30302bf5), var(--binder-fiber) center/220px, #35342e;
  box-shadow: 0 1px 1px #0006, 1px 3px 4px -2px #0009;
}
/* Keep custom paper colors visible beneath the texture in either theme. */
html[data-theme] .editorial-project-view .binder-veil.project-file-slip[style*="background-color"] {
  background-image: var(--theme-grain, none), linear-gradient(125deg, #fff2, transparent 55%, #342a170c);
  background-size: 250px, auto;
}
html[data-theme="dark"] .project-file-slip .file-fields dt { color: #c2bbac; }
html[data-theme="dark"] .file-star--red { color: #ff8d7e; }
html[data-theme="dark"] .file-star--blue { color: #9fbfff; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .project-file-slip { transition: rotate .22s ease-out; }
  .editorial-project-view.has-case-study .project-file-slip:hover { rotate: -.3deg; }
}

.case-study .case-project-title {
  display: flex;
  align-items: baseline;
  gap: clamp(.5rem, 1.3cqw, 1rem);
  margin: 0 0 clamp(1.6rem, 3.4cqw, 2.6rem);
}
.case-study .case-project-title h1 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font: 300 clamp(2rem, 5.4cqw, 3.6rem)/1.09 SohneBreit, Inter, sans-serif;
  letter-spacing: -.04em;
  text-align: start;
  overflow-wrap: break-word;
}
.case-study .case-project-title .project-mark {
  flex: 0 0 clamp(.85rem, 2cqw, 1.2rem);
  margin: 0;
}

@media (max-width: 34rem) {
  .editorial-project-view.has-case-study .binder-page::before { transform: none; }
  .editorial-project-view.has-case-study .binder-page {
    padding-inline: clamp(.875rem, 4.1vw, 1.25rem) clamp(.875rem, 3.75vw, 1.125rem);
  }
}
@media (max-width: 23rem) {
  body[data-page="project"] #site-main { width: calc(100% - 1.25rem); }
  .editorial-project-view.has-case-study .binder-page { padding-inline: 1rem .875rem; }
}

@container portfolio-case (max-width: 32rem) {
  .case-study > .case {
    --folio-body: .9375rem;
    --folio-leading: 1.56;
    --folio-caption: .78125rem;
    --folio-detail: .875rem;
  }
}
