/* 01. Compact, persistent channel cards in the right-hand gutter. */
.social-rail {
  position: fixed;
  /* Leave breathing room at the edge without overlapping the centered body. */
  right: clamp(16px, calc((100vw - var(--content-max)) / 2 - 112px), 40px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: grid;
  gap: 10px;
  width: 88px;
}
.social-channel { position: relative; }
.social-channel summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border: 1px solid #d8e5f5;
  border-radius: 12px;
  background: #fff;
  color: #31597e;
  box-shadow: 0 6px 22px #1834540e;
  cursor: pointer;
  list-style: none;
  transition: border-color .2s, box-shadow .2s;
}
.social-channel summary::-webkit-details-marker { display: none; }
.social-channel summary::marker { content: ''; }
.social-channel summary:hover, .social-channel[open] summary {
  border-color: #8bb6f0;
  color: var(--blue);
  box-shadow: 0 8px 25px #1834541c;
}
.social-channel summary:focus-visible { outline: 3px solid #8bb6f0; outline-offset: 3px; }
.social-channel summary span { font-size: 12px; white-space: nowrap; }
.social-thumbnail { width: 72px; height: 72px; object-fit: contain; background: white; }

/* 02. QR-only assets preserve the full pattern and its white quiet zone. */
.social-panel {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  margin-right: 14px;
  padding: 12px;
  border: 1px solid #d8e5f5;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 60px #17365724;
}
.social-panel img { display: block; width: 100%; height: auto; max-height: calc(100dvh - 140px); object-fit: contain; }

/* 03. On smaller screens the three channels share a compact bottom dock. */
@media (max-width: 1100px) {
  body { padding-bottom: 120px; }
  .social-rail {
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    right: 50%;
    transform: translateX(50%);
    width: min(330px, calc(100% - 32px));
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .social-channel summary { gap: 5px; padding: 8px; }
  .social-thumbnail { width: 60px; height: 60px; }
  .social-panel {
    position: fixed;
    top: auto;
    bottom: 114px;
    right: 50%;
    transform: translateX(50%);
    margin: 0;
    width: min(320px, calc(100vw - 32px));
  }
  .social-panel img { max-height: calc(100dvh - 260px); }
  .back-to-top { bottom: 132px; }
}
@media (prefers-reduced-motion: reduce) {
  .social-channel summary { transition: none; }
}
/* Bridge the gutter so pointer travel to a QR panel does not close it. */
@media (min-width: 1101px) {
  .social-panel::after { content: ''; position: absolute; top: 0; right: -15px; width: 15px; height: 100%; }
}
