/* ==========================================================================
   wall.css - the visitor photo wall: grid, upload sheet, viewer.

   The overlays sit on <body> above both shells, so one set of styles serves
   the desktop and the phone. Flat, square and dark, like a Modern app.
   ========================================================================== */

/* -- grid ------------------------------------------------------------------ */

.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}
.wall-tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #222;
  cursor: pointer;
}
.wall-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms var(--ease-out);
}
.wall-tile:hover img { transform: scale(1.04); }
.wall-tile-name {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 8px 6px;
  font-size: 12px;
  color: #fff;
  text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wall-empty {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.6);
  max-width: 34em;
}

/* -- overlays -------------------------------------------------------------- */

.wall-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  animation: wall-in 180ms var(--ease-out);
}
.wall-overlay.is-leaving { opacity: 0; transition: opacity 180ms linear; }
@keyframes wall-in { from { opacity: 0; } to { opacity: 1; } }

/* -- upload sheet ---------------------------------------------------------- */

.wall-sheet {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 22px 22px 18px;
  background: #1d1d1d;
  border-top: 4px solid var(--accent);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: wall-sheet-in 260ms var(--ease-out);
}
@keyframes wall-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.wall-sheet-title {
  font-family: var(--font-light);
  font-weight: 200;
  font-size: 32px;
  line-height: 1.1;
}
.wall-note { font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, 0.62); }
.wall-note.is-big { font-size: 15px; color: rgba(255, 255, 255, 0.82); }

.wall-file { display: none; }

.wall-preview {
  height: 220px;
  display: grid;
  place-items: center;
  background: #121212;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  cursor: pointer;
  overflow: hidden;
}
.wall-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wall-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.wall-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
}
.wall-input:focus { outline: none; border-color: var(--accent); }

.wall-status { min-height: 1.2em; font-size: 13px; color: rgba(255, 255, 255, 0.7); }
.wall-status.is-err { color: #ff8a80; }

.wall-actions { display: flex; justify-content: flex-end; gap: 10px; }
.wall-button {
  height: 34px;
  padding: 0 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  cursor: pointer;
}
.wall-button:disabled { opacity: 0.4; cursor: default; }
.wall-button.is-ghost { background: transparent; border: 1px solid rgba(255, 255, 255, 0.3); }

/* -- viewer ---------------------------------------------------------------- */

.wall-overlay.is-viewer { background: #000; }
.wall-view-img {
  max-width: 100vw;
  max-height: 100dvh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.wall-view-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 40px 20px 18px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: #fff;
  pointer-events: none;
}
.wall-view-name { font-size: 18px; font-weight: 600; }
.wall-view-caption { font-size: 15px; margin-top: 3px; color: rgba(255, 255, 255, 0.86); }
.wall-view-count { font-size: 12px; margin-top: 8px; color: rgba(255, 255, 255, 0.5); }

.wall-view-nav,
.wall-view-close {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 0;
  cursor: pointer;
}
.wall-view-nav { top: 50%; transform: translateY(-50%); }
.wall-view-nav.is-prev { left: 12px; }
.wall-view-nav.is-next { right: 12px; }
.wall-view-close { top: 12px; right: 12px; }
.wall-view-nav:hover,
.wall-view-close:hover { background: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .wall-overlay, .wall-sheet { animation: none; }
}

/* -- per shell ------------------------------------------------------------- */

.wall-app { padding-bottom: 40px; }
.wall-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  max-width: 1100px;
}
.wall-head .wall-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wall-grid.is-desktop {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  max-width: 1100px;
}
/* Three across, like the Windows Phone camera roll. */
.wall-grid.is-phone { grid-template-columns: repeat(3, 1fr); gap: 4px; }
.wall-grid.is-phone .wall-tile-name { font-size: 11px; padding: 14px 6px 4px; }
