/*
Theme Name: Twenty Twenty-One Child
Template: twentytwentyone
Version: 1.0
*/

/* ここに子テーマ用CSSを追加していきます */
/* 応急処置：背景を白に固定 */
body,
.site,
.site-content,
#page,
#content {
  background: #fff !important;
}
/* Twenty Twenty-One の light theme 背景を無効化 */
.site,
.site-main,
.site-content,
.entry-content {
  background-color: #fff !important;
}
/* PICKUP：カード全体を“それっぽく”クリックできる見た目に */
.pickup_area .pickup-item {
  margin: 0;
}

.pickup_area .pickup-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* 画像のhover */
.pickup_area .pickup-item dt {
  overflow: hidden;
}

.pickup_area .pickup-item dt img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .25s ease, opacity .25s ease;
}

.pickup_area .pickup-item:hover dt img {
  transform: scale(1.02);
  opacity: .92;
}

/* タイトルのhover */
.pickup_area .pickup-item dd {
  margin: 0;
}

.pickup_area .pickup-item dd .pickup-link {
  transition: opacity .2s ease;
}

.pickup_area .pickup-item:hover dd .pickup-link {
  opacity: .75;
}
/* PICKUP：カード全体をホバーで持ち上げる */
#pickup .pickup-link{
  display:block;
  text-decoration:none;
  color:inherit;
  border-radius:10px;
  overflow:hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

#pickup dl{
  background:#fff;
  border-radius:10px;
}

#pickup .pickup-link:hover{
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,.15);
}
/* PICKUP：画像を軽くズーム */
#pickup .pickup-link img{
  display:block;
  width:100%;
  height:auto;
  transition: transform .3s ease;
}

#pickup .pickup-link:hover img{
  transform: scale(1.03);
}
/* PICKUP：タイトルの余白と行間 */
#pickup dd{
  margin: 12px 0 0;
  line-height: 1.5;
}
/* ===== PICKUP：上品 hover（影＋ちょいズーム）===== */

/* リンク全体をカード化 */
#pickup .pickup-link{
  display:block;
  text-decoration:none;
  color:inherit;
  border-radius:10px;
  overflow:hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}

/* dl をカードの土台に（白背景で安定） */
#pickup dl{
  background:#fff;
  border-radius:10px;
}

/* hover時：少し持ち上げ＋控えめな影 */
#pickup .pickup-link:hover{
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(0,0,0,.14);
}

/* 画像：軽くズーム */
#pickup .pickup-link img{
  display:block;
  width:100%;
  height:auto;
  transition: transform .28s ease;
}

#pickup .pickup-link:hover img{
  transform: scale(1.03);
}

/* タイトル：読みやすい余白だけ */
#pickup dd{
  margin: 12px 0 0;
  line-height: 1.55;
}
/* --- PICKUP: カード全体クリック + Grid + hover --- */
#pickup .pickup_area{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

#pickup .pickup-card{
  display: block;
  text-decoration: none;
  color: inherit;
}

#pickup .pickup-card dl{
  margin: 0;
}

#pickup .pickup-card dt{
  margin: 0;
}

#pickup .pickup-card img{
  display: block;
  width: 100%;
  height: auto;
}

#pickup .pickup-card dd{
  margin: 12px 0 0;
  font-weight: 700;
  line-height: 1.5;
}

/* hover演出 */
#pickup .pickup-card{
  transition: transform .15s ease, box-shadow .15s ease;
}
#pickup .pickup-card:hover{
  transform: translateY(-2px);
}

/* スマホで1列、タブレットで2列 */
@media (max-width: 1024px){
  #pickup .pickup_area{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px){
  #pickup .pickup_area{ grid-template-columns: 1fr; }
}
/* PICKUP：Gridを強制（他CSSに負けないように） */
#pickup .pickup_area{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 28px !important;
}

/* 旧CSSの float / width が残っていても崩れないように無効化 */
#pickup .pickup_area dl{
  float: none !important;
  width: auto !important;
  margin: 0 !important;
}

/* スマホで1列、タブレットで2列 */
@media (max-width: 1024px){
  #pickup .pickup_area{ grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 767px){
  #pickup .pickup_area{ grid-template-columns: 1fr !important; }
}
/* Grid化したので clearfix(cf) の疑似要素を無効化 */
#pickup .pickup_area.cf::before,
#pickup .pickup_area.cf::after{
  content: none !important;
  display: none !important;
}
/* ピックアップ hover演出 */
#pickup .pickup_area dl{
  transition: transform .25s ease, box-shadow .25s ease;
}

#pickup .pickup_area a:hover dl{
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,.15);
}
@media (max-width: 767px){
  #pickup .pickup_area{
    grid-template-columns: 1fr;
  }
}
/* ヘッダー画像の文字がはみ出ない対策（スマホ用） */
@media (max-width: 768px) {
  .header-visual .text-area {
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%);
    width: 90%;
    padding: 0 5%;
    box-sizing: border-box;
    text-align: center;
  }

  .header-visual .text-area h1 {
    font-size: 5vw;   /* 画面幅に応じて文字サイズが変わる */
    line-height: 1.3;
  }
}
/* ヘッダー文字 スマホ最短修正（強制上書き版） */
@media (max-width: 768px) {
  header .header-visual,
  header .main-visual,
  #header .header-visual,
  #header .main-visual {
    padding: 0 5% !important;
  }

  header .header-visual h1,
  header .main-visual h1,
  #header .header-visual h1,
  #header .main-visual h1 {
    font-size: 5vw !important;
    line-height: 1.3 !important;
    text-align: center !important;
    word-break: keep-all;
  }

  header .header-visual *,
  header .main-visual * {
    max-width: 100%;
    box-sizing: border-box;
  }
}
/* スマホ時：ヘッダー画像上のタイトルが切れる問題を修正 */
@media (max-width: 768px) {

  header.entry-header.alignwide {
    overflow: visible !important;     /* はみ出しカット防止 */
  }

  header.entry-header.alignwide .entry-title {
    position: static !important;      /* absolute対策 */
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 5% !important;
    box-sizing: border-box;
    font-size: clamp(18px, 5vw, 26px) !important;
    line-height: 1.3 !important;
    text-align: center !important;
    white-space: normal !important;   /* 折り返し許可 */
    word-break: break-word;
  }

  header.entry-header.alignwide .post-thumbnail {
    overflow: hidden;                 /* 画像側は崩れ防止 */
  }
}
/* スマホ時：ヘッダー画像内のタイトルが切れるのを防ぐ */
@media (max-width: 768px) {

  /* ヘッダー画像の高さを可変に */
  header.entry-header.alignwide .post-thumbnail,
  header.entry-header.alignwide .post-thumbnail img {
    height: auto !important;
    min-height: 220px;          /* 文字が2～3行でも収まる最低高 */
    object-fit: cover;
  }

  /* タイトルの位置とサイズをスマホ用に最適化 */
  header.entry-header.alignwide .entry-title {
    position: absolute;        /* 画像上に載せたまま */
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%);
    width: 90% !important;
    padding: 0 5%;
    box-sizing: border-box;
    font-size: clamp(18px, 5vw, 26px) !important;
    line-height: 1.3 !important;
    text-align: center !important;
    white-space: normal !important;
    word-break: break-word;
  }
}
/* ===== スマホ時：ヘッダー画像のタイトルが切れる問題の最終修正 ===== */
@media (max-width: 768px) {

  /* ヘッダー全体：はみ出しを許可 */
  header.entry-header.alignwide {
    position: relative !important;
    overflow: visible !important;
  }

  /* アイキャッチ（画像）の高さ固定を解除 */
  header.entry-header.alignwide figure.post-thumbnail,
  header.entry-header.alignwide figure.post-thumbnail img {
    height: auto !important;
    min-height: 280px !important;   /* ← ここで高さを確保（必要なら300pxに） */
    max-height: none !important;
    width: 100% !important;
    object-fit: cover;
  }

  /* タイトルを中央に収める */
  header.entry-header.alignwide .entry-title {
    position: absolute !important;  /* 画像上に載せる */
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%);
    width: 92% !important;
    padding: 0 4% !important;
    box-sizing: border-box;
    font-size: clamp(18px, 5vw, 26px) !important;
    line-height: 1.3 !important;
    text-align: center !important;
    white-space: normal !important;
    word-break: break-word;
  }
}
@media (max-width: 768px) {

  header.entry-header.alignwide figure.post-thumbnail,
  header.entry-header.alignwide figure.post-thumbnail img {
    min-height: 240px !important;   /* 220〜260で微調整 */
    object-fit: cover;              /* デザイン重視 */
  }

}
/* スマホ：本文内の大きな画像を切らずに表示 */
@media (max-width: 768px) {

  .entry-content img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }

}
/* スマホ：ヘッダー画像上のタイトルが隠れるのを確実に防ぐ（タイトルを画像の外へ） */
@media (max-width: 768px) {

  header.entry-header.alignwide {
    overflow: visible !important;
  }

  /* タイトルを画像の上に重ねない */
  header.entry-header.alignwide .entry-title {
    position: static !important;
    transform: none !important;
    margin: 12px auto 8px !important;
    padding: 0 5% !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    white-space: normal !important;
    word-break: break-word !important;
    background: none !important;
    color: #111 !important;
  }

  /* 画像は普通に表示（切らない） */
  header.entry-header.alignwide figure.post-thumbnail,
  header.entry-header.alignwide figure.post-thumbnail img {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    object-fit: contain !important;
  }
}
/* スマホ：ヘッダー（アイキャッチ上）の記事タイトル色を白に戻す */
@media (max-width: 768px) {
  header.entry-header.alignwide .entry-title{
    color: #fff !important;
  }
}
/* スマホ：ページトップボタンが本文に被らないように位置を上げる */
@media (max-width: 768px) {
  #pagetop, .pagetop, .page-top, .to-top, .back-to-top {
    bottom: 90px !important; /* 60〜120で調整 */
    right: 16px !important;
  }
}
/* スマホ：アイキャッチ画像の inline height を無効化して、文章を隠さない */
@media (max-width: 768px) {

  header.entry-header.alignwide figure.post-thumbnail img {
    height: auto !important;      /* ← これが最重要 */
    aspect-ratio: auto !important;
    max-height: none !important;
    display: block;
  }

  header.entry-header.alignwide figure.post-thumbnail {
    margin-bottom: 24px !important; /* 画像と本文の間に余白 */
  }
}
/* スマホ：記事のアイキャッチ（post-thumbnail）を非表示 */
@media (max-width: 768px) {
  header.entry-header.alignwide figure.post-thumbnail {
    display: none !important;
  }
}
@media (max-width: 768px) {
  header.entry-header.alignwide {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}