/* photos index */
.photo-day-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.photo-day-card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px; text-decoration: none;
  transition: transform .15s, border-color .15s;
}
.photo-day-card:hover { transform: translateX(2px); border-color: var(--accent); }
.pdc-top { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.85rem; margin-bottom: 12px; }
.pdc-top .date { color: var(--ink); font-weight: 500; }
.pdc-top .cnt { color: var(--ink-dim); }
.pdc-thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.pdc-thumbs img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px; display: block; }

/* photo detail (per-date article) */
.photo-detail { max-width: 920px; margin: 0 auto; }
.back { display: inline-block; margin-top: 12px; font-family: var(--mono); font-size: 0.85rem; color: var(--ink-dim); text-decoration: none; }
.back:hover { color: var(--accent); }
.photo-hdr { margin: 24px 0 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.photo-hdr .date-big { font-family: var(--mono); font-size: 1rem; color: var(--accent); }
.photo-hdr h1 { font-size: 1.5rem; margin: 6px 0 0; letter-spacing: -0.01em; color: var(--ink); }

/* masonry: natural aspect, smaller cells, more per row */
.photo-masonry { column-count: 4; column-gap: 6px; }
.photo-cell { position: relative; display: block; margin: 0 0 6px; break-inside: avoid; border-radius: 4px; overflow: hidden; cursor: zoom-in; transition: opacity .15s; }
.photo-cell:hover { opacity: 0.88; }
.photo-cell img { width: 100%; height: auto; display: block; }
.video-cell .cell-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; color: rgba(255, 255, 255, 0.92); pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}
.video-cell .video-placeholder {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 3; background: #1c1c1c; color: var(--ink-dim);
  font-family: var(--mono); font-size: 0.85rem;
}
@media (max-width: 1000px) { .photo-masonry { column-count: 3; } }
@media (max-width: 640px)  { .photo-masonry { column-count: 2; } }

.pager { display: flex; justify-content: space-between; margin-top: 32px; font-family: var(--mono); font-size: 0.85rem; }
.pager a { color: var(--ink-dim); text-decoration: none; }
.pager a:hover { color: var(--accent); }

/* card popup viewer */
body.modal-open { overflow: hidden; }
.photo-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
}
.photo-modal[hidden] { display: none; }
.photo-card {
  position: relative;
  background: var(--panel, #1a1a1a);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 12px; padding: 10px;
  max-width: 80vw; max-height: 80vh;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  cursor: default;
  display: flex; align-items: center; justify-content: center;
}
.photo-modal-content {
  display: flex; align-items: center; justify-content: center;
  max-width: calc(80vw - 20px); max-height: calc(80vh - 20px);
}
.photo-modal-content img,
.photo-modal-content video {
  max-width: calc(80vw - 20px); max-height: calc(80vh - 20px);
  width: auto; height: auto;
  display: block; background: #000; border-radius: 6px;
}
.photo-modal-close {
  position: absolute; top: -14px; right: -14px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--panel, #1a1a1a); color: var(--ink, #fff);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.25));
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: background .15s, border-color .15s, transform .15s;
}
.photo-modal-close:hover { border-color: var(--accent, #fff); transform: scale(1.08); }
