/* ===========================================================================
   N5 Galleries · tenant pages
   Public subdomain listing ({user}.n5galleries.com) and password gate.
   Loads after theme.css. Uses only theme tokens.
   =========================================================================== */

.page-tenant { background: var(--bg); }
.tenant-main { padding: 0; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- HEADER (photographer name banner) ---------- */
.tenant-header {
  padding: 88px 32px 56px;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
}
.tenant-header-inner { max-width: 1200px; margin: 0 auto; }
.tenant-eyebrow {
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
  font-weight: 500;
}
.tenant-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -.015em;
  margin: 0;
  color: var(--text);
}

/* ---------- GALLERY GRID ---------- */
.tenant-content {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 56px 32px 80px;
}
.tenant-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.tenant-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.tenant-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
  color: var(--text);
}
.tenant-cover {
  aspect-ratio: 4 / 3;
  background: var(--surface-alt) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line-soft);
}
.tenant-cover-placeholder {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--text-muted);
  padding: 0 24px;
  text-align: center;
}
.tenant-card-meta { padding: 18px 22px 22px; }
.tenant-card-meta h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -.01em;
  margin: 0 0 4px;
  color: var(--text);
}
.tenant-card-meta span {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tenant-empty {
  text-align: center;
  padding: 80px 32px;
  color: var(--text-muted);
}

/* ---------- FOOTER ---------- */
.tenant-footer {
  text-align: center;
  padding: 32px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.tenant-footer a { color: var(--text-secondary); }
.tenant-footer a:hover { color: var(--text); }

/* ---------- PASSWORD GATE ---------- */
.page-gate { background: var(--bg); }
.gate-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 44px 36px 36px;
  box-shadow: var(--shadow);
  text-align: center;
}
.gate-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--text);
  margin-bottom: 18px;
}
.gate-icon-expired {
  background: var(--danger-soft);
  color: var(--danger);
}
.gate-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -.01em;
  margin: 0 0 8px;
  color: var(--text);
}
.gate-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 24px;
  line-height: 1.5;
}
.gate-form { text-align: left; }
.gate-cancel {
  margin-top: 8px;
  text-align: center;
}
.gate-credit {
  margin: 22px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: .04em;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 720px) {
  .tenant-header { padding: 56px 20px 36px; }
  .tenant-content { padding: 36px 20px 60px; }
  .tenant-grid { gap: 18px; grid-template-columns: 1fr; }
  .gate-card { padding: 32px 24px; }
}

/* ============================================================
   Subdomain extras: main-site link, photo-count meta, lock badge,
   client-not-found 404 panel.
   ============================================================ */

/* Top-right action cluster on the tenant header. Holds Client Login + Visit main site.
   Was absolutely positioned when there was only one link; now a flex row of two items. */
.tenant-header { position: relative; }
.tenant-header-actions {
  position: absolute;
  top: 24px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.tenant-mainlink {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  font-family: inherit;
  transition:
    color var(--dur-fast) var(--ease),
    border-bottom-color var(--dur-fast) var(--ease);
}
.tenant-mainlink:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}
.tenant-mainlink--button {
  /* Render the button identically to the link siblings — no native button chrome. */
  padding: 6px 0;
}

/* Per-client gallery search input — sits centered below the photographer name. */
.tenant-search {
  position: relative;
  margin: 22px auto 0;
  max-width: 360px;
  display: flex;
  align-items: center;
}
.tenant-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: inline-flex;
}
.tenant-search-input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.tenant-search-input::placeholder { color: var(--text-muted); }
.tenant-search-input:focus {
  border-color: var(--text-secondary);
  box-shadow: 0 0 0 3px rgba(56, 55, 58, 0.08);
}

/* ============================================================
   Gallery view: floating action bar over the cover (Home, Client
   Login, Main site). Positioned absolutely so it sits in the top-
   right corner above the cover image without affecting layout.
   ============================================================ */
.cover-actions {
  position: absolute;
  top: 24px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 4;
}
.cover-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  font-family: inherit;
  transition:
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}
.cover-action:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.cover-action svg { flex-shrink: 0; }

/* Same buttons appear on the password gate page, but the gate's background is light
   (var(--surface)) — so use dark text instead of white. */
.gate-actions {
  position: fixed;
  top: 24px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 4;
}
.gate-actions .cover-action {
  background: var(--surface);
  color: var(--text-secondary);
  border-color: var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.gate-actions .cover-action:hover {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--line);
}

@media (max-width: 640px) {
  .tenant-header-actions {
    right: 20px;
    gap: 12px;
  }
  .cover-actions, .gate-actions {
    right: 20px;
    top: 20px;
    gap: 6px;
  }
  .cover-action {
    padding: 6px 10px;
    font-size: 11px;
  }
  .cover-action span { display: none; }   /* icon-only on narrow screens to save space */
  .cover-action svg { width: 18px; height: 18px; }
}

/* Photo count + date row under each gallery name */
.tenant-card-stats {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: .02em;
}
.tenant-card-stats .dot-sep {
  margin: 0 6px;
  opacity: .55;
}

/* Small lock badge overlaid on private gallery covers */
.tenant-cover { position: relative; }
.tenant-card-lock {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* "Client gallery not found" panel — replaces framework 404 for tenant subdomains */
.tenant-404 {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.tenant-404-card {
  max-width: 480px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .04);
}
.tenant-404-card h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -.01em;
  margin: 0 0 12px;
  color: var(--text);
}
.tenant-404-card p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 28px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .tenant-mainlink { top: 20px; right: 20px; }
  .tenant-404-card { padding: 36px 24px; }
}
