/* ---- Reset & base ---- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---- Page frame (the white border around everything) ---- */
.page {
  padding: clamp(16px, 3vw, 48px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Title at top right ---- */
.page-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: clamp(24px, 4vw, 64px);
}

.title {
  font-size: 14px;
  font-weight: 400;
  margin: 0;
  text-decoration: line-through;
  color: #1a1a1a;
  letter-spacing: 0.01em;
}

/* ---- The justified gallery ---- */
/* Each row is a flex container. JS sets each tile's width and height
   based on its true aspect ratio so nothing is cropped. */
.gallery {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.row {
  display: flex;
  /* gap between tiles in a row, and between rows (margin-bottom on row) */
}

.row + .row {
  margin-top: var(--gap, 12px);
}

.tile {
  position: relative;
  overflow: hidden;
  background: #f4f4f4;
  margin-right: var(--gap, 12px);
}

.row .tile:last-child {
  margin-right: 0;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* harmless - tile dimensions exactly match image ratio */
  display: block;
}

/* ---- Mobile: stack into single column ---- */
@media (max-width: 700px) {
  .row {
    flex-direction: column;
  }
  .tile {
    margin-right: 0;
    margin-bottom: var(--gap, 12px);
    width: 100% !important;
    height: auto !important;
    aspect-ratio: var(--ratio, 3 / 2);
  }
  .row .tile:last-child {
    margin-bottom: 0;
  }
}

/* ---- Footer link ---- */
.page-footer {
  margin-top: clamp(24px, 4vw, 64px);
  display: flex;
  justify-content: center;
  font-size: 13px;
}

.page-footer a {
  color: #666;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.page-footer a:hover {
  color: #1a1a1a;
}
