/* A family's page: the gallery, the share sheet and the sticky give bar.
 *
 * Mobile first. On a phone the page is one column in the order a visitor
 * needs it: the photos edge to edge, the title and who the family is, the
 * big "Podporiť" button, "Zdieľať", then the story. From 900px the title and
 * the buttons move into a glass column beside the photos and stay in view.
 *
 * Loaded after refresh.css and cards.css, and written one selector deep
 * (`html .sd ...`) so it wins the same way they do, without !important.
 */

/* "Požiadať o pomoc" on one line: on a narrow phone it wrapped into a
   three line circle next to the wordmark. */
html .site-bar .btn--small { white-space: nowrap; }

html .sd {
  max-width: 1120px;
  padding: 0 16px 112px;
}
html .sd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "gallery" "head" "text";
  gap: 20px;
}
html .sd-gallery { grid-area: gallery; position: relative; margin: 0 -16px; }
html .sd-head { grid-area: head; min-width: 0; }
html .sd-text { grid-area: text; min-width: 0; }

/* ------------------------------------------------------------ gallery */
html .sd-gallery__track,
html .sd-gallery__none {
  display: flex;
  aspect-ratio: 4 / 3;
  width: 100%;
  background: linear-gradient(150deg, var(--p-pink, #ffd3ee), var(--p-purple, #e2d0ff));
}
html .sd-gallery__track {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
html .sd-gallery__track::-webkit-scrollbar { display: none; }
html .sd-gallery__track:focus-visible { outline-offset: -3px; }
html .sd-slide {
  flex: 0 0 100%;
  margin: 0;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
html .sd-slide__open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
html .sd-slide__open:disabled { cursor: default; }
html .sd-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html .sd-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 0;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(22, 18, 31, 0.32);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
html .sd-dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
}
html .sd-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  transition: width 0.2s, background 0.2s;
}
html .sd-dot.is-on::before { width: 18px; background: #fff; }

html .sd-gallery__arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
html .sd-gallery__arrow--prev { left: 14px; }
html .sd-gallery__arrow--next { right: 14px; }
html .sd-thumbs { display: none; }

/* --------------------------------------------------------------- head */
html .sd-title {
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.12;
  margin: 0;
  overflow-wrap: anywhere;
}
html .sd-who {
  margin: 8px 0 0;
  font-weight: 700;
  color: #b0306e;
}
html .sd .sponsor-banner { margin: 16px 0 0; }
html .sd-give {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin-top: 18px;
  font-size: 18px;
}
html .sd .give-note { margin: 8px 0 0; text-align: center; }
html .sd-share-btn {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  margin-top: 10px;
}
html .sd-money { margin-top: 22px; }
html .sd .verified { margin-top: 18px; }
html .sd-teaser { margin: 0; font-size: 17px; line-height: 1.55; }
html .story-page__video {
  width: 100%;
  margin-top: 18px;
  border-radius: 18px;
  background: #000;
  display: block;
  max-height: 520px;
}

/* ------------------------------------------------------- share sheet */
html .sd-sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
html .sd-sheet::backdrop,
html .sd-lightbox::backdrop {
  background: rgba(22, 18, 31, 0.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
html .sd-sheet__panel {
  border-radius: 28px 28px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  background: rgba(255, 250, 251, 0.94);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: 0 -18px 50px rgba(180, 90, 150, 0.18);
  animation: sd-up 0.28s cubic-bezier(.2, .8, .2, 1);
  max-height: 92dvh;
  overflow-y: auto;
}
html .sd-sheet__grab {
  width: 44px;
  height: 5px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: var(--line-strong, #e4d6e2);
}
html .sd-sheet__title { margin: 0 0 8px; font-size: 22px; }
html .sd-sheet__list { list-style: none; margin: 0; padding: 0; }
html .sd-action {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
html .sd-action:hover { background: rgba(255, 140, 215, 0.14); }
html .sd-action[aria-busy="true"] { opacity: 0.7; cursor: progress; }
html .sd-action__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #f4e9f6;
  color: var(--ink);
}
html .sd-action__icon--fb { background: #1877f2; color: #fff; }
html .sd-action__icon--wa { background: #25d366; color: #fff; }
html .sd-action__icon--ig {
  background: radial-gradient(circle at 30% 110%, #ffd27a 0%, #ff6b8b 45%, #b44be0 100%);
  color: #fff;
}
html .sd-sheet__hint {
  margin: 8px 4px 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff3c9;
  font-size: 14px;
  line-height: 1.5;
}
html .sd-sheet__close { width: 100%; justify-content: center; margin-top: 12px; }

/* ---------------------------------------------------------- lightbox */
html .sd-lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(13, 10, 18, 0.96);
  color: #fff;
  overflow: hidden;
}
html .sd-lightbox__bar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px 18px;
}
html .sd-icon-btn,
html .sd-lightbox__arrow {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
html .sd-lightbox__track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
html .sd-lightbox__track::-webkit-scrollbar { display: none; }
html .sd-lightbox__slide {
  flex: 0 0 100%;
  height: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
html .sd-lightbox__slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
html .sd-lightbox__arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
html .sd-lightbox__arrow--prev { left: 16px; }
html .sd-lightbox__arrow--next { right: 16px; }

/* ------------------------------------------------- sticky bar, toast */
html .sd-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 250, 251, 0.86);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border-top: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 -12px 34px rgba(180, 90, 150, 0.14);
  transform: translateY(110%);
  transition: transform 0.25s cubic-bezier(.2, .8, .2, 1);
}
html .sd-sticky.is-on { transform: none; }
html .sd-sticky .btn {
  display: flex;
  width: 100%;
  justify-content: center;
  min-height: 52px;
  font-size: 17px;
}
html .sd-toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 60;
  transform: translate(-50%, 12px);
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fffafb;
  font-weight: 700;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
html .sd-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@keyframes sd-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------ wider */
@media (min-width: 600px) {
  html .sd-gallery { margin: 0; }
  html .sd-gallery__track,
  html .sd-gallery__none { border-radius: 28px; box-shadow: 0 24px 60px rgba(180, 90, 150, 0.16); }
}

@media (min-width: 700px) {
  html .sd-sheet {
    inset: 0;
    width: min(440px, calc(100vw - 32px));
    margin: auto;
    height: fit-content;
  }
  html .sd-sheet__panel { border-radius: 28px; padding: 18px 20px 20px; }
  html .sd-sheet__grab { display: none; }
}

@media (min-width: 900px) {
  html .sd { padding: 32px 40px 80px; }
  html .sd-grid {
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-areas: "gallery head" "text head";
    gap: 28px 36px;
    align-items: start;
  }
  html .sd-head {
    position: sticky;
    top: 24px;
    padding: 26px;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    border-radius: 36px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.5));
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    backdrop-filter: blur(18px) saturate(1.3);
    box-shadow: 0 24px 60px rgba(180, 90, 150, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  }
  html .sd-title { font-size: 34px; }
  html .sd-gallery__arrow { display: block; }
  html .sd-dots { display: none; }
  html .sd-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 10px;
    margin-top: 12px;
  }
  html .sd-thumb {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--p-pink, #ffd3ee);
    cursor: pointer;
  }
  html .sd-thumb.is-on { border-color: #ff8cd7; }
  html .sd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
  html .sd-lightbox__arrow { display: block; }
  html .sd-sticky { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html .sd-gallery__track, html .sd-lightbox__track { scroll-behavior: auto; }
  html .sd-sheet__panel { animation: none; }
  html .sd-sticky, html .sd-toast, html .sd-dot::before { transition: none; }
}
