/* Quick share for visitors: the page's share bar, a section's "Share this" button and its menu, and the highlight
   when someone opens a link to one section. Built from the site's tokens (site/css/tokens.css); every element here
   carries data-cms-feature. Owned by the "share" piece (cms/public/share -> site/cms/share). */

/* ---------- the page's share bar ---------- */
.cms-share { padding: 0 var(--gutter, 24px); background: var(--canvas, #fbf9f4); color: var(--ink, #111b1d); font-family: var(--font-sans, system-ui, sans-serif); }
.cms-share-end { position: relative; z-index: 1; padding-block: var(--space-9, 48px) var(--space-10, 64px); }
.cms-share-top { padding-block: var(--space-6, 24px); border-bottom: 1px solid var(--line, rgba(17,27,29,.1)); }
.cms-share-in { display: flex; align-items: center; gap: var(--space-4, 16px) var(--space-7, 32px); flex-wrap: wrap; }
.cms-share-end .cms-share-in { padding-top: var(--space-7, 32px); border-top: 1px solid var(--line, rgba(17,27,29,.1)); }
.cms-share-title { display: flex; align-items: center; gap: 10px; margin: 0; margin-right: auto; font-size: var(--fs-eyebrow, 13px); font-weight: var(--fw-ui, 500); line-height: 1.3; letter-spacing: var(--tracking-eyebrow, .12em); text-transform: uppercase; color: var(--teal-700, #0a625c); }
.cms-share-title::before { content: ""; width: 13px; height: 13px; flex: 0 0 auto; border-radius: 50%; border: 1.5px solid currentColor; background: radial-gradient(circle, currentColor 0 2px, transparent 2.6px); }
.cms-share-list { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.cms-share-li { margin: 0; }
.cms-share-li[hidden] { display: none; }
.cms-share-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; min-width: 44px; padding: 0; border: 0; border-radius: 999px; background: var(--surface, #fff); color: var(--ink, #111b1d); font: inherit; font-size: var(--fs-small, 14px); font-weight: var(--fw-ui, 500); text-decoration: none; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-2, rgba(17,27,29,.18)); transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .3s var(--ease-spring, cubic-bezier(.34,1.4,.64,1)); -webkit-tap-highlight-color: transparent; }
.cms-share-ico { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; }
.cms-share-ico svg { width: 20px; height: 20px; display: block; }
.cms-share-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* the two buttons that say what they do: the phone's share sheet and Copy link. Copy link is as wide as its longer
   label ("Link copied"), so the row never jumps when it changes */
.cms-share-btn:is([data-net="copy"], [data-net="native"]) { padding-right: 18px; }
.cms-share-btn:is([data-net="copy"], [data-net="native"]) .cms-share-ico { width: 36px; margin-left: 6px; }
.cms-share-btn:is([data-net="copy"], [data-net="native"]) .cms-share-name { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
.cms-share-btn[data-net="copy"] .cms-share-name { display: inline-flex; flex-direction: column; }
.cms-share-btn[data-net="copy"] .cms-share-name::after { content: "Link copied"; height: 0; overflow: hidden; visibility: hidden; }
.cms-share-btn[data-net="native"] { background: var(--accent, #00857a); color: var(--on-accent, #fff); box-shadow: none; }
.cms-share-btn:focus-visible { outline: 2px solid var(--teal-500, #128f86); outline-offset: 3px; }
@media (hover: hover) {
  .cms-share-btn:hover { background: var(--ink, #111b1d); color: var(--canvas, #fbf9f4); box-shadow: none; transform: translateY(-2px); }
  .cms-share-btn[data-net="native"]:hover { background: var(--accent-hover, #0a625c); color: #fff; }
}
.cms-share-btn.is-done { background: var(--teal-50, #e9f6f2); color: var(--teal-800, #0a4c48); box-shadow: inset 0 0 0 1.5px var(--teal-500, #128f86); transform: none; }
@media (hover: hover) and (min-width: 641px) {
  .cms-share-btn.is-done:hover { background: var(--teal-50, #e9f6f2); color: var(--teal-800, #0a4c48); box-shadow: inset 0 0 0 1.5px var(--teal-500, #128f86); transform: none; }
}
.cms-share-live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* phones: a share-sheet grid, every way to share with its name under it */
@media (max-width: 640px) {
  .cms-share-end { padding-block: var(--space-7, 32px) var(--space-9, 48px); }
  .cms-share-in { display: block; }
  .cms-share-title { margin-bottom: var(--space-5, 20px); }
  .cms-share-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4, 16px) 8px; align-items: start; }
  .cms-share-btn, .cms-share-btn:is([data-net="copy"], [data-net="native"]) { flex-direction: column; gap: 7px; width: 100%; height: auto; min-width: 0; padding: 0; background: none; box-shadow: none; color: var(--ink-2, #3a4548); font-size: 12px; line-height: 1.25; text-align: center; }
  .cms-share-btn .cms-share-ico, .cms-share-btn:is([data-net="copy"], [data-net="native"]) .cms-share-ico { width: 52px; height: 52px; margin: 0; border-radius: 999px; background: var(--surface, #fff); color: var(--ink, #111b1d); box-shadow: inset 0 0 0 1px var(--line-2, rgba(17,27,29,.18)); transition: background-color .18s ease, color .18s ease; }
  .cms-share-btn .cms-share-ico svg { width: 22px; height: 22px; }
  .cms-share-btn .cms-share-name { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
  .cms-share-btn[data-net="native"] { background: none; color: var(--ink-2, #3a4548); }
  .cms-share-btn[data-net="native"] .cms-share-ico { background: var(--accent, #00857a); color: #fff; box-shadow: none; }
  .cms-share-btn:active .cms-share-ico { transform: scale(.94); }
  /* a narrow window with a mouse: hovering lights up the circle only, never the whole stacked button */
  .cms-share-btn[data-net]:hover { background: none; box-shadow: none; color: var(--ink-2, #3a4548); transform: none; }
  .cms-share-btn.is-done, .cms-share-btn.is-done[data-net]:hover { background: none; box-shadow: none; color: var(--teal-800, #0a4c48); transform: none; }
  .cms-share-btn.is-done .cms-share-ico { background: var(--teal-50, #e9f6f2); color: var(--teal-800, #0a4c48); box-shadow: inset 0 0 0 1.5px var(--teal-500, #128f86); }
}

/* ---------- a section's "Share this" button (works on light, sand and night sections: it takes their colours) ---------- */
.cms-share-sec { position: relative; display: flex; justify-content: flex-start; margin-top: var(--space-6, 24px); }
.cms-share-pill { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--fg, currentColor); font: inherit; font-family: var(--font-sans, system-ui, sans-serif); font-size: var(--fs-small, 14px); font-weight: var(--fw-ui, 500); cursor: pointer; box-shadow: inset 0 0 0 1px var(--rule-2, currentColor); transition: background-color .18s ease, color .18s ease, box-shadow .18s ease; -webkit-tap-highlight-color: transparent; }
.cms-share-pill .cms-share-ico { width: 26px; height: 26px; }
.cms-share-pill .cms-share-ico svg { width: 18px; height: 18px; }
.cms-share-pill:focus-visible { outline: 2px solid var(--teal-500, #128f86); outline-offset: 3px; }
.cms-share-pill[aria-expanded="true"] { box-shadow: inset 0 0 0 1.5px var(--fg-link, var(--teal-500, #128f86)); color: var(--fg-link, var(--teal-700, #0a625c)); }
@media (hover: hover) { .cms-share-pill:hover { box-shadow: inset 0 0 0 1.5px var(--fg-link, var(--teal-500, #128f86)); color: var(--fg-link, var(--teal-700, #0a625c)); } }

/* ---------- the menu a section's button opens (a card under the button; a sheet from the bottom on phones) ---------- */
.cms-share-menu { position: absolute; z-index: var(--z-toast, 200); width: 280px; padding: 8px; border-radius: 16px; background: var(--surface, #fff); color: var(--ink, #111b1d); font-family: var(--font-sans, system-ui, sans-serif); box-shadow: 0 0 0 1px var(--line, rgba(17,27,29,.1)), var(--shadow-lg, 0 24px 60px -20px rgba(0,0,0,.35)); animation: cms-share-in .18s var(--ease-out, ease-out); }
.cms-share-menu[hidden] { display: none; }
.cms-share-menu-head { padding: 10px 12px 8px; }
.cms-share-menu-kicker { margin: 0; font-size: 11.5px; font-weight: var(--fw-ui, 500); letter-spacing: var(--tracking-eyebrow, .12em); text-transform: uppercase; color: var(--teal-700, #0a625c); }
.cms-share-menu-title { margin: 4px 0 0; font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--ink, #111b1d); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cms-share-menu-list { margin: 4px 0 0; padding: 0; list-style: none; }
.cms-share-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink, #111b1d); font: inherit; font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cms-share-item .cms-share-ico { width: 32px; height: 32px; border-radius: 999px; background: var(--tint, #f2ecdf); color: var(--ink, #111b1d); }
.cms-share-item .cms-share-ico svg { width: 18px; height: 18px; }
.cms-share-item .cms-share-name { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
.cms-share-item:is(:hover, :focus-visible) { background: var(--teal-50, #e9f6f2); outline: none; }
.cms-share-item:focus-visible { box-shadow: inset 0 0 0 2px var(--teal-500, #128f86); }
.cms-share-item[data-net="native"] .cms-share-ico { background: var(--accent, #00857a); color: #fff; }
.cms-share-item.is-done { color: var(--teal-800, #0a4c48); }
.cms-share-item.is-done .cms-share-ico { background: var(--teal-500, #128f86); color: #fff; }
.cms-share-menu-sep { height: 1px; margin: 6px 10px; background: var(--line, rgba(17,27,29,.1)); }
.cms-share-scrim { position: fixed; inset: 0; z-index: calc(var(--z-toast, 200) - 1); background: rgba(13, 23, 25, .42); animation: cms-share-fade .18s ease-out; }
.cms-share-scrim[hidden] { display: none; }
.cms-share-close { display: none; }
@media (min-width: 641px) { .cms-share-scrim { background: transparent; animation: none; } }
@media (max-width: 640px) {
  .cms-share-menu { position: fixed; left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-height: 86vh; overflow: auto; padding: 8px 12px calc(14px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; animation: cms-share-up .26s var(--ease-out, ease-out); }
  .cms-share-menu::before { content: ""; display: block; width: 40px; height: 4px; margin: 4px auto 6px; border-radius: 4px; background: var(--line-2, rgba(17,27,29,.18)); }
  .cms-share-menu-head { display: flex; align-items: flex-start; gap: 12px; padding: 6px 6px 10px; }
  .cms-share-menu-head > div { flex: 1 1 auto; min-width: 0; }
  .cms-share-close { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border: 0; border-radius: 999px; background: var(--tint, #f2ecdf); color: var(--ink, #111b1d); font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
  .cms-share-menu-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; padding: 6px 0 4px; }
  .cms-share-menu-sep { display: none; }
  .cms-share-item { flex-direction: column; gap: 7px; min-height: 0; padding: 4px 0; font-size: 12px; line-height: 1.25; text-align: center; }
  .cms-share-item:is(:hover, :focus-visible) { background: none; }
  .cms-share-item .cms-share-ico { width: 52px; height: 52px; }
  .cms-share-item .cms-share-ico svg { width: 22px; height: 22px; }
}

/* ---------- a link to one section: scroll there and light it up ---------- */
/* the same landing spot as the site's own #links (site/css/base.css, js/motion.js) */
[data-cms-share] { scroll-margin-top: calc(var(--nav-h, 64px) + var(--space-6, 24px)); }
.cms-share-hlbox { position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; animation: cms-share-hl 3.6s var(--ease-out, ease-out) both; }
/* the "Shared with you" note sits at the foot of the window, so it never covers the top of the section it names */
.cms-share-flag { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: var(--z-toast, 200); display: inline-flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 10px 16px 10px 12px; border-radius: 999px; background: var(--night, #0d1719); color: var(--on-night, #f2f0eb); font-family: var(--font-sans, system-ui, sans-serif); font-size: 14px; font-weight: var(--fw-ui, 500); box-shadow: var(--shadow-lg, 0 20px 40px -20px rgba(0,0,0,.4)); transform: translateX(-50%); animation: cms-share-flag 4.2s var(--ease-out, ease-out) both; pointer-events: none; }
.cms-share-flag svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--teal-300, #63c2b4); }
.cms-share-flag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@keyframes cms-share-hl {
  0%, 12% { box-shadow: inset 0 0 0 4px var(--teal-400, #2bb3a3), inset 0 0 0 9999px rgba(43, 179, 163, .09); }
  70% { box-shadow: inset 0 0 0 4px rgba(43, 179, 163, .7), inset 0 0 0 9999px rgba(43, 179, 163, .03); }
  100% { box-shadow: inset 0 0 0 4px rgba(43, 179, 163, 0), inset 0 0 0 9999px rgba(43, 179, 163, 0); }
}
@keyframes cms-share-flag { 0% { opacity: 0; transform: translate(-50%, 10px); } 8%, 82% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 6px); } }
@keyframes cms-share-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes cms-share-up { from { transform: translateY(100%); } }
@keyframes cms-share-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .cms-share-btn, .cms-share-pill { transition: none; }
  .cms-share-btn:hover { transform: none; }
  .cms-share-menu, .cms-share-scrim { animation: none; }
  .cms-share-hlbox { animation-duration: 6s; }
}
