/*
 Theme Name: Astra Child
 Template: astra
*/

/* =========================================
  Design Tokens
========================================= */
:root{
  --brand: #269DA8;
  --brand-dark: #1c7d86;
  --brand-10: #f0fafa;
  --accent-red: #E53935;
  --accent-red-dark: #c62828;
  --white: #fff;
  --black: #000;
  --gray-55: #555;
  --gray-88: #888;
}

/* =========================================
  Headings (H1–H3 color / H2–H4 spacing & underline)
========================================= */
/* H1〜H3共通カラー */
h1, h2, h3 { color: var(--brand) !important; }

/* H2以下：余白 */
h2, h3, h4 { margin-top: 3em; }

/* H2の下線 */
h2{
  border-bottom: 4px solid var(--brand) !important;
  padding-bottom: .3em;
  margin-bottom: 1em;
}

/* TOPのみ：H2 下線なし・中央 */
body.home h2{
  border-bottom: none !important;
  text-align: center;
}

/* =========================================
  Global: Primary Header (overlay)
========================================= */
.ast-primary-header-bar{
  background-color: transparent;
  position: absolute;
  inset: 0 auto auto 0; /* top:0; left:0 */
  width: 100%;
  z-index: 100;
}

/* =========================================
  Breadcrumb
========================================= */
.breadcrumb-wrap{
  text-align: right;
  margin-bottom: 1.5em;
  font-size: .9em;
}

/* =========================================
  Header Nav: Contact Button
========================================= */
.main-header-menu li.nav-contact-btn > a{
  background-color: var(--accent-red);
  color: var(--white) !important;
  padding: .5em 1em;
  border-radius: 4px;
  font-weight: 700;
  transition: background-color .3s ease;
  text-decoration: none;
}
.main-header-menu li.nav-contact-btn > a:hover{
  background-color: var(--accent-red-dark);
  text-decoration: none;
}

/* =========================================
  Shared First View (archive/blog/page)
========================================= */
body.page .entry-title,
body.blog .entry-title,
body.archive .entry-title{
  font-size: 2.4rem;
  font-weight: 700;
  text-align: left;
  position: relative;
  z-index: 1;
  padding: 260px 20px 180px;
  margin: -80px 0 60px;
  display: block;
  min-height: 500px;
  box-sizing: border-box;
  width: 100%;
}

/* ファーストビュー背景画像：共通 */
body.page:not(.home) .entry-title::before,
body.archive .entry-title::before,
body.blog .entry-title::before{
  content: "";
  position: absolute;
  top: 0;
  left: calc(-1 * ((100vw - 100%) / 2));
  width: 100vw;
  height: 500px;
  background: url('/wp-content/uploads/2025/08/sub_top-scaled.png') center top/cover no-repeat;
  z-index: -1;
}

/* =========================================
  Home: Hero
========================================= */
/* TOP：ページタイトルは非表示（DOMは残す） */
body.home .entry-title{ display: none !important; }

/* 背景＋比率固定（3402:1843） */
body.home .home-hero{
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  height: calc(100vw * 1843 / 3402);
  background: url('/wp-content/uploads/2025/08/main_top.png') center top/cover no-repeat;
  overflow: hidden;
  z-index: 0;
}

/* 中身中央配置 */
body.home .home-hero .home-hero__inner{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: min(92vw, 1240px);
  padding: 0 20px;
  box-sizing: border-box;
  z-index: 1;
}

/* ヒーローH1 */
body.home .home-hero h1{
  margin: 0 0 20px;
  line-height: 1.25;
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 700;
  color: var(--brand); /* 必要なら #fff に変更 */
}

/* ボタン行 */
body.home .home-hero .wp-block-buttons{ margin-top: 25%; }

/* ヒーロー専用ボタン（淡いオレンジ） */
body.home .home-hero .wp-block-button.is-style-marueito-hero-orange .wp-block-button__link{
  --arrow-color: var(--white);
  background-color: #ffa543;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-weight: 700;
  border-radius: 99px;
  transition: .3s all;
  padding: 25px 110px 25px 50px;
  line-height: 1;
  box-sizing: border-box;
}
body.home .home-hero .wp-block-button.is-style-marueito-hero-orange .wp-block-button__link::after{
  content: '';
  position: absolute;
  top: 45%;
  right: 30px;
  width: 50px;
  height: 7px;
  border-bottom: 2px solid var(--arrow-color);
  border-right: 2px solid var(--arrow-color);
  transform: translateY(-50%) skewX(45deg);
  transition: .3s all;
}
body.home .home-hero .wp-block-button.is-style-marueito-hero-orange .wp-block-button__link:hover{
  background-color: #F5B36B;
}
body.home .home-hero .wp-block-button.is-style-marueito-hero-orange .wp-block-button__link:hover::after{
  right: 15px;
}

/* ヒーローをコンテンツ幅制限から外す */
.ast-container .entry-content > .wp-block-group.home-hero{
  max-width: none !important;
  width: auto;
  padding-left: 0;
  padding-right: 0;
}
.ast-container .entry-content > .wp-block-group.alignfull.home-hero{
  max-width: none !important;
}

body.home .site-content > .ast-container{ padding-top: 0 !important; }
body.home .entry-content{ margin-top: -150px !important; }
body.home .entry-content > *:first-child{ margin-top: 0 !important; }
body.home .entry-content > .wp-block-group.home-hero{ margin-top: 0 !important; }

/* =========================================
  Buttons (Global)
========================================= */
/* 共通ベース */
.wp-block-button.is-style-marueito-arrow-primary .wp-block-button__link,
.wp-block-button.is-style-marueito-arrow-outline .wp-block-button__link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
  font-weight: 700;
  border-radius: 99px;
  transition: .3s all;
  padding: 20px 100px 20px 30px;
  line-height: 1;
  box-sizing: border-box;
}

/* 背景色・テキスト色 */
.wp-block-button.is-style-marueito-arrow-primary .wp-block-button__link{
  --arrow-color: var(--white);
  background-color: var(--brand);
  color: var(--white);
}
.wp-block-button.is-style-marueito-arrow-outline .wp-block-button__link{
  --arrow-color: var(--brand);
  background-color: var(--white);
  color: var(--brand);
  border: 2px solid var(--brand);
}

/* 矢印（共通） */
.wp-block-button.is-style-marueito-arrow-primary .wp-block-button__link::after,
.wp-block-button.is-style-marueito-arrow-outline .wp-block-button__link::after{
  content: '';
  position: absolute;
  top: 45%;
  right: 30px;
  width: 50px;
  height: 7px;
  border-bottom: 2px solid var(--arrow-color);
  border-right: 2px solid var(--arrow-color);
  transform: translateY(-50%) skewX(45deg);
  transition: .3s all;
}

/* ホバー */
.wp-block-button.is-style-marueito-arrow-primary .wp-block-button__link:hover{
  background-color: var(--brand-dark);
}
.wp-block-button.is-style-marueito-arrow-outline .wp-block-button__link:hover{
  background-color: var(--brand-10);
  color: var(--brand-dark);
  border-color: var(--brand-dark);
}
.wp-block-button.is-style-marueito-arrow-primary .wp-block-button__link:hover::after{
  border-color: var(--white);
  right: 15px;
}
.wp-block-button.is-style-marueito-arrow-outline .wp-block-button__link:hover::after{
  border-color: var(--brand-dark);
  right: 15px;
}

/* フッター用（白ボタン大きく） */
footer .wp-block-button.is-style-marueito-arrow-outline .wp-block-button__link{
  padding: 40px 150px 40px 50px;
}
footer .wp-block-button.is-style-marueito-arrow-outline .wp-block-button__link::after{
  right: 30px;
  width: 50px;
}

/* 2カラム横並びボタン */
.marueito-two-column-buttons{
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.marueito-two-column-buttons .wp-block-button{
  flex: 0 0 48%;
  display: flex;
  align-items: stretch;
}
/* aタグ本体 */
.marueito-two-column-buttons .wp-block-button__link{
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  height: 70px;
  padding: 0 60px 0 20px;
  box-sizing: border-box;
  border-radius: 99px;
  background-color: var(--brand);
  color: var(--white);
  font-weight: 700;
  line-height: 1;
  position: relative;
  text-decoration: none;
  transition: .3s all;
}
/* 矢印 */
.marueito-two-column-buttons .wp-block-button__link::after{
  content: '';
  position: absolute;
  top: 45%;
  right: 20px;
  width: 110px;
  height: 7px;
  border-bottom: 2px solid var(--white);
  border-right: 2px solid var(--white);
  transform: translateY(-50%) skewX(45deg);
  transition: .3s all;
}
.marueito-two-column-buttons .wp-block-button__link:hover{ background-color: var(--brand-dark); }
.marueito-two-column-buttons .wp-block-button__link:hover::after{ right: 15px; }

/* Gutenbergの自動マージンをリセット */
.marueito-two-column-buttons.is-layout-flow > *{ margin-block-start: 0 !important; }

/* =========================================
  Custom Table (20/80)
========================================= */
.wp-block-table.custom-table table.has-fixed-layout{
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2em;
}
.wp-block-table.custom-table table.has-fixed-layout td{
  border: 1px solid #ccc;
  padding: .75em 1em;
  vertical-align: top;
}
.wp-block-table.custom-table table.has-fixed-layout tr td:first-child{
  background-color: var(--brand) !important;
  color: var(--white) !important;
  width: 20% !important;
  font-weight: 700;
}
.wp-block-table.custom-table table.has-fixed-layout tr td:nth-child(2){
  background-color: var(--white) !important;
  color: var(--black) !important;
  width: 80% !important;
}

/* =========================================
  Service Blocks
========================================= */
/* team-maru 支援内容 */
.marueito-support-icons{
  display: grid;
  gap: 30px;
  text-align: center;
}
.marueito-support-icons .support-item{
  display: flex;
  flex-direction: column;
  align-items: center;
}
.marueito-support-icons img{
  width: 80px;
  height: auto;
  margin-bottom: 10px;
}
.marueito-support-icons p{
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--brand);
}

/* team-maru 業界例 */
.industry-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
  padding: 1em 0;
}
.industry-item{
  background-color: var(--brand);
  color: var(--white);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
}

.acf-service-thum{
  width: auto;
  height: 250px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}
.acf-field-service_description{
  max-width: 600px;
  margin: 0 30px;
  padding: 1em;
  line-height: 1.6;
  text-align: left;
}

.reason-card{
  background-color: var(--white);
  border: 2px solid var(--brand);
  border-radius: 12px;
  padding: 2.5em;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1em;
}
.reason-card .wp-block-image img{
  box-sizing: border-box;
  height: auto;
  max-width: 50%;
  vertical-align: bottom;
}
.reason-section{
  background-color: #f5f5f5;
  border-radius: 20px;
  margin-top: 4em;
  padding: 4em !important;
  box-sizing: border-box;
  width: 100%;
}

/* 女性のキャリア支援 */
.marueito-career-support{
  display: flex;
  flex-direction: column;
  gap: 2em;
  padding: 2em 1em;
  border-radius: 16px;
  margin-top: 2em;
}
.marueito-career-support .wp-block-columns{
  gap: 40px;
  align-items: flex-start;
}
.marueito-career-support .wp-block-column{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.4em;
}
.marueito-career-support h4{
  text-align: center;
  margin: 0 0 .5em;
  color: var(--brand);
}
.marueito-career-support img{
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
}
.marueito-career-support p.has-text-align-center{
  margin: 1em 2.8em .5em;
  font-size: 1.1em;
  font-weight: 700;
  color: #333;
}
.marueito-career-support .acf-field-service_description{
  max-width: 600px;
  margin: 1em auto 0;
  padding: 0 1em;
  line-height: 1.6;
  text-align: left;
}

/* 円形背景セクション */
.circle-bg-section{
  background: url('/wp-content/uploads/2025/08/company-service-scaled.png') center center/cover no-repeat;
  padding: 4em 2em;
  color: var(--white);
}
.circle-text-columns{
  display: flex;
  gap: 4em;
  justify-content: center;
}
.circle-text-columns .wp-block-column p{
  text-align: center;
  max-width: 24em;
  margin: 0 auto;
  line-height: 1.8;
}

/* =========================================
  Contact (CF7)
========================================= */
table.CF7_table{
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  border: none;
  border-collapse: collapse;
  font-size: 1rem;
}
.CF7_table th,
.CF7_table td{
  padding: 1em 0;
  border: none;
  text-align: left;
  vertical-align: top;
}
.CF7_req{
  font-size: .75em;
  padding: 3px 6px;
  background: var(--brand);
  color: var(--white);
  border-radius: 3px;
  margin-left: .5em;
}
.CF7_table input,
.CF7_table textarea{
  width: 100%;
  padding: .8em;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
}
.CF7_table textarea{ min-height: 120px; }
.CF7_table ::placeholder{ color: var(--gray-88); }

.CF7_btn{ text-align: center; margin-top: 2em; }
.wpcf7 input.wpcf7-submit{
  background-color: var(--brand);
  color: var(--white);
  font-size: 1.1em;
  padding: .8em 2em;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  transition: background-color .3s ease;
}
.wpcf7 input.wpcf7-submit:hover{ background-color: var(--brand-dark); }
.wpcf7-spinner{ display: none; }

/* =========================================
  News Archive (一覧)
========================================= */
.news-archive__inner{
  margin: 0 auto;
  padding: 3em 1em;
}
.news-archive__list{ list-style: none; margin: 0; padding: 0; }
.news-archive__item{
  padding: 1.5em 0;
  margin: 0;
  transition: box-shadow .3s;
  border-radius: 0;
}
.news-archive__item:hover{
  box-shadow: 0 6px 20px rgba(0,0,0,.03);
}
.news-archive__item:not(:last-child)::after{
  content: "";
  display: block;
  margin-top: 1.5em;
  border-bottom: 2px solid var(--brand);
}
.news-archive__link{
  text-decoration: none !important;
  color: inherit;
  display: block;
}
.news-archive__meta{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5em;
}
.news-archive__date{
  color: var(--gray-55);
  font-size: .95em;
  white-space: nowrap;
}
.news-archive__category{
  text-decoration: none !important;
  display: inline-block;
  padding: .2em .8em;
  font-size: .9em;
  color: var(--brand);
  border: 1px solid var(--brand);
  background-color: var(--white);
  border-radius: 99px;
  white-space: nowrap;
}
.news-archive__title{
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--brand);
  border: none;
  line-height: 1.4;
}

/* =========================================
  Policy lists
========================================= */
.main-list{
  list-style: decimal;
  padding-left: 2em;
}
.main-list > li{
  margin-bottom: 1em;
  text-indent: 0;
}
.main-list > li + li{ margin-top: 2em; }
.main-list > li > .sub-list{ margin-top: 1.5em; }

/* サブリスト (1)(2)... */
.sub-list{
  list-style: none !important;
  counter-reset: sub-counter;
  padding-left: 2.5em;
}
.sub-list li{
  counter-increment: sub-counter;
  position: relative;
  padding-left: 2.5em;
  text-indent: 0;
  margin-bottom: .3em;
}
.sub-list li::before{
  content: "(" counter(sub-counter) ")";
  position: absolute;
  inset: 0 auto auto 0; /* left:0; top:0 */
}
.policy-date{
  margin-top: 4em;
  font-size: .9em;
  text-align: right;
}

/* =========================================
  Single Post (個別記事)
========================================= */
/* ヘッダー直下余白除去 */
.single-post .site-content > .ast-container{ padding-top: 0 !important; }
.single-post .entry-content{ margin-top: 0 !important; }

/* ヒーロー（タイトル帯） */
body.single-post .entry-title{
  font-size: 2.4rem;
  font-weight: 700;
  text-align: left;
  position: relative;
  z-index: 1;
  margin-top: -80px; /* グロナビ背面まで背景を回す */
  padding: 260px 20px 180px;
  margin-bottom: 60px;
  min-height: 500px;
  box-sizing: border-box;
  width: 100%;
  overflow: visible; /* クリップしない */
}
body.single-post .entry-title::before{
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%); /* 中央基準 */
  width: 100vw;
  height: 500px;
  background: url('/wp-content/uploads/2025/08/sub_top-scaled.png') center top/cover no-repeat;
  z-index: -1;
  pointer-events: none;
}

/* 2カラム */
.news-single__inner{
  max-width: 1240px;
  margin: 0 auto;
  padding: 2em 20px;
}
.news-single__main{ display: flex; gap: 3em; }
.news-single__left{ width: 30%; font-size: .95em; }
.news-single__right{ width: 70%; }

/* カテゴリ：一覧と同バッジ */
.post-category{ margin-bottom: .5em; }
.post-category a{
  display: inline-block;
  padding: .2em .8em;
  font-size: .9em;
  color: var(--brand);
  border: 1px solid var(--brand);
  background-color: var(--white);
  border-radius: 99px;
  text-decoration: none;
  white-space: nowrap;
}
.post-category a + a{ margin-left: .5em; }

.post-date{ margin-bottom: 1.5em; font-size: .9em; color: var(--gray-55); }
.post-thumbnail{ margin-bottom: 1.5em; }

/* 目次 */
.toc-title{ font-weight: 700; }
#toc_container{ font-size: .9em; line-height: 1.6; }
#toc_container ul{ list-style: decimal; padding-left: 1.5em; }
#toc_container ul ul{ list-style: disc; margin-left: 1.2em; }

/* TOCリンク：青色＆下線なし */
#toc_container a,
#toc_container a:visited,
#toc_container a:hover,
#toc_container a:focus{
  color: var(--brand) !important;
  text-decoration: none !important;
}

/* =========================================
  Media Queries (consolidated)
  - Mobile (<=768px)
  - Tablet (>=769px)
  - Desktop Wide (>=922px)
========================================= */

/* ===== Mobile ===== */
@media (max-width: 768px){
  /* Home Hero: 中央位置微調整 & タイトルサイズ */
  body.home .home-hero .home-hero__inner{
    top: 58%;
    transform: translate(-50%,-58%);
  }
  body.home .home-hero h1{
    font-size: clamp(22px, 6vw, 40px);
  }

  /* CF7 テーブル：縦積み */
  .CF7_table tr,
  .CF7_table th,
  .CF7_table td{
    display: block;
    width: 100%;
  }
  .CF7_table td{ margin-bottom: 1em; }
}

/* ===== Tablet ===== */
@media (min-width: 769px){
  /* CF7 テーブル：横2カラム比率 */
  .CF7_table th{ width: 30%; }
  .CF7_table td{ width: 70%; }
}

/* ===== Desktop Wide ===== */
@media (min-width: 922px){
  /* Single Post: 本文コンテナ幅を統一 */
  .single-post .site-content > .ast-container{
    max-width: 1240px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

/* teammaruサービスの支援内容一覧 */
/* 781px ～ 600px：4列 */
@media (max-width: 781px) and (min-width: 600px){
  .marueito-support-icons .wp-block-columns.is-layout-flex{
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
  }
  .marueito-support-icons .wp-block-column{ margin: 0; }
}

/* 599px ～ 450px：3列 */
@media (max-width: 599px) and (min-width: 450px){
  .marueito-support-icons .wp-block-columns.is-layout-flex{
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
  .marueito-support-icons .wp-block-column{ margin: 0; }
}

/* 449px 以下：2列 */
@media (max-width: 449px){
  .marueito-support-icons .wp-block-columns.is-layout-flex{
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .marueito-support-icons .wp-block-column{ margin: 0; }
}

/* marueitoについての部分 */
/* 781px以下：画像カラムを横幅いっぱい＆中央寄せ */
@media (max-width: 781px){
  .wp-block-columns.is-layout-flex.wp-container-core-columns-is-layout-28f84493 
  > .wp-block-column:first-child {
    flex: 0 0 100% !important;   /* 幅100%に拡張 */
    max-width: 100% !important;
    text-align: center;          /* 中央寄せ */
  }

  .wp-block-columns.is-layout-flex.wp-container-core-columns-is-layout-28f84493 
  > .wp-block-column:first-child img {
    width: 100% !important;      /* 画像を横幅いっぱい */
    height: auto !important;
  }
}

/* ================================
   Footer CTA（お問い合わせ）
   全デバイスで上paddingを80pxに統一
   bottomはデフォルトの80pxをそのまま利用
==================================*/

/* 599px 以下 */
@media (max-width: 599px){
  .site-footer-above-section-1{
    padding-top: 80px !important;   /* 上だけ追加 */
    padding-left: 16px;
    padding-right: 16px;
    /* bottomはAstraデフォルト80pxを維持 */
  }

  .site-footer-above-section-1 .ast-builder-html-element h2{
    margin-top: 0;
    margin-bottom: .6em;
    text-align: center;
  }
  .site-footer-above-section-1 .ast-builder-html-element p{
    margin: 0 auto 1.2em;
    line-height: 1.8;
    text-align: center;
    max-width: 32em;
  }

  .site-footer-above-section-1 .wp-block-buttons{
    justify-content: center;
  }
  .site-footer-above-section-1
  .wp-block-button.is-style-marueito-arrow-outline .wp-block-button__link{
    padding: 16px 72px 16px 22px;
    font-size: 16px;
    width: min(100%, 420px);
    margin: 0 auto;
    border-radius: 99px;
  }
  .site-footer-above-section-1
  .wp-block-button.is-style-marueito-arrow-outline .wp-block-button__link::after{
    width: 60px;
    right: 22px;
  }
}

/* さらに小さい端末（〜360px） */
@media (max-width: 360px){
  .site-footer-above-section-1{
    padding-top: 80px !important;
    padding-left: 12px;
    padding-right: 12px;
  }
  .site-footer-above-section-1
  .wp-block-button.is-style-marueito-arrow-outline .wp-block-button__link{
    padding: 14px 56px 14px 18px;
    font-size: 15px;
    width: 100%;
  }
  .site-footer-above-section-1
  .wp-block-button.is-style-marueito-arrow-outline .wp-block-button__link::after{
    width: 44px;
    right: 18px;
  }
}

/* 600–781px：タブレット寄り */
@media (min-width: 600px) and (max-width: 781px){
  .site-footer-above-section-1{
    padding-top: 80px !important;
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ================================
   フッター横端の余白（1230px以下で内側にパディング）
==================================*/
@media (max-width: 1230px){
  .site-primary-footer-wrap .ast-builder-grid-row-container-inner,
  .site-primary-footer-wrap .site-primary-footer-inner-wrap {
    padding-inline: 20px; /* 左右に適度な余白 */
  }
}

/* ================================
   フッターロゴが大きくならないようにする==================================*/

/* ▼ 本文領域の1カラム時は全幅化する */
@media (max-width: 781px){
  .site-content 
  .wp-block-columns.is-layout-flex.wp-container-core-columns-is-layout-28f84493 
  > .wp-block-column:first-child {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    text-align: center;
  }
  .site-content 
  .wp-block-columns.is-layout-flex.wp-container-core-columns-is-layout-28f84493 
  > .wp-block-column:first-child img{
    width: 100% !important;
    height: auto !important;
  }
}

/* ▼ フッター内のロゴ画像は元サイズのまま（例：85px上限） */
@media (max-width: 781px){
  .site-primary-footer-wrap img{
    width: auto !important;
    max-width: 85px !important;
    height: auto !important;
  }
}

/* ================================
   サービス紹介　選ばれる理由
==================================*/
/* 「marueitoが選ばれる理由」：600〜781pxは6枚を通しで2列に並べる */
@media (max-width: 781px) and (min-width: 600px){
  /* 親ラッパーをグリッド化：全カードをここで2列レイアウト */
  .reason-section .reason-icons-wrapper{
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 24px;
    row-gap: 24px;
  }
  /* 中間の .wp-block-columns を“透過”して子カードを親グリッドに参加させる */
  .reason-section .reason-icons-wrapper > .wp-block-columns{
    display: contents !important;
  }
  /* 各カードの余白・幅をリセット（WPのモバイル1列指定を無効化） */
  .reason-section .reason-card{
    margin: 0 !important;
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
  }
}

/* ================================
   サービス紹介　ボタンリンク
==================================*/
/* 599px 以下：縦並び＋ボタンを横幅いっぱいに */
@media (max-width: 599px){
  .marueito-two-column-buttons{
    display: flex;
    flex-direction: column;     /* 縦並び */
    gap: 16px;                  /* ボタン間の間隔はお好みで */
    justify-content: center;    /* 親の中で中央寄せ */
  }
  .marueito-two-column-buttons .wp-block-button{
    flex: 0 0 100% !important;  /* 幅100%の1列 */
    width: 100% !important;
    margin: 0;                  /* 余白リセット */
  }
  .marueito-two-column-buttons .wp-block-button__link{
    width: 100% !important;     /* a要素も親いっぱいに */
    max-width: none !important;
  }
}

/* ================================
   会社概要
==================================*/
/* ================================
   Value（バリュー）
   781px以下：画像の直下に対応テキストを来させる（×3セット）
   HTMLはそのままでOK
==================================*/
@media (max-width: 781px){
  /* セクション特定：見出し h2（idがURLエンコードの“バリュー”）を持つ .wp-block-group */
  .wp-block-group:has(> h2#\%e3\%83\%90\%e3\%83\%aa\%e3\%83\%a5\%e3\%83\%bc) > .wp-block-group{
    display: flex !important;
    flex-direction: column !important;
    gap: 24px;
  }

  /* 中間の .wp-block-columns を“透過”して孫 .wp-block-column を直下に集約 */
  .wp-block-group:has(> h2#\%e3\%83\%90\%e3\%83\%aa\%e3\%83\%a5\%e3\%83\%bc)
  > .wp-block-group > .wp-block-columns{
    display: contents !important;
  }

  /* 並び替え：画像(1,2,3)→ order:1,3,5 / テキスト(1,2,3)→ order:2,4,6 */
  .wp-block-group:has(> h2#\%e3\%83\%90\%e3\%83\%aa\%e3\%83\%a5\%e3\%83\%bc)
  > .wp-block-group > .wp-block-columns:first-of-type .wp-block-column:nth-child(1){ order:1; }
  .wp-block-group:has(> h2#\%e3\%83\%90\%e3\%83\%aa\%e3\%83\%a5\%e3\%83\%bc)
  > .wp-block-group > .wp-block-columns:first-of-type .wp-block-column:nth-child(2){ order:3; }
  .wp-block-group:has(> h2#\%e3\%83\%90\%e3\%83\%aa\%e3\%83\%a5\%e3\%83\%bc)
  > .wp-block-group > .wp-block-columns:first-of-type .wp-block-column:nth-child(3){ order:5; }

  .wp-block-group:has(> h2#\%e3\%83\%90\%e3\%83\%aa\%e3\%83\%a5\%e3\%83\%bc)
  > .wp-block-group > .wp-block-columns:last-of-type  .wp-block-column:nth-child(1){ order:2; }
  .wp-block-group:has(> h2#\%e3\%83\%90\%e3\%83\%aa\%e3\%83\%a5\%e3\%83\%bc)
  > .wp-block-group > .wp-block-columns:last-of-type  .wp-block-column:nth-child(2){ order:4; }
  .wp-block-group:has(> h2#\%e3\%83\%90\%e3\%83\%aa\%e3\%83\%a5\%e3\%83\%bc)
  > .wp-block-group > .wp-block-columns:last-of-type  .wp-block-column:nth-child(3){ order:6; }

  /* 見た目の微調整（任意） */
  .wp-block-group:has(> h2#\%e3\%83\%90\%e3\%83\%aa\%e3\%83\%a5\%e3\%83\%bc)
  .wp-block-image{ margin-bottom: .8em; }
}

/* ================================
   Home: ヒーロー直下余白
==================================*/
/* 600px〜1199px：ヒーロー直下の余白を小さくして被りを防ぐ */
@media (max-width: 1199px) and (min-width: 600px){
  body.home .entry-content{
    margin-top: -25px !important;
  }
}

/* 600px〜781px：ヒーローの見出しとボタンを縮小 */
@media (max-width: 781px) and (min-width: 600px){
  /* 見出しをやや小さく */
  body.home .home-hero h1{
    font-size: clamp(20px, 4vw, 34px);
    line-height: 1.25;
  }

  /* ボタンを少し小さく */
  body.home .home-hero .wp-block-button.is-style-marueito-hero-orange .wp-block-button__link{
    padding: 16px 80px 16px 32px; /* 上右下左 */
    font-size: 0.95rem;
  }
  body.home .home-hero .wp-block-button.is-style-marueito-hero-orange .wp-block-button__link::after{
    width: 44px;
    height: 6px;
    right: 24px;
  }

  /* ボタン行の位置も少しだけ上げる（任意） */
  body.home .home-hero .wp-block-buttons{
    margin-top: 16%;
  }
}

/* 〜599px：ヒーローのテキスト＆ボタンを中央寄せ */
@media (max-width: 599px){
  /* テキスト中央 */
  body.home .home-hero .home-hero__inner{
    text-align: center;
  }
  body.home .home-hero h1{
    text-align: inherit;
    font-size: 1.4em;
  }

  /* ボタン中央 */
  body.home .home-hero .wp-block-buttons{
    justify-content: center; /* Flexで中央寄せ */
  }
  body.home .home-hero .wp-block-button{
    margin-left: auto;  /* 念のため中央に固定 */
    margin-right: auto;
  }
}

/* 599px 以下：ヒーローを全画面表示＋SP画像に差し替え */
@media (max-width: 599px){
  /* TOPページ ヒーロー */
  body.home .home-hero{
    /* 画像差し替え */
    background-image: url('/wp-content/themes/astra-child/images/sp_topimg.png') !important;
    background-position: center top !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;

    /* 全画面化（ノッチ端末も考慮） */
    height: 100svh;           /* iOS/AndroidのUI除外の安全なvh */
    min-height: 560px;        /* 超小画面の保険（任意） */

    /* 余白や幅をフルブリードに固定 */
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    overflow: hidden;
  }

  /* ヒーロー内のテキスト位置調整（中央寄せは既存通り） */
  body.home .home-hero .home-hero__inner{
    top: 55%;
    transform: translate(-50%, -55%);
    width: min(92vw, 560px);
    padding-inline: 16px;
    text-align: center;
  }
}

/* 599px 以下：下層・ブログの帯画像もSP版に差し替え（必要なら） */
@media (max-width: 599px){
  body.page:not(.home) .entry-title::before,
  body.archive .entry-title::before,
  body.blog .entry-title::before{
    background-image: url('/wp-content/themes/astra-child/images/sp_subimg.png') !important;
    background-position: center top !important;
    background-size: cover !important;
  }
}
