/* =====================================================
   Sangha — anonymous public post stream
   Full-screen overlay triggered from the bottom nav.
   ===================================================== */

.sangha-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  /* The top-bar sits above the feed; leave room for it. */
  padding-top: calc(20px + 40px + 20px); /* topbar top + pill height + gap */
  padding-bottom: 100px; /* reserved for floating bottom nav */
  animation: sangha-fade 0.22s ease-out;
}

.sangha-overlay[hidden] {
  display: none;
}

@keyframes sangha-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* On desktop, keep the overlay inside the phone mockup */
@media (min-width: 520px) {
  .sangha-overlay {
    left: 50%;
    transform: translateX(-50%);
    width: min(100vw, calc(100vh * 9 / 16));
    max-width: 440px;
  }
}

/* ============== Feed card ============== */
.sangha-card {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 16px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  position: relative; /* needed so invitation stacks inside */
}

.sangha-feed {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 16px 16px 200px; /* bottom padding clears the invitation */
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #1a1a1a;

  scrollbar-width: thin;
  scrollbar-color: rgba(186, 141, 66, 0.5) transparent;
}
.sangha-feed::-webkit-scrollbar { width: 4px; }
.sangha-feed::-webkit-scrollbar-track { background: transparent; }
.sangha-feed::-webkit-scrollbar-thumb {
  background: rgba(186, 141, 66, 0.5);
  border-radius: 4px;
}

.sangha-post {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: post-in 0.28s ease-out;
}

@keyframes post-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sangha-post-body {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 400;
  color: #1a1a1a;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.sangha-post-meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-yellow);
  letter-spacing: 0.1px;
}

/* ============== Composer ============== */
.sangha-composer {
  width: calc(100% - 32px); /* exact 16px left/right */
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0px 20px 20px;
  padding: 12px 14px;
  background: #FFF;
  border: 1px solid rgba(186, 141, 66, 0.55);
  border-radius: 12px;
  flex-shrink: 0;
}

.sangha-composer-input {
  flex: 1 1 auto;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: #1a1a1a;
  padding: 2px 0;
}

.sangha-composer-input::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

.sangha-send-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.12s ease, opacity 0.15s ease;
  opacity: 0.45;
}

.sangha-send-btn.is-ready {
  opacity: 1;
}

.sangha-send-btn:active {
  transform: scale(0.9);
}

.sangha-send-btn svg {
  width: 22px;
  height: 22px;
  stroke: var(--color-yellow);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sangha-hint {
  margin: 0 0 10px;
  padding: 0 16px;
  font-size: 13px;
  color: #BA8D42;
  text-align: center;
  opacity: 0.8;
  line-height: 1.5;
}


/* =====================================================
   VINATI — Invitation area (arch + hint + composer)
   ===================================================== */

/*
 * The bottom of the feed card is a sticky invitation area:
 * a decorative arch image on top, the hint text, then the composer.
 *
 * Structure:
 *   .vinati-invitation        →  cream-backgrounded container
 *     .vinati-arch            →  decorative arch image (PNG with
 *                                 transparent scallop dips)
 *     .vinati-invitation-body →  holds the hint and composer
 *
 * Because the arch image has its own transparency baked in, no
 * masking, clip-paths, or other CSS shape tricks are needed —
 * the image renders against the cream background and its
 * transparent areas show the cream through.
 */
.vinati-invitation {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* Gradient fade sits BEHIND the arch SVG — transparent at top
   so the feed scrolls visibly under the scalloped edge, then
   fully cream where the hint text and composer live */
.vinati-invitation::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    #F9F4ED 32%,
    #F9F4ED 100%
  );
  z-index: 0;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  pointer-events: none;
}

/* Push arch and body above the gradient pseudo-element */
.vinati-arch,
.vinati-invitation-body {
  position: relative;
  z-index: 1;
}

/* Arch image — decorative top of the invitation area. */
.vinati-arch {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

/* Hint + composer sit naturally below the arch image. */
.vinati-invitation-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: transparent;
}

.vinati-hint {
  width: 100%;
  padding: 2px 24px 10px;
  font-size: 14px;
  font-weight: 500;
  color: #BA8D42;
  text-align: center;
  line-height: 1.55;
  font-style: italic;
  background: transparent;
}


/* =====================================================
   VINATI — Blessing card overlay
   ===================================================== */

.vinati-card-backdrop {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  animation: vinati-backdrop-in 0.2s ease-out;
}

.vinati-card-backdrop[hidden] {
  display: none;
}

@keyframes vinati-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/*
 * Card shape: temple arch frame.
 * The arch SVG (.vinati-card-border) is the actual card background —
 * it fills the whole .vinati-card area via absolute positioning, and
 * all content sits on top of it. Padding is tuned so content stays
 * visually inside the arch's curved outline.
 */
.vinati-card {
  position: relative;
  width: 100%;
  background: transparent;

  display: flex;
  flex-direction: column;
  align-items: center;
  /* Padding tuned to keep content inside the arch curve:
     top is generous to clear the scalloped peak,
     bottom clears the tapered foot. */
  padding: 72px 44px 80px;
  gap: 0;

  /* Soft outer shadow — the gold edge now lives in the SVG itself */
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.35));

  animation: vinati-card-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vinati-card-in {
  from { opacity: 0; transform: scale(0.88) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/*
 * Arch SVG — IS the card background.
 * Stretched to fill the whole .vinati-card area so every child
 * (lottie, blessing image, text, CTA) sits visually inside the
 * arch shape. Explicit z-index: 0 keeps it BEHIND the content.
 */
.vinati-card-border {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Force the SVG to stretch and fill, ignoring intrinsic ratio */
  object-fit: fill;
  pointer-events: none;
  z-index: 0 !important;
}

/* Every direct content child of the card sits above the arch SVG.
   The !important and explicit positioning override the legacy
   `.vinati-card img { z-index: 11 }` rule below. */
.vinati-card > .vinati-lottie-wrap,
.vinati-card > .vinati-blessing-wrap,
.vinati-card > .vinati-card-headline,
.vinati-card > .vinati-card-sub,
.vinati-card > .vinati-cta {
  position: relative;
  z-index: 2;
}

/* Inline images inside content wrappers (e.g. the blessing image,
   the namaste icon on the CTA) need to render above the arch
   border too. */
.vinati-card .vinati-blessing-img,
.vinati-card .vinati-cta-icon {
  position: relative;
  z-index: 2;
}

/* Lottie container */
.vinati-lottie-wrap {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.vinati-lottie-wrap lottie-player {
  width: 140px;
  height: 140px;
}

/* Blessing SVG image container */
.vinati-blessing-wrap {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.vinati-blessing-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Ensure hidden attribute is respected even when display is set by CSS */
.vinati-lottie-wrap[hidden],
.vinati-blessing-wrap[hidden] {
  display: none !important;
}

/* Text */
.vinati-card-headline {
  font-size: 18px;
  font-weight: 700;
  color: #BA8D42;
  text-align: center;
  line-height: 1.3;
  margin-bottom: 4px;
}

.vinati-card-sub {
  font-size: 16px;
  font-weight: 500;
  color: #BA8D42;
  text-align: center;
  line-height: 1.3;
  margin-bottom: 20px;
}

/* CTA button — hugs its content (the label + namaste icon)
   instead of stretching the full card width. */
.vinati-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  align-self: center;
  padding: 14px 28px;
  border-radius: 50px;
  background: #BA8D42;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.2px;
  transition: opacity 0.2s ease, transform 0.12s ease;
  cursor: pointer;
  white-space: nowrap;
}

.vinati-cta.is-loading {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.vinati-cta.is-ready {
  opacity: 1;
}

.vinati-cta:active:not(:disabled) {
  transform: scale(0.97);
}

.vinati-cta-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}


/* =====================================================
   VINATI — Toast notification
   ===================================================== */

.vinati-toast {
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 20;
  background: #2a1a0a;
  color: #f5efe0;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 100%;
  min-width: 300px;
  white-space: normal;
  text-align: center;
  line-height: 1.4;
}

.vinati-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
