/* DETAIL */

@media screen and (min-width: 801px) {
  body.single .l-main {
    margin-top: -4px;
  }
  body.single .l-pagecontainer {
    position: relative;
    padding-bottom: 35px;
  }
  body.single .l-wrapper {
    padding-bottom: 60px;
  }
}
body.single .l-pagecontainer::before {
  content: '';
  display: block;
  width: 100%;
  height: 440px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  background-color: #f7f9fa;
}

body.single .l-main article {
  max-width: 864px;
}

body.single .l-pagecontainer .l-basecontent,
body.single .l-pagecontainer .c-snippetcontent {
  max-width: 828px;
  max-width: 864px;
}

body.single .l-pagecontainer .widget {
  position: relative;
}

body.single .l-pagecontainer .widget .toc {
  width: 288px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

body.single .l-pagecontainer .widget .toc.is-fixed {
  position: fixed;
  top: 120px;
}

body.single .l-pagecontainer .widget .toc.is-bottom {
  position: absolute;
  top: unset;
  bottom: 0px;
}

@media screen and (max-width: 1100px) {
  body.single .l-pagecontainer .widget .toc,
  body.single .l-pagecontainer .widget .toc.is-fixed,
  body.single .l-pagecontainer .widget .toc.is-bottom {
    width: 100%;
    max-height: 100%;
    position: relative;
    top: unset;
    bottom: unset;
  }
}

body.single .c-sharebox {
  margin-top: 52px;
}

body.single .c-sharebox.-title-area {
  margin-top: 20px;
  margin-bottom: 40px;
}
body.single .c-sharebox.-title-area ul li a {
  width: 60px;
  height: 28px;
}
body.single .c-sharebox ul li a img {
  width: 16px;
  height: 16px;
}
@media screen and (min-width: 1440px) {
  body.single .c-sharebox.-title-area {
    display: none;
  }
}

@media screen and (min-width: 1440px) {
  body.single .c-sharebox {
    display: block;
    position: fixed;
    top: calc(50% - 86px);
    left: calc((100% - 1332px) / 2 - 48px);
    margin: 0;
  }
  body.single .c-sharebox p {
    margin-right: 0;
    margin-bottom: 5px;
    font-size: 13px;
    text-align: center;
    color: #666;
  }
  body.single .c-sharebox ul {
    display: block;
    margin: 0;
  }
  body.single .c-sharebox ul li {
    margin-bottom: 8px;
  }
  body.single .c-sharebox ul li a {
    /* display: block; */
    width: 40px;
    height: 40px;
    /* padding-top: 5px; */
    background-color: #f3f3f3;
    text-align: center;
    border-radius: 20px;
    transition: opacity 0.2s ease-out;
  }
  body.single.ua-desktop .c-sharebox ul li a:hover {
    /* opacity: .6; */
  }
}
@media screen and (min-width: 1468px) {
  body.single .c-sharebox {
    left: calc((100% - 1332px) / 2 - 64px);
  }
}

body.single .l-pagecontainer .section-related {
  padding-top: 55px;
  border-top: 1px solid #d8d8d8;
  margin-bottom: 0;
}
body.single .c-snippetcontent {
  margin-top: 56px;
  padding-top: 36px;
}
body.single .c-snippetcontent h2 {
  margin-top: 2em;
  padding: 0;
  border: none;
  text-align: center;
}
body.single .c-snippetcontent h2:before {
  display: none;
}
body.single .l-pagecontainer .c-snippetcontent.c-snippetcontent-primary {
  border-top: 2px solid #002c91;
  border-bottom: 2px solid #002c91;
}

body.single
  .l-pagecontainer
  .c-snippetcontent.c-snippetcontent-primary.l-basecontent {
  padding-right: 0;
  padding-bottom: 44px;
  padding-left: 0;
}
body.single .c-snippetcontent.c-snippetcontent-secondary {
  margin-top: 0;
  padding-top: 48px;
}
body.single .c-snippetcontent.c-snippetcontent-secondary .inner {
  background-color: #f7f9fa;
  border: 1px solid #e7edf0;
  border-radius: 5px;
  text-align: center;
  padding: 15px;
}

/* 目次枠内にH2がある時のための調整用スタイル */
body.single .wp-block-group .l-basecontent h2 {
  position: static;
  margin-top: 0;
  margin-bottom: 0;
  padding: 0;
  border-bottom: none;
  color: inherit;
  font-size: inherit;
}

@media screen and (min-width: 801px) {
}

/* ARCHIVE */
@media screen and (min-width: 801px) {
  body.archive .l-main {
    margin-top: -6px;
  }
}

/* HOME */
body.home.is-top .header-logo {
  pointer-events: none;
}
body.home .l-pagecontainer.is-home .l-wrapper {
  padding-bottom: 0;
}
body.home .l-pagecontainer .l-section:first-child {
  margin-bottom: 50px;
}
body.home .l-pagecontainer .l-section:last-child {
  margin-bottom: 0;
}
body.home .l-section .c-entrylist.c-entrylist-col3 .item:nth-child(4) {
  /* 4つ目が表示された場合の対策 */
  display: none;
}

@media screen and (min-width: 801px) {
  body.home .l-section .c-entrylist.c-entrylist-col3 .item {
    margin-bottom: 0;
  }
}

body.single {
  position: relative;
}

.modal {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  width: 80%;
  max-width: 500px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.modal-content .modal-inner {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.modal-content img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.modal-content .close-btn {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 40px;
  height: 40px;
  background-color: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 30px;
  font-size: 28px;
  line-height: 40px;
  text-align: center;
}

.modal-content .close-btn:hover {
  background-color: #d8d8d8;
}

.floating-bannar {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 300px;
  height: 300px;
  background-color: #fff;
  z-index: 1;
}

.floating-bannar.is-show {
  display: block;
}

.floating-bannar .floating-bannar-inner {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid #d8d8d8;
}

.floating-bannar .floating-bannar-inner .floating-bannar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.floating-bannar .close-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  background-color: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 30px;
  font-size: 28px;
  line-height: 30px;
  text-align: center;
}

.floating-bannar .close-btn:hover {
  background-color: #d8d8d8;
}

@media screen and (max-width: 768px) {
  .floating-bannar {
    width: 150px;
    height: 150px;
    right: 12px;
    bottom: 12px;
    transform-origin: bottom right;
    transition: width 0.3s ease;
  }

  /* 拡大時は右下固定（right は据え置き、幅だけ左へ伸ばす） */
  @media (hover: hover) and (pointer: fine) {
    .floating-bannar:hover {
      width: calc(100vw - 24px);
      right: 12px;
    }

    body.has-floating-bannar .floating-bannar:hover {
      width: calc(100vw - 60px);
      right: 30px;
    }
  }

  /* タッチ長押し・スクロール連動（common.js が .is-expanded を付与） */
  .floating-bannar.is-expanded {
    width: calc(100vw - 24px);
    right: 12px;
  }

  body.has-floating-bannar .floating-bannar.is-expanded {
    width: calc(100vw - 60px);
    height: calc(100vw - 60px);
    right: 30px;
  }

  .floating-bannar .close-btn {
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    font-size: 18px;
    line-height: 24px;
  }
}

/* フローティングバナー表示時: ページトップと位置を入れ替え（バナー＝下端、ページトップ＝その上） */
body.has-floating-bannar .floating-bannar {
  right: 30px;
  bottom: 30px;
  z-index: 850;
}

/* フローティング下端30px + バナー高さ300px + 余白16px（PC。スマホは下記メディアで150px） */
body.has-floating-bannar .js-pagetop {
  bottom: calc(30px + 300px + 16px);
}

@media screen and (max-width: 768px) {
  body.has-floating-bannar .js-pagetop {
    bottom: calc(30px + 150px + 16px);
  }

  /* is-expanded 時は横幅が広がるためページトップをさらに上げる（body.floating-bannar-expanded は JS が同期） */
  body.has-floating-bannar:not(.floating-bannar-closed).floating-bannar-expanded .js-pagetop {
    bottom: calc(30px + 150px + 48px);
  }
}

/* フローティングを閉じたあとはページトップを通常位置（base.css の bottom: 30px）へ */
body.has-floating-bannar.floating-bannar-closed .js-pagetop {
  bottom: 30px;
}
