/* Willy Wall · square photo grid + full view. Greyscale chrome, photos in colour. */
/* ------------------------------------------------------------- the wall */
.wall { max-width: 1100px; margin: 0 auto; padding: 18px 0 56px; }
.masthead { margin: 0 12px 18px; padding: 12px 16px 13px; text-align: center; background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; }
.masthead h1 { font: 700 clamp(19px, 2.4vw, 26px)/1.1 var(--font-ui); text-wrap: balance; }
.masthead p { margin-top: 5px; font-size: 13.5px; color: var(--ink-2); text-wrap: balance; }
.masthead .masthead__iphone { margin-top: 4px; font: 17px/1 var(--font-lcd); color: #666; }

.grid { list-style: none; margin: 0; padding: 0 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 4px; } }
@media (min-width: 1180px) { .grid { grid-template-columns: repeat(5, 1fr); } }
.tile {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 0;
  overflow: hidden; background: var(--soft); cursor: zoom-in;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s cubic-bezier(.2, .8, .2, 1), filter .2s; }
.tile::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 0 var(--ink); transition: box-shadow .15s; pointer-events: none; }
.tile:hover img { transform: scale(1.04); }
.tile:hover::after, .tile:focus-visible::after { box-shadow: inset 0 0 0 3px var(--ink); }
.tile:focus-visible { outline-offset: -3px; box-shadow: none; border-radius: 0; }
/* carousel mark: two stacked squares, top right */
.tile__multi {
  position: absolute; top: 6px; right: 6px; z-index: 1; width: 18px; height: 18px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff' d='M3 0h6v6H8V1H3z'/%3E%3Cpath fill='%23fff' d='M0 3h6v6H0z'/%3E%3C/svg%3E") center / contain no-repeat;
  image-rendering: pixelated; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .9)) drop-shadow(0 1px 1px rgba(0, 0, 0, .5));
}
@media (max-width: 560px) { .tile__multi { top: 4px; right: 4px; width: 14px; height: 14px; } }
.wall__error, .noscript { padding: 40px 16px; text-align: center; }

/* ---------------------------------------------------------- full view */
.lb {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--ink); overflow: auto;
}
html.lb-open { overflow: hidden; }
.lb::backdrop { background: rgba(17, 17, 17, .86); }
.lb[open] { display: grid; place-items: center; }
.lb__panel {
  position: relative; width: min(92vw, calc(100vh - 252px), 760px); width: min(92vw, calc(100svh - 252px), 760px); min-width: min(92vw, 300px);
  margin: 20px auto; padding: 10px 10px 12px; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .3);
}
.lb[open] .lb__panel { animation: lb-in .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes lb-in { from { opacity: 0; transform: scale(.94); } }
/* sits above the photo, never on it */
.lb__close {
  width: 34px; height: 34px; margin: 0 0 8px auto; padding: 0;
  display: grid; place-items: center; font: 700 24px/1 var(--font-ui);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 50%; cursor: pointer;
}
.lb__close:hover { background: var(--ink); color: #fff; }
.lb__frame { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--soft); touch-action: pan-y; }
.lb__stack { position: absolute; inset: 0; }
.lb__post { position: absolute; inset: 0; overflow: hidden; transition: opacity .18s, transform .25s cubic-bezier(.2, .8, .2, 1); }
.lb__post.is-out { opacity: 0; }
.lb__track { display: flex; width: 100%; height: 100%; will-change: transform; }
.lb__track.is-snapping { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.lb__slide { flex: 0 0 100%; height: 100%; }
.lb__img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* no save-image menu on a long press (iOS callout), no drag-out, no selection; wall.js also blocks the context menu */
.grid img, .lb img { -webkit-touch-callout: none; -webkit-user-drag: none; -webkit-user-select: none; user-select: none; }
/* carousels only: arrows + dots under the photo (never on it); on wide screens the arrows sit beside the panel */
.lb__media { position: relative; }
.lb__ctrl { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 8px; }
.lb__ctrl[hidden] { display: none; }
.lb__cs {
  flex: none; width: 34px; height: 34px; padding: 0 0 2px;
  display: grid; place-items: center; font: 700 20px/1 var(--font-ui); color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 50%; cursor: pointer; touch-action: manipulation;
}
.lb__cs:hover:not([disabled]) { background: var(--ink); color: #fff; }
.lb__cs[disabled] { opacity: .3; cursor: default; }
.lb__dots { display: flex; justify-content: center; gap: 5px; min-width: 40px; pointer-events: none; }
.lb__dots i { width: 7px; height: 7px; border-radius: 50%; background: #c4c4c4; transition: background .2s, transform .2s; }
.lb__dots i.is-on { background: var(--ink); transform: scale(1.15); }
@media (min-width: 900px) and (hover: hover) {
  .lb__ctrl { padding-top: 6px; }
  .lb__cs {
    position: absolute; top: calc(50% - 26px); width: 40px; height: 40px; font-size: 24px;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, .3);
  }
  .lb__cs--prev { left: -62px; } .lb__cs--next { right: -62px; }
  .lb__cs[disabled] { visibility: hidden; }
}

.lb__info { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: start; padding: 10px 2px 0; }
.lb__caption { grid-column: 1; font-size: 15px; line-height: 1.4; }
.lb__caption:empty { display: none; }
.lb__meta { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font: 17px/1.1 var(--font-lcd); color: #555; }
.lb__meta:not(:has(:not(:empty):not([hidden]))) { display: none; }
.lb__loc:empty, .lb__date:empty { display: none; }
.lb__loc::before {
  content: ""; display: inline-block; width: 10px; height: 12px; margin-right: 5px; vertical-align: -1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 6' shape-rendering='crispEdges' fill='%23555'%3E%3Cpath d='M1 0h3v1h1v2H4v1H3v2H2V4H1V3H0V1h1zM2 1v2h1V1z'/%3E%3C/svg%3E") center / contain no-repeat;
  image-rendering: pixelated;
}
.lb__orig { color: #555; }
.lb__info .love { grid-column: 2; grid-row: 1 / 4; }
.lb__pos { grid-column: 1; font: 15px/1 var(--font-lcd); color: #888; }

/* placeholder squares (until real photos are imported) */
.ph {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px;
  background: repeating-linear-gradient(45deg, #d9d9d9 0 10px, #e2e2e2 10px 20px);
  color: #444; font: 18px/1.1 var(--font-lcd); text-align: center; text-transform: uppercase;
}
.ph img { width: 48px !important; height: 48px !important; object-fit: contain; image-rendering: pixelated; opacity: .75; }
.tile .ph { font-size: 13px; gap: 3px; } .tile .ph img { width: 22px !important; height: 22px !important; }

/* hearts aimed at the viewer */
.love {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 10px;
  background: #fafafa; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer;
  font: 20px/1 var(--font-lcd); font-variant-numeric: tabular-nums; white-space: nowrap;
  transition: transform .15s cubic-bezier(.3, 1.8, .5, 1);
}
.love:hover, .love.is-popping { background: #111; color: #fff; }
.love:hover .love__heart, .love.is-popping .love__heart { filter: invert(1); }
.love:active { transform: scale(.94); }
.love.is-popping { animation: pop .45s cubic-bezier(.3, 1.8, .5, 1); }
.love__heart { width: 16px; height: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 7' shape-rendering='crispEdges' fill='%23111'%3E%3Cpath d='M1 0h2v1h2V0h2v1h1v3H7v1H6v1H5v1H3V6H2V5H1V4H0V1h1z'/%3E%3C/svg%3E") center / contain no-repeat; image-rendering: pixelated; }
@keyframes pop { 40% { transform: scale(1.15); } }

.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 60; max-width: min(92vw, 420px);
  padding: 10px 16px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; border-radius: 10px; font: 600 16px/1.3 var(--font-ui); text-align: center;
  transition: opacity .25s, transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; z-index: 55; width: 100%; height: 100%; pointer-events: none; }

/* ------------------------------------------------------------- mobile */
@media (max-width: 560px) {
  :root { --menu-h: 42px; }
  .wall { padding-top: 10px; }
  .masthead { margin: 0 8px 12px; padding: 9px 12px 10px; }
  .masthead h1 { font-size: 19px; }
  .masthead p { font-size: 12.5px; }
  .grid { padding: 0 8px; gap: 2px; }                 /* lines up with the masthead */
  .lb__panel { width: 100%; min-width: 0; margin: 0; border-radius: 0; border-width: 1.5px 0; padding: 8px 8px 12px; box-shadow: none; }
  .lb__info { grid-template-columns: 1fr; }
  .lb__info .love { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .001ms !important; }
}
