/* ==========================================================================
   Bodywise by Yara — responsive layer
   The pages are built with inline style="" attributes, so these rules use
   attribute-substring selectors + !important (the one case where a stylesheet
   overrides inline styles) to retrofit a mobile layout WITHOUT changing the
   desktop rendering. Desktop (>1024px) is untouched.
   ========================================================================== */

/* ---- Mobile hamburger button (hidden on desktop) ---- */
.bw-burger { display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 9px; background: none; border: none; cursor: pointer; }
.bw-burger span { display: block; width: 22px; height: 2px; background: #2b2620; border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease; }
.bw-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.bw-burger.open span:nth-child(2) { opacity: 0; }
.bw-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* On desktop the menu wrapper is "invisible": its children (links + right group)
   act as direct flex items of the nav, so the desktop layout is unchanged. */
.bw-navmenu { display: contents; }

/* ===================== Tablet: ease the widest grids ===================== */
@media (max-width: 1024px) {
  [style*="grid-template-columns:repeat(4,1fr)"] { grid-template-columns: repeat(2,1fr) !important; }
  [style*="grid-template-columns:repeat(3,1fr)"] { grid-template-columns: repeat(2,1fr) !important; }
}

/* ===================== Phone / small tablet ===================== */
@media (max-width: 820px) {
  html, body { overflow-x: hidden; }

  /* ---- Navigation: collapse to hamburger dropdown ---- */
  nav { padding-left: 20px !important; padding-right: 20px !important; }
  .bw-burger { display: flex !important; }
  .bw-navmenu {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column !important; align-items: stretch !important; gap: 10px !important;
    background: #f4efe7; padding: 16px 24px 22px !important;
    border-bottom: 1px solid rgba(43,38,32,.1); box-shadow: 0 16px 30px rgba(43,38,32,.10);
  }
  .bw-navmenu.open { display: flex !important; }
  .bw-navlinks { flex-direction: column !important; align-items: flex-start !important; gap: 2px !important; }
  .bw-navlinks a { display: block; padding: 9px 0 !important; font-size: 16px !important; }
  .bw-navright { justify-content: space-between !important; width: 100% !important; }

  /* ---- Collapse every multi-column grid to a single column ---- */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  /* Footer reads better as two columns on a phone */
  [style*="grid-template-columns:1.4fr 1fr 1fr 1.2fr"] { grid-template-columns: 1fr 1fr !important; gap: 28px 24px !important; }

  /* ---- Reduce the 48px section gutters ---- */
  [style*="max-width:1240px"],
  [style*="max-width:1080px"],
  [style*="max-width:900px"] { padding-left: 24px !important; padding-right: 24px !important; }
  /* blog-post.php article text wrappers */
  [style*="padding:48px 48px 0"],
  [style*="padding:40px 48px 0"] { padding-left: 24px !important; padding-right: 24px !important; }

  /* ---- Trim very large vertical section padding ---- */
  [style*="padding:96px 48px"] { padding-top: 60px !important; padding-bottom: 60px !important; }
  [style*="padding:88px 0"] { padding-top: 60px !important; padding-bottom: 60px !important; }
  [style*="padding:88px 48px"] { padding-top: 60px !important; padding-bottom: 60px !important; }

  /* ---- Headings down to mobile sizes ---- */
  h1 { font-size: 38px !important; line-height: 1.08 !important; }
  h2 { font-size: 28px !important; }

  /* ---- Tame fixed image heights ---- */
  [style*="height:440px"] { height: 240px !important; }
  [style*="height:420px"] { height: 280px !important; }
  [style*="min-height:540px"] { min-height: 320px !important; }

  /* ---- Yoga gallery (1.6fr/1fr collage with fixed height) ---- */
  [style*="grid-template-columns:1.6fr 1fr"] { grid-template-columns: 1fr !important; height: auto !important; }
  [style*="grid-template-columns:1.6fr 1fr"] > div:first-child { height: 260px !important; }
  [style*="grid-template-rows:1fr 1fr"] { grid-template-rows: auto auto !important; height: auto !important; }
  [style*="grid-template-rows:1fr 1fr"] > div { height: 260px !important; }
  /* Hero collage (height:480px wrapper) keeps a sensible height */
  [style*="height:480px"] { height: auto !important; }

  /* ---- Homepage hero: tighten the stacked text so the image is visible
         without scrolling (matches the other pages' compact heroes) ---- */
  [style*="padding:72px 48px 44px"] {
    padding-top: 28px !important;
    padding-bottom: 24px !important;
    gap: 18px !important;
  }
  /* Homepage hero image: give it a fixed band like the inner pages
     (targeted so the yoga 480px collage above is untouched) */
  [style*="overflow:hidden; height:480px"] { height: 240px !important; }

  /* ---- Inner-page heroes: lift the title up to match the homepage
         (each keeps its own bottom padding) ---- */
  [style*="padding:64px 48px 40px"],
  [style*="padding:64px 48px 48px"],
  [style*="padding:64px 48px 88px"] { padding-top: 28px !important; }
}

/* ===================== Small phones ===================== */
@media (max-width: 480px) {
  h1 { font-size: 31px !important; }
  h2 { font-size: 25px !important; }
  nav { padding-left: 16px !important; padding-right: 16px !important; }
  /* Footer to a single column on the narrowest screens */
  [style*="grid-template-columns:1.4fr 1fr 1fr 1.2fr"] { grid-template-columns: 1fr !important; }
}

/* ===================== WhatsApp floating button ===================== */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(43, 38, 32, .22);
  transition: transform .2s ease, box-shadow .2s ease;
}
.wa-float:hover,
.wa-float:focus-visible { transform: scale(1.07); box-shadow: 0 10px 24px rgba(43, 38, 32, .30); }
.wa-float svg { width: 32px; height: 32px; display: block; }
@media (max-width: 820px) {
  .wa-float { right: 16px; bottom: 16px; width: 52px; height: 52px; }
  .wa-float svg { width: 30px; height: 30px; }
}
