/* =====================================================
   ESアカデミー｜統合CSS 完全版
   WordPress.com / Dara テーマ

   HOME：既存カバーブロック
   那珂湊校・勝田校：画像ブロック2枚で切り替え
     PC用    es-campus-image
     スマホ用 es-campus-mobile
   3つの強み：es-strength-section / es-strength-card

   これまでの追加CSSはバックアップ後、すべて置換する
===================================================== */

/* 01｜サイト・基本の幅 */
body .site {
  width: 100% !important;
  max-width: none !important;
  margin-inline: auto;
  box-sizing: border-box;
}

/* 02｜ナビゲーション */
body #site-navigation,
body .main-navigation {
  position: relative !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 100vw !important;
  max-width: none !important;
  margin-inline: 0 !important;
  box-sizing: border-box;
  z-index: 9999 !important;
}
body .site-header {
  position: relative;
  z-index: 9999;
}
body .main-navigation ul ul {
  z-index: 10000 !important;
  top: 100% !important;
  margin-top: 0 !important;
}
body .main-navigation ul li:hover > ul,
body .main-navigation ul li:focus-within > ul {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 03｜公式HOME：既存カバーを全幅表示（スマホの高さは変更しない） */
body.home .entry-content > .wp-block-cover:first-child {
  position: relative !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 100vw !important;
  max-width: none !important;
  margin-inline: 0 !important;
  box-sizing: border-box;
}
@media (min-width: 1000px) {
  body.home .entry-content > .wp-block-cover:first-child {
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  body.home .entry-content > .wp-block-cover:first-child
  .wp-block-cover__image-background {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
  }
}

/* 04｜校舎ページだけ、本文・記事の幅を拡張 */
/* PC用画像がページ内にあることを目印にする。
   PC用画像はスマホで非表示でも :has() の判定対象となる。 */
body.page:not(.home):has(.es-campus-image) .site-content,
body.page:not(.home):has(.es-campus-image) .content-wrapper,
body.page:not(.home):has(.es-campus-image) .content-area,
body.page:not(.home):has(.es-campus-image) .site-main,
body.page:not(.home):has(.es-campus-image) .site-main > article {
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  box-sizing: border-box !important;
}
body.page:not(.home):has(.es-campus-image) #secondary {
  display: none !important;
}
body.page:not(.home):has(.es-campus-image) .entry-header,
body.page:not(.home):has(.es-campus-image) .entry-content {
  width: 100% !important;
  max-width: 1200px !important;
  margin-inline: auto !important;
  padding-inline: 30px !important;
  box-sizing: border-box !important;
}
body.page:not(.home):has(.es-campus-image)
.entry-content .is-layout-constrained > :not(.alignfull):not(.alignleft):not(.alignright) {
  max-width: 100% !important;
}
body.page:not(.home):has(.es-campus-image)
.entry-content .wp-block-group__inner-container {
  max-width: 100%;
}
body.page:not(.home):has(.es-campus-image) .entry-content {
  overflow-wrap: break-word;
}

/* 05｜PC画像・スマホ画像の共通表示位置 */
body.page:not(.home) .entry-content .es-campus-image,
body.page:not(.home) .entry-content .es-campus-mobile {
  position: relative !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 100vw !important;
  max-width: none !important;
  height: auto !important;
  aspect-ratio: auto !important;
  margin: 0 0 36px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
body.page:not(.home) .entry-content .es-campus-image > a,
body.page:not(.home) .entry-content .es-campus-mobile > a {
  display: block;
  width: 100%;
}
body.page:not(.home) .entry-content .es-campus-image img,
body.page:not(.home) .entry-content .es-campus-mobile img {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  opacity: 1 !important;
  filter: none !important;
  border-radius: 0 !important;
}

/* 06｜画像の自動切り替え（デフォルトはPC画像） */
body.page:not(.home) .entry-content .es-campus-image {
  display: block !important;
}
body.page:not(.home) .entry-content .es-campus-mobile {
  display: none !important;
}

/* 07｜通常の本文画像 */
body .entry-content img {
  max-width: 100%;
  height: auto;
}

/* 08｜JOURNAL：これまでの設定を維持 */
body.blog .site-main article .entry-content,
body.single-post .site-main article .entry-content {
  width: calc(100% - 40px);
  max-width: 760px !important;
  margin-inline: auto !important;
  box-sizing: border-box;
}
body.blog .entry-title,
body.single-post .entry-title,
body.single-post .entry-content h2,
body.single-post .entry-content h3,
body.single-post .entry-content h4 {
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
}
body.single-post .sharedaddy.sd-like,
body.single-post .sharedaddy.sd-like-enabled,
body.single-post .wpl-likebox {
  display: none !important;
}

/* 09｜3つの強み：共通のセクション */
.es-strength-section {
  position: relative !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: calc(100vw - 64px) !important;
  max-width: 1100px !important;
  margin: 48px 0 !important;
  padding: 44px 38px !important;
  background-color: #F3EEE7 !important;
  border-radius: 10px;
  box-sizing: border-box !important;
}
.es-strength-section > .wp-block-heading {
  color: #38291F;
  text-align: center;
}
.es-strength-section .wp-block-columns {
  display: flex;
  flex-wrap: nowrap;
  gap: 24px !important;
  align-items: stretch;
}
.es-strength-section .wp-block-column {
  flex: 1 1 0 !important;
  min-width: 0 !important;
}

/* 10｜3つの強み：各カード */
.es-strength-card {
  background: #FFFFFF !important;
  width: 100%;
  height: 100%;
  padding: 36px 24px !important;
  text-align: center !important;
  box-sizing: border-box !important;
}
.es-strength-card h2,
.es-strength-card h3,
.es-strength-card p {
  text-align: center !important;
}
.es-strength-card h2 {
  color: #B19A84 !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 38px !important;
  font-weight: 400 !important;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: .04em !important;
  line-height: 1.2 !important;
  margin: 0 0 18px !important;
}
.es-strength-card h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  background: #D9C9BA;
  margin: 12px auto 0;
}
.es-strength-card h3 {
  color: #38291F !important;
  font-size: 22px !important;
  line-height: 1.5 !important;
  margin: 0 0 18px !important;
  overflow-wrap: break-word;
}
.es-strength-card p {
  color: #706258 !important;
  font-size: 17px !important;
  line-height: 1.8 !important;
  margin: 0 !important;
  overflow-wrap: break-word;
}

/* 11｜タブレット */
@media (min-width: 768px) and (max-width: 999px) {
  body.page:not(.home):has(.es-campus-image) .entry-header,
  body.page:not(.home):has(.es-campus-image) .entry-content {
    padding-inline: 24px !important;
  }
  .es-strength-section {
    width: calc(100vw - 40px) !important;
    padding: 32px 20px !important;
  }
  .es-strength-section .wp-block-columns { gap: 14px !important; }
  .es-strength-card { padding: 28px 15px !important; }
  .es-strength-card h3 { font-size: 19px !important; }
  .es-strength-card p { font-size: 15px !important; }
}

/* 12｜スマホ：画像切替・本文余白・強みの縦並び */
@media (max-width: 767px) {
  /* 校舎ページの本文外枠を画面幅に揃える */
  body.page:not(.home):has(.es-campus-image) .site-content,
  body.page:not(.home):has(.es-campus-image) .content-wrapper,
  body.page:not(.home):has(.es-campus-image) .content-area,
  body.page:not(.home):has(.es-campus-image) .site-main,
  body.page:not(.home):has(.es-campus-image) .site-main > article {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
  }
  body.page:not(.home):has(.es-campus-image) .entry-header,
  body.page:not(.home):has(.es-campus-image) .entry-content {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-inline: auto !important;
    padding-inline: 16px !important;
    box-sizing: border-box !important;
  }

  /* PC画像は表示しない */
  body.page:not(.home) .entry-content .es-campus-image {
    display: none !important;
  }
  /* スマホ用正方形画像だけ表示 */
  body.page:not(.home) .entry-content .es-campus-mobile {
    display: block !important;
    width: 100vw !important;
    max-width: none !important;
    height: auto !important;
    aspect-ratio: auto !important;
    margin: 0 0 30px !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  body.page:not(.home) .entry-content .es-campus-mobile img {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    object-position: center !important;
  }

  /* 3つの強み */
  .es-strength-section {
    width: calc(100vw - 32px) !important;
    max-width: none !important;
    margin: 30px 0 !important;
    padding: 28px 16px !important;
  }
  .es-strength-section .wp-block-columns {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 18px !important;
  }
  .es-strength-section .wp-block-column {
    width: 100% !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
  }
  .es-strength-card {
    width: 100% !important;
    height: auto !important;
    padding: 28px 22px !important;
  }
  .es-strength-card h2 { font-size: 36px !important; }
  .es-strength-card h3 { font-size: 21px !important; }
  .es-strength-card p { font-size: 16px !important; }
  body.page:not(.home):has(.es-campus-image) .entry-content p,
  body.page:not(.home):has(.es-campus-image) .entry-content li {
    overflow-wrap: break-word;
  }
}

/* 13｜小型スマホ */
@media (max-width: 480px) {
  .es-strength-section { padding: 24px 12px !important; }
  .es-strength-card { padding: 26px 18px !important; }
  .es-strength-card h2 { font-size: 34px !important; }
  .es-strength-card h3 { font-size: 20px !important; }
  .es-strength-card p { font-size: 15px !important; }
}
