/* ==========================================================================
   Liam Senekal Photography — Client Gallery System
   Shared stylesheet. Do not duplicate per-gallery — every property page
   links to this one file at /assets/style.css
   ========================================================================== */

:root {
  --paper: #f3f2ee;
  --surface: #ffffff;
  --ink: #1a1d1e;
  --ink-soft: #5b5f5c;
  --brass: #9c7a45;
  --brass-soft: #c9b48c;
  --line: #dad8d1;
  --overlay: rgba(15, 16, 17, 0.94);
  --radius: 2px;
  --maxw: 1320px;

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; }

img { display: block; max-width: 100%; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Header / "listing plaque" ---------- */

.gallery-header {
  padding: 36px 0 30px;
  border-bottom: 1px solid var(--line);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.brand-mark {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mark:hover { color: var(--brass); }

.brand-mark svg { width: 14px; height: 14px; fill: var(--brass); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 10px;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--brass);
  margin-right: 10px;
  vertical-align: middle;
}

.property-address {
  font-family: var(--font-display);
  font-weight: 480;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.12;
  margin: 0 0 16px;
  max-width: 16ch;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}

.meta-row span b {
  color: var(--ink);
  font-weight: 500;
}

.gallery-actions {
  margin-top: 18px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.action-btn svg { width: 14px; height: 14px; }

.action-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.action-btn:disabled {
  opacity: 0.55;
  cursor: default;
  background: none;
  color: var(--ink);
}

/* ---------- Grid ---------- */

.gallery-grid {
  padding: 32px 0 120px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.frame {
  position: relative;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  opacity: 0;
  animation: frame-in 0.5s ease forwards;
}

@keyframes frame-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.frame-img-wrap {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--line);
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.frame:hover img { transform: scale(1.035); }

.frame-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(15, 16, 17, 0.55);
  padding: 4px 8px;
  border-left: 2px solid var(--brass);
  backdrop-filter: blur(2px);
}

.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 16, 17, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.fav-btn:hover { transform: scale(1.08); }

.fav-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.fav-btn.active { background: var(--brass); }
.fav-btn.active svg { fill: #fff; stroke: #fff; }

/* ---------- Selection bar ---------- */

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 120%);
  z-index: 40;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 12px 10px 12px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s ease;
  max-width: calc(100vw - 32px);
  overflow-x: auto;
}

.selection-bar.visible { transform: translate(-50%, 0); }

.selection-bar b { color: var(--brass-soft); }

.selection-bar button {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--brass);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
}

.selection-bar button:hover { background: var(--brass-soft); }

.selection-bar button:disabled {
  opacity: 0.6;
  cursor: default;
}

.selection-bar #download-fav-btn {
  background: none;
  border: 1px solid var(--brass);
  color: var(--brass-soft);
}

.selection-bar #download-fav-btn:hover {
  background: var(--brass);
  color: #fff;
}

.selection-bar .clear-btn {
  background: none;
  color: var(--ink-soft);
  padding: 9px 10px;
}

.selection-bar .clear-btn:hover { color: #fff; background: none; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox-img-wrap {
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lb-btn {
  pointer-events: all;
  position: absolute;
  background: none;
  border: none;
  color: var(--paper);
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.lb-btn:hover { opacity: 1; }

.lb-close {
  top: 22px;
  right: 26px;
}
.lb-close svg { width: 22px; height: 22px; }

.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
}
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb-prev svg, .lb-next svg { width: 30px; height: 30px; }

.lb-bottom-row {
  pointer-events: none;
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.lb-fav, .lb-download {
  pointer-events: all;
  position: static;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.lb-fav svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--paper);
  stroke-width: 1.8;
}

.lb-fav.active svg { fill: var(--brass-soft); stroke: var(--brass-soft); }

.lb-download svg { width: 16px; height: 16px; }

.lb-download:disabled { opacity: 0.6; cursor: default; }

.lb-counter {
  top: 24px;
  left: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--brass-soft);
}

@media (max-width: 640px) {
  .lb-prev, .lb-next { display: none; }
  .lightbox img { max-height: 70vh; }
  .lb-bottom-row { gap: 8px; bottom: 18px; }
  .lb-fav, .lb-download { padding: 9px 14px; font-size: 11px; }
}

/* ---------- Footer ---------- */

.gallery-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 60px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-footer a { color: var(--ink-soft); text-decoration: none; }
.gallery-footer a:hover { color: var(--brass); }

@media (prefers-reduced-motion: reduce) {
  .frame, .frame img, .lb-btn, .selection-bar { transition: none !important; animation: none !important; }
}
