/* Markets & More — mobile responsive layer.
   Desktop (above 720px) is unchanged. Everything in this file kicks in only
   under the mobile breakpoint, so the original TwentyTwelve look is intact. */

/* ----- Hamburger button (always rendered, hidden on desktop) ----- */
.mm-hamburger {
  display: none;
  position: absolute;
  top: 18px; right: 18px;
  width: 44px; height: 44px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 1001;
  border-radius: 6px;
}
.mm-hamburger:hover { background: rgba(247, 147, 29, .12); }
.mm-hamburger:focus-visible { outline: 2px solid #f7931d; outline-offset: 2px; }
.mm-hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: #444;
  margin: 5px auto;
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

/* ----- Overlay backdrop (hidden by default) ----- */
.mm-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 4, .55);
  z-index: 1098;
  opacity: 0;
  transition: opacity .25s ease;
}

/* ----- Slide-in mobile menu panel (hidden by default) ----- */
.mm-mobile-menu {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 86%;
  max-width: 340px;
  background: #fff;
  z-index: 1099;
  transform: translateX(100%);
  transition: transform .3s ease;
  box-shadow: -8px 0 24px rgba(0,0,0,.18);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mm-mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid #eee;
  background: linear-gradient(135deg, #f7931d 0%, #c87515 100%);
  color: #fff;
}
.mm-mobile-menu-header .mm-mm-title {
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 1.05em;
  letter-spacing: 0.02em;
}
.mm-mobile-close {
  width: 38px; height: 38px;
  border: 0;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: background .15s ease;
}
.mm-mobile-close:hover { background: rgba(255,255,255,.32); }
.mm-mobile-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mm-mobile-menu nav { padding: 8px 0 24px; }
.mm-mobile-menu nav ul { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.mm-mobile-menu nav ul li { list-style: none !important; margin: 0; padding: 0; }
.mm-mobile-menu nav > ul > li > a {
  display: block;
  padding: 14px 20px;
  color: #2a1a08 !important;
  font-weight: 600;
  text-decoration: none !important;
  font-size: 1.02em;
  border-bottom: 1px solid #f3ebda;
}
.mm-mobile-menu nav > ul > li > a:hover,
.mm-mobile-menu nav > ul > li > a:focus { background: #fff7eb; color: #a55a1f !important; }
.mm-mobile-menu nav ul.sub-menu { background: #fdfaf3; padding: 4px 0 8px; }
.mm-mobile-menu nav ul.sub-menu li a {
  display: block;
  padding: 9px 20px 9px 36px;
  color: #5a3a18 !important;
  text-decoration: none !important;
  font-size: 0.94em;
  font-weight: 400;
  border-bottom: 1px solid #f3ebda;
}
.mm-mobile-menu nav ul.sub-menu li a::before {
  content: "› ";
  color: #f7931d;
  margin-right: 4px;
}
.mm-mobile-menu nav ul.sub-menu li a:hover,
.mm-mobile-menu nav ul.sub-menu li a:focus { background: #fff7eb; color: #a55a1f !important; }
.mm-mobile-menu nav ul.sub-menu li:last-child a { border-bottom: 0; }

/* ----- Active state (when JS adds .mm-menu-open to body) ----- */
body.mm-menu-open { overflow: hidden; }
body.mm-menu-open .mm-menu-backdrop { display: block; opacity: 1; }
body.mm-menu-open .mm-mobile-menu { display: block; transform: translateX(0); }
body.mm-menu-open .mm-hamburger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.mm-menu-open .mm-hamburger span:nth-child(2) { opacity: 0; }
body.mm-menu-open .mm-hamburger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============================================================
   MOBILE LAYOUT — kicks in below 720px (preserves desktop layout)
   ============================================================ */
@media (max-width: 720px) {
  /* Show hamburger, hide the inline TwentyTwelve nav */
  .mm-hamburger { display: block; }
  #site-navigation { display: none !important; }
  .menu-toggle { display: none !important; }

  /* Tighten the header */
  #masthead.site-header {
    padding: 14px 16px 12px;
    position: relative;
  }
  .site-header hgroup { text-align: left; }
  .site-header .site-title { font-size: 1.4em; line-height: 1.1; }
  .site-header .site-description { font-size: 0.85em; }
  .site-header .header-search { display: none; }
  .site-header .header-image {
    max-width: 70%;
    height: auto;
    margin-top: 10px;
  }

  /* Stack content + sidebar */
  #main.wrapper { padding: 0 14px; max-width: 100%; }
  #primary.site-content,
  #secondary.widget-area {
    width: 100% !important;
    float: none !important;
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
  }
  #secondary.widget-area { margin-top: 24px !important; }

  /* Sidebar widgets look tidier when stacked */
  .widget-area aside.widget {
    margin-bottom: 18px;
    padding: 14px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #f0e6d8;
  }
  .widget-area .vr_wrapper { width: auto !important; }

  /* Hero block: smaller pad, smaller text */
  .mm-hero {
    padding: 22px 18px;
    margin-bottom: 20px;
  }
  .mm-hero h1 { font-size: 1.5em; }
  .mm-hero p { font-size: 0.97em; }
  .mm-hero::after { width: 120px; height: 120px; right: -30px; top: -30px; }

  /* Year tile grid: 2 columns, smaller squares */
  .mm-year-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .mm-year-tile { aspect-ratio: 1 / 1; }
  .mm-year-tile .mm-year-num { font-size: 1.8em; bottom: 12px; left: 14px; }
  .mm-year-tile .mm-year-label { top: 12px; left: 14px; font-size: 0.68em; }
  .mm-year-tile .mm-year-tag { top: 34px; left: 14px; right: 14px; font-size: 0.85em; }

  /* Photo grid: 2 columns on smaller phones, 1 below 480 */
  .mm-photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  /* Highlights: smaller padding */
  ul.mm-highlights li { padding: 9px 0 9px 28px; font-size: 0.96em; }

  /* Page article tweaks */
  .entry-content { font-size: 0.98em; line-height: 1.55; }
  .entry-title { font-size: 1.5em !important; line-height: 1.15; }
  .entry-header { margin-bottom: 14px; }

  /* Headings inside entry-content */
  .entry-content h2 { font-size: 1.2em; margin-top: 22px; }
  .entry-content h3 { font-size: 1.05em; }

  /* Event-page map (was floating right) — stack full width */
  .entry-content div[style*="float:right"],
  .entry-content div[style*="float: right"] {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 16px 0 !important;
  }
  .em-location-map-container { width: 100% !important; height: 240px !important; }

  /* Site footer */
  #colophon .site-info { padding: 10px 14px; font-size: 0.86em; }

  /* Tables on mobile — let them scroll horizontally if too wide */
  .entry-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    max-width: 100%;
  }

  /* Make iframes (any embedded video / map) fluid */
  .entry-content iframe { max-width: 100%; height: auto; }

  /* Prev/next season nav stacks */
  .mm-seasons-nav { flex-direction: column; gap: 8px; }

  /* Body background can stay orange (it works on mobile too) */
}

/* Below 480px: single-column photo grid */
@media (max-width: 479px) {
  .mm-photo-grid { grid-template-columns: 1fr; }
  .mm-year-grid { grid-template-columns: 1fr; }
  .mm-year-tile { aspect-ratio: 16 / 9; }
  .site-header .site-title { font-size: 1.25em; }
}
