/* ─────────────────────────────────────────────────────────────────────
   Operforma — Biblioteca article share.

   Two surfaces:
     • .nav-share — the quiet "Compartilhar" control injected into the article
       nav (light reading surface, matches the .nav-links register).
     • .bib-share-* — the share bottom sheet, on the DARK ink surface (brand
       identity), pinned over the whole viewport.

   Behaviour + DOM live in /assets/biblioteca-share.js. Colours come from the
   global dark-surface tokens in tokens.css; the two prototype shades with no
   token are scoped locally on .bib-share-overlay. The cream-paper card palette
   is canvas-only (in the JS), not CSS. */

/* ── Nav control (light reading surface) ──
   Two breakpoint variants, mirroring the site-nav chrome's own
   .site-desktop-only / .site-hamburger split:
     • .nav-share          — labelled control inside the desktop right cluster
       (.site-desktop-only), left of the CTA. Hidden on mobile with the cluster.
     • .nav-share--bar     — icon-only control in the bar next to the hamburger,
       shown only on mobile (where the cluster is hidden). */
.nav-share {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 11px 4px;            /* ≥ 44px tap target with the 22px line height */
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s ease;
}
.nav-share:hover { color: var(--ink); }
.nav-share svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Mobile bar variant — icon-only, matches the hamburger's register. */
.nav-share--bar { display: none; }
@media (max-width: 600px) {
  .nav-share--bar {
    display: inline-flex;
    padding: 8px;
    margin: -8px 4px -8px -8px;
    color: var(--sn-icon, var(--ink));
  }
  .nav-share--bar svg { width: 22px; height: 22px; }
}

/* ── Share sheet (dark ink surface) ── */
.bib-share-overlay {
  --surface-2: #26221C;        /* channel rows — prototype shade, no global token */
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(10, 9, 8, 0);
  transition: background .25s ease;
}
.bib-share-overlay.is-open {
  background: rgba(10, 9, 8, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.bib-share-sheet {
  background: var(--surface);
  border-top: 1px solid var(--line-dark);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding: 12px 22px 30px;
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(102%);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1);
  color: var(--white);
}
.bib-share-overlay.is-open .bib-share-sheet { transform: translateY(0); }

/* Desktop: a centred card rather than a full-bleed bottom sheet. */
@media (min-width: 720px) {
  .bib-share-overlay { justify-content: center; align-items: center; padding: 32px; }
  .bib-share-sheet {
    width: 440px;
    max-width: 100%;
    border: 1px solid var(--line-dark);
    border-radius: 20px;
    transform: translateY(16px);
    opacity: 0;
    transition: transform .28s cubic-bezier(.22, 1, .36, 1), opacity .2s ease;
  }
  .bib-share-overlay.is-open .bib-share-sheet { transform: translateY(0); opacity: 1; }
}

.bib-share-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-dark);
  margin: 0 auto 18px;
}
@media (min-width: 720px) {
  .bib-share-handle { display: none; }
}

.bib-share-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.bib-share-head-text { min-width: 0; }
.bib-share-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--indigo-soft);
}
.bib-share-eyebrow::before {
  content: '';
  display: block;
  width: 18px;
  height: 1px;
  background: currentColor;
  flex-shrink: 0;
}
.bib-share-title {
  margin: 12px 0 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.35;
  color: var(--white);
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bib-share-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin: -4px -8px 0 0;
  color: var(--grey-mid);
  -webkit-tap-highlight-color: transparent;
}
.bib-share-close svg { width: 22px; height: 22px; display: block; }

.bib-share-body {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.bib-share-preview {
  width: 132px;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.bib-share-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bib-share-preview-loading {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-soft);
}
.bib-share-preview-ratio {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(241, 234, 219, 0.55);
}

.bib-share-channels {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bib-share-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  padding: 15px 16px;
  min-height: 64px;
  cursor: pointer;
  color: var(--white);
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s ease, transform .08s ease;
}
.bib-share-row:hover { border-color: var(--indigo-soft); }
.bib-share-row:active { transform: scale(0.99); }
.bib-share-row:disabled { opacity: 0.6; cursor: default; }
.bib-share-row-glyph {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--ink);
  border: 1px solid var(--line-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--indigo-soft);
}
.bib-share-row-glyph svg { width: 22px; height: 22px; }
.bib-share-row-text { flex: 1; min-width: 0; }
.bib-share-row-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  color: var(--white);
}
.bib-share-row-sub {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-mid);
}
.bib-share-row-arr { flex-shrink: 0; color: var(--grey-soft); display: flex; }
.bib-share-row-arr svg { width: 18px; height: 18px; }

.bib-share-hint {
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-soft);
  line-height: 1.6;
}
.bib-share-hint.is-toast {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
  color: var(--grey-mid);
  text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
  .bib-share-overlay,
  .bib-share-sheet { transition: none; }
}
