/* BW PM Client — Construction Updates Gallery */
/* Year → Month → Area tabs → Photo Grid + Lightbox */

.pmc-gallery {
  max-width: 1200px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Year tabs ─────────────────────────────────────────── */
.pmc-year-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.pmc-year-tab {
  padding: 10px 24px;
  border: 2px solid #2c3e50;
  border-radius: 6px;
  background: none;
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.pmc-year-tab:hover { background: #f0f0f0; }
.pmc-year-tab.active {
  background: #2c3e50;
  color: #fff;
}

/* ── Month tabs ────────────────────────────────────────── */
.pmc-month-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pmc-month-tab {
  padding: 8px 18px;
  border: none;
  border-radius: 4px;
  background: #e8e8e8;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.pmc-month-tab:hover { background: #ddd; }
.pmc-month-tab.active {
  background: #2c3e50;
  color: #fff;
}

/* ── Area tabs ─────────────────────────────────────────── */
.pmc-area-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.pmc-area-tab {
  padding: 10px 20px;
  border: none;
  background: #e8e8e8;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #555;
  cursor: pointer;
  border-radius: 6px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.pmc-area-tab:hover { background: #ddd; color: #333; }
.pmc-area-tab.active {
  background: #2c3e50;
  color: #fff;
}
/* First area tab gets accent color when active */
.pmc-area-tab:first-child.active {
  background: #8b4513;
  color: #fff;
}

/* ── Photo grid ────────────────────────────────────────── */
.pmc-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.pmc-photo-link {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: #f0f0f0;
  cursor: pointer;
}
.pmc-photo-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.pmc-photo-link:hover img {
  transform: scale(1.04);
}

/* States */
.pmc-empty, .pmc-no-data, .pmc-loading {
  text-align: center;
  color: #888;
  padding: 40px 20px;
  font-size: 15px;
  grid-column: 1 / -1;
}
.pmc-error {
  text-align: center;
  color: #c0392b;
  padding: 20px;
  font-size: 14px;
  grid-column: 1 / -1;
}

/* ── Lightbox ──────────────────────────────────────────── */
.pmc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pmc-lb-img-wrap {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pmc-lb-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
  -webkit-user-drag: none;
}
.pmc-lb-close,
.pmc-lb-prev,
.pmc-lb-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  z-index: 10;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.pmc-lb-close:hover,
.pmc-lb-prev:hover,
.pmc-lb-next:hover { opacity: 1; }
.pmc-lb-close { top: 16px; right: 20px; font-size: 36px; line-height: 1; }
.pmc-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); font-size: 48px; line-height: 1; }
.pmc-lb-next { right: 16px; top: 50%; transform: translateY(-50%); font-size: 48px; line-height: 1; }
.pmc-lb-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 14px;
}

/* ── Per-unit updates ──────────────────────────────────── */
.pmc-unit-updates {
  max-width: 1200px;
  margin: 20px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.pmc-unit-header-bar {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e5e5;
}
.pmc-unit-header {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: #2c3e50;
}
.pmc-unit-date {
  color: #888;
  font-weight: 500;
  font-size: 18px;
}
.pmc-unit-subhead {
  margin: 0;
  color: #666;
  font-size: 13px;
}
.pmc-unit-grid {
  grid-template-columns: repeat(3, 1fr) !important;
}
.pmc-unit-month-tabs {
  margin: 0 0 16px 0 !important;
}
.pmc-unit-footer {
  margin-top: 24px;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #e5e5e5;
}
.pmc-view-all-btn {
  display: inline-block;
  padding: 12px 28px;
  background: #2c3e50;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s;
}
.pmc-view-all-btn:hover {
  background: #1a252f;
  color: #fff !important;
}

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .pmc-photo-grid,
  .pmc-unit-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px;
  }
  .pmc-unit-header { font-size: 18px; }
  .pmc-unit-date { font-size: 15px; }
  .pmc-photo-link { border-radius: 4px; }

  .pmc-year-tabs { gap: 6px; }
  .pmc-year-tab { padding: 10px 18px; font-size: 15px; }

  .pmc-month-tabs { gap: 4px; }
  .pmc-month-tab { padding: 8px 14px; font-size: 13px; }

  .pmc-area-tab { padding: 10px 14px; font-size: 12px; }

  .pmc-lb-prev { left: 8px; font-size: 36px; }
  .pmc-lb-next { right: 8px; font-size: 36px; }
  .pmc-lb-close { top: 8px; right: 12px; font-size: 30px; }
}
