/* Share button and panel (28 Oct 2026, his request: the share pattern of ekonomi.org.tr, with X,
   WhatsApp and LinkedIn only). A quiet text button opens a panel with the picture the post will
   carry, its text and its link, and one button per network. Loaded only by pages that carry the
   button (build.py, SHARE), with site/js/share.js. */

.sharer {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.25rem; padding: 0 0.1rem;
  border: 0; border-bottom: 1.5px solid var(--accent); background: none; cursor: pointer;
  color: var(--ink); font: 500 var(--fs-small)/1 var(--sans); letter-spacing: 0.01em;
}
.sharer svg { width: 1rem; height: 1rem; color: var(--accent); }
.sharer:hover { color: var(--accent); }
.sharer:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sharebar { display: flex; align-items: center; gap: 1rem; }
.sharebar--end { margin: calc(var(--u) * 1.6) 0 calc(var(--u) * 1.4); padding-top: calc(var(--u) * 0.6); border-top: var(--hair) solid var(--line); }
/* his placement (28 Oct 2026): under the last item of the sticky contents in the side column, in
   view while reading; phones, which have no side column, keep it at the end of the page */
.side__share { padding-top: 0.15rem; }
@media (min-width: 1100px) { .sharebar--end { display: none; } }

html.share-on { overflow: hidden; }
/* above the fixed bar (z-index 100), below the skip link (300) */
.share-sheet {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1.25rem;
  background: rgba(24, 24, 27, 0.5);
}
.share-sheet__box {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 19rem;
  width: min(60rem, 100%); max-height: calc(100dvh - 2.5rem); overflow: auto;
  background: var(--surface); box-shadow: 0 18px 50px rgba(24, 24, 27, 0.25);
}
.share-sheet__pic { display: grid; place-items: center; min-width: 0; margin: 0; padding: 1.25rem; background: var(--surface-2); }
.share-sheet__pic img { display: block; width: 100%; height: auto; border: var(--hair) solid var(--line); }
.share-sheet__side {
  display: flex; flex-direction: column; gap: 0.75rem; min-width: 0;
  padding: 1.5rem 1.4rem 1.25rem; border-top: 3px solid var(--cat);
}
.share-sheet__title { margin: 0; font: 400 1.5rem/1.15 var(--serif); letter-spacing: -0.01em; }
.share-sheet__text { margin: 0; color: var(--ink); font: 400 1rem/1.45 var(--serif); }
.share-sheet__link { margin: 0; color: var(--ink-2); font: 400 var(--fs-meta)/1.4 var(--sans); overflow-wrap: anywhere; }
.share-sheet__links {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem;
  margin-top: 0.25rem; padding-top: 0.9rem; border-top: var(--hair) solid var(--line);
}
.share-sheet__links a {
  display: flex; flex-direction: column; align-items: center; gap: 0.45rem; padding: 0.7rem 0.25rem;
  color: var(--ink); font: 400 var(--fs-meta)/1 var(--sans); letter-spacing: 0.01em; text-decoration: none;
}
.share-sheet__links a:hover { background: var(--cat-soft); }
.share-sheet__links svg { width: 1.5rem; height: 1.5rem; }
.share-sheet__links [data-net="wa"] svg { color: #1f8f4e; }
.share-sheet__links [data-net="in"] svg { color: #0a66c2; }
.share-sheet__note { margin: 0; color: var(--ink-3); font: 400 var(--fs-meta)/1.5 var(--sans); }

/* the picture itself, since a link cannot put it into an X post: share menu, copy, download; and the text */
.share-sheet [hidden] { display: none !important; }
.share-sheet__acts { margin: 0; padding: 0.4rem 0 0; list-style: none; border-top: var(--hair) solid var(--line); }
.share-sheet__acts :is(a, button) {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.5rem 0;
  border: 0; background: none; cursor: pointer; color: var(--ink); text-align: left; text-decoration: none;
  font: 400 var(--fs-small)/1.3 var(--sans); letter-spacing: 0.01em;
}
.share-sheet__acts svg { flex: none; width: 1.1rem; height: 1.1rem; color: var(--accent); }
.share-sheet__acts :is(a, button):hover span { text-decoration: underline; text-decoration-thickness: var(--hair); text-underline-offset: 0.25em; }
.share-sheet__acts button:disabled { opacity: 0.5; cursor: default; }
.share-sheet__status { margin: 0; min-height: 1.5em; color: var(--ink); font: 400 var(--fs-meta)/1.5 var(--sans); }
.share-sheet__close {
  position: absolute; top: 0.5rem; right: 0.5rem; display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: 50%; background: none;
  color: var(--ink-2); font: 400 1.5rem/1 var(--sans); cursor: pointer;
}
.share-sheet__close:hover { background: var(--surface-2); color: var(--ink); }
.share-sheet a:focus-visible, .share-sheet button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* phones: a sheet from the bottom, the picture above the buttons */
@media (max-width: 760px) {
  .share-sheet { align-items: end; padding: 0; }
  .share-sheet__box { grid-template-columns: minmax(0, 1fr); max-height: 100dvh; }
  .share-sheet__pic { padding: 0.75rem; }
  .share-sheet__side { padding: 1.1rem 1rem 1rem; }
  .share-sheet__close { background: var(--surface); }
}
@media (prefers-reduced-motion: no-preference) {
  .share-sheet__box { animation: share-in 0.18s ease-out; }
}
@keyframes share-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media print { .sharebar, .share-sheet { display: none !important; } }
