/* ============================================================
   Von's Vision — mobile responsive layer
   Loaded LAST in <head> on every page. Desktop (>900px) is
   untouched except for hiding the mobile menu elements.
   Theme: dark #231f20 / orange #f05022 / navy #091f3e / white.
   ============================================================ */

/* ---- mobile menu elements: hidden on desktop ---- */
#vvHamburger { display: none; }
#vvMobileNav { display: none; }
#vvNavBackdrop { display: none; }
#vvMobileHero { display: none; }

@media screen and (max-width: 900px) {

  /* ---------- fluid chrome ---------- */
  html, body { overflow-x: hidden; }
  .headerRow, .converterRow, .contentTable, .contentTableFull { width: 100% !important; }
  .header, .headerHeight { height: auto; }
  .headerRow { height: auto; }
  .header td { padding: 6px 10px !important; }
  .converter { position: relative; height: auto; min-height: 70px; }
  .converterRow, .converterHeight { height: auto; }
  .converterRow td { padding: 10px !important; }
  #imgBannerLogo { width: 120px !important; margin-left: 4px; }

  /* hide the desktop CMS menu (and its unwired burger overlay) */
  #mbmcpebul_table, [id^="mbmcpebul_table_burger"] { display: none !important; }

  /* header: keep DONATE/CONTACT buttons, hide social icon row to reduce clutter */
  .header .hvr-float-shadow { display: none; }
  .header .orangeButton { font-size: 12px !important; padding: 8px 10px !important; }
  .header div[style*="float: right"] { float: none !important; margin: 0 !important; text-align: center; }

  /* ---------- fluid content ---------- */
  .bigTable img { max-width: 100%; height: auto !important; }
  .bigTable [style*="width:"] { max-width: 100% !important; }
  .bigTable table[style*="width:"] { width: 100% !important; }
  .bigTable div[style*="width: 1200px"] { width: 100% !important; }
  .bigTable table[width], .bigTable td[width] { max-width: 100% !important; }
  .contentTable, .contentTableFull { table-layout: auto; }
  .contentTable td, .contentTableFull td { word-wrap: break-word; }
  h1 { font-size: 30px !important; line-height: 1.15 !important; }
  h2 { font-size: 22px !important; line-height: 1.2 !important; }

  /* content padding on cells (padding on the table itself doesn't inset rows) */
  .homeCell, .footerCell { padding-left: 12px !important; padding-right: 12px !important; }

  /* ---------- homepage slider: swap fixed LayerSlider for static hero ---------- */
  #layerslider-container-fw { display: none !important; }
  .slideshowRow { height: auto !important; }
  #vvMobileHero { display: block; }
  #vvMobileHero img { width: 100%; height: auto; display: block; }

  /* ---------- executive board / grid card tables: 2-up ---------- */
  .contentTable td[width="25%"], .contentTable td[width="33%"], .contentTable td[width="50%"] {
    display: inline-block; width: 48% !important; vertical-align: top;
  }
  .contentTable table[style*="width: 280px"] { width: 100% !important; min-height: 0 !important; }

  /* generic inline-block card wrappers (sponsors etc.) */
  .bigTable div[style*="display:inline-block"][style*="23%"] { width: 48% !important; }

  /* sub-footers stack */
  .subFooter1Row, .subFooter2Row { height: auto !important; }
}

@media screen and (max-width: 700px) {
  /* stack multi-column content tables (board grids, impact/need/why bands) */
  .contentTable table, .contentTable tbody, .contentTable tr, .contentTable td {
    display: block; width: 100% !important; box-sizing: border-box;
  }
  .contentTable td[width="25%"], .contentTable td[width="33%"], .contentTable td[width="50%"] {
    display: block; width: 100% !important;
  }
  .contentTable table[style*="width: 280px"] { margin-left: auto; margin-right: auto; max-width: 320px; }
  .bigTable div[style*="display:inline-block"][style*="23%"] { width: 100% !important; }
  .bigTable div[style*="display:inline-block"][style*="49.5%"] { width: 100% !important; }
  h1 { font-size: 26px !important; }
  /* photo gallery thumbs: 2 per row */
  #vlightbox1 img { width: 46vw !important; height: auto !important; margin: 4px; }
}

/* ============================================================
   Mobile menu (hamburger + slide-in panel + backdrop)
   ============================================================ */
@media screen and (max-width: 900px) {
  #vvHamburger {
    display: block; position: absolute; top: 50%; right: 14px;
    transform: translateY(-50%);
    width: 44px; height: 40px; padding: 8px 9px;
    background: transparent; border: 2px solid #f05022; border-radius: 6px;
    cursor: pointer; z-index: 10010;
  }
  #vvHamburger span {
    display: block; height: 3px; width: 100%; background: #ffffff;
    border-radius: 2px; margin: 4px 0;
  }
  #vvNavBackdrop {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 10020;
  }
  #vvNavBackdrop.show { opacity: 1; pointer-events: auto; }
  #vvMobileNav {
    display: block; position: fixed; top: 0; right: 0; bottom: 0;
    width: 290px; max-width: 85vw; background: #231f20;
    border-left: 4px solid #f05022;
    transform: translateX(102%); transition: transform .28s ease;
    z-index: 10030; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 18px 0 30px 0; box-sizing: border-box;
  }
  #vvMobileNav.open { transform: translateX(0); }
  #vvMobileNav .vv-nav-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px 14px 18px; border-bottom: 1px solid #3a3536;
  }
  #vvMobileNav .vv-nav-head img { width: 110px; height: auto; }
  #vvMobileNav .vv-nav-close {
    background: none; border: 0; color: #ffffff; font-size: 30px;
    line-height: 1; cursor: pointer; padding: 4px 8px;
  }
  #vvMobileNav a.vv-link {
    display: block; padding: 14px 22px; color: #ffffff; text-decoration: none;
    font-family: rubik, Arial, sans-serif; font-size: 15px; font-weight: 500;
    letter-spacing: 1px; text-transform: uppercase;
    border-bottom: 1px solid #3a3536;
  }
  #vvMobileNav a.vv-link:active, #vvMobileNav a.vv-link:hover { background: #2e2a2b; color: #f05022; }
  #vvMobileNav .vv-group {
    padding: 14px 22px 6px 22px; color: #f05022; font-family: rubik, Arial, sans-serif;
    font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  }
  #vvMobileNav a.vv-sub {
    display: block; padding: 10px 22px 10px 34px; color: #d8d4d5; text-decoration: none;
    font-family: rubik, Arial, sans-serif; font-size: 13.5px; letter-spacing: 0.5px;
    text-transform: uppercase;
  }
  #vvMobileNav a.vv-sub:active, #vvMobileNav a.vv-sub:hover { color: #f05022; }
  #vvMobileNav .vv-nav-cta { padding: 18px 22px 6px 22px; text-align: center; }
  #vvMobileNav .vv-nav-cta a {
    display: block; margin-bottom: 10px; padding: 12px 10px; border-radius: 4px;
    font-family: rubik, Arial, sans-serif; font-size: 14px; font-weight: 700;
    letter-spacing: 1px; text-decoration: none; text-transform: uppercase;
  }
  #vvMobileNav .vv-cta-donate { background: #f05022; color: #ffffff; }
  #vvMobileNav .vv-cta-contact { background: transparent; color: #ffffff; border: 2px solid #f05022; }
  #vvMobileNav .vv-nav-social { text-align: center; padding: 12px 0 0 0; }
  #vvMobileNav .vv-nav-social a { color: #b7b2b3; font-size: 22px; margin: 0 9px; text-decoration: none; }
  body.vv-nav-open { overflow: hidden; }
}
