/* assets/style.css */
[hidden]{ display:none !important; }
.modalOverlay[hidden]{ display:none !important; }

:root{
  --container: 1680px;
  --bg:#ffffff;
  --text:#52525b;
  --title:#4b5563;
  --muted:#6b7280;
  --line:#c9cfd6;
  --line-hover:#c1121f;
  --border:#e5e7eb;
  --accent:#2563eb;
  --danger:#b91c1c;

  --page-x: 28px;
  --gap-x: 34px;
  --gap-y: 56px;
}

*{ box-sizing:border-box; }

html,
body{
  height:100%;
}

body{
  margin:0;
  font-family: Arial, Helvetica, sans-serif;
  background:var(--bg);
  color:var(--text);
}

.container{
  width:min(100%, var(--container));
  margin:0 auto;
  padding:16px var(--page-x) 48px;
}

/* ===== Liste d'articles ===== */
.projectsGrid{
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  column-gap:var(--gap-x);
  row-gap:var(--gap-y);
  align-items:start;
}

.projectCard{
  display:block;
  text-decoration:none;
  color:inherit;
}

.projectMedia{
  width:100%;
  aspect-ratio:16 / 10;
  background:#f3f4f6;
  overflow:hidden;
  margin-bottom:14px;
}

.projectMedia img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.projectFallback{
  width:100%;
  height:100%;
  background:linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
}

.projectContent{
  padding:0;
}

.projectContent h2{
  margin:0;
  font-size:15px;
  line-height:1.3;
  font-weight:400;
  color:var(--title);
  letter-spacing:-0.01em;
}

.projectContent h2::after{
  content:"";
  display:block;
  width:38px;
  height:1px;
  margin-top:10px;
  margin-bottom:10px;
  background:var(--line);
  transition:
    width .22s ease,
    background-color .22s ease;
}

.projectCard:hover .projectContent h2::after,
.projectCard:focus-visible .projectContent h2::after{
  width:74px;
  background:var(--line-hover);
}

.projectContent p{
  margin:0;
  font-size:11px;
  line-height:1.65;
  color:var(--muted);
}

/* éléments inutiles sur cette version */
.projectOverlay,
.projectBadge,
.scrollBtn,
.pageHeader,
.pageShell,
.pageLayout,
.pageMain,
.projectsSection{
  display:none !important;
}

/* ===== MODAL ===== */
.modalOverlay{
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.32);
  backdrop-filter: blur(10px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:9999;
}

.modal{
  width:min(480px, 100%);
  background:#fff;
  border:1px solid #eceff3;
  border-radius:20px;
  box-shadow:0 24px 70px rgba(15,23,42,.16);
  overflow:hidden;
}

.modalHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:22px 22px 0;
  border-bottom:none;
}

.modalHeader h2{
  margin:0;
  font-size:18px;
  line-height:1.2;
  font-weight:700;
  color:#111827;
}

.modalHeader p{
  margin:8px 0 0;
  font-size:14px;
  line-height:1.45;
  color:#6b7280;
}

.modalClose{
  flex:0 0 auto;
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border:1px solid #e5e7eb;
  border-radius:999px;
  background:#fff;
  color:#111827;
  text-decoration:none;
  font-size:22px;
  line-height:1;
  padding:0;
}

.modalBody{
  padding:18px 22px 22px;
}

.pinError{
  margin:0 0 12px;
  color:var(--danger);
  font-size:13px;
  min-height:18px;
}

.textWrap{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:0;
}

.textInput{
  width:100%;
  height:52px;
  padding:0 16px;
  border-radius:14px;
  border:1px solid #dbe1ea;
  background:#f8fafc;
  outline:none;
  font-size:16px;
  color:#111827;
  box-shadow:none;
}

.textInput::placeholder{
  color:#9ca3af;
}

.textInput:focus{
  border-color:#c7d2fe;
  background:#fff;
  box-shadow:0 0 0 4px rgba(37,99,235,.10);
}

.pinDots{
  display:flex;
  justify-content:center;
  gap:10px;
  margin:4px 0 16px;
}

.pinDot{
  width:12px;
  height:12px;
  border-radius:999px;
  border:2px solid rgba(15,23,42,.18);
  background:transparent;
}

.pinDot.filled{
  background:#111827;
  border-color:#111827;
}

.keypad{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:10px;
}

.keyBtn{
  border:1px solid #e5e7eb;
  background:#fff;
  border-radius:14px;
  padding:14px 0;
  font-size:18px;
  cursor:pointer;
  box-shadow:none;
}

.keyBtn.secondary{
  font-size:13px;
  color:#6b7280;
}

.pinActions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:16px;
  flex-wrap:wrap;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:110px;
  height:44px;
  padding:0 16px;
  border-radius:12px;
  border:1px solid #e5e7eb;
  background:#fff;
  color:#111827;
  text-decoration:none;
  cursor:pointer;
  white-space:nowrap;
  font-size:15px;
  font-weight:500;
}

.btn.primary{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}

.shake{
  animation:shake .28s ease-in-out 0s 1;
}

@keyframes shake{
  0%{ transform:translateX(0); }
  25%{ transform:translateX(-8px); }
  50%{ transform:translateX(8px); }
  75%{ transform:translateX(-6px); }
  100%{ transform:translateX(0); }
}

.srOnly{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* ===== Responsive ===== */
@media (max-width: 1400px){
  .projectsGrid{
    grid-template-columns:repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px){
  .projectsGrid{
    grid-template-columns:repeat(3, minmax(0, 1fr));
    column-gap:24px;
    row-gap:40px;
  }

  .projectContent h2{
    font-size:17px;
  }

  .projectContent p{
    font-size:12px;
  }
}

@media (max-width: 760px){
  .container{
    padding:18px 18px 36px;
  }

  .projectsGrid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:22px 16px;
  }

  .projectMedia{
    margin-bottom:10px;
  }

  .projectContent h2{
    font-size:15px;
    line-height:1.25;
  }

  .projectContent h2::after{
    width:28px;
    margin-top:8px;
    margin-bottom:8px;
  }

  .projectCard:hover .projectContent h2::after,
  .projectCard:focus-visible .projectContent h2::after{
    width:52px;
  }

  .projectContent p{
    font-size:11px;
    line-height:1.5;
  }

  .modalOverlay{
    padding:14px;
    align-items:flex-end;
  }

  .modal{
    width:100%;
    border-radius:18px 18px 0 0;
  }

  .modalHeader{
    padding:18px 18px 0;
  }

  .modalBody{
    padding:16px 18px 18px;
  }

  .pinActions{
    display:grid;
    grid-template-columns:1fr;
  }

  .btn{
    width:100%;
    min-width:0;
  }

  .textInput{
    font-size:16px;
  }
}

@media (max-width: 520px){
  .projectsGrid{
    grid-template-columns:1fr;
    gap:24px;
  }

  .projectMedia{
    aspect-ratio:16 / 9;
  }

  .projectContent h2{
    font-size:18px;
  }

  .projectContent p{
    font-size:13px;
    line-height:1.6;
  }

  .textInput{
    font-size:16px;
  }
}