/*
Theme Name: AFFINGER7 Child
Template: affinger
Description: AFFINGER7 対応・くらしもり用のレスポンシブ調整
Version: 20260410
*/

/*
 * くらしもり / Responsive Care v1
 * AFFINGER7本体のレイアウト・メニュー・目次・広告処理は変更しない。
 * 既存のテーマ設定を活用しつつ、本文内の可読性・幅・操作性を補完。
 */
#contentInner .entry-content {
  overflow-wrap: break-word;
}
#contentInner .entry-content :where(img, video, iframe, embed, object) {
  max-width: 100%;
}
#contentInner .entry-content :where(h1, h2, h3, h4) {
  overflow-wrap: anywhere;
}
#contentInner .entry-content a:focus-visible {
  outline: 3px solid #28664f;
  outline-offset: 3px;
  border-radius: 3px;
}
#contentInner .entry-content :where(.wp-block-table, .table-scroll, .km-table-scroll) {
  max-width: 100%;
}
#contentInner .entry-content :where(table) {
  max-width: 100%;
}
#contentInner .entry-content :where(pre, .wp-block-code) {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* TOP: レイアウトはテーマを基準に余白だけ最適化 */
body.home.page-id-123 #contentInner,
body.home.page-id-123 #contentInner main {
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  min-width: 0;
}
body.home.page-id-123 #side {
  display: none !important;
}
body.home.page-id-123 .km-home {
  width: 100%;
  min-width: 0;
  max-width: 1060px;
}
body.home.page-id-123 .km-home .km-tiles > a,
body.home.page-id-123 .km-home .km-steps > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media screen and (max-width: 959px) {
  #contentInner .entry-content :where(.wp-block-columns, .wp-block-column) {
    min-width: 0;
  }
  #st-mobile-logo img,
  #st-mobile-logo picture,
  #st-mobile-logo svg {
    max-width: min(54vw, 220px);
    height: auto;
  }
  body.home.page-id-123 #contentInner,
  body.home.page-id-123 #contentInner main {
    width: 100% !important;
    min-width: 0;
  }
}
@media screen and (max-width: 719px) {
  body.home.page-id-123 .km-tiles,
  body.home.page-id-123 .km-steps {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
/* AFFINGER7のスマホブレークポイント：599px以下 */
@media screen and (max-width: 599px) {
  #contentInner .entry-content :where(p, li) {
    line-height: 1.9;
    overflow-wrap: anywhere;
  }
  #contentInner .entry-content :where(.wp-block-table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #contentInner .entry-content > table,
  #contentInner .entry-content .wp-block-table > table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #contentInner .entry-content table :where(th, td) {
    padding: 11px 9px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #contentInner .entry-content :where(.wp-block-button__link) {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  body.home.page-id-123 .km-home {
    font-size: 16px;
  }
  body.home.page-id-123 .km-hero-links a {
    min-height: 48px;
  }
}
@media screen and (max-width: 359px) {
  #st-mobile-logo img {
    max-width: 48vw;
  }
  body.home.page-id-123 .km-home .km-hero {
    padding: 20px 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.home.page-id-123 .km-tiles a {
    transition: none !important;
    transform: none !important;
  }
}
