/* Project page template: block library, see docs/fiche-projet.md.
   Loaded by project pages only, via {{> head pageCss="/project.css"}}. */

.project-page main {
  --project-col: 44rem;
}

.project-page h2 {
  margin-top: 0;
}

/* Prototype: show block names to discuss the template. */
.proto [data-block] {
  position: relative;
  outline: 1px dashed #f1791d;
  outline-offset: -6px;
}
.proto [data-block]::before {
  content: attr(data-block);
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 0.15rem 0.5rem;
  background: #f1791d;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 1;
}

/* 1. Hero */
.project-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding-block: 3rem 0;
  background-color: var(--green-brand-tint-color);
  overflow: hidden;

  .breadcrumb {
    font-size: 0.8rem;
    font-weight: 700;
    a {
      color: var(--green-brand-dark-color);
    }
  }
  h1 {
    margin: 0.5rem 0 1rem;
    font-size: 2.5rem;
    line-height: 1.15;
    color: var(--green-brand-dark-color);
  }
  .project-hero__text {
    padding-bottom: 3rem;
  }
}
/* Hero without visual (no capture available yet) */
.project-hero--text {
  grid-template-columns: minmax(0, 50rem);
}

.project-eyebrow {
  margin: 1.5rem 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-brand-dark-color);
}
.project-lead {
  font-size: 1.2rem;
  line-height: 1.5;
}
.project-hero__visual {
  align-self: end;
  margin: 0;
  height: 22rem;
  overflow: hidden;
  border-radius: 0.75rem 0.75rem 0 0;
  box-shadow: 0 -0.5rem 2rem rgba(24, 80, 68, 0.2);

  img {
    display: block;
    width: 100%;
    height: auto;
  }
}

/* 2. Identity card */
.project-facts {
  padding-block: 1.5rem;
  background-color: var(--green-brand-dark-color);
  color: var(--white-text-color);

  dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1.5rem;
    margin: 0;
  }
  dt {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--green-brand-light-color);
  }
  dd {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    line-height: 1.4;
  }
}

/* 3–4. Context and challenge */
.project-col {
  max-width: var(--project-col);
  line-height: 1.6;
}
.project-story {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
  padding-block: 3rem;
}
.project-challenge {
  padding: 1.5rem;
  border-radius: 1rem;
  border-left: 6px solid var(--green-brand-light-color);
  background-color: var(--main-bg-color);
  line-height: 1.5;
}
.project-challenge__label,
.project-outcome__label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.project-challenge__text {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--green-brand-dark-color);
}

/* 5. Difficulties */
.project-difficulties ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
  counter-reset: diff;
}
.project-difficulties li {
  counter-increment: diff;
  padding: 1.5rem;
  border: 1px solid var(--green-brand-light-color);
  border-radius: 1rem;
  line-height: 1.5;

  &::before {
    content: '0' counter(diff);
    font-size: 2rem;
    font-weight: 800;
    color: var(--green-brand-light-color);
  }
  h3 {
    margin: 0.5rem 0;
    color: var(--green-brand-dark-color);
  }
  p {
    margin: 0;
  }
}

/* 6. Approach (same look as the home steps band) */
.project-approach {
  background-color: var(--green-brand-tint-color);

  ol {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 1rem;
    padding: 0;
    list-style: none;
    counter-reset: step;
  }
  li {
    counter-increment: step;
    padding: 1.5rem;
    border-radius: 1rem;
    background-color: var(--white-bg-color);
    line-height: 1.5;
    &::before {
      content: counter(step);
      display: inline-grid;
      place-items: center;
      width: 2.5rem;
      height: 2.5rem;
      border-radius: 50%;
      background-color: var(--green-brand-dark-color);
      color: var(--white-text-color);
      font-weight: 700;
    }
  }
  h3 {
    color: var(--green-brand-dark-color);
  }
}

/* 7. Contribution */
.project-contribution {
  padding-block: 3rem 1rem;
}
.project-statement {
  max-width: 50rem;
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--green-brand-dark-color);
}

/* 8. Visuals */
.project-note {
  font-size: 0.85rem;
  font-style: italic;
}
.project-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;

  figure {
    margin: 0;
  }
  figure.is-wide {
    grid-column: 1 / -1;
  }
  a {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid #c9d6d2;
    border-radius: 0.75rem;
  }
  figure.is-wide a {
    aspect-ratio: 21 / 9;
  }
  img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.3s;
  }
  a:hover img {
    transform: scale(1.03);
  }
  figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
  }
}

/* 9. Outcome */
.project-outcome {
  padding-block: 3rem;
  background-color: var(--green-brand-dark-color);
  color: var(--white-text-color);
  line-height: 1.5;
}
.project-outcome__label {
  color: var(--green-brand-light-color);
}
.project-outcome__text {
  max-width: 50rem;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
}

/* 10. Testimonials */
.project-quotes__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.5rem;

  blockquote {
    margin: 0;
    padding: 1.5rem;
    border-radius: 1rem;
    font-style: normal;
  }
  blockquote p {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.5;
  }
  footer {
    display: block;
    padding: 0;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--green-brand-dark-color);
  }
}

/* Badge (used in the second phase lead) */
.project-badge {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background-color: var(--green-brand-light-color);
  color: var(--green-brand-dark-color);
  font-size: 0.8rem;
  font-weight: 700;
}

/* 11. Follow-up */
.project-cta {
  background-color: var(--green-brand-tint-color);
}
.project-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--green-brand-light-color);

  a {
    color: var(--green-brand-dark-color);
    font-weight: 700;
  }
}

/* Variant: second phase of an ongoing project (mini case study) */
.project-phase {
  padding-block: 3rem;
  border-top: 6px solid var(--green-brand-light-color);
  background: linear-gradient(
    180deg,
    var(--green-brand-tint-color) 0,
    var(--white-bg-color) 22rem
  );

  h2 {
    margin-top: 0.25rem;
  }
  .project-gallery {
    margin-top: 1.5rem;
  }
}
.project-phase__label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-brand-dark-color);
}
.project-phase__lead {
  max-width: 50rem;
  font-size: 1.15rem;
  line-height: 1.5;
}
a.project-badge {
  text-decoration: none;
}
.project-gallery--compare {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-phase .project-gallery a {
  aspect-ratio: 16 / 10;
}

/* Mobile */
@media screen and (max-width: 875px) {
  .project-hero,
  .project-story {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .project-hero h1 {
    font-size: 1.8rem;
  }
  .project-hero__visual {
    height: 14rem;
  }
  .project-gallery,
  .project-gallery--compare {
    grid-template-columns: 1fr;
  }
  .project-gallery figure.is-wide a {
    aspect-ratio: 4 / 3;
  }
}
