/* Desktop (1024px and above) deliberately retains the original stylesheet. */
@media screen and (max-width: 1023.98px) {
  body { width: auto; margin: 0; background: #fff; }
  #wrap, #wrap * { box-sizing: border-box; }
  div#header { position: static; width: 100%; height: auto; background: #ffe642; }
  #header > img { display: block; width: 100%; max-width: 900px; height: auto; margin: auto; }
  div#search { position: static; display: flex; align-items: center; justify-content: flex-end; gap: 16px; width: 100%; height: auto; margin: 0; padding: 8px 20px; background: #ffe642; }
  #search table, #search tbody, #search tr, #search td { display: block; width: auto; height: auto; padding: 0; }
  #search table:first-child td:first-child, #search table:nth-child(2) td:not(:has(a)) { display: none; }
  div#searchwrapper { width: 240px; height: 42px; background: #fff; border: 1px solid #7d871d; border-radius: 24px; }
  #searchwrapper .searchbox { width: calc(100% - 54px); height: 36px; top: 2px; left: 12px; font-size: 16px; color: #111; }
  #searchwrapper .searchbox_submit { width: 37px; height: 28px; left: auto; right: 5px; top: 6px; }
  #search table:nth-child(2) img { display: block; width: 44px; height: 44px; }
  div#navbar { position: static; width: 100%; height: auto; margin: 0; padding: 4px 16px; background: #91a000; text-align: left; }
  #navbar[data-menu-ready] #menu-toggle { display: flex; align-items: center; justify-content: center; width: 48px; height: 44px; margin: 0 0 0 auto; padding: 10px; border: 1px solid #fff; border-radius: 4px; background: transparent; color: #fff; cursor: pointer; }
  #menu-toggle img { width: 24px; height: 24px; filter: invert(1); }
  #menu-toggle .menu-close-icon { display: none; }
  #menu-toggle[aria-expanded="true"] .menu-open-icon { display: none; }
  #menu-toggle[aria-expanded="true"] .menu-close-icon { display: block; }
  #menu-toggle:focus-visible, #nav a:focus-visible { outline: 3px solid #222; outline-offset: 2px; }
  #navbar table, #navbar tbody { display: block; width: 100%; }
  #navbar[data-menu-ready]:not(.menu-open) table { display: none; }
  #navbar #nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px 0; }
  #navbar #nav td { display: flex; flex-direction: column; justify-content: center; width: auto; height: auto; padding: 0; text-align: left; }
  #navbar #nav br { display: none; }
  #navbar #nav a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; font-size: 15px; }
  div#main { position: static; width: 100%; height: auto; margin: 0; padding: 0; overflow: visible; }
  #main > table { width: 100%; max-width: 100%; }
  #main > table:first-child, #main > table:first-child > tbody { display: block; }
  #main > table:first-child > tbody > tr { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; padding: 16px 20px 24px; }
  #main > table:first-child > tbody > tr > td { display: block; min-width: 0; width: auto; padding: 0; }
  #main > table:first-child > tbody > tr > td:only-child { grid-column: 1 / -1; }
  #main img, #main input[type="image"], #main video { max-width: 100% !important; height: auto; }
  #main iframe, #main object, #main embed { max-width: 100%; }
  #main .maintext, #main .shoptext { text-align: left; line-height: 1.5; overflow-wrap: anywhere; }
  #main .sectiontitle { font-size: 24px; overflow-wrap: anywhere; }
  #main td, #main p, #main a, #main label, #main div { overflow-wrap: anywhere; }
  #main td > table { max-width: 100%; }
  #main table[width="698"], #main table[width="698"] > tbody { display: block; width: 100%; }
  #main table[width="698"] > tbody > tr { display: grid; grid-template-columns: 115px minmax(0, 1fr); gap: 12px 16px; padding: 16px 0 24px; border-bottom: 1px solid #ddd; }
  #main table[width="698"] > tbody > tr > td { display: block; width: auto; min-width: 0; }
  #main table[width="698"] > tbody > tr > td:nth-child(3) { grid-column: 2; }
  #main table[width="698"] center { text-align: left; }
  #main table[width="698"] form { margin-top: 8px; }
  #main form { max-width: 100%; }
  #main fieldset { min-width: 0; max-width: 100%; }
  #main input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="image"]), #main select, #main textarea { box-sizing: border-box; max-width: 100%; min-width: 0; font-size: 16px; }
  #main input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="image"]), #main select { min-height: 44px; }
  #main textarea { width: 100%; }
  #main input[type="file"] { width: 100%; }
  #main input[type="submit"], #main button { white-space: normal; cursor: pointer; }
  #main .sidenavbar { font-size: 15px; line-height: 1.4; }
  #main .sidenavbar a { display: inline-block; padding: 8px 0; }
  #main .footernavbar { line-height: 2; padding: 0 12px; }
  #main .footertext { display: inline-block; line-height: 1.6; padding: 0 12px; }
  #main .responsive-table { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #main .responsive-table > table { max-width: none; }
  #main form table, #main form tbody { display: block; width: 100%; max-width: 100%; }
  #main form table tr { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 12px; margin-bottom: 12px; }
  #main form table td { display: block; width: auto; min-width: 0; }
  #main form table td:only-child, #main form table td[colspan] { grid-column: 1 / -1; }
  #main form table label { display: inline-block; padding: 8px 0; }
  #main ul.calendar-nav, #main ul.event-listing-nav, #main ul.custom-listing, #main ul.events { width: auto; max-width: 100%; margin-left: 0; margin-right: 0; }
  #main ul.calendar-nav, #main ul.event-listing-nav { display: flex; gap: 8px; }
  #main ul.calendar-nav li, #main ul.event-listing-nav li { float: none; flex: 1; min-width: 0; }
}

/* Mobile: stack the section navigation above the unchanged page content. */
@media screen and (max-width: 767.98px) {
  #wrap { display: grid; grid-template-columns: minmax(0, 1fr) 64px; background: #91a000; }
  /* The right-hand search graphic is baked into the desktop header image. */
  div#header { position: relative; overflow: hidden; grid-column: 1 / -1; }
  #header > img { width: 140.625%; max-width: none; margin: 0; }
  #header .mobile-home-link { display: block; position: absolute; inset: 0; }
  #header .mobile-home-link:focus-visible { outline: 3px solid #222; outline-offset: -3px; }
  div#search { grid-column: 1; grid-row: 2; padding: 8px 8px 8px 12px; gap: 8px; background: #91a000; }
  #search table:first-child { flex: 1; min-width: 0; }
  div#searchwrapper { width: 100%; max-width: none; margin-left: auto; }
  #searchwrapper .searchbox_submit { background: url('/search-icon.svg') center / 24px 24px no-repeat; }
  div#navbar { display: contents; }
  #navbar[data-menu-ready] #menu-toggle { grid-column: 2; grid-row: 2; align-self: center; margin: 0 12px 0 4px; }
  #navbar table { grid-column: 1 / -1; grid-row: 3; padding: 0 12px; }
  div#main { grid-column: 1 / -1; grid-row: 4; background: #fff; }
  #navbar #nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #navbar #nav a { padding: 10px 8px; font-size: 14px; }
  #main > table:first-child > tbody > tr { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 12px 16px 24px; }
  #main > table:first-child > tbody > tr > td:first-child:has(.sidenavbar) { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 0 16px; margin-bottom: 8px; padding-bottom: 12px; border-bottom: 1px solid #ddd; }
  #main .sidenavbar { margin: 4px 0; font-size: 14px; }
  #main .sidenavbar br { display: none; }
  #main .sidenavbar a { padding: 6px 0; }
  #main table[width="698"] > tbody > tr { grid-template-columns: 90px minmax(0, 1fr); gap: 12px; }
  #main table[width="698"] > tbody > tr > td:nth-child(3) { grid-column: 1 / -1; }
  #main table[width="698"] > tbody > tr > td:nth-child(3) strong { display: inline-block; margin-bottom: 8px; font-size: 22px; line-height: 1.3; }
  #main .maintext, #main .shoptext { font-size: 15px; }
  #main .sectiontitle { font-size: 22px; }
  #main .footernavbar { font-size: 12px; line-height: 2.2; }
  #main form table tr { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  #main form input[type="text"], #main form input[type="email"], #main form input[type="password"], #main form input[type="url"], #main form select { width: 100%; }
  #main form table label { padding: 0; }
  #main:has(input[type="search"]) > table:first-child { font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.5; }
  #main:has(input[type="search"]) h1 { font-size: 22px; line-height: 1.3; }
  #main:has(input[type="search"]) h2 { font-size: 18px; line-height: 1.3; }
  #main:has(input[type="search"]) ul { padding-left: 20px; }
  #main:has(input[type="search"]) li { margin-bottom: 24px; }
  #main form:has(input[type="search"]) > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 24px; }
  #main form:has(input[type="search"]) label { grid-column: 1 / -1; }
  #main input[type="search"] { width: 100%; }
  #main form[action*="paypal.com"] input[type="image"] { width: 200px; height: auto; }
  /* Match the yellow pill inside the legacy 200px PayPal image, retaining a 48px tap target. */
  #main form[action*="paypal.com"] input[type="submit"] { width: 200px; height: 48px; padding: 0; border: 8px solid transparent; border-left-width: 24px; border-right-width: 24px; border-radius: 40px / 24px; background-clip: padding-box; color: #016fd0; font-size: 17px !important; }
  #main table:has(img[src*="/images/buttons/"]), #main table:has(img[src*="/images/buttons/"]) > tbody { display: block; width: 100%; }
  #main table:has(img[src*="/images/buttons/"]) > tbody > tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #main table:has(img[src*="/images/buttons/"]) td { display: block; padding: 0; }
  #main table:has(img[src*="/images/buttons/"]) img { display: block; width: 100%; }
}
