/* Share buttons of a debate (A3 §10). Uses the main.css tokens (loaded after dupeeats-main). */

.debate-share {
  margin-top: var(--s-6);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}

.share-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  margin-bottom: var(--s-4);
}
.share-title { font-size: var(--fs-md); font-weight: 700; }
.share-link { font-size: var(--fs-sm); color: var(--muted); }
.share-link a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.share-link a:hover { color: var(--ink); text-decoration-color: currentColor; }

.share-body {
  display: grid;
  gap: var(--s-5);
  align-items: start;
}

.share-btns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.share-btn:hover { background: var(--sunken); }
.share-btn:active { transform: scale(0.97); }
.share-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ink), var(--ring); }
.share-btn[hidden] { display: none; }
/* Native share only where the browser has it: html.can-share is set in <head>, so
   the row never shifts when share.js runs (A11 review P1-2). */
.share-btn--native { display: none; }
.can-share .share-btn--native { display: inline-flex; }
.share-btn .icon { width: 18px; height: 18px; }

/* A typographic X, no third-party logo. */
.share-x {
  display: inline-block;
  width: 18px;
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.share-preview { margin: 0; width: 120px; }
.share-preview[hidden] { display: none; }
.share-preview img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  border-radius: var(--r-md);
  background: var(--sunken);
  box-shadow: 0 0 0 1px var(--line);
}

@media (min-width: 560px) {
  .share-btns { display: flex; flex-wrap: wrap; }
  .share-btn { justify-content: flex-start; }
}

@media (min-width: 720px) {
  .share-body { grid-template-columns: minmax(0, 1fr) auto; }
  .share-preview { width: 132px; }
}

@media (prefers-reduced-motion: reduce) {
  .share-btn { transition: none; }
  .share-btn:active { transform: none; }
}
