/* "Share Solyenne" panel. Colours come from the website theme tokens. */
.share-sheet {
  --share-select: var(--primary);
  box-sizing: border-box;
  width: min(1040px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  color: var(--ink);
  font: 500 16px/1.5 Manrope, system-ui, sans-serif;
}

.share-sheet::backdrop {
  background: rgba(17, 26, 29, 0.55);
}

.share-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 0;
}

.share-sheet__head h2 {
  margin: 0;
  font: 600 28px/1.2 Quicksand, system-ui, sans-serif;
}

.share-sheet__close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font: 400 26px/1 Manrope, sans-serif;
  cursor: pointer;
}

.share-sheet__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  padding: 16px 24px 24px;
}

.share-sheet fieldset {
  min-width: 0;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.share-sheet legend {
  margin-bottom: 10px;
  padding: 0;
  font: 700 14px/1.3 Manrope, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.share-sheet__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.share-formats__list {
  display: grid;
  gap: 10px;
}

.share-formats__option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  cursor: pointer;
}

.share-formats__option span {
  font-size: 14px;
  color: var(--muted);
}

.share-themes__list {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 4px 2px 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.share-themes__option {
  display: flex;
  flex: 0 0 104px;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  width: 104px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  scroll-snap-align: start;
  cursor: pointer;
}

.share-sheet__swatch {
  display: block;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.share-themes__name {
  font: 600 13px/1.25 Manrope, sans-serif;
  text-align: center;
}

.share-formats__option:has(:checked),
.share-themes__option:has(:checked) {
  border-color: var(--share-select);
}

.share-formats__option:has(:focus-visible),
.share-themes__option:has(:focus-visible),
.share-sheet button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.share-sheet__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.share-sheet__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 200px;
  padding: 12px;
  box-sizing: border-box;
  border-radius: 20px;
  background: var(--soft);
}

.share-sheet__caption {
  margin: 0 0 10px;
  font: 700 15px/1.3 Manrope, sans-serif;
  color: var(--muted);
}

.share-sheet__canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(52dvh, 520px);
  border-radius: 28px;
  box-shadow: 0 10px 32px rgba(17, 26, 29, 0.18);
}

.share-sheet__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.share-sheet__action,
.share-sheet__secondary {
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  font: 700 16px/1.2 Manrope, sans-serif;
  cursor: pointer;
}

.share-sheet__action {
  border: 2px solid var(--share-select);
  background: var(--share-select);
  color: var(--paper);
}

.share-sheet[data-dark="true"] .share-sheet__action {
  color: var(--cream);
}

.share-sheet__secondary {
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.share-sheet__action:disabled {
  opacity: 0.6;
  cursor: progress;
}

.share-sheet__status {
  min-height: 1.5em;
  margin: 0;
  font-size: 14px;
  text-align: center;
  color: var(--muted);
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .share-sheet__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .share-sheet__canvas {
    max-height: 42dvh;
  }
}

.article-share-open {
  align-self: flex-start;
}

.article-share-open:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.share-sheet__instructions {
  margin: 0 0 20px;
}

@media (max-width: 760px) {
  .share-sheet--article .share-sheet__preview {
    order: 1;
  }
}

.share-sheet__slide-controls {
  margin-top: 12px;
}

.share-sheet__slide-controls[hidden] {
  display: none;
}

.share-sheet--article .share-themes__list {
  flex-wrap: wrap;
  overflow: visible;
  gap: 4px;
  padding: 4px;
}

.share-sheet--article .share-themes__option {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 5px;
  border-radius: 50%;
}

.share-sheet--article .share-sheet__swatch {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}
