/* A pattern's links (stitch/sharing.js), on the studio and the stitching page alike: the dialog's frame
   and its main buttons are each page's own (.notice / .sew-card, .button / .px-btn); this is what is
   inside it. Colors are the pages' tokens (the stitching page's dark screen swaps them). */
.share-box { width: min(380px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
.share-title { display: flex; align-items: center; gap: 5px; margin: 0 0 14px; font-size: 16px; font-weight: 500; }
.share-info {
  display: inline-grid; place-items: center; flex: none; width: 15px; height: 15px; padding: 0;
  border: 1.2px solid var(--ink-3); border-radius: 50%; background: none; color: var(--ink-3);
  font: 700 9.5px/1 var(--sans); cursor: pointer;
}
.share-info[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }
.share-box .share-about {   /* (.share-box: over the dialogs' own p rules)  what a link holds: a small tip over what is under the title (it takes no room), pointing at the ⓘ (sharing.js places it) */
  position: absolute; z-index: 2; max-width: calc(100% - 44px); margin: 0; padding: 7px 11px; border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  background: #2b2622; color: #fffbe9; font-size: 11.5px; line-height: 1.5; white-space: pre-line;
}
.share-about::before {
  content: ""; position: absolute; top: -5px; left: var(--tip, 20px); margin-left: -5px;
  border: 5px solid transparent; border-top: 0; border-bottom-color: #2b2622;
}
.share-make { width: 100%; justify-content: center; }
.share-make:disabled { opacity: .45; cursor: default; }
.share-login { text-align: center; }
.share-login p { margin: 4px 0 12px; color: var(--ink-2); font-size: 13px; line-height: 1.6; white-space: pre-line; }
.share-login a { width: 100%; justify-content: center; text-decoration: none; }
.share-has, .share-none { margin: 8px 0 0; color: var(--ink-3); font-size: 12px; text-align: center; }
.share-error { margin: 8px 0 0; color: var(--danger, #b3261e); font-size: 13px; }
.share-status { margin: 10px 0 0; color: var(--ink-2); font-size: 12.5px; text-align: center; }

.share-list { margin: 10px 0 0; padding: 0; list-style: none; }
.share-item { border-top: 1px solid var(--line); }
.share-item.open { margin: 6px -10px; padding: 0 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card, #fffbe9); }
.share-item.open + .share-item { border-top-color: transparent; }
/* every row alike (sharing.js rowOf): its picture, two lines, then copy · send · ⋯ */
.share-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.share-head { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
div.share-head { cursor: default; }
.share-head b { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-tools { flex: none; display: flex; align-items: center; gap: 6px; }
.share-head i { font-style: normal; font-weight: 400; color: var(--ink-2); font-size: 13px; }
.share-now {
  display: inline-block; padding: 0 7px; border: 1.5px solid #5f7d4a; border-radius: 999px;
  color: #3f5a2e; font-size: 11px; font-weight: 700; vertical-align: 1px; white-space: nowrap;
}
:root[data-theme="dark"] .share-now { border-color: #8fb071; color: #b7d39b; }
.share-url, .share-sub { display: block; margin-top: 3px; color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-sub .share-url { display: inline; }      /* after the "now" chip, on its line */
.share-icon {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0;
  border: 1.5px solid var(--line); border-radius: 8px; background: var(--card, #fff); color: var(--ink); cursor: pointer;
}
.share-icon svg { width: 15px; height: 15px; }
.share-icon:hover { border-color: var(--ink-3); }
.share-icon:disabled { opacity: .35; cursor: default; }
.share-dots {
  flex: none; width: 22px; height: 34px; padding: 0; border: 0; background: none; color: var(--ink-3); font-size: 17px; line-height: 1; cursor: pointer;
}
.share-dots[aria-expanded="true"] { color: var(--ink); }

.share-more { display: grid; gap: 10px; }
.share-swap {
  width: 100%; padding: 9px 10px; border: 1.5px solid #5f7d4a; border-radius: 8px; background: var(--card, #fff);
  color: #3f5a2e; font: 600 13px/1 var(--sans); cursor: pointer;
}
:root[data-theme="dark"] .share-swap { border-color: #8fb071; color: #b7d39b; }
.share-swap:disabled { opacity: .5; cursor: default; }
.share-acts { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.share-act {
  display: inline-flex; align-items: center; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--card, #fff); color: var(--ink); font: 600 12.5px/1 var(--sans); text-decoration: none; white-space: nowrap;
}
.share-bin { margin-left: auto; border-color: transparent; background: none; color: var(--ink-3); }

/* the pattern behind a link, as big as the screen lets it be: anywhere closes it */
.share-view {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 16px; border: 0;
  background: rgba(20, 18, 16, .92); cursor: zoom-out;
}
.share-view[open] { display: grid; place-items: center; }
.share-view::backdrop { background: transparent; }
.share-view canvas { display: block; image-rendering: pixelated; }

/* the studio has no danger button of its own (the stitching page's .px-btn.danger is pxbtn.css) */
.button.danger { background: #c4452b; color: #fff; box-shadow: none; }

/* a workshop pattern's links as its history (a git log): a line down the left, a dot a version, the
   pattern as it is now green, the beginning filled; versions with no link now, and someone else's, quieter */
.share-list.share-line { position: relative; padding-left: 20px; }
.share-list.share-line::before { content: ""; position: absolute; left: 6px; top: 18px; bottom: 18px; border-left: 2px solid var(--line); }
.share-line > .share-item { position: relative; }
.share-line > .share-item::before { content: ""; position: absolute; left: -19px; top: 28px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink-3); box-sizing: border-box; }
.share-line > .share-item.open::before { left: -9px; }
.share-line > .share-item.theirs::before { border-style: dashed; }
.share-line > .share-item.first::before { background: var(--ink-3); border-style: solid; }
.share-line > .share-item.now::before { background: #5f7d4a; border-color: #5f7d4a; }
:root[data-theme="dark"] .share-line > .share-item.now::before { background: #8fb071; border-color: #8fb071; }
.share-tag { display: inline-block; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; font-size: 10.5px; font-weight: 500; color: var(--ink-2); vertical-align: 1px; }
.share-thumb { flex: none; width: 46px; height: 46px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--sand); cursor: pointer; }
span.share-thumb { cursor: default; }
/* the picture is a link's preview card (thumb.js: the pattern in the middle of a 1200 × 630 paper): its middle, close */
.share-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); }
/* "copied", a moment over the button pressed (sharing.js tipOver) */
.share-tip { position: absolute; z-index: 3; transform: translate(-50%, -100%); padding: 4px 9px; border-radius: 6px; background: #2b2622; color: #fffbe9;
  font-size: 11.5px; white-space: nowrap; pointer-events: none; animation: share-tip 1.4s ease forwards; }
.share-tip::after { content: ""; position: absolute; left: 50%; bottom: -4px; margin-left: -4px; border: 4px solid transparent; border-bottom: 0; border-top-color: #2b2622; }
@keyframes share-tip { 0% { opacity: 0; } 10%, 75% { opacity: 1; } 100% { opacity: 0; } }
