/* ============================================================
   FULLERTON GO! — photo albums page (uses styles.css brand vars)
   ============================================================ */

.albums-body { background: var(--paper); }

.albums-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 4%;
  background: var(--paper);
  border-bottom: var(--border);
}
.albums-header .brand { font-family: var(--chunky); font-size: 1.25rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 0.6rem; }
.albums-header .brand em { font-style: normal; color: var(--orange); }
.albums-header .brand-badge { width: 40px; height: 40px; }
.albums-tag {
  font-family: var(--pixel);
  font-size: 0.65rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5em 0.7em;
}
.albums-home { margin-left: auto; padding: 0.55em 0.9em 0.35em; box-shadow: 3px 3px 0 var(--ink); }

.albums-main { padding: 3rem 0 4rem; min-height: 60vh; }
.albums-h1 {
  font-family: var(--chunky);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--ink);
  text-shadow: 4px 4px 0 var(--yellow);
  margin-bottom: 0.4rem;
}
.albums-sub { font-family: var(--pixel); font-size: 0.6rem; color: var(--muted, #5c6478); margin-bottom: 2rem; }
.albums-empty { font-family: var(--pixel); font-size: 0.7rem; padding: 2rem 0; }

/* ---- album grid ---- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.6rem;
}
.album-card {
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  border: var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  display: block;
}
.album-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.album-cover { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--ink); overflow: hidden; border-bottom: var(--border); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-count {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  font-family: var(--pixel);
  font-size: 0.5rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4em 0.6em;
}
.album-meta { display: block; padding: 0.9rem 1rem; }
.album-name { display: block; font-family: var(--chunky); font-size: 1.1rem; }
.album-date { display: block; font-family: var(--pixel); font-size: 0.5rem; color: var(--orange-dark); margin-top: 0.35rem; }

/* ---- album detail ---- */
.album-back {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--yellow);
  border: 2px solid var(--ink);
  padding: 0.6em 0.9em;
  margin-bottom: 1.4rem;
}
.album-back:hover { background: var(--ink); color: var(--yellow); }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}
.media-tile {
  position: relative;
  margin: 0;
  background: var(--ink);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  overflow: hidden;
}
.media-tile img { display: block; width: 100%; height: 220px; object-fit: cover; }
.media-noimg { display: grid; place-items: center; height: 220px; font-family: var(--pixel); font-size: 0.6rem; color: var(--paper); }
.media-tile.is-video { cursor: pointer; }
.media-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 54px; height: 54px;
  display: grid; place-items: center;
  background: rgba(240, 121, 31, 0.92);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 50%;
  font-size: 1.2rem;
}
.media-tile figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.5rem 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(to top, rgba(27,31,61,0.9), transparent);
}

/* lightbox media wrapper (lightbox chrome comes from styles.css) */
.lb-media img, .lb-media video {
  display: block;
  width: 100%;
  max-height: min(74vh, 900px);
  object-fit: contain;
  border: var(--border);
  background: var(--ink);
}

@media (max-width: 600px) {
  .media-tile img, .media-noimg { height: 160px; }
}

/* ============================================================
   BUILDER (only shown with ?admin)
   ============================================================ */
.album-builder {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  width: min(380px, 94vw);
  max-height: 85vh;
  overflow: auto;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow);
}
.album-builder.is-collapsed .ab-body { display: none; }
.ab-head {
  position: sticky;
  top: 0;
  font-family: var(--pixel);
  font-size: 0.7rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ab-x { background: var(--orange); color: #fff; border: 2px solid var(--paper); width: 26px; height: 22px; cursor: pointer; font-weight: 700; }
.ab-body { padding: 0.9rem; }
.ab-hint { font-size: 0.78rem; line-height: 1.5; margin-bottom: 0.7rem; }
.ab-hint b { color: var(--orange-dark); }

.ab-album { border: 2px solid var(--ink); background: #fff; padding: 0.7rem; margin-bottom: 0.9rem; }
.ab-album-head { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.5rem; }
.ab-title { flex: 1; font-family: var(--chunky); font-size: 1rem; border: 2px solid var(--ink); padding: 0.35rem 0.5rem; }
.ab-field { display: flex; flex-direction: column; gap: 0.2rem; font-family: var(--pixel); font-size: 0.42rem; margin-bottom: 0.5rem; }
.ab-field input, .ab-cap { font-family: var(--mono); font-size: 0.8rem; border: 2px solid var(--ink); padding: 0.35rem; background: #fff; width: 100%; }

.ab-items { display: flex; flex-direction: column; gap: 0.4rem; }
.ab-item { display: flex; gap: 0.5rem; align-items: center; border: 2px solid var(--line, #e6e2d9); padding: 0.35rem; }
.ab-thumb { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; background: var(--ink); overflow: hidden; }
.ab-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ab-item-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.ab-item-src { font-family: var(--pixel); font-size: 0.4rem; color: var(--muted, #5c6478); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-item-btns { display: flex; flex-direction: column; gap: 2px; }
.ab-mini { width: 24px; height: 20px; border: 2px solid var(--ink); background: var(--paper); cursor: pointer; font-size: 0.6rem; line-height: 1; }
.ab-mini:hover { background: var(--yellow); }
.ab-del { background: var(--orange); color: #fff; }

.ab-btn {
  font-family: var(--pixel);
  font-size: 0.55rem;
  padding: 0.7em 0.9em;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(27,31,61,0.35);
  cursor: pointer;
  display: inline-block;
}
.ab-btn:hover { background: var(--orange); }
.ab-pick { background: var(--orange); color: #fff; margin-top: 0.5rem; }
.ab-add-album { width: 100%; margin: 0.3rem 0 0.8rem; }
.ab-actions { display: flex; gap: 0.5rem; margin-bottom: 0.6rem; }
.ab-export { background: var(--orange); color: #fff; }
.ab-out { width: 100%; font-family: var(--mono); font-size: 0.72rem; border: 2px solid var(--ink); padding: 0.5rem; background: #fff; }
.ab-files { font-family: var(--mono); font-size: 0.75rem; margin: 0.4rem 0 0 1rem; }
