/*
Theme Name: Baby Signs BS5
Theme URI: https://www.babysigns.jp
Description: 一般社団法人日本ベビーサイン協会 一般公開サイト（Bootstrap 5リニューアル版）
Author: Baby Signs
Version: 1.0.0
Text Domain: babysigns-bs5
Requires at least: 6.3
Tested up to: 6.7
Requires PHP: 7.4
*/

/* ========================================================
   Bootstrap 5はfunctions.phpでCDN/NPMから読み込む
   このファイルはテーマ固有のカスタムスタイルのみ
   ======================================================== */

/* ---------- CSS カスタムプロパティ ---------- */
:root {
  --bs-primary:        #F77A00;       /* ベビーサインオレンジ */
  --bs-primary-rgb:    247, 122, 0;
  --bs-primary-dark:   #D96800;       /* ホバー時の濃いオレンジ */
  --bs-primary-light:  #FFE0B2;       /* 薄いオレンジ（背景用） */
  --bs-secondary:      #FFA940;       /* セカンダリオレンジ */
  --bs-secondary-rgb:  255, 169, 64;
  --bs-accent:         #FFD166;       /* ゴールドアクセント */
  --bs-online-badge:   #0070CF;       /* オンライン教室バッジ（ブルー） */
  --bs-text:           #4a4a4a;
  --bs-light-bg:       #FFFAF5;       /* ウォームホワイト */
  --bs-section-bg:     #FFF5EA;       /* セクション背景（薄オレンジ） */
  --font-main: 'Noto Sans JP', 'Hiragino Kaku Gothic Pro', Meiryo, sans-serif;
}

/* ---------- ベース ---------- */
body {
  font-family: var(--font-main);
  color: var(--bs-text);
  background-color: #fff;
  font-size: 1rem;
  line-height: 1.8;
}

img { max-width: 100%; height: auto; }

a { color: var(--bs-primary-dark); text-decoration: none; }
a:hover { color: var(--bs-primary-dark); text-decoration: underline; }

/* ---------- Bootstrap btn-primary / badge オーバーライド ---------- */
.btn-primary {
  --bs-btn-bg:              var(--bs-primary);
  --bs-btn-border-color:    var(--bs-primary);
  --bs-btn-hover-bg:        var(--bs-primary-dark);
  --bs-btn-hover-border-color: var(--bs-primary-dark);
  --bs-btn-active-bg:       var(--bs-primary-dark);
  --bs-btn-color:           #fff;
  --bs-btn-hover-color:     #fff;
}

.btn-outline-primary {
  --bs-btn-color:           var(--bs-primary);
  --bs-btn-border-color:    var(--bs-primary);
  --bs-btn-hover-bg:        var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary-dark);
  --bs-btn-active-bg:       var(--bs-primary-dark);
  --bs-btn-hover-color:     #fff;
}

.bg-primary  { background-color: var(--bs-primary)  !important; }
.text-primary { color: var(--bs-primary)             !important; }
.border-primary { border-color: var(--bs-primary)    !important; }

/* ---------- グローバルナビ ---------- */
#site-header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar-brand img { height: 48px; }

.navbar-nav .nav-link {
  font-size: .9rem;
  font-weight: 500;
  color: var(--bs-text) !important;
  padding: .5rem .9rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--bs-primary-dark) !important;
}

.header-cta .btn {
  font-size: .85rem;
  border-radius: 50px;
}

/* ドロップダウンメニュー */
.dropdown-menu {
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  border-radius: .75rem;
}

.dropdown-item { font-size: .875rem; }
.dropdown-item:hover { color: var(--bs-primary); }

/* ---------- ヒーローセクション ---------- */
.hero-section {
  background: linear-gradient(135deg, #FFF5EA 0%, #FFF9F0 100%);
  padding: 5rem 0 4rem;
  overflow: hidden;
}

.hero-section .hero-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.4;
  color: #3a3a3a;
}

.hero-section .hero-subtitle {
  font-size: 1.1rem;
  color: #666;
}

.hero-carousel .carousel-item img {
  border-radius: 1.5rem;
  object-fit: cover;
  max-height: 480px;
}

/* ---------- セクション共通 ---------- */
.section-heading {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 700;
  position: relative;
  padding-bottom: 1rem;
  margin-bottom: 2.5rem;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 4px;
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-accent));
  border-radius: 2px;
}

.section-bg { background-color: var(--bs-section-bg); }

/* ---------- コースカード ---------- */
.course-card {
  border: none;
  border-radius: 1.25rem;
  transition: transform .25s, box-shadow .25s;
  overflow: hidden;
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}

.course-card .card-header {
  font-weight: 700;
  font-size: 1rem;
  border-radius: 1.25rem 1.25rem 0 0 !important;
  border-bottom: none;
  padding: 1rem 1.25rem .75rem;
}

/* 月齢別カラー：Pre=ウォームレッド / Main=オレンジ（ブランド） / Iya=グリーン */
.course-card.pre    .card-header { background-color: #FFECE8; color: #C62828; }
.course-card.main   .card-header { background-color: #FFF3E0; color: #E65100; }
.course-card.iya    .card-header { background-color: #E8F5E9; color: #2E7D32; }

/* ---------- 教室検索 ---------- */
.classroom-search-box {
  background: #fff;
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.classroom-search-box .form-select,
.classroom-search-box .form-control {
  border-radius: .75rem;
  border-color: #ddd;
  font-size: .9rem;
}

/* 教室カード */
.classroom-card {
  border: 1px solid var(--bs-primary-light);
  border-radius: 1rem;
  transition: box-shadow .2s;
}

.classroom-card:hover {
  box-shadow: 0 6px 20px rgba(247,122,0,.2);
}

.classroom-card .teacher-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bs-primary);
}

/* ---------- 講師一覧 ---------- */
.teacher-card {
  border: none;
  border-radius: 1.25rem;
  transition: transform .2s, box-shadow .2s;
  text-align: center;
}

.teacher-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}

.teacher-card .teacher-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bs-primary);
  margin: 0 auto 1rem;
  display: block;
}

.teacher-card .teacher-area {
  font-size: .8rem;
  color: #999;
}

/* ---------- ニュース/お知らせ ---------- */
.news-list .news-item {
  border-bottom: 1px solid var(--bs-primary-light);
  padding: .75rem 0;
}

.news-date {
  font-size: .9rem;
  color: #aaa;
  min-width: 90px;
}

.news-cat {
  font-size: .75rem;
  padding: .15em .65em;
  border-radius: 50px;
  background: var(--bs-primary); /* ACFで色未設定時のデフォルト（inline styleで上書き） */
  color: #fff;
  white-space: nowrap;
  text-decoration: none;         /* <a>タグ化した際の下線を除去 */
  display: inline-block;
  line-height: 1.5;
  transition: opacity .15s;
}
a.news-cat:hover {
  opacity: .85;
  text-decoration: none;
}

/* ---------- オンライン教室バッジ ---------- */
.online-badge {
  background: var(--bs-online-badge);
  color: #fff;
}

/* ---------- CTAバナー ---------- */
.cta-section {
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-secondary) 100%);
  padding: 4rem 0;
  color: #fff;
}

.cta-section h2 { font-weight: 700; }

/* ---------- フッター ---------- */
#site-footer {
  background: #3a3a3a;
  color: #ccc;
  padding: 3rem 0 1.5rem;
}

#site-footer a { color: #ccc; }
#site-footer a:hover { color: #fff; text-decoration: none; }

#site-footer .footer-logo img { height: 40px; filter: brightness(0) invert(1); opacity: .8; }

#site-footer .footer-nav-heading {
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: .75rem;
}

#site-footer .footer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#site-footer .footer-nav-list li { margin-bottom: .4rem; }
#site-footer .footer-nav-list a { font-size: .8rem; }

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 1rem;
  transition: background .2s;
  margin-right: .5rem;
}

.footer-social a:hover { background: var(--bs-primary); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 2rem;
  padding-top: 1.5rem;
  font-size: .78rem;
  color: #999;
}

/* ---------- ページトップへ ---------- */
#page-top {
  position: fixed;
  bottom: 2rem;
  right: 1.5rem;
  z-index: 100;
}

#page-top a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bs-primary);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  transition: background .2s, transform .2s;
}

#page-top a:hover {
  background: var(--bs-primary-dark);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ---------- ブロックエディタ対応 ---------- */
/* VK Group ブロックの内部パディングと干渉しないよう entry-content 直下のみスコープ */
.entry-content > .wp-block-group { padding: 1rem 0; }

.wp-block-button__link {
  border-radius: 50px !important;
}

.wp-block-image img { border-radius: .75rem; }

/* ---------- ページ本文エリア ---------- */
.entry-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  border-left: 4px solid var(--bs-primary);
  padding-left: .75rem;
  margin: 2rem 0 1rem;
}

.entry-content h4 {
  font-size: 1.2rem;
  font-weight: 700;
  border-bottom: 2px solid var(--bs-primary-light);
  padding-bottom: .3rem;
  margin: 1.5rem 0 .75rem;
}

.yt-maxw896 {
  max-width: 896px;
  margin: 0 auto;
}

/* ---------- プレースホルダー色（入力済みと区別できるよう薄く統一） ----------
   Bootstrap 5 は .form-control::placeholder にクラスセレクターで定義するため
   グローバルの ::placeholder より詳細度が高い。同じ詳細度で後から上書きする。 */
::placeholder,
.form-control::placeholder,
.form-select::placeholder,
input::placeholder,
textarea::placeholder {
  color: #b0b7be;
  opacity: 1; /* Firefox はデフォルトで opacity を下げるため明示 */
}

/* ---------- フォーム共通 ---------- */
.entry-form .form-control,
.entry-form .form-select {
  border-radius: .5rem;
  border-color: #ddd;
  font-size: .9rem;
}

.entry-form .form-label { font-weight: 500; font-size: .9rem; }

.entry-form .required-badge {
  font-size: .7rem;
  background: #e53935;
  color: #fff;
  padding: .15em .5em;
  border-radius: 3px;
  margin-left: .4rem;
}

/* ---------- 404ページ ---------- */
.page-404 { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.page-404 .error-code { font-size: 8rem; font-weight: 900; color: var(--bs-primary-light); line-height: 1; }

/* ---------- レスポンシブ調整 ---------- */
@media (max-width: 767.98px) {
  .hero-section { padding: 3rem 0 2.5rem; }
  .classroom-search-box { padding: 1.5rem; }
  .section-heading { font-size: 1.4rem; }
  .course-card { margin-bottom: 1rem; }
}

/* @media (min-width: 992px) {
  .dropdown-menu {
    display: block;
    opacity: 0;
    transform: translateY(10px);
    transition: visibility 0s 0.3s, opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  }
  .dropdown:hover .dropdown-menu,
  .dropdown-menu.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: visibility 0s 0s, opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  }
} */

/* ---------- デザイン調整 ---------- */
.breadcrumb.small {
  font-size: 0.75rem;
}
.nav-search-class a {
  font-size: 1rem;
}
#main-content {
  background: linear-gradient(135deg, #FFF5EA 0%, #FFF9F0 100%);
}
h3.h6.fw-bold.border-3.ps-2,
h2.h5.fw-bold.border-3.ps-2 {
  padding: .2rem 0.8rem .3rem !important;
  border-radius: 100px;
}
.text-pink {
  color: #ff7700 !important;
}
h2.h6.card-title,
.news-item h2.h6 {
  font-size: 1.2rem;
}
.shadow-sm {
	box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.35) !important;
}
.pagination .page-link {
  color: #ff7700;
}
.pagination .active > .page-link,
.pagination .page-link.active {
  background-color: #ff7700;
  border-color: #ff7700;
  color: #fff;
}
@media (width >= 991px) and (width <= 1399px) {
  .middle-hidden {
    display: none;
  }
}
@media (max-width: 990px){
  .footer-bottom div a {
    display: block;
  }
}
@media (max-width: 440px){
  .footer-bottom p,
  .footer-bottom div {
    font-size: .68rem;
  }
}


/* ==========================================================
   VK Blocks Pro 対応スタイル
   ==========================================================
   bootstrap_vk_using.css（Bootstrap 4）は functions.php で除去済み。
   block-build.css に残る競合ルールをここで上書きする。
   ========================================================== */

/* -- Alert: block-build.css が Bootstrap 4 配色で上書きするのを打ち消す -- */
.alert-success {
  background-color: var(--bs-success-bg-subtle, #d1e7dd) !important;
  color:            var(--bs-success-text-emphasis, #0f5132) !important;
  border-color:     var(--bs-success-border-subtle, #badbcc) !important;
}
.alert-danger {
  background-color: var(--bs-danger-bg-subtle,  #f8d7da) !important;
  color:            var(--bs-danger-text-emphasis,  #842029) !important;
  border-color:     var(--bs-danger-border-subtle,  #f5c2c7) !important;
}
.alert-warning {
  background-color: var(--bs-warning-bg-subtle, #fff3cd) !important;
  color:            var(--bs-warning-text-emphasis, #664d03) !important;
  border-color:     var(--bs-warning-border-subtle, #ffecb5) !important;
}
.alert-info {
  background-color: var(--bs-info-bg-subtle,    #cff4fc) !important;
  color:            var(--bs-info-text-emphasis,    #055160) !important;
  border-color:     var(--bs-info-border-subtle,    #9eeaf9) !important;
}

/* -- VK Blocks ボタンブロック: rounded-pill スタイルを継承 -- */
.wp-block-button__link {
  border-radius: 50px !important;
}

/* -- VK Group ブロックの heading margin-top リセット影響を限定 -- */
/* block-build.css: .wp-block-group h3:first-child { margin-top: 0 }
   これは VK Group 内でのみ適切な挙動なので、通常コンテンツには影響なし（OK）  */

/* -- VK メディアテキストブロック: ブレークポイント調整 -- */
/* @media (max-width: 991px) {
    .wp-block-media-text {
        grid-template-columns: 1fr !important;
    }
    .wp-block-media-text.is-stacked-on-mobile {
        grid-template-areas: "media" "content" !important;
    }
} */
/* @media (min-width: 992px) {
    .wp-block-media-text {
        grid-template-columns: 50% 1fr !important;
    }
} */

/* ==========================================================
   スマホ対応: フォーム要素のフォントサイズ 16px 保証
   ----------------------------------------------------------
   iOS Safari は font-size < 16px のフォーム要素にフォーカスすると
   ページを自動ズームする。全フォーム要素を 16px 以上に統一して防止。
   ========================================================== */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="password"],
input[type="search"],
select,
textarea,
.form-control,
.form-select {
  font-size: max( 16px, 1rem ) !important;
}

.form-control-sm,
.form-select-sm {
  font-size: 16px !important;
}