/* Site-wide smartphone navigation and readability */
.sitewide-mobile-menu { display: none; }
@media screen and (max-width: 767px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body {
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px 12px 28px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    font-size: 18px !important;
    line-height: 1.8 !important;
  }
  body, p, div, span, font, li, dt, dd, blockquote,
  table, tbody, thead, tfoot, tr, td, th,
  input, select, textarea, button {
    font-size: inherit !important;
    line-height: 1.8 !important;
  }
  h1 { font-size: 1.55rem !important; line-height: 1.4 !important; }
  h2 { font-size: 1.35rem !important; line-height: 1.45 !important; }
  h3 { font-size: 1.2rem !important; line-height: 1.5 !important; }
  small { font-size: .9rem !important; }
  table { max-width: 100% !important; }
  td, th {
    min-width: 0 !important;
    height: auto !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    box-sizing: border-box !important;
  }
  img, video, iframe, object, embed {
    max-width: 100% !important;
    height: auto !important;
  }
  iframe { width: 100% !important; }
  a { overflow-wrap: anywhere !important; }

  .sitewide-mobile-menu {
    display: block !important;
    width: 100%;
    max-width: 760px;
    margin: 0 auto 14px;
    box-sizing: border-box;
    position: relative;
    z-index: 1000;
  }
  .sitewide-mobile-menu summary {
    display: block;
    cursor: pointer;
    list-style: none;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid #8f7f55;
    background: #fff8e7;
    color: #111;
    font-weight: bold;
    font-size: 18px !important;
    line-height: 48px !important;
    box-sizing: border-box;
  }
  .sitewide-mobile-menu summary::-webkit-details-marker { display: none; }
  .sitewide-mobile-menu summary::after { content: "▼"; float: right; font-size: 13px; }
  .sitewide-mobile-menu[open] summary::after { content: "▲"; }
  .sitewide-mobile-menu-nav {
    border: 1px solid #8f7f55;
    border-top: 0;
    background: #fffdf4;
    padding: 7px 15px 11px;
    box-sizing: border-box;
  }
  .sitewide-mobile-menu-nav a {
    display: block;
    padding: 10px 2px;
    border-bottom: 1px dotted #c7b98e;
    color: #111;
    text-decoration: none;
    font-weight: bold;
    font-size: 17px !important;
    line-height: 1.5 !important;
  }
  .sitewide-mobile-menu-nav a:last-child { border-bottom: 0; }
  .sitewide-mobile-menu-heading {
    padding: 10px 2px 3px;
    color: #604f22;
    font-weight: bold;
    font-size: 15px !important;
  }

  /* Hide each page's legacy navigation on smartphones; the new Menu remains. */
  .original-page-menu { display: none !important; }
}


/* Ryofu Shorin smartphone layout */
@media screen and (max-width: 767px) {
  body.ryofu-splash-page {
    min-height: 100vh !important;
    padding: 10px 12px 24px !important;
    background-position: center top !important;
  }
  .ryofu-splash-page > a {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
  }
  .ryofu-splash-logo {
    display: block !important;
    width: 100% !important;
    max-width: 499px !important;
    height: auto !important;
    margin: 12px auto 0 !important;
  }

  body.ryofu-main-page {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 14px 28px !important;
    background-attachment: scroll !important;
    background-size: auto !important;
  }
  .ryofu-main-page > table,
  .ryofu-main-page .ryofu-products {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }
  .ryofu-main-page .ryofu-products > tbody,
  .ryofu-main-page .ryofu-products > tbody > tr,
  .ryofu-main-page .ryofu-products > tbody > tr > td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .ryofu-main-page .ryofu-products > tbody > tr > td {
    padding: 10px 0 18px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }
  .ryofu-main-page .ryofu-products > tbody > tr > td[colspan] {
    padding: 2px 0 !important;
  }
  .ryofu-main-page .ryofu-products img {
    max-width: 100% !important;
    height: auto !important;
  }
  .ryofu-main-page br + br + br {
    line-height: 1 !important;
  }
  .ryofu-main-page table:not(.original-page-menu) {
    max-width: 100% !important;
  }
  .ryofu-main-page table:not(.original-page-menu) td,
  .ryofu-main-page table:not(.original-page-menu) th {
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}


/* Tokyo congregation and Sacraments pages: full-width smartphone layout */
@media screen and (max-width: 767px) {
  body.tokyo-mobile-page,
  body.sacrament-mobile-page {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  body.tokyo-mobile-page > div[id^="Layer"] {
    position: static !important;
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 8px 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }
  body.tokyo-mobile-page > div#Layer1 { display: none !important; }

  body.tokyo-mobile-page table,
  body.sacrament-mobile-page table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }
  body.tokyo-mobile-page table > tbody,
  body.tokyo-mobile-page table > tbody > tr,
  body.tokyo-mobile-page table > tbody > tr > td,
  body.tokyo-mobile-page table > tr,
  body.tokyo-mobile-page table > tr > td,
  body.sacrament-mobile-page table > tbody,
  body.sacrament-mobile-page table > tbody > tr,
  body.sacrament-mobile-page table > tbody > tr > td,
  body.sacrament-mobile-page table > tr,
  body.sacrament-mobile-page table > tr > td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  body.tokyo-mobile-page td,
  body.tokyo-mobile-page th,
  body.sacrament-mobile-page td,
  body.sacrament-mobile-page th {
    padding-left: 4px !important;
    padding-right: 4px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }
  body.tokyo-mobile-page img,
  body.sacrament-mobile-page img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* The site-wide Menu stays at the top; old page menus stay hidden. */
  body.tokyo-mobile-page .original-page-menu,
  body.sacrament-mobile-page .original-page-menu,
  body.osaka-page .original-page-menu,
  body.tokyo-mobile-page csobj,
  body.sacrament-mobile-page csobj,
  body.osaka-page csobj {
    display: none !important;
  }

  /* Osaka Google Calendar: smartphone height reduced to half-size. */
  body.osaka-page iframe.osaka-calendar {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 450px !important;
    margin: 0 auto !important;
  }
}

@media (max-width:768px){
.sitewide-mobile-menu{display:block!important;margin:0 0 10px 0}
.original-page-menu{display:none!important}
table{width:100%!important;max-width:100%!important}
td{word-break:break-word!important}
img{max-width:100%!important;height:auto!important}
body{font-size:18px!important;overflow-x:hidden}
}
