/* The share sheet (share.js): in the site's own paper, ink and petal colours, like the card itself. */
.ss-share {
  width: min(460px, 94vw);
  max-width: none;
  max-height: 94dvh;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 28px;
  color: var(--color-ink);
  background:
    radial-gradient(60% 40% at 90% 0%, color-mix(in srgb, var(--color-petal-light) 45%, transparent), transparent 70%),
    radial-gradient(55% 40% at 0% 100%, color-mix(in srgb, var(--color-leaf-light) 25%, transparent), transparent 70%),
    var(--color-paper);
  box-shadow: 0 40px 90px -30px rgba(36, 31, 38, 0.55);
  overflow: auto;
  overscroll-behavior: contain;
}
.ss-share[open] { animation: sh-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1); }
.ss-share.closing { animation: sh-out 0.22s ease-in forwards; }
.ss-share::backdrop { background: rgba(36, 31, 38, 0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@keyframes sh-in { from { opacity: 0; translate: 0 26px; scale: 0.97; } }
@keyframes sh-out { to { opacity: 0; translate: 0 18px; } }

.sh-body { display: grid; justify-items: center; gap: 10px; padding: 22px 18px 16px; text-align: center; }
.ss-share h2 { margin: 4px 0 0; font: 700 40px/1 var(--font-hand); color: var(--color-ink); }
.ss-share h2 em { font-style: normal; color: var(--color-petal-shade); }
.sh-lede { margin: -4px 0 2px; font: italic 500 18px/1.35 var(--font-serif); color: var(--color-name); }

.sh-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1.5px solid rgba(36, 31, 38, 0.14);
  border-radius: 50%;
  color: var(--color-ink);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}
.sh-close svg { width: 20px; }
.sh-close:hover { border-color: var(--color-petal); }

/* the card shrinks on short screens so the buttons always fit without scrolling */
.sh-card { width: min(100%, 300px, calc((94dvh - 290px) * 0.8)); margin: 4px 0; }
.sh-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 24px 46px -22px rgba(36, 31, 38, 0.55), 0 0 0 1px rgba(36, 31, 38, 0.08);
  background: var(--color-paper);
}

.sh-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.sh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1.5px solid rgba(36, 31, 38, 0.16);
  border-radius: 99px;
  font: 600 14.5px/1 var(--font-ui);
  color: var(--color-ink);
  background: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: translate 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease;
}
.sh-btn svg { width: 18px; }
.sh-btn:hover { translate: 0 -2px; border-color: var(--color-petal); }
/* the main button, like the site's sticker buttons */
.sh-btn.primary {
  border: 2px solid var(--color-ink);
  background: linear-gradient(180deg, var(--color-petal-light), var(--color-petal));
  box-shadow: 0 3px 0 var(--color-ink);
}
:is(.sh-btn, .sh-close):focus-visible { outline: 2.5px solid var(--color-leaf); outline-offset: 3px; }
.sh-note { min-height: 1.2em; margin: 0; font: italic 600 16px/1.2 var(--font-serif); color: var(--color-leaf-shade); }
/* narrow phones: the three buttons still fit on one row */
@media (max-width: 420px) {
  .sh-actions { gap: 6px; }
  .sh-btn { gap: 6px; padding: 11px 12px; font-size: 13.5px; }
  .sh-btn svg { width: 16px; }
}
.sh-more { display: none; }

/* tablets: a bigger card, same single column */
@media (min-width: 600px) and (min-height: 760px) {
  .ss-share { width: min(540px, 92vw); }
  .sh-card { width: min(100%, 380px, calc((94dvh - 290px) * 0.8)); }
}

/* wide screens (and phones held sideways): side by side — the card large on the left, the words
   and buttons on the right */
@media (min-width: 700px) and (orientation: landscape) {
  .ss-share { width: min(1040px, 92vw); border-radius: 34px; }
  .sh-body {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 1fr auto auto auto auto 1fr;
    grid-template-areas: "card ." "card title" "card lede" "card more" "card actions" "card note";
    justify-items: start;
    align-items: start;
    column-gap: clamp(32px, 4vw, 56px);
    row-gap: 0;
    padding: clamp(28px, 4vh, 44px) clamp(32px, 4vw, 56px);
    text-align: left;
  }
  .ss-share h2 { grid-area: title; margin: 0; font-size: clamp(44px, 4vw, 56px); white-space: nowrap; }
  .sh-lede { grid-area: lede; margin: 10px 0 0; font-size: 22px; }
  .sh-more {
    grid-area: more;
    display: block;
    max-width: 32ch;
    margin: 18px 0 0;
    font: 400 15.5px/1.55 var(--font-ui);
    color: rgba(36, 31, 38, 0.62);
  }
  /* the card: as tall as the screen comfortably allows */
  .sh-card { grid-area: card; width: min(480px, 46vw, calc((94dvh - 2 * clamp(28px, 4vh, 44px)) * 0.8)); margin: 0; }
  .sh-card img { border-radius: 24px; }
  .sh-actions { grid-area: actions; display: grid; justify-content: stretch; gap: 10px; width: min(100%, 280px); margin-top: 28px; }
  .sh-btn { justify-content: center; padding: 14px 20px; font-size: 15px; }
  .sh-note { grid-area: note; margin-top: 14px; }
  .sh-close { top: 18px; right: 18px; }
}

@media (prefers-reduced-motion: reduce) { .ss-share[open], .ss-share.closing { animation: none; } }
/* short landscape screens (a phone held sideways): a tighter right column
   so nothing needs scrolling */
@media (min-width: 700px) and (orientation: landscape) and (max-height: 560px) {
  .sh-body { padding: 18px 28px; }
  .ss-share h2 { font-size: 38px; }
  .sh-lede { font-size: 18px; margin-top: 4px; }
  .sh-more { display: none; }
  .sh-actions { margin-top: 16px; gap: 8px; }
  .sh-btn { padding: 10px 16px; }
  .sh-card { width: calc((94dvh - 36px) * 0.8); }
}
