/* Contact page-only styles (shared theme/nav in style.css) */

/* ---------------- CONTACT PAGE ---------------- */
.contact-section {
  background: var(--bg-soft);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.contact-hero {
  padding-top: 4.25rem;
  padding-bottom: 2.75rem;
}

.contact-hero h1 {
  font-size: clamp(2.2rem, 3vw + 1rem, 3rem);
  margin: 0;
  letter-spacing: -0.02em;
}

.contact-hero p {
  margin: 1rem 0 0;
  color: rgba(26, 26, 26, 0.72);
  max-width: 65ch;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: stretch; /* ✅ equal height columns */
}

/* Make sure the right column wrapper and its card can stretch */
.contact-grid--qa > .qa-ask {
  height: 100%;
}

.contact-grid--qa > .qa-ask .contact-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
/* Left card should also stretch + allow CTA to sit at bottom */
.contact-grid--qa > .card.contact-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Pin the left CTA to the bottom of the card */
.contact-grid--qa > .card.contact-card .contact-cta-row {
  margin-top: auto;
}

/* ✅ Force the public feed row to span across both columns */
.contact-grid--qa > .qa-full {
  grid-column: 1 / -1;
  width: 100%;
}

/* Make sure the card inside also fills the row */
.contact-grid--qa > .qa-full .qa-feed-card {
  width: 100%;
}

.contact-cta-row {
  margin-top: auto; /* ✅ push CTA to bottom of the card */
  padding-top: 1.2rem; /* keeps the same spacing above the button */
}

/* ---------------- Card surface (top two boxes + public feed) ---------------- */
.contact-card,
.qa-feed-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;

  /* subtle gold “edge” so it reads against the cream background */
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(197, 165, 114, 0.08);
}

/* Gentle interactive polish (doesn't look clickable, just “alive”) */
.contact-card:hover,
.qa-feed-card:hover {
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(197, 165, 114, 0.14);
}

/* When someone is typing in the form, make it feel intentional */
.contact-card:focus-within,
.qa-feed-card:focus-within {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.09), 0 0 0 1px rgba(197, 165, 114, 0.22);
}

/* ---------------- Q&A (chat threads) ---------------- */
.qa {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  flex: 1;
  min-height: 0;
}

.qa-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1;
  min-height: 0;
}

/* Ensure the status never creates a “phantom” space when empty */
.qa-form > .qa-status:empty {
  display: none;
}

/* Keep status visually above the button */
.qa-form > .qa-status {
  margin-top: 0.4rem;
  margin-bottom: 0.35rem;
  order: 10;
}

/* Button is always bottom-most and baseline-locked */
.qa-form > button.btn.btn-primary {
  order: 20;
  margin-top: auto;
}
/* Let the question textarea expand to fill the available card height */
.qa-form .field textarea {
  flex: 1;
  min-height: 180px; /* baseline size on desktop */
  resize: vertical; /* still allow manual resize if desired */
}

/* Keep CTAs consistent */
.contact-grid--qa .btn.btn-primary {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qa-status {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(26, 26, 26, 0.7);
  line-height: 1.2;
}

.qa-list {
  margin-top: 1.2rem;
  display: grid;
  gap: 1.1rem;
}

/* Each thread = one question + message bubbles + reply form */
.qa-thread {
  display: grid;
  gap: 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  padding: 1rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.05);
}

/* Ensure questions sit flush-left, with replies indented like a thread */
.qa-thread {
  width: 100%;
  justify-items: start;
}

.chat-bubble {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04);

  /* Key: stop tiny “floating cards” */
  width: clamp(320px, 78%, 860px);
  max-width: 100%;
}

.chat-root {
  background: rgba(255, 255, 255, 0.95);

  /* Root question MUST sit flush-left even if it’s founder */
  margin-left: 0 !important;
  margin-right: auto !important;

  /* Question should use full thread width */
  width: 100%;
  max-width: 100%;
}

/* Align left/right like a real chat */
.chat-bubble.is-visitor {
  margin-right: auto;
}

.chat-bubble.is-founder {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.92);
}

/* Founder accent line */
.chat-bubble.is-founder::before {
  content: "";
  display: block;
  height: 2px;
  width: 90px;
  margin-bottom: 0.65rem;
  background: linear-gradient(to right, var(--gold), rgba(197, 165, 114, 0));
  opacity: 0.85;
}

/* Meta row */
.chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.chat-who {
  font-weight: 600;
}

.chat-time {
  font-size: 0.85rem;
  color: rgba(26, 26, 26, 0.55);
  white-space: nowrap;
}

.chat-body {
  margin-top: 0.35rem;
  color: rgba(26, 26, 26, 0.86);
}

/* Replies sit slightly “under” the question */
.chat-stack {
  display: grid;
  gap: 0.75rem;
  margin-left: 1.6rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(197, 165, 114, 0.22);
}

/* Reply button */
.chat-actions {
  margin-top: 0.65rem;
}

.chat-reply-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  color: rgba(26, 26, 26, 0.65);
  text-decoration: underline;
  text-decoration-color: rgba(197, 165, 114, 0.55);
  text-underline-offset: 3px;
}

.chat-reply-btn:hover {
  color: rgba(26, 26, 26, 0.85);
  text-decoration-color: rgba(197, 165, 114, 0.9);
}

/* Inline reply form inside each thread */
.chat-reply-form {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 1rem;
  display: grid;
  gap: 0.9rem;
  margin-left: 1.6rem;
}

/* Thread-level success message (shown after sending a reply) */
.chat-thread-status {
  margin-left: 1.6rem;
  margin-top: -0.25rem;
  font-size: 0.9rem;
  color: rgba(26, 26, 26, 0.7);
}

/* Layout responsive */
@media (max-width: 980px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .chat-stack,
  .chat-reply-form,
  .chat-thread-status {
    margin-left: 1rem;
    padding-left: 0.85rem;
  }
}
@media (max-width: 520px) {
  .chat-bubble {
    width: 100%;
  }
}
