/* FEATURES-DESIGN-02 : huit cartes « Espace de direction ».
   Couleurs / pastels inchangés. Structure plate (ico + num directs) pour hydratation RSC stable. */

.f02-sec {
  --f02-radius: 22px;
  --f02-ease: cubic-bezier(0.2, 0, 0, 1);
  --f02-shadow: 0 1px 2px rgba(20, 32, 28, 0.05), 0 16px 32px -26px rgba(20, 32, 28, 0.42);
  --f02-shadow-hover: 0 2px 4px rgba(20, 32, 28, 0.06), 0 28px 46px -28px rgba(20, 32, 28, 0.5);
}

.f02-card--sage     { --f02-tint: #eef3e6; --f02-line: #d5e2c4; --f02-ink: #466a27; }
.f02-card--sky      { --f02-tint: #e8effc; --f02-line: #c9d8f2; --f02-ink: #2c5594; }
.f02-card--sand     { --f02-tint: #f3ead7; --f02-line: #e3d3b1; --f02-ink: #7a4a00; }
.f02-card--forest   { --f02-tint: #edf5f1; --f02-line: #cfe3d9; --f02-ink: #10473a; }
.f02-card--lavender { --f02-tint: #f0edf8; --f02-line: #dcd5ee; --f02-ink: #56458c; }
.f02-card--teal     { --f02-tint: #e4f4f3; --f02-line: #c3e5e2; --f02-ink: #0b6b66; }
.f02-card--slate    { --f02-tint: #e1ecf0; --f02-line: #c7d7de; --f02-ink: #3e525d; }
.f02-card--amber    { --f02-tint: #fbefd6; --f02-line: #f0d9a6; --f02-ink: #7a5410; }

.f02-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.f02-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-areas:
    "ico title"
    "ico desc"
    "ico status";
  column-gap: 14px;
  row-gap: 6px;
  min-width: 0;
  padding: 16px 16px 16px 14px;
  border: 1px solid var(--f02-line);
  border-radius: 18px;
  background: var(--f02-tint);
  box-shadow: var(--f02-shadow);
  color: var(--np-night);
}

/* Flat structure (integration) + optional DESIGN-02 .f02-card-top wrapper */
.f02-card-top,
.f02-card > .f02-ico-box {
  grid-area: ico;
}

.f02-card-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.f02-ico-box {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--np-white);
  border: 1px solid var(--f02-line);
  color: var(--f02-ink);
}

.f02-ico-box .f02-ico {
  width: 24px;
  height: 24px;
}

.f02-num {
  font-family: var(--np-font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--f02-ink);
  padding-left: 2px;
}

/* Flat: number sits top-right on mobile (matches DESIGN card-top num) */
.f02-card > .f02-num {
  position: absolute;
  top: 14px;
  right: 14px;
  padding-left: 0;
}

.f02-title {
  grid-area: title;
  margin: 0;
  padding-right: 2rem;
  font-family: var(--np-font-display);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
  hyphens: auto;
}

.f02-desc {
  grid-area: desc;
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--np-stone-700);
}

.f02-card .f02-status {
  grid-area: status;
  margin: 4px 0 0;
}

@media (min-width: 640px) {
  .f02-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .f02-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px 22px 20px;
    border-radius: var(--f02-radius);
  }

  .f02-card-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
  }

  /* Flat tablet+: ico then num on one visual row via absolute num */
  .f02-card > .f02-ico-box {
    margin-bottom: 6px;
  }

  .f02-card > .f02-num {
    top: 22px;
    right: 22px;
  }

  .f02-card > .f02-title {
    padding-right: 2.5rem;
  }

  .f02-ico-box {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .f02-ico-box .f02-ico {
    width: 30px;
    height: 30px;
  }

  .f02-title {
    font-size: 20px;
  }

  .f02-card .f02-status {
    margin-top: auto;
    padding-top: 8px;
  }
}

@media (min-width: 1100px) {
  .f02-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .f02-card,
  .f02-ico-box {
    transition: transform 250ms var(--f02-ease), box-shadow 250ms var(--f02-ease);
  }

  .f02-card:hover,
  .f02-card--hover-demo {
    transform: translateY(-4px);
    box-shadow: var(--f02-shadow-hover);
  }

  .f02-card:hover .f02-ico-box,
  .f02-card--hover-demo .f02-ico-box {
    transform: translateY(-2px) scale(1.06);
  }
}

.f02-card:focus-within,
.f02-card--focus-demo {
  outline: 3px solid var(--np-focus);
  outline-offset: 3px;
}
