/* Narrow layouts for the public site. */
@media (max-width: 960px) {
  body:has(#spMenu) { padding-top: 0; }
  body:has(#spMenu) > header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    min-height: 60px;
    padding: 6px 12px;
    gap: 8px;
  }
  body:has(#spMenu) > header h1 { flex: 1; min-width: 0; padding: 0; }
  body:has(#spMenu) > header h1 img { width: auto; max-width: 100%; max-height: 46px; height: auto; }
  body:has(#spMenu) > header :is(#counter, #bnPanf, #menu) { display: none; }

  #spMenu { display: block; flex: 0 0 auto; color: #fff; text-align: left; }
  #spMenu summary { cursor: pointer; }
  #spMenu > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 10px;
    background: #191970;
    border-radius: 4px;
    font-size: 14px;
    list-style: none;
  }
  #spMenu > summary::-webkit-details-marker { display: none; }
  #spMenu nav {
    position: absolute;
    top: 100%;
    right: 0;
    width: min(100vw, 380px);
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #191970;
  }
  #spMenu nav :is(a, summary) {
    display: block;
    min-height: 44px;
    padding: 12px 16px;
    border-bottom: 1px solid #51519a;
    color: inherit;
    text-decoration: none;
    line-height: 1.4;
  }
  #spMenu nav summary { display: list-item; list-style-position: inside; }
  #spMenu nav details a { padding-inline-start: 32px; background: #272783; }
  #spMenu :is(a, summary):focus-visible { outline: 2px solid #fff8b1; outline-offset: -3px; }

  body:has(#spMenu) section { opacity: 1; top: 0; transition: none; animation: none; }
  body:has(#spMenu) :is(section, footer) img { max-width: 100%; height: auto; }
  body:has(#spMenu) iframe { max-width: 100%; }
  body:has(#spMenu) :is(section, footer) { overflow-wrap: anywhere; }
  body:has(#spMenu) .page h2 {
    padding: 30px 12px;
    /* Keep the crop above the seam in the two-part source image. */
    background-size: max(100%, 480px) auto;
    background-position: center 20%;
    animation: none;
    font-size: clamp(23px, 5vw, 32px);
  }
  section#tpConcept { background-size: cover; background-position: center; padding: 28px 12px; }
  #tpConcept :is(#tpTxt1, #tpTxt2) { font-size: clamp(19px, 4vw, 29px); }
  #tpConcept :is(#tpTxt1, #tpLogo, #tpTxt2) { opacity: 1; animation: none; }
  #tpConcept li > div { flex: 0 0 auto; }

  section#tpBigNews, section#tpOrg, section#Sponcer, #btmCts { padding-block: 30px; }
  section#tpBigNews ul { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  section#tpBigNews ul li { width: 100%; height: auto; margin: 0; background-image: none; }
  section#tpBigNews ul li a { height: auto; padding: 12px; }
  .bigNewsT { margin: 0 0 8px; padding: 0 0 6px; }
  .bigNewsM { gap: 10px; margin: 0; padding: 0; align-items: flex-start; }
  .bigNewsM > div { min-width: 0; }
  .bigNewsImg { flex: 0 0 28%; width: auto; height: auto; margin: 0; }
  .bigNewsImg img { display: block; }
  #tpOrg > :is(h2, p) { padding-inline: 12px; }
  #orgChart {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: min(92%, 720px);
    height: auto;
    background: none;
  }
  #orgChart > img { display: none; }
  #orgChart > a[id], #orgChart #popbox a {
    position: static;
    width: auto;
    height: auto;
    padding: 8px;
  }
  #orgChart #popbox {
    position: static;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: auto;
  }
  #orgChart #popbox > div { grid-column: 1 / -1; }
  #Sponcer ul { justify-content: center; gap: 8px; }
  #Sponcer li { width: min(46%, 174px); }
  #btmCts { background-size: cover; background-position: center; }
  body:has(#spMenu) #tpSNS div img { height: auto; max-height: 60px; max-width: calc(100% - 16px); }
  div#diaryBox { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  #sdMenu, #sdMain { width: 100%; }
  #sdMenu { max-width: 360px; }
  body:has(#spMenu) :is(input, select, textarea, button) { max-width: 100%; }
  body:has(#spMenu) :is(.course, #result) table { table-layout: fixed; }
}

@media (max-width: 600px) {
  #ab_concept > p { text-align: left; }
  #ab_concept > p > br:first-of-type { display: none; }
  section#ab_history > dl { display: block; margin-block: 24px; }
  section#ab_history > dl > dt {
    width: 100%;
    margin: 0 0 8px;
    padding: 8px 10px;
    border-bottom: 0;
    background: #e6e6fa;
  }
  section#ab_history > dl > dt > br { display: none; }
  section#ab_history > dl > dd { width: 100%; margin-bottom: 18px; padding-bottom: 16px; }
  section#ab_history > dl > dd dl {
    display: grid;
    grid-template-columns: minmax(3.25em, max-content) minmax(0, 1fr);
    gap: 6px 8px;
  }
  section#ab_history > dl > dd dl > :is(dt, dd) { width: auto; }
  #orgChart, #orgChart #popbox { grid-template-columns: minmax(0, 1fr); }
  #reqpanf dl { padding: 14px; }
  #reqpanf :is(dt, dd) { width: 100%; }
  #reqpanf dt { border-bottom: 0; font-weight: bold; }
  #reqpanf dd { margin-bottom: 8px; }
  .login-box { width: min(92%, 360px); padding: 24px; }
  body:has(#spMenu) :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { font-size: 16px; }
  section#ab_record ul { flex-wrap: wrap; gap: 6px; padding: 0; }
  section#ab_record li { margin: 0; }
  section#ab_staff dd ul { padding-inline-start: 16px; }
  .playerImg, .profile { width: 100%; }
  .playerImg { height: auto; }
  .playerImg img { width: auto; }
}
