/* ============================================================
   Mobile-first responsive overrides for felipebernardo.org
   Applied globally via layout.tsx
   ============================================================ */

/* ── Elementor hidden classes ─── */
@media (max-width: 1024px) {
  .elementor-hidden-tablet { display: none !important; }
}
@media (max-width: 767px) {
  .elementor-hidden-mobile { display: none !important; }
}

/* ── Global container safety ─── */
*, *::before, *::after { box-sizing: border-box; }
img, video, iframe { max-width: 100%; }
body { overflow-x: hidden; }

/* ── e-con (Elementor containers) ──────────────────────────── */
@media (max-width: 767px) {
  /* Stack all Elementor flex containers vertically */
  .e-con.e-parent,
  .e-flex.e-con,
  .e-con-boxed .e-con-inner {
    flex-direction: column !important;
  }
  .e-con-inner {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  /* Allow child containers to go full-width */
  .e-con.e-child,
  [class*="elementor-element-"] .e-con.e-child {
    width: 100% !important;
    max-width: 100% !important;
    --container-widget-width: 100% !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   HOMEPAGE
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  /* Hero section */
  .elementor-element-bfb104d .e-con-inner,
  .elementor-element-b8890fa .e-con-inner,
  .elementor-element-733945e .e-con-inner {
    flex-direction: column !important;
    padding: 32px 16px !important;
  }

  /* About / two-column sections */
  .elementor-element-5be3e3e,
  .elementor-element-1646bb5 {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Hero image */
  .elementor-element-a0b55fc img {
    max-height: 320px;
    width: 100%;
    object-fit: cover;
  }

  /* Section headings */
  .elementor-heading-title {
    font-size: clamp(22px, 6vw, 40px) !important;
    line-height: 1.25 !important;
  }

  /* Contact section two columns → one */
  .elementor-element-7750c1a .e-con-inner {
    flex-direction: column !important;
    padding: 32px 16px !important;
  }
  .elementor-element-712a1e0,
  .elementor-element-9a81a27 {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Podcast section cards */
  .elementor-element-aac73d2 {
    flex-direction: column !important;
    border-radius: 12px !important;
  }
  .elementor-element-b2577ce {
    width: 100% !important;
    max-width: 100% !important;
  }
  .elementor-element-b2577ce img {
    border-radius: 12px 12px 0 0 !important;
  }

  /* Spotify iframe */
  iframe[src*="spotify"] {
    min-height: 232px;
  }
}

/* ═══════════════════════════════════════════════════════════
   BLOG LISTING
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  /* Featured post card (182) — stack image above text */
  .elementor-182 .elementor-element-b38987d {
    flex-direction: column !important;
  }
  .elementor-182 .elementor-element-09616ab img {
    height: 240px !important;
    border-radius: 10px 10px 0 0;
  }
  .elementor-182 .elementor-element-405eb9b {
    width: 100% !important;
    max-width: 100% !important;
    padding: 24px !important;
  }
  .elementor-182 .elementor-element-d8dcd8e .elementor-heading-title {
    font-size: 26px !important;
    line-height: 1.3 !important;
  }

  /* Post card (208) — stack image above text */
  .elementor-208 .elementor-element-698dd0d > .e-con-inner {
    flex-direction: column !important;
    padding: 0 !important;
  }
  .elementor-208 .elementor-element-404e2ac img {
    height: 220px !important;
    border-radius: 10px 10px 0 0 !important;
  }
  .elementor-208 .elementor-element-752c284 {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 0 10px 10px !important;
    padding: 20px !important;
  }
  .elementor-208 .elementor-element-ad9e5d4 .elementor-heading-title {
    font-size: 22px !important;
    line-height: 1.35 !important;
  }

  /* Category sidebar on blog page → hide or stack */
  .elementor-element-cae21a4,
  .elementor-element-712a1e0 {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Blog grid: single column */
  .e-loop-item {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   BLOG POST
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  /* Two-column outer → single column */
  .elementor-251 .elementor-element-7e4d8b7 {
    flex-direction: column !important;
  }
  .elementor-251 .elementor-element-cae21a4 {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px !important;
  }

  /* Featured image in post */
  .elementor-element-2f6f85d7 > .elementor-widget-container > div {
    height: 220px !important;
  }

  /* Post content typography */
  .entry-content.wp-block-post-content {
    font-size: 16px !important;
    line-height: 1.7 !important;
  }
  .entry-content h1, .entry-content h2 { font-size: clamp(20px, 5vw, 32px) !important; }
  .entry-content h3, .entry-content h4 { font-size: clamp(18px, 4.5vw, 26px) !important; }

  /* Post navigation prev/next */
  .elementor-post-navigation {
    flex-direction: column !important;
    gap: 16px;
  }

  /* Related posts */
  .elementor-posts-container {
    grid-template-columns: 1fr !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   PODCAST PAGE
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .podcast-episodes { padding: 40px 0; }
  .podcast-episodes-inner { padding: 0 16px; }

  .episode-item {
    padding: 14px 12px !important;
    gap: 8px !important;
  }
  .episode-title { font-size: 14px !important; }
  .episode-desc { display: none !important; } /* hide on tiny screens */
  .ep-play-btn { width: 36px !important; height: 36px !important; }

  /* Sticky player bar on mobile */
  .ep-player-bar {
    padding: 8px 12px 10px !important;
    gap: 8px !important;
  }
  .ep-bar-skip { display: none !important; } /* reclaim space on small screens */
  .ep-bar-time { font-size: 10px !important; }
  .ep-bar-dots { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   COACHING PAGE
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .elementor-310 .e-con-inner {
    padding: 24px 16px !important;
    flex-direction: column !important;
  }
  .elementor-element-3a64394 {
    width: 100% !important;
    max-width: 100% !important;
  }
  .elementor-element-3a64394 img {
    width: 100% !important;
    height: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   CONTACT FORM (WPForms)
═══════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .wpforms-field-row {
    flex-direction: column !important;
  }
  .wpforms-field-row-block {
    width: 100% !important;
    max-width: 100% !important;
  }
  .wpforms-field input[type="text"],
  .wpforms-field input[type="email"],
  .wpforms-field textarea {
    font-size: 16px !important; /* prevents iOS zoom */
    width: 100% !important;
  }
  .wpforms-submit {
    width: 100% !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   FOOTER — already responsive, minor tweaks
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .fb-footer { padding: 40px 16px 0; }
  .fb-footer-bottom { padding: 16px 0; }
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL TYPOGRAPHY SCALING
═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .elementor-heading-title.elementor-size-default {
    font-size: clamp(20px, 6vw, 36px) !important;
  }
  .elementor-widget-text-editor p {
    font-size: 15px !important;
    line-height: 1.65 !important;
  }
}
