/* Page « Mes projets » (complète home.css). */

.projects { max-width: var(--max); margin: 0 auto; padding: 32px 24px 64px; }
.projects-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
}
.projects-head h1 { font-size: clamp(2rem, 3.6vw, 2.8rem); }
.projects-lead { margin: 10px 0 0; color: var(--muted); max-width: 40em; }
.projects-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.projects-status { min-height: 1.6em; margin: 20px 0 8px; color: var(--muted); }
.projects-empty {
  padding: 40px 24px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

.project-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 20px;
}
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  transition: box-shadow .2s, transform .2s;
}
.project-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.project-card:focus-within { box-shadow: 0 0 0 2px var(--focus); }
.project-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #12161d;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-thumb-empty {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2a3240, #12161d);
}
.project-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.project-name { margin: 0; font-size: 1.1rem; line-height: 1.3; overflow-wrap: anywhere; }
.project-name a { color: var(--text); text-decoration: none; }
.project-name a:hover { text-decoration: underline; }
.project-date { margin: 0; color: var(--muted); font-size: .88rem; }
.project-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.project-menu {
  list-style: none;
  margin: 4px 0 0;
  padding: 6px;
  display: grid;
  gap: 2px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
}
.menu-item {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover { background: var(--ghost); text-decoration: underline; }
.menu-item.is-danger { color: var(--error); font-weight: 650; }

/* ---------- Stockage ---------- */

.storage {
  margin-top: 56px;
  padding: 28px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--glow-b), var(--glow-a));
  border: 1px solid var(--border);
}
.storage h2 { margin: 0 0 16px; font-size: 1.4rem; }
.storage-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px 40px; }
@media (max-width: 860px) { .storage-grid { grid-template-columns: 1fr; } }
.storage p { margin: 0 0 12px; }
.storage-usage { font-weight: 650; }
.storage-tips { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--muted); }
.storage-tips strong { color: var(--text); }
.storage code { font-size: .9em; color: var(--text); background: var(--bg-2); padding: 1px 6px; border-radius: 6px; }

/* ---------- Dialogues ---------- */

.dlg {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}
.dlg::backdrop { background: rgba(5, 8, 14, .6); }
.dlg-body { display: grid; gap: 18px; padding: 24px; }
.dlg h2 { margin: 0; font-size: 1.35rem; }
.dlg p { margin: 0; color: var(--muted); }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.dlg .field { display: grid; gap: 6px; }
.dlg .field > span { font-weight: 650; font-size: .95rem; }
.dlg .input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
}

.templates { margin: 0; padding: 0; border: 0; min-width: 0; }
.templates legend { padding: 0; margin-bottom: 8px; font-weight: 650; font-size: .95rem; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr)); gap: 10px; }
.template { position: relative; }
.template input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.template label {
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 8px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg-2);
  cursor: pointer;
}
.template canvas { width: 100%; height: auto; border-radius: 6px; display: block; }
.template-label { font-weight: 700; }
.template-desc { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.template input:checked + label { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.template input:checked + label .template-label::after { content: " ✓"; }
.template input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .project-card { transition: none; }
  .project-card:hover { transform: none; }
}
