* { box-sizing: border-box; }
body { font-family: system-ui, Arial; background:#f6f7fb; margin:0; color:#111; }
a { color: inherit; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { margin: 18px auto; padding: 0 12px; width: 100%; }
.container.narrow { max-width: 560px; }
.container.wide { max-width: 1120px; }

/* Topbar */
.topbar { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.topbar h1 { margin: 10px 0; font-size: 24px; }
.topbar-right { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

/* Buttons */
.btn {
  display:inline-block; padding:10px 12px; border-radius:12px;
  background:#111; color:#fff; text-decoration:none; border:0;
}
.btn.secondary { background:#444; }
.btn:active { transform: translateY(1px); }
.btn.full { width:100%; margin-top: 12px; }

/* Cards / forms */
.alert { background:#ffe3e3; padding:10px 12px; border-radius:12px; margin:12px 0; }
.card {
  background:#fff; padding:14px; border-radius:16px;
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
  margin-top: 14px;
}
label { display:block; margin-top:12px; font-weight:600; }
input, textarea, select {
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px solid #ddd;
  margin-top:6px;
  font-size:16px; /* évite zoom iOS */
}
.small { color:#666; font-size:12px; }

/* Layout */
.layout { display:grid; grid-template-columns: 260px 1fr; gap:14px; margin-top:14px; }
.sidebar h3 { margin:0 0 10px 0; }

.filter { display:block; padding:11px 12px; border-radius:12px; text-decoration:none; }
.filter:hover { background:#f2f2f2; }
.filter.active { background:#111; color:#fff; }
.sep { height:10px; }

/* Tiles */
.grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap:12px; }
.tile {
  background:#fff; border-radius:18px; overflow:hidden; text-decoration:none;
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
  display:flex; flex-direction:column;
}
.thumb { height: 170px; background:#eee; display:flex; align-items:center; justify-content:center; }
.thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.placeholder { color:#666; font-size:14px; }
.tile-body { padding:12px; }
.tile-body h3 { margin:0 0 6px 0; font-size: 16px; }
.meta { color:#555; font-size:14px; margin:6px 0; }
.tile-body p { margin: 8px 0 0 0; line-height: 1.25; }

.badge {
  display:inline-block; padding:5px 10px; border-radius:999px;
  font-size:12px; background:#eee; margin: 4px 6px 0 0;
}

/* Photos */
.photos {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap:10px;
  margin-top:12px;
}
.photos img {
  width:100%;
  border-radius:14px;
  object-fit:cover;
  cursor: zoom-in;
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}

/* Footer */
.footer {
  margin-top: auto;
  text-align: center;
  padding: 16px 10px;
  color: #777;
  font-size: 13px;
}

/* ===== Login page only (ne casse pas PC) ===== */
body.page-center {
  min-height: 100vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding: 16px;
}
body.page-center .center-card {
  width:100%;
  max-width:520px;
  margin:0 auto;
  background:#fff;
  border-radius:18px;
  padding:18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
body.page-center .center-card h1 { margin: 0 0 12px 0; font-size: 26px; }

/* ===== Mobile ===== */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  body { font-size: 18px; }
  .container { padding: 0 14px; margin: 14px auto; }

  .topbar h1 { font-size: 26px; }
  .btn { padding: 14px 14px; font-size: 16px; }

  input, textarea, select { padding: 14px; font-size: 18px; }

  .grid { grid-template-columns: 1fr; gap: 14px; }
  .thumb { height: 260px; }
  .tile-body h3 { font-size: 20px; }
  .meta { font-size: 16px; }
  .badge { font-size: 14px; padding: 7px 12px; }

  .photos { grid-template-columns: 1fr; }
}

/* ===== Lightbox fullscreen ===== */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;      /* IMPORTANT: plein écran sans couper */
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  cursor: zoom-out;
}
.lightbox .close {
  position: fixed;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}
