/* ===========================
   Photo Gallery + Lightbox
   Local CSS only
   =========================== */

:root {
  --pg-max: 1100px;
  --pg-gap: 12px;
  --pg-radius: 14px;
  --pg-border: #e8e8e8;
  --pg-text: #111;
  --pg-muted: #555;

  --lb-bg: rgba(0, 0, 0, 0.86);
  --lb-panel: rgba(0, 0, 0, 0.45);
  --lb-border: rgba(255, 255, 255, 0.16);
  --lb-text: #f3f3f3;
  --lb-muted: rgba(255, 255, 255, 0.75);
}

.pg-wrap {
  max-width: var(--pg-max);
  margin: 0 auto;
  padding: 18px 16px 44px;
  color: #fff;
}

.pg-header {
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--pg-border);
  margin-bottom: 16px;
}

.pg-title {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.2;
  color: #fff;
}

.pg-subtitle {
  margin: 0;
  color: var(--pg-muted);
  color: #fff;
}

/* Grid */
.pg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--pg-gap);
  color: #fff;
}

@media (min-width: 720px) {
  .pg-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
}

/* Card as button (better accessibility) */
.pg-card {
  appearance: none;
  border: 1px solid var(--pg-border);
  background: #f7f7f7;
  border-radius: var(--pg-radius);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.pg-card:focus {
  outline: 3px solid rgba(42, 96, 153, 0.25);
  outline-offset: 2px;
}

.pg-thumb {
  width: 100%;
  height: 210px;
  display: block;
  object-fit: cover;
  transform: scale(1);
  transition: transform 180ms ease;
}

.pg-card:hover .pg-thumb {
  transform: scale(1.03);
}

@media (max-width: 520px) {
  .pg-thumb {
    height: 170px;
  }
}

/* ===========================
   Lightbox
   =========================== */

.lb {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.lb.is-open {
  display: block;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: var(--lb-bg);
}

.lb-dialog {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  top: 50%;
  transform: translateY(-50%);
  padding: 14px 56px 54px;
}

.lb-img {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  background: #111;
  border: 1px solid var(--lb-border);
}

/* Buttons */
.lb-btn {
  position: absolute;
  border: 1px solid var(--lb-border);
  background: var(--lb-panel);
  color: #fff;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
  user-select: none;
}

.lb-btn:hover {
  background: rgba(0, 0, 0, 0.65);
}

.lb-close {
  top: 10px;
  right: 10px;
  font-size: 34px;
  padding: 6px 12px;
}

.lb-prev {
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-next {
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-meta {
  margin-top: 12px;
}

.lb-caption {
  color: var(--lb-text);
  font-size: 14px;
}

.lb-counter {
  margin-top: 6px;
  color: var(--lb-muted);
  font-size: 12px;
}

@media (max-width: 520px) {
  .lb-dialog {
    padding: 12px 48px 46px;
  }
}

/* NEW ALBUM STYLE*/

/* Album list grid */
.album-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
  margin-top: 18px;
}
@media (min-width: 860px){
  .album-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
.album-card{
  display:block;
  border:1px solid #e8e8e8;
  border-radius: 14px;
  overflow:hidden;
  text-decoration:none;
  color:#111;
  background:#fff;
}
.album-cover{
  background:#f3f3f3;
  height: 190px;
  overflow:hidden;
}
.album-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition: transform 180ms ease;
}
.album-card:hover .album-cover img{ transform: scale(1.03); }
.album-placeholder{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#666;
  font-size:14px;
}
.album-meta{ padding: 12px 12px 14px; }
.album-name{ margin:0 0 6px 0; font-size:18px; }
.album-image-title{ color:#444; font-size:13px; margin-bottom:6px; }
.album-desc{ color:#555; font-size:13px; margin-bottom:8px; }
.album-count{ color:#777; font-size:12px; }

.back-link{
  text-decoration:none;
  border:1px solid #e8e8e8;
  padding:8px 10px;
  border-radius: 12px;
  color:#111;
  background:#fff;
}
.back-link:hover{ background:#f7f7f7; }

/*photo descriptions new */
.pg-info{
  padding: 10px 10px 12px;
  background: #fff;
  border-top: 1px solid #ededed;
}

.pg-photo-title{
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: #111;
}

.pg-photo-caption{
  font-size: 12px;
  color: #555;
  line-height: 1.35;
  max-height: 3.9em;            /* about 3 lines */
  overflow: hidden;
}
