/*
 * Takatsuki AI Home Stack 1.1.0
 * トップページ専用:
 * - 6つのコーナーを縦に隙間なく接続
 * - WordPress本文幅を越えて、画面の左右端までフル幅表示
 * - 外側の白帯をなくし、ベージュ背景で統一
 * - 各コーナー内部の画像は中央・親幅内に収める
 */

.tas-home-stack,
.tas-home-stack * {
  box-sizing: border-box;
}

/*
 * フルブリードは「統合枠」1か所だけで行う。
 * 子プラグイン側で100vwを重ねないことで、横ずれを防ぐ。
 */
.tas-home-stack {
  position: relative;
  left: 50%;
  width: 100vw;
  max-width: 100vw;
  margin: 0 0 0 -50vw !important;
  padding: 0 !important;
  border: 0 !important;
  background: #e9e0d2 !important;
  overflow-x: clip;
}

.tas-home-stack-section {
  display: block;
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0 !important;
  margin-block: 0 !important;
  padding: 0 !important;
  padding-block: 0 !important;
  border: 0 !important;
  background: #e9e0d2;
}

/* セクション間の縦方向の隙間を完全に消す */
.tas-home-stack > .tas-home-stack-section + .tas-home-stack-section {
  margin-top: 0 !important;
  margin-block-start: 0 !important;
}

.tas-home-stack-section > :first-child,
.tas-home-stack-section > :last-child {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}

/*
 * 各ショートコードの最外層は、すでにフル幅の親に合わせる。
 * ここでは100vw / calc(50% - 50vw) / translateX を打ち消す。
 */
.tas-home-stack-section > :first-child {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  transform: none !important;
}

/* 既知の各コーナールート */
.tas-home-stack .tas-policy-top-imageonly,
.tas-home-stack .tas-policy-banner-link,
.tas-home-stack .tai-research-wrap,
.tas-home-stack .tai-wrap,
.tas-home-stack .juei-weekly-featured,
.tas-home-stack .juei-public-hero,
.tas-home-stack .tas-research-feature {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  transform: none !important;
}

/* 画像は中央。幅不足なら100%まで拡大し、はみ出しは禁止 */
.tas-home-stack img {
  display: block;
  max-width: 100% !important;
  height: auto !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* トップ用の大判ビジュアルは親幅いっぱい */
.tas-home-stack .tas-policy-top-imageonly img,
.tas-home-stack .tas-policy-banner-link img,
.tas-home-stack .juei-weekly-featured img,
.tas-home-stack .juei-public-hero img {
  width: 100% !important;
  max-width: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

/* 画像のインライン行間が白帯になるのを防止 */
.tas-home-stack .tas-policy-top-imageonly,
.tas-home-stack .tas-policy-banner-link,
.tas-home-stack .juei-public-hero {
  line-height: 0 !important;
  font-size: 0 !important;
}

/* 空要素が挟まっても縦の白帯を作らない */
.tas-home-stack-section > p:empty,
.tas-home-stack-section > br:first-child,
.tas-home-stack-section > br:last-child {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Gutenbergショートコードブロック自体の上下余白も無効化 */
.wp-block-shortcode:has(.tas-home-stack) {
  margin: 0 !important;
  padding: 0 !important;
}

/* ページの外側に見える部分はベージュで統一 */
body.home,
body.home #page,
body.home .site,
body.home .site-content {
  background-color: #e9e0d2;
}

@media (max-width: 782px) {
  .tas-home-stack {
    left: 50%;
    width: 100vw;
    max-width: 100vw;
    margin-left: -50vw !important;
    margin-right: 0 !important;
  }

  .tas-home-stack-section,
  .tas-home-stack-section > :first-child {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    transform: none !important;
  }
}


/* ===== v1.1.1 research feature centering repair =====
 * The policy plugin contains several historical full-bleed/grid rules for
 * .tas-research-feature.  Inside the unified home stack we normalize only
 * this feature so it stays centered on desktop and becomes one clean column
 * on phones without clipping either side.
 */
.tas-home-stack-takatsuki-ai-research-feature-v2{
  overflow:hidden !important;
  background:#e9e0d2 !important;
}

.tas-home-stack-takatsuki-ai-research-feature-v2 .tas-research-feature,
.tas-home-stack-takatsuki-ai-research-feature-v2 .tas-research-feature-fullbleed{
  position:relative !important;
  left:auto !important;
  right:auto !important;
  transform:none !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  margin:0 !important;
  padding:0 !important;
  overflow:hidden !important;
}

.tas-home-stack-takatsuki-ai-research-feature-v2 .tas-feature-inner{
  width:min(1240px, calc(100% - 48px)) !important;
  max-width:1240px !important;
  min-width:0 !important;
  margin:22px auto 24px !important;
  padding:34px !important;
  display:grid !important;
  grid-template-columns:minmax(0, .9fr) minmax(0, 1.1fr) !important;
  gap:34px !important;
  align-items:center !important;
  justify-content:center !important;
  box-sizing:border-box !important;
}

.tas-home-stack-takatsuki-ai-research-feature-v2 .tas-feature-copy,
.tas-home-stack-takatsuki-ai-research-feature-v2 .tas-feature-image{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  margin-left:auto !important;
  margin-right:auto !important;
  box-sizing:border-box !important;
}

.tas-home-stack-takatsuki-ai-research-feature-v2 .tas-feature-image{
  overflow:hidden !important;
}

.tas-home-stack-takatsuki-ai-research-feature-v2 .tas-feature-image img{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  height:auto !important;
  margin:0 auto !important;
  object-fit:contain !important;
  object-position:center center !important;
}

@media (max-width: 760px){
  .tas-home-stack-takatsuki-ai-research-feature-v2 .tas-research-feature,
  .tas-home-stack-takatsuki-ai-research-feature-v2 .tas-research-feature-fullbleed{
    width:100% !important;
    max-width:100% !important;
    margin:0 !important;
    padding:0 !important;
  }

  .tas-home-stack-takatsuki-ai-research-feature-v2 .tas-feature-inner{
    width:100% !important;
    max-width:100% !important;
    margin:0 auto !important;
    padding:16px 14px 0 !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:16px !important;
    border-radius:0 !important;
    overflow:hidden !important;
  }

  .tas-home-stack-takatsuki-ai-research-feature-v2 .tas-feature-copy,
  .tas-home-stack-takatsuki-ai-research-feature-v2 .tas-feature-image{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 auto !important;
    padding-left:0 !important;
    padding-right:0 !important;
    transform:none !important;
  }

  .tas-home-stack-takatsuki-ai-research-feature-v2 .tas-feature-copy h2,
  .tas-home-stack-takatsuki-ai-research-feature-v2 .tas-feature-question{
    max-width:100% !important;
    overflow-wrap:anywhere !important;
  }

  .tas-home-stack-takatsuki-ai-research-feature-v2 .tas-feature-image img{
    width:100% !important;
    max-width:100% !important;
    height:auto !important;
    max-height:none !important;
    object-fit:contain !important;
    object-position:center center !important;
  }
}

/* ===== v1.2.0 ANIME IMAGE PRODUCTION teaser ===== */
.tas-home-stack-anime-image-production,
.tas-home-stack-anime-image-production .tas-anime-teaser,
.tas-home-stack-anime-image-production .tas-anime-teaser-link {
  display:block;
  width:100%;
  max-width:100%;
  margin:0 !important;
  padding:0 !important;
  background:#0e1018;
  line-height:0;
  font-size:0;
  overflow:hidden;
}

.tas-home-stack-anime-image-production .tas-anime-teaser-image {
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  height:auto !important;
  margin:0 auto !important;
  object-fit:contain !important;
  object-position:center center !important;
}

@media (max-width: 760px){
  .tas-home-stack-anime-image-production,
  .tas-home-stack-anime-image-production .tas-anime-teaser,
  .tas-home-stack-anime-image-production .tas-anime-teaser-link,
  .tas-home-stack-anime-image-production .tas-anime-teaser-image{
    width:100% !important;
    max-width:100% !important;
  }
}

/* v1.2.2: teaser click target hardening */
.tas-home-stack-anime-image-production{
  position:relative !important;
  isolation:isolate;
}
.tas-home-stack-anime-image-production .tas-anime-teaser-link{
  position:relative !important;
  z-index:20 !important;
  pointer-events:auto !important;
  cursor:pointer !important;
  display:block !important;
  width:100% !important;
}
.tas-home-stack-anime-image-production .tas-anime-teaser-image{
  pointer-events:none !important;
}


/* v1.2.5: スマホでティザー画像の金縁が画面端に埋もれないようにする */
@media (max-width: 760px){
  .tas-home-stack-anime-image-production{
    background:#0e1018 !important;
    padding:6px !important;
    overflow:visible !important;
  }

  .tas-home-stack-anime-image-production .tas-anime-teaser,
  .tas-home-stack-anime-image-production .tas-anime-teaser-link{
    width:100% !important;
    max-width:100% !important;
    padding:0 !important;
    margin:0 auto !important;
    overflow:visible !important;
    background:#0e1018 !important;
  }

  .tas-home-stack-anime-image-production .tas-anime-teaser-image{
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    height:auto !important;
    margin:0 auto !important;
    object-fit:contain !important;
    object-position:center center !important;
  }
}
