/*
Theme Name: Cocoon Child
Template: cocoon-master
*/

@media screen and (min-width: 1024px) {
  #content-in {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 2%;
    max-width: 1200px;
    margin: 0 auto;
  }

  #main {
    width: 70%;
    order: 1;
  }

  #sidebar {
    width: 28%;
    order: 2;
  }
}

@media screen and (max-width: 1023px) {
  #content-in {
    display: block;
    margin: 0 10px;
  }

  #main,
  #sidebar {
    width: 100%;
  }
}

#main,
#sidebar,
.entry-content,
.main > .entry-content,
.main .wpcf7 {
  margin-top: 0 !important;
  padding-top: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* スマホ：フッターリンク縦並び */
@media screen and (max-width: 767px) {
  #navi-footer-in ul,
  .footer-bottom nav ul {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px;
    padding-left: 0 !important;
    margin: 0 !important;
  }

  #navi-footer-in ul li,
  .footer-bottom nav ul li {
    width: 100% !important;
    margin: 5px 0 !important;
  }

  #navi-footer-in ul li a,
  .footer-bottom nav ul li a {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
  }

  #navi-footer-in ul li::after,
  .footer-bottom nav ul li::after {
    content: none !important;
  }
}

/* 固定ページのアイキャッチ画像を中央に表示 */
.page-thumbnail {
  max-width: 100%;
  text-align: center;
  margin: 30px auto;
}

.page-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.page-thumbnail {
  margin-bottom: 20px;
  text-align: center;
}
.page-thumbnail img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* 左右の高さを揃えるためのflex設定 */
#content {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
}

/* mainとsidebarの高さを100%に */
#main,
#sidebar {
  height: auto;
  align-self: stretch;
}

/* 左右のカラム高さ揃え・右側の凹み解消 */
@media screen and (min-width: 1024px) {
  #content-in {
    align-items: flex-start;
  }

  #main {
    margin-bottom: 0;
  }

  #sidebar {
    margin-top: 0;
    padding-top: 0;
  }

  .page-thumbnail {
    margin-bottom: 30px;
  }
}

/* 左右カラムの上端を揃える＋右カラムの落ち込みを防ぐ */
@media screen and (min-width: 1024px) {
  #content-in {
    display: flex;
    align-items: flex-start;
  }

  #main {
    flex: 1;
    margin: 0;
  }

  #sidebar {
    width: 28%;
    margin: 0;
    padding: 0;
  }

  .page-thumbnail {
    margin-bottom: 20px;
  }
}

/* アイキャッチ画像を左カラムの幅内に制限し、右のサイドバーと横並びに */
.page-thumbnail {
  max-width: 100%;
  height: auto;
  margin-bottom: 20px;
}

/* 全体をFlexで横並びに調整（PC幅のみ） */
@media screen and (min-width: 1024px) {
  #content-in {
    display: flex;
    align-items: flex-start;
    gap: 20px;
  }

  #main {
    flex: 1;
    max-width: 70%;
  }

  #sidebar {
    width: 28%;
  }

  /* 必要なら画像を本文内に寄せる */
  .page-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
  }
}

/* アイキャッチ画像のレイアウト調整 */
.page-thumbnail {
  float: left;
  margin: 0 20px 20px 0;
  max-width: 48%;
}

@media screen and (max-width: 768px) {
  .page-thumbnail {
    float: none;
    max-width: 100%;
    margin: 0 auto 20px;
  }
}

/* アイキャッチ画像と本文＋サイドバーの整列を調整 */
.main {
  overflow: hidden;
}

.page-thumbnail {
  float: left;
  margin: 0 20px 20px 0;
  max-width: 45%;
  height: auto;
}

@media screen and (max-width: 768px) {
  .page-thumbnail {
    float: none;
    max-width: 100%;
    margin: 0 auto 20px;
  }
}

@media screen and (max-width: 1023px) {
  body.page #sidebar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-top: 20px !important;
  }

  body.page #main,
  body.page #sidebar {
    width: 100% !important;
    float: none !important;
    display: block !important;
  }
}
