/* ============================================================
   RealtyDataLabs — Media & Insights Page Styles
   Depends on: base.css (CSS custom properties)
   ============================================================ */

/* ── Media Hero ─────────────────────────────────────────────── */
.media-hero {
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 56px;
  text-align: center;
}

.media-hero h1 {
  font-size: var(--size-hero);
  margin-bottom: 12px;
}

.media-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Media Section ───────────────────────────────────────────── */
.media-section {
  margin-bottom: 72px;
}

.media-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.media-section-header h2 {
  font-size: var(--size-h2);
  padding-left: 14px;
  position: relative;
}

.media-section-header h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 100%;
  background: var(--gradient);
  border-radius: 999px;
}

/* ── Follow Button ───────────────────────────────────────────── */
.media-follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--size-small);
  color: var(--accent-teal);
  border: 1px solid rgba(0, 212, 170, 0.3);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  transition: var(--transition);
  text-decoration: none;
}

.media-follow-btn:hover {
  background: rgba(0, 212, 170, 0.08);
  color: var(--accent-teal);
}

/* ── 3-Column Media Grid ────────────────────────────────────── */
.media-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── YouTube / Video Embed Wrapper ──────────────────────────── */
.media-embed-wrap {
  background: rgba(26, 26, 46, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
}

.media-embed-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Embed Fallback ─────────────────────────────────────────── */
.media-embed-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(26, 26, 46, 0.9);
  color: var(--text-secondary);
  font-size: var(--size-small);
  text-align: center;
  padding: 20px;
}

.media-embed-fallback .embed-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

.media-embed-fallback p {
  margin: 0;
  line-height: 1.5;
}

.media-embed-fallback a {
  color: var(--accent-teal);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.media-embed-fallback a:hover {
  color: var(--accent-teal);
  opacity: 0.85;
}

/* ── Instagram Grid ─────────────────────────────────────────── */
.instagram-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.instagram-post {
  aspect-ratio: 1;
  background: rgba(26, 26, 46, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.instagram-post-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
}

.instagram-post-fallback .ig-icon {
  font-size: 2rem;
  opacity: 0.35;
}

.instagram-post-fallback p {
  font-size: var(--size-tiny);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.instagram-cta-cell {
  background: rgba(26, 26, 46, 0.6);
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  text-align: center;
  aspect-ratio: 1;
}

.instagram-cta-cell p {
  font-size: var(--size-small);
  color: var(--text-secondary);
  margin: 0;
}

/* ── Twitter / X Embed ───────────────────────────────────────── */
.twitter-embed-wrap {
  max-width: 560px;
  margin: 0 auto;
  background: rgba(26, 26, 46, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 400px;
  padding: 8px;
}

/* ── TikTok Grid ─────────────────────────────────────────────── */
.tiktok-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.tiktok-embed-wrap {
  background: rgba(26, 26, 46, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tiktok-embed-wrap blockquote,
.tiktok-embed-wrap > * {
  width: 100%;
}

.tiktok-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
}

.tiktok-fallback .tt-icon {
  font-size: 2.5rem;
  opacity: 0.35;
}

.tiktok-fallback p {
  font-size: var(--size-small);
  color: var(--text-secondary);
  margin: 0;
}

.tiktok-fallback a {
  color: var(--accent-teal);
  font-weight: 600;
}

/* ── Social CTA Bar ──────────────────────────────────────────── */
.social-cta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 32px;
  background: rgba(26, 26, 46, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-top: 56px;
  margin-bottom: 56px;
  text-align: center;
}

.social-cta-bar h3 {
  width: 100%;
  font-size: var(--size-h3);
  margin-bottom: 4px;
}

.social-cta-bar p {
  width: 100%;
  font-size: var(--size-small);
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ── Responsive: 1024px ──────────────────────────────────────── */
@media (max-width: 1024px) {
  .media-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .tiktok-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Responsive: 768px ───────────────────────────────────────── */
@media (max-width: 768px) {
  .instagram-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .media-section-header {
    flex-wrap: wrap;
    gap: 12px;
  }
}

/* ── Responsive: 480px ───────────────────────────────────────── */
@media (max-width: 480px) {
  .media-grid-3,
  .tiktok-grid {
    grid-template-columns: 1fr;
  }

  .instagram-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .media-hero h1 {
    font-size: var(--size-h1);
  }
}
