/* Sharing: the Share button (team pages and public pages) and the public report/finding pages.
   Public pages load only app.css + this file. Every class here is prefixed (share-, pub-)
   because base.html loads this file on every team page too. */

/* ---------- Share button ---------- */
.share-btn svg, .pub-call svg, .pub-actions svg {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.share-btn[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

/* ---------- Public page shell ---------- */
body.pub { background: var(--bg); }
body.pub .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

.pub-header {
  background: var(--surface);
  border-top: 4px solid var(--brand);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.pub-header-inner {
  max-width: 640px; margin: 0 auto; padding: 10px 16px; min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.pub-logo { display: block; max-height: 44px; max-width: 200px; object-fit: contain; }
.pub-org-name {
  font-weight: 800; font-size: 1.15rem; color: var(--brand); min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pub-call { flex: none; min-height: 44px; }

.pub-page { padding-top: 20px; padding-bottom: 32px; }

/* ---------- Hero ---------- */
.pub-hero { margin-bottom: 20px; }
.pub-eyebrow {
  margin: 0 0 6px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand);
}
.pub-address { margin: 0; font-size: 1.65rem; line-height: 1.15; overflow-wrap: anywhere; }
.pub-city { margin: 4px 0 8px; font-size: 1.05rem; color: var(--muted); }
.pub-meta { margin: 0; font-size: 0.9rem; color: var(--muted); }
.pub-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.pub-badges img { height: 40px; width: auto; max-width: 110px; object-fit: contain; }

.pub-cover {
  display: block; margin: 0 0 16px; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4 / 3; background: #e9edf2; box-shadow: var(--shadow);
}
.pub-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

.pub-intro { color: var(--muted); margin: 0 0 16px; }

/* ---------- Overview card ---------- */
.pub-overview { display: grid; gap: 16px; }
.pub-label {
  display: block; margin-bottom: 6px; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.pub-chip-lg { font-size: 1rem; padding: 4px 16px; }
.pub-stat { font-size: 1.3rem; }
.pub-kv { padding-top: 14px; border-top: 1px solid var(--border); }

.pub-text { margin: 0 0 12px; overflow-wrap: anywhere; }
.pub-text:last-child { margin-bottom: 0; }

.pub-actions { margin: 8px 0 28px; }

/* ---------- Findings ---------- */
.pub-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.pub-finding { border-left: 4px solid var(--border); }
.pub-sev-urgent { border-left-color: var(--urgent); }
.pub-sev-repair_soon { border-left-color: var(--repair); }
.pub-sev-monitor { border-left-color: var(--monitor); }
.pub-finding-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.pub-finding-cat { font-weight: 700; }
.pub-noissues { display: flex; align-items: center; gap: 12px; }
.pub-noissues svg {
  width: 36px; height: 36px; flex: none; padding: 6px; border-radius: 50%;
  background: #dcf1e5; fill: none; stroke: var(--ok); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Photo grid ---------- */
.pub-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pub-photo { margin: 0; min-width: 0; }
.pub-photo a {
  display: block; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: #e9edf2;
}
.pub-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pub-photo figcaption { margin-top: 4px; font-size: 0.78rem; line-height: 1.3; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Closing ---------- */
.pub-thanks { border-top: 4px solid var(--brand); }
.pub-signoff { margin: 8px 0 0; font-weight: 700; }

.pub-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}
.pub-footer-inner { max-width: 640px; margin: 0 auto; }
.pub-footer-org { font-weight: 800; font-size: 1.05rem; margin-bottom: 4px; }
.pub-contact { display: flex; flex-direction: column; margin: 6px 0 8px; }
.pub-contact a {
  display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px;
  font-weight: 600; text-decoration: none; overflow-wrap: anywhere;
}
.pub-fineprint { margin: 8px 0 0; font-size: 0.8rem; color: var(--muted); }

/* ---------- Invalid link ---------- */
.pub-missing { margin-top: 48px; padding: 32px 20px; text-align: center; }
.pub-missing svg {
  width: 48px; height: 48px; margin-bottom: 12px;
  fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Photo lightbox (created by sharing.js) ---------- */
.pub-lightbox {
  width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh;
  margin: 0; padding: 0; border: 0; background: transparent;
}
.pub-lightbox::backdrop { background: rgba(10, 14, 20, 0.94); }
.pub-lightbox figure {
  height: 100%; margin: 0; padding: calc(64px + env(safe-area-inset-top)) 12px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.pub-lightbox img { max-width: 100%; max-height: calc(100% - 48px); object-fit: contain; border-radius: 4px; }
.pub-lightbox figcaption { margin-top: 12px; max-width: 560px; color: #fff; text-align: center; }
.pub-lightbox-close {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 28px; line-height: 1; cursor: pointer;
}
