@charset "utf-8";

/* ==========================================================================
   ヘッダー固定とコンテンツの回り込み防止
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--color-bg-white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.site-main {
  position: relative;
  margin-top: 220px;
}

/* ヘッダーの裏側にだけ指定色を敷くギミック */
.site-main::before {
  content: "";
  position: absolute;
  top: -220px;
  left: 0;
  width: 100%;
  height: 220px;
  background-color: var(--color-bg-yellow, #fffdf7);
  z-index: -1;
  pointer-events: none;
}

@media (max-width: 1024px) {
  .site-main {
    margin-top: 64px;
  }

  .site-main::before {
    top: -64px;
    height: 64px;
  }
}

/* ==========================================================================
   レイアウトベース
   ========================================================================== */
.header-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

@media (max-width: 1024px) {
  .pc-only {
    display: none !important;
  }

  .header-container {
    padding: 0 15px;
    flex-wrap: wrap;
    align-items: center;
  }
}

/* ==========================================================================
   トップバー（サブナビ & SNS）
   ========================================================================== */
.header-top {
  border-bottom: 1px solid var(--color-border--blue);
  padding: 8px 0;
}

.header-top .header-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.sub-nav ul {
  font-family: "M PLUS Rounded 1c", sans-serif;
  display: flex;
  align-items: center;
}

.sub-nav li {
  font-size: var(--font-size-16px);
  font-weight: bold;
}

.sub-nav a {
  color: var(--color-primary);
  text-decoration: none;
  transition: 0.2s;
}

.sub-nav a:hover {
  color: #ff9d00;
}

.sub-nav li:not(:last-child)::after {
  content: "|";
  color: var(--color-primary);
  margin: 0 12px;
  font-weight: normal;
}

.header-sns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-sns img {
  width: 34px;
  height: 34px;
}

/* ==========================================================================
   ミドルバー（ロゴ & ツール & 検索）
   ========================================================================== */
.header-middle {
  padding: 20px 0;
}

.header-logo img {
  width: 320px;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 25px;
}

.accessibility-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-group .label {
  font-size: var(--font-size-14px);
  font-weight: bold;
}

.btn-group {
  display: inline-flex;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  overflow: hidden;
}

/* 黒背景時のコントロール枠調整 */
body[data-theme="dark"] .btn-group {
  border-color: var(--color-border--blue);
}

.btn-toggle {
  font-size: var(--font-size-16px);
  font-weight: bold;
  padding: 6px 16px;
  background-color: #ffffff;
  color: #1f1f1f;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.btn-toggle:not(:last-child) {
  border-right: 1px solid #1f1f1f;
}

body[data-theme="dark"] .btn-toggle:not(:last-child) {
  border-right: 1px solid var(--color-border--blue);
}

.btn-toggle.is-active {
  background-color: #e6e6e6;
}

body[data-theme="dark"] .btn-toggle.is-active {
  background-color: #444444;
  color: #ffffff;
}

/* 「黒」ボタンの初期スタイル */
.btn-toggle.is-black {
  background-color: #1f1f1f;
  color: #ffffff;
}

.btn-toggle.is-black.is-active {
  background-color: #444444;
}

/* 検索フォーム */
.search-form {
  width: 320px;
  border: 2px solid var(--color-primary);
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--color-bg-white);
}

.search-form .mt-site-search-container,
.search-form .mt-site-search,
.search-form .mt-site-search > div,
.search-form .mt-site-search-form {
  width: 100%;
  display: flex;
}

.search-form input {
  border: none;
  padding: 10px 14px;
  flex: 1;
  width: 0;
  font-size: var(--font-size-16px);
  outline: none;
  color: var(--color-text-main);
  box-sizing: border-box;
}

.search-form button {
  background-color: var(--color-primary);
  color: var(--color-text-btn01);
  font-weight: bold;
  padding: 10px 24px;
  font-size: var(--font-size-16px);
  cursor: pointer;
  transition: 0.2s;
}

.search-form button:hover {
  color: var(--color-text-hover01);
}

@media (max-width: 1024px) {
  .header-middle {
    padding: 0;
  }

  .header-middle .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .header-logo {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 150px);
    padding-right: 10px;
    box-sizing: border-box;
  }

  .header-logo img {
    width: 100%;
    max-width: 280px;
    height: auto;
    display: block;
  }

  /* 閲覧補助ツールコンテナ（上から重ねて固定） */
  .header-tools {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    height: calc(100vh - 64px);
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
  }

  .header-tools.is-open {
    display: flex;
  }

  /* スマホ表示の閲覧補助コントロール（縦2行） */
  .accessibility-controls {
    width: 100%;
    flex-direction: column;
    gap: 12px;
    background-color: var(--color-bg-gray);
    padding: 24px;
    box-sizing: border-box;
  }

  .control-group {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* 検索フォーム */
  .search-form {
    width: 100%;
    margin-top: 0;
    border-radius: 0;
  }

  .search-form input {
    width: 100%;
  }

  .search-form button {
    padding: 10px 16px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* --- スマホ専用ヘッダーボタン（右上固定） --- */
  .sp-header-buttons {
    display: flex;
    align-items: stretch;
    height: 64px;
    flex-shrink: 0;
    margin-right: -15px;
  }

  .sp-btn-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    border: none;
    cursor: pointer;
    font-family: "M PLUS Rounded 1c", sans-serif;
    color: #ffffff;
    transition: background-color 0.2s;
  }

  .sp-btn-nav.is-assist {
    background-color: var(--color-secondly);
    color: var(--color-text-btn02);
  }

  .sp-btn-nav.is-menu {
    background-color: var(--color-primary);
    color: var(--color-text-btn01);
  }

  .sp-btn-nav .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-bottom: 2px;
  }

  .sp-btn-nav .icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .sp-btn-nav .icon.is-active-view,
  .sp-btn-nav .text.is-active-view {
    display: none;
  }

  .sp-btn-nav.is-active .icon.is-default,
  .sp-btn-nav.is-active .text.is-default {
    display: none !important;
  }

  .sp-btn-nav.is-active .icon.is-active-view {
    display: flex;
  }

  .sp-btn-nav.is-active .text.is-active-view {
    display: block;
  }

  .sp-btn-nav .text {
    font-size: 0.6875rem;
    font-weight: bold;
    line-height: 1;
    padding-top: 4px;
  }
}

/* ==========================================================================
   ボトムバー（グローバルナビゲーション）
   ========================================================================== */
.global-nav {
  font-family: "M PLUS Rounded 1c", sans-serif;
  background-color: var(--color-primary);
}

.global-nav ul {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 8px 0;
}

.global-nav li {
  flex-grow: 1;
  border-left: 1px solid var(--color-bg-white);
}

.global-nav li:last-child {
  border-right: 1px solid var(--color-bg-white);
}

.global-nav a {
  display: block;
  color: var(--color-text-btn01);
  padding: 8px;
  font-weight: 600;
  font-size: var(--font-size-18px);
  text-decoration: none;
  transition: 0.2s;
  white-space: nowrap;
  text-align: center;
}

.global-nav a:hover {
  color: var(--color-text-hover01);
}

.sp-header-buttons,
.sp-only {
  display: none;
}

@media (max-width: 1024px) {
  .global-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    height: calc(100vh - 64px);
    overflow-y: auto;
    border-top: none;
    background-color: var(--color-primary);
    z-index: 999;
  }

  .global-nav.is-open {
    display: block;
  }

  .global-nav .header-container {
    padding: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .global-nav ul {
    flex-direction: column;
    width: 100%;
    padding: 0;
  }

  .global-nav li {
    width: 100%;
    border-left: none;
    border-bottom: 1px solid var(--color-bg-white);
  }

  .global-nav a {
    display: block;
    padding: 12px 24px;
    text-align: left;
    text-decoration: none;
    font-size: var(--font-size-16px);
    font-weight: 600;
  }

  .sp-only {
    display: block;
  }

  .sp-sub-nav-list li:last-child {
    border-bottom: 1px solid var(--color-bg-white);
  }

  .sp-sns-icons {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 16px 0 70px;
  }

  .sp-sns-icons img {
    width: 40px;
    height: 40px;
    display: block;
  }
}

/* ==========================================================================
   フッターエリア
   ========================================================================== */
.site-footer {
  width: 100%;
  background-color: var(--color-bg-white);
  color: var(--color-text-main);
}

.footer-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-nav {
  font-family: "M PLUS Rounded 1c", sans-serif;
  background-color: var(--color-primary);
}

.footer-nav ul {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 8px 0;
}

.footer-nav li {
  flex-grow: 1;
  border-left: 1px solid var(--color-bg-white);
}

.footer-nav li:last-child {
  border-right: 1px solid var(--color-bg-white);
}

.footer-nav a {
  display: block;
  color: var(--color-text-btn01);
  padding: 8px;
  font-weight: 600;
  font-size: var(--font-size-18px);
  text-decoration: none;
  transition: 0.2s;
  white-space: nowrap;
  text-align: center;
}

.footer-nav a:hover {
  color: var(--color-text-hover01);
}

.footer-main {
  padding: 50px 0 60px;
  background-image: url('https://www.yshakyo.or.jp/.assets/footer_bg_pattern.svg');
  background-repeat: no-repeat;
  background-position: right bottom;
  position: relative;
}

.footer-main-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

body[data-theme="dark"] .footer-main {
  background-image: none;
}

.footer-character {
  flex-shrink: 0;
  text-align: center;
  width: 220px;
}

.char-img {
  width: 180px;
  height: auto;
  margin: 0 auto 8px;
}

.char-caption {
  font-size: var(--font-size-12px);
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: 2px;
}

.char-name {
  font-size: var(--font-size-14px);
  font-weight: 700;
  margin-bottom: 10px;
}

.char-btn {
  display: inline-block;
  background-color: var(--color-primary);
  color: var(--color-text-btn01);
  font-size: var(--font-size-14px);
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  transition: 0.2s;
  white-space: nowrap;
}

.char-btn:hover {
  color: var(--color-text-hover01);
}

.footer-info {
  flex-grow: 1;
  max-width: 480px;
}

.footer-logo {
  margin-bottom: 18px;
}

.footer-logo img {
  width: 320px;
  height: auto;
}

.footer-address {
  font-size: var(--font-size-18px);
  line-height: 1.6;
  margin-bottom: 18px;
}

.footer-phone-pc {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.phone-icon {
  width: 24px;
  height: auto;
  margin-top: 4px;
}

.phone-number-wrap {
  line-height: 1.2;
}

.phone-number {
  font-size: var(--font-size-32px);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.phone-number a {
  color: var(--color-text-main);
  text-decoration: none;
}

.phone-hours {
  font-size: var(--font-size-18px);
  margin-top: 2px;
}

.footer-phone-sp {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sp-phone-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  transition: opacity 0.2s;
}

.sp-phone-btn:hover {
  opacity: 0.8;
}

.sp-phone-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.footer-sns-promote {
  flex-shrink: 0;
  text-align: center;
}

.sns-title img {
  width: 260px;
  margin: 0 auto 24px;
}

.sns-buttons {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sns-buttons a {
  transition: opacity 0.2s;
}

.sns-buttons a:hover {
  opacity: 0.7;
}

.sns-buttons img {
  width: 400px;
  height: auto;
  display: block;
}

.footer-bottom {
  background-color: var(--color-secondly);
  padding: 16px 0;
  text-align: center;
}

.copyright {
  font-size: var(--font-size-14px);
  font-weight: bold;
  color: var(--color-text-main);
}

@media (max-width: 1024px) {

  .site-footer {
    border-top: 3px solid var(--color-border--blue);
  }

  .footer-nav {
    display: none;
    padding: 15px 0;
  }

  .footer-main {
    padding: 40px 0;
    background-size: auto;
    background-image: url('https://www.yshakyo.or.jp/.assets/footer_bg_pattern_sp.svg');
    background-position: bottom;
  }

  body[data-theme="dark"] .footer-main {
    background-image: none;
  }

  .footer-main-flex {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }

  .footer-character {
    width: 100%;
  }

  .footer-info {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-logo {
    justify-content: center;
  }

  .footer-phone-pc {
    display: none !important;
  }

  .footer-phone-sp {
    display: flex;
  }

  .footer-sns-promote {
    width: 100%;
  }

  .sns-buttons {
    align-items: center;
  }

  .sns-buttons img {
    max-width: 100%;
    width: 280px;
  }

  .footer-bottom {
    padding-bottom: 70px !important;
  }
}

/* ==========================================================================
   固定ナビゲーション
   ========================================================================== */
.fixed-nav {
  position: fixed;
  right: 0;
  top: 60%;
  transform: translateY(-60%);
  z-index: 990;
}

.fixed-nav-container {
  display: flex;
  flex-direction: column;
  border: 3px solid var(--color-border--blue);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background-color: var(--color-bg-white);
  overflow: hidden;
  box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.1);
}

.fixed-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  padding: 24px 0;
  background-color: var(--color-secondly);
  color: var(--color-primary);
  text-decoration: none;
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: bold;
  font-size: var(--font-size-16px);
  line-height: 1.4;
  text-align: center;
  writing-mode: vertical-rl;
  transition: 0.2s;
}

.fixed-nav-item:not(:last-child) {
  border-bottom: 3px solid var(--color-border--blue);
}

.fixed-nav-item:hover {
  background-color: var(--color-primary);
  color: var(--color-text-hover01);
}

@media (max-width: 1024px) {
  .fixed-nav {
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    z-index: 1001 !important;
  }

  .fixed-nav-container {
    flex-direction: row !important;
    border: none !important;
    border-top: 3px solid var(--color-primary) !important;
    border-radius: 0 !important;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.15) !important;
  }

  .fixed-nav-item {
    flex: 1 !important;
    width: auto !important;
    padding: 16px 0 !important;
    writing-mode: horizontal-tb !important;
    font-size: var(--font-size-14px) !important;
    line-height: 1.2 !important;
  }

  .fixed-nav-item:not(:last-child) {
    border-bottom: none !important;
    border-right: 3px solid var(--color-primary) !important;
  }

  body[data-theme="dark"] .fixed-nav-container {
    border-top-color: var(--color-border--blue) !important;
  }

  body[data-theme="dark"] .fixed-nav-item:not(:last-child) {
    border-right-color: var(--color-border--blue) !important;
  }
}

/* ==========================================================================
   ページトップボタン
   ========================================================================== */
.page-top-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  background-color: #1f1f1f;
  border-radius: 6px;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.page-top-btn::after {
  content: "";
  width: 12px;
  height: 12px;
  border-top: 3px solid #ffffff;
  border-left: 3px solid #ffffff;
  transform: rotate(45deg);
  margin-top: 4px;
}

.page-top-btn:hover {
  opacity: 0.9;
}

@media (max-width: 1024px) {
  .page-top-btn {
    bottom: 70px !important;
  }
}

/* ==========================================================================
   スマホ表示の時に記述順に関係なくハンバーガーメニューを表示
   ※必ず末尾に記述すること
   ========================================================================== */
@media (max-width: 1024px) {
  .sp-header-buttons {
    display: flex !important;
  }

  .sp-only {
    display: block !important;
  }
}