:root{
  --bg: #0b0b0c;
  --text: rgba(255,255,255,.78);
  --muted: rgba(255,255,255,.60);
  --tile-bg: #0b0b0c;
}

*{ box-sizing: border-box; }

html, body { height: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

.page{
  width: 100%;
}

.grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0; /* no padding between columns */
}

@media (max-width: 880px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px){
  .grid{ grid-template-columns: 1fr; }
}

.tile{
  margin: 0;
  border: none;
  background: transparent;
  overflow: hidden;
}

.tile-link{
  display: block;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.tile-link img{
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.caption{
  display: block;
  padding: 6px 8px;              /* always visible */
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);

  /* optional: keeps it from taking too much height */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-link:hover img{
  filter: contrast(1.02) brightness(1.02);
  transform: scale(1.01);
}

/* subtle transform without breaking layout */
.tile-link img{
  transition: transform .18s ease, filter .18s ease;
}

/* Lightbox */
.no-scroll{ overflow: hidden; }

.lb{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;

  background: rgba(0,0,0,.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 9999;
}

.lb[aria-hidden="false"]{
  opacity: 1;
  pointer-events: auto;
}

.lb-panel{
  width: min(1020px, 96vw);
  max-height: 92vh;

  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #0b0b0b;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.lb-close{
  position: absolute;
  top: 10px;
  right: 10px;

  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);

  cursor: pointer;
}

.lb-media{
  padding: 12px;
  display: grid;
  place-items: center;
}

.lb-img{
  max-width: 100%;
  max-height: 70vh;
  border-radius: 10px;
  background: #111;   
}

.lb-caption{
  padding: 10px 14px 14px;
  color: rgba(255,255,255,.82);
  font-size: 14px;
}

.lb-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;

  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);

  cursor: pointer;
}

.lb-prev{ left: 10px; }
.lb-next{ right: 10px; }

@media (max-width: 520px){
  .lb-nav{ width: 40px; height: 40px; }
  .lb-media{ padding: 10px; }
}
