/* O.MICHELET — Work / Case Studies
   Extends style.css. Reuses .built-hero, .built-grid, .project-card,
   .status-badge and .project-link from the design system.
================================================= */

/* Index grid — cards are anchors here, so override the global link fade
   with a deliberate hover state. */
a.project-card {
  color: inherit;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

a.project-card:hover {
  opacity: 1;
  transform: translateY(-4px);
  border-color: var(--color-sage);
  box-shadow: 0 12px 32px rgba(10, 10, 10, 0.07);
}

a.project-card:hover .project-link {
  gap: 8px;
}

a.project-card:focus-visible {
  outline: 2px solid var(--color-sage);
  outline-offset: 3px;
}

/* Card thumbnail — negative margins pull it out to the card edge, past the
   card's own padding, so it reads as a full-bleed header. */
.card-thumb {
  margin: calc(var(--space-unit) * -5) calc(var(--space-unit) * -5) calc(var(--space-unit) * 4);
  border-radius: 11px 11px 0 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background-color: var(--color-mint);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

a.project-card:hover .card-thumb img {
  transform: scale(1.03);
}

/* Hero links out to the live build / source
================================================= */
.case-links {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--space-unit) * 3);
  margin-top: calc(var(--space-unit) * 4);
}

.case-links a {
  font-size: var(--text-nav);
  font-weight: 500;
  color: var(--color-white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 2px;
  transition: border-color 0.25s ease;
}

.case-links a:hover {
  opacity: 1;
  border-bottom-color: var(--color-white);
}

/* Feature imagery
================================================= */
.case-feature {
  background-color: var(--color-white);
  padding-bottom: calc(var(--space-unit) * 8);
}

.case-feature figure,
.case-inline-figure {
  margin: 0;
  max-width: 100%;
}

.case-feature img,
.case-inline-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(10, 10, 10, 0.08);
  background-color: var(--color-mint);
}

.case-feature figcaption,
.case-inline-figure figcaption {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin-top: calc(var(--space-unit) * 2);
  max-width: 60ch;
}

/* A second figure sitting inside a body section rather than the feature band. */
.case-inline-figure {
  margin: calc(var(--space-unit) * 5) 0 0;
  max-width: 68ch;
}

/* Case study detail — hero
================================================= */
.case-hero {
  padding-top: 160px;
  padding-bottom: calc(var(--space-unit) * 9);
}

.case-hero .breadcrumb {
  font-size: var(--text-small);
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: calc(var(--space-unit) * 4);
  display: block;
}

.case-hero .breadcrumb a:hover { color: var(--color-white); opacity: 1; }

.case-hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  max-width: 16ch;
  margin-bottom: calc(var(--space-unit) * 3);
}

.case-lede {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  max-width: 640px;
}

/* Meta bar — the at-a-glance strip under the hero
================================================= */
.case-meta-bar {
  background-color: var(--color-white);
  border-bottom: 1px solid rgba(10, 10, 10, 0.08);
}

.case-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: calc(var(--space-unit) * 4);
  padding: calc(var(--space-unit) * 5) 0;
}

@media (max-width: 820px) {
  .case-meta-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .case-meta-grid { grid-template-columns: 1fr; gap: calc(var(--space-unit) * 3); }
}

.case-meta-item .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: calc(var(--space-unit) * 1);
  display: block;
}

.case-meta-item .value {
  font-size: 1rem;
  line-height: 1.45;
  color: var(--color-forest);
}

/* Body
================================================= */
.case-body { padding: var(--section-padding-y) 0; }

.case-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: calc(var(--space-unit) * 8);
  align-items: start;
}

@media (max-width: 900px) {
  .case-layout {
    grid-template-columns: 1fr;
    gap: calc(var(--space-unit) * 5);
  }
}

.case-section { margin-bottom: calc(var(--space-unit) * 8); }
.case-section:last-child { margin-bottom: 0; }

.case-section > h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  margin-bottom: calc(var(--space-unit) * 4);
  max-width: 22ch;
}

.case-section p {
  max-width: 68ch;
  margin-bottom: calc(var(--space-unit) * 2.5);
}

.case-section p:last-child { margin-bottom: 0; }

.case-section strong { font-weight: 500; color: var(--color-forest); }

/* Sticky section label in the left rail */
.case-rail {
  position: sticky;
  top: 120px;
}

@media (max-width: 900px) {
  .case-rail { position: static; }
}

.case-rail .rail-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
  color: var(--color-sage);
  display: block;
  margin-bottom: calc(var(--space-unit) * 2);
}

.case-rail p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* Findings / deliverables list
================================================= */
.case-list { max-width: 68ch; }

.case-list li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: calc(var(--space-unit) * 2);
  line-height: 1.65;
}

.case-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(0.825em - 3px); /* optical centre of the first line */
  width: 6px;
  height: 6px;
  background-color: var(--color-sage);
}

.case-list li strong {
  font-weight: 500;
  color: var(--color-forest);
}

/* Numbers strip — the evidence
================================================= */
.case-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: calc(var(--space-unit) * 4);
  padding: calc(var(--space-unit) * 5);
  background-color: var(--color-mint);
  border-radius: 12px;
  margin: calc(var(--space-unit) * 5) 0;
}

.case-fact .figure {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  line-height: 1;
  color: var(--color-sage);
  margin-bottom: calc(var(--space-unit) * 1.5);
}

.case-fact .caption {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

/* Pull quote
================================================= */
.case-quote {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  line-height: 1.4;
  color: var(--color-forest);
  border-left: 2px solid var(--color-sage);
  padding-left: calc(var(--space-unit) * 4);
  margin: calc(var(--space-unit) * 6) 0;
  max-width: 60ch;
}

.case-quote cite {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: calc(var(--space-unit) * 2);
}

/* Prev / next
================================================= */
.case-nav {
  border-top: 1px solid rgba(10, 10, 10, 0.08);
  padding: calc(var(--space-unit) * 6) 0;
  display: flex;
  justify-content: space-between;
  gap: calc(var(--space-unit) * 4);
  flex-wrap: wrap;
}

.case-nav a {
  display: block;
  max-width: 320px;
}

.case-nav .direction {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: calc(var(--space-unit) * 1);
  display: block;
}

.case-nav .case-nav-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--color-forest);
  line-height: 1.2;
}

.case-nav a:hover .case-nav-title { color: var(--color-sage); opacity: 1; }

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

@media (max-width: 600px) {
  .case-nav { flex-direction: column; }
  .case-nav .next { text-align: left; margin-left: 0; }
}
