/* ==========================================================================
   Everything a logged-out visitor sees: the public site at
   photography.oriamur.com and share links alike. Deliberately calm and
   chrome-free — the photographs are the interface.
   ========================================================================== */

body.gal {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

body.gal main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  padding: clamp(1.5rem, 5vw, 3rem) var(--pad);
}

body.gal main > .back {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-decoration: none;
  margin-bottom: 0.75rem;
}
body.gal main > .back:hover { color: var(--accent); }

.gal-title {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}
.gal-desc {
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 0 0.5rem;
}
body.gal .count {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: clamp(1.25rem, 4vw, 2rem);
}

/* ------------------------------------------------------------- front page */

.pub-intro { margin-bottom: clamp(1.5rem, 4vw, 2.25rem); }
.pub-intro h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}
.pub-intro .sub { color: var(--text-muted); max-width: 60ch; margin: 0; }

.pub-covers .cover-card .ph {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--surface-2);
}

/*
 * Tiles are laid out by the .pv-grid / .pv-item rules in app.css, which is where
 * the three gallery layouts (grid / masonry / feature) live — the share page and
 * the owner's gallery view deliberately render identically. `.gal-tile` remains
 * only as the JavaScript hook for the lightbox.
 */

.msg {
  text-align: center;
  color: var(--text-muted);
  padding: 4rem 1rem;
}
.msg h1 {
  color: var(--text);
  font-size: 1.5rem;
}

.gal-foot {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}
.gal-foot p { margin: 0.2rem 0; }
.gal-foot .fine { opacity: 0.7; }

.lb-note { display: block; font-size: 0.78rem; opacity: 0.7; margin-top: 0.3rem; }

.lb-order {
  margin-left: 0.75rem;
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.lb-order:hover { background: var(--surface-2); border-color: var(--accent); }

/* ------------------------------------------------------------ print enquiry */

.order-dlg {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: min(560px, 92vw);
  max-height: 88dvh;
}
.order-dlg::backdrop { background: rgba(0, 0, 0, 0.72); }
.order-dlg form { padding: 1.25rem 1.35rem 1.35rem; display: grid; gap: 0.85rem; }
.order-dlg header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.order-dlg h2 { margin: 0; font-size: 1.25rem; }
.order-dlg .sub { color: var(--text-muted); font-size: 0.88rem; margin: 0; }
.order-dlg label { display: grid; gap: 0.3rem; font-size: 0.85rem; color: var(--text-muted); }
.order-dlg .fine { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

.order-grid { display: grid; grid-template-columns: 1fr 1fr 90px; gap: 0.7rem; }
@media (max-width: 520px) {
  .order-grid { grid-template-columns: 1fr; }
}

.order-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }

.order-msg {
  margin: 0;
  font-size: 0.88rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-muted);
}
.order-msg.ok { color: #c9f5d6; border: 1px solid #2c6b43; }
.order-msg.bad { color: #ffd7d8; border: 1px solid #5b2326; }

/* ------------------------------------------------------- image protections */

/*
 * Turns off the two accidental ways to walk off with a file: dragging a photo
 * out of the page, and long-press → "Save image" on a phone. Right-click is
 * handled in gallery.js, which can be selective about it.
 *
 * None of this stops a screenshot, and it isn't meant to. The real limit is the
 * resolution these pages are given — the ~2048px derivative, never the
 * original. See src/config.ts.
 */
body.gal .pv-item img,
body.gal .lb img,
body.gal .cover-card img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}

@media (max-width: 600px) {
  .gal-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
  .lb-nav { width: 40px; height: 40px; }
}
