    html {
    background-color: #ffffff;
    scrollbar-width: none;
    transition: all 0.3s;
}
section.topics {
    width: 94vw;
    margin: 13% auto 4%;
}
.fexbox {
    width: 100%;
    max-width: 100%;
display: inline-block;
    grid-gap: 3rem 3rem;
    margin: 3rem auto;
}

.text-description {
    margin-top: 1rem; /* 画像とテキストの間の余白 */
}
.title-ani {
    overflow: hidden;
    color: #393939 !important;
    transition-delay: 0.6s;
    font-size: 3.6rem;margin-left: 0%;
}

.title-ani-s {
    overflow: hidden;
    color: #343434 !important;
    transition-delay: 0.7s;
    font-size: 1.3rem;margin-left: 0%;
}
/* スマホなどの小さな画面では1列にする */
@media (max-width: 768px) {
    .i-section1__flexbox {
        grid-template-columns: 1fr; /* 1列表示 */
    }
}
  /* アイコンを右側に固定表示 */
  .floating-icon {
    position: fixed;
    right: 20%;
    bottom: 5rem;
    width: 50px;
    height: 50px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(50px); /* 初期状態では少し下に隠れている */
  }

  /* アイコンが表示されるときのスタイル */
  .floating-icon.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* スライドイン */
  }
  .floating-icon.hide {
    opacity: 0; /* フェードアウト */
    transform: translateY(50px); /* フェードアウト時に下にスライド */
  }

  /* オーバーレイのスタイル */
  .video-overlay {
    display: none; /* 初期状態では非表示 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / 70%);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease; /* フェードインと拡大のトランジション */
    transform: scale(0.9); /* 初期状態では少し縮小 */
  }

  /* 動画をレスポンシブに表示するためのラッパー */
  .video-wrapper {
    position: relative;
    width: 80%;
    padding-bottom: 30%;
    margin: 2rem auto;
  }

  /* YouTube動画のスタイル */
  #youtube-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
  }

  /* オーバーレイが表示されるときのアクティブ状態 */
  .video-overlay.active {
    display: flex;
    opacity: 1;
    transform: scale(1); /* 拡大して元のサイズに */
  }

  /* 閉じるボタンのスタイル */
  .close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #fff;
    border: none;
    font-size: 2rem;
    cursor: pointer;
  }

  /* スマホや小さな画面向けの調整 */
  @media (max-width: 768px) {
    .video-wrapper {
      width: 95%;
      padding-bottom: 56.25%; /* アスペクト比を維持 */
    }

    .close-btn {
      font-size: 1.5rem; /* 閉じるボタンのサイズも調整 */
    }
  }

  /* 大画面向けの調整 */
  @media (min-width: 1200px) {
    .video-wrapper {
      max-width: 60rem;
    }
  }
  .i-section1__flexbox.card{
    display: block;
}
.leftbox {
  display: block !important;
  position: relative !important;
  overflow: hidden !important;
  border-radius: 15px !important;
  transition: transform 0.3s ease !important, box-shadow 0.3s ease !important;
}
.text-description {
    margin-top: 2rem;
    font-size: 1rem;
    font-size: 1.1rem;
    font-family: YakuHanJP, Zen Kaku Gothic New, sans-serif !important;
    font-weight: 500;
    letter-spacing: 1px;
    line-height: 1.8rem;
    margin-left: 6%;
    margin-right: 6%;
}
.text.sponly {
    display: none;
}
.fexbox {
    padding-left: 0%;
    padding-right: 0%;
}
span.que {
    font-size: 1.4rem;
    font-weight: 600;
    padding-right: 2%;
}
@media (max-width: 768px) {
    .text.sponly {
    display: block;
}

    .fexbox {
        width: 100%;
        display: inline-block;
        margin: 2rem 0%;
    }
    .tb-none {
        display: block;
    }
    .text.pconly {
    display: none;
}
    .i-section1__flexbox {
margin-top: 2rem;
    }  
}
@media (max-width: 768px) {
  a.leftbox {
    position: relative;
    display: block;
    overflow: hidden;
  }

   a.leftbox .image::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0); /* デフォルトは透明 */
    transition: background 0.3s ease;
    z-index: 1;
  }


  a.leftbox .text {
    display: none;
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    color: white;
    z-index: 2;
    transition: color 0.3s ease;
  }



  /* 指で触れた際の動作 */
  a.leftbox:active .image::before {
    background: rgba(0, 0, 0, 0.7); /* 黒い透過を引く */
  }

  /* 指で触れた際にtextクラスを表示 */
  a.leftbox:active .text {
    display: block;
    color: white; /* 白文字で表示 */
  }
  .text-description {
    margin-top: 2rem;
    font-size: 1rem;
    font-size: 0.94rem;
    font-family: YakuHanJP, Zen Kaku Gothic New, sans-serif !important;
    font-weight: 500;
    letter-spacing: 1px;
    line-height: 1.8rem;
    margin-left: 0%;
    margin-right: 0%;
}
section.topics {
    width: 90%;
    margin: 7rem auto 20%;
}
    .title-ani {
        overflow: hidden;
        color: var(--secondary-color) !important;
        transition-delay: 0.6s;
        font-size: 2rem;
    }
    .title-ani-s {
        overflow: hidden;
        color: var(--accent-color) !important;
        transition-delay: 0.7s;
        font-size: 1rem;
    }
}
.fadein {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scrollin {
  opacity: 1;
  transform: translateY(0);
}
.fadein {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.fadein.fade-in {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .fadein {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 1s ease-out, transform 1s ease-out;
    }

    .fadein.fade-in {
        opacity: 1;
        transform: translateY(0);
    }
}
.my-svg {
    width: 55%;
    height: auto;
    margin: 20% auto 10%;
    display: block;
    animation: blink 5s infinite, color-change 7s infinite;
    transition: transform 0.1s;
}
section.message p {
    font-weight: 500;
    letter-spacing: .05em;
    line-height: 3.5em;
    margin: 0 auto 2em;
    white-space: nowrap;
    display: inline;
    font-size: 1rem;
}
.floating-icon {
    position: fixed;
    right: 25%;
    bottom: 5rem;
    width: 4.3rem;
    height: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(50px); /* 初期状態では少し下に隠れている */
}

/* マウスホバーでシェイクアニメーションを追加 */
.floating-icon:hover {
    animation: shake 0.5s ease-in-out;
}

/* シェイクアニメーションの定義 */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}


  /* アイコンが表示されるときのスタイル */
  .floating-icon.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* スライドイン */
  }
  .floating-icon.hide {
    opacity: 0; /* フェードアウト */
    transform: translateY(50px); /* フェードアウト時に下にスライド */
  }

  /* オーバーレイのスタイル */
  .video-overlay {
    display: none; /* 初期状態では非表示 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / 70%);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease; /* フェードインと拡大のトランジション */
    transform: scale(0.9); /* 初期状態では少し縮小 */
  }

  /* 動画をレスポンシブに表示するためのラッパー */
  .video-wrapper {
    position: relative;
    width: 80%;
    padding-bottom: 30%;
    margin: 2rem auto;
  }

  /* YouTube動画のスタイル */
  #youtube-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
  }

  /* オーバーレイが表示されるときのアクティブ状態 */
  .video-overlay.active {
    display: flex;
    opacity: 1;
    transform: scale(1); /* 拡大して元のサイズに */
  }

  /* 閉じるボタンのスタイル */
  .close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #fff;
    border: none;
    font-size: 2rem;
    cursor: pointer;
  }

  /* スマホや小さな画面向けの調整 */
  @media (max-width: 768px) {
    .video-wrapper {
      width: 95%;
      padding-bottom: 56.25%; /* アスペクト比を維持 */
    }
    section.message p {
            font-size: 0.9rem;
    }
    .my-svg {
        width: 65%;
    }
    .floating-icon {
        position: fixed;
        right: 10%;
    }
    section.message {
        padding: 8% 0% 10%;
        margin: 0 auto 10%;
        display: flex;
        justify-content: center;
    }
    .close-btn {
      font-size: 1.5rem; /* 閉じるボタンのサイズも調整 */
    }
  }

  /* 大画面向けの調整 */
  @media (min-width: 1200px) {
    .video-wrapper {
      max-width: 60rem;
    }
  }
  p.text001.cat.kadai {
    margin-bottom: 4%;
}
.inner{
    width: 75vw;
    margin: 0 auto;
    margin-top: 5%;
}
.inner.news {
    margin-top: 8%;
}
.newsDl .subDl dd {
    width: 86%;
    padding: 0% 0 1% 5%;
    float: left;
}
.newsDl .subDl dd .news_txt {
    width: 80%;
    padding-right: 0%;
    padding-left: 0%;
    float: left;
    word-break: break-all;
    letter-spacing: 0vw;
    line-height: 2.2;
    font-weight: 500;
    -webkit-text-stroke: 0vw;
}
.newsDl .subDl dd .news_date {
    width: 16%;
    float: left;
    margin-right: 0%;
    font-size: 1.6rem;
    font-weight: 500;
    -webkit-text-stroke: 0.02vw;
    line-height: 1.6vw;
}
.newsDl .subDl dt {
    margin-top: 0%;
}
span.titleh2.new {
    margin-left: 1%;
    font-size: 2.2rem;
    color: #000!important;
}
dt.news_category.animation_item {
    width: 14%;
    background: #000000;
    border-radius: 25px;
    text-align: center;
    float: inline-start;
    padding: 0px 27px 0px;
    clear: both;
    color: #ffffff;
    line-height: 3.4rem;
}
dt.news_category.animation_item {
    line-height: 3rem;
}
p.contentslead {
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 2.25;
    letter-spacing: .1em;
}
p.concepttext {
    font-size: 1rem;
    line-height: 2rem;
    letter-spacing: 1px;
    -webkit-text-stroke: 0.01vw;
}

h2.c-heading-primary {
    font-size: 1.3rem;
    margin: 1% 0 5% 0;
    font-weight: 600;
    display: flex;
    align-items: center; /* ポチとテキストを中央揃えに */
}

h2.c-heading-primary::before {
    content: '';
    display: inline-block;
    width: 0.3em;
    height: 0.3em;
    background-color: #FFD700;
    border-radius: 50%;
    margin-right: 0.5em;
    flex-shrink: 0;
}
.value-box-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  margin: 2rem 0;
}

.value-box {
    flex: 1 1 calc(33.333% - 2rem);
    /* min-width: 280px; */
    box-sizing: border-box;
    background: #f7f7f7;
    border-radius: 20px;
    padding: 3% 3% 5%;  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.value-tag {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.value-tag .label {
    font-weight: 600;
    margin-right: 0.1em;
    font-size: 0.74rem;
}

.value-tag .line {
    flex-grow: 1;
    height: 1px;
    background-color: #000;
    margin: 0 -0.5em 0 0.3em;
    max-width: 29px;
}

.value-tag .circle {
    width: 40px;
    height: 40px;
    border: 1px solid #000;
    border-radius: 50%;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
}
.value-content h3 {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0rem;
    line-height: 4.6;
    text-align: center;
}

.value-content p {
    font-size: 0.94rem;
    line-height: 1.6;
}
.value-box:hover {
  transform: scale(1.03); /* 少しだけ拡大 */
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); /* ふわっと浮く感じ */
}
/* スマホ対応 */
@media screen and (max-width: 768px) {
  .value-box {
    flex: 1 1 100%;
  }
}
.kensyu.bcon {
    overflow-x: hidden !important;
}
.kensyu.bcon {
    width: 95vw;
    max-width: calc(95vw);
    margin-left: 5vw;
    border-radius: 5.8651026393vw 0 0 5.8651026393vw;
    background-color: #fff5c4;
    padding: 5vw 0 6vw;
    margin-top: 5%;
}
.kensyu.w70.ow {
    width: 72vw;
    margin: 0 14vw 0 9vw;
}
.accordion-content {
    display: none;
    margin: 1.5em 0 0em;
}

.accordion-content.is-open {
  display: block;
}

.accordion-title {
  cursor: pointer;
  position: relative;
  padding-right: 2em;
}

.accordion-title .open-close-btn::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-size: 1.2em;
}

.accordion-title.is-open .open-close-btn::after {
  content: '−';
}
.accordion-item {
    font-size: 1rem;
    border-top: 1px solid #e8e8e8;
    padding: 2%;
}
.faqbox {
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 9%;
}
.que {
  flex-shrink: 0;
  min-width: 1.5em;    /* 幅を固定して揃える */
  text-align: left;
}
span.que {
    font-size: 1.4rem;
    font-weight: 600;
    padding-right: 2%;
}

.accordion-title {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  position: relative;
}

.que {
  flex-shrink: 0;
  font-weight: bold;
  font-size: 1.2em;
  min-width: 1.5em;
  text-align: left;
}

.question-text {
  flex: 1;
  font-size: 1em;
  line-height: 1.6;
}
.answer-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  margin-top: 1em;
}

.ans {
    flex-shrink: 0;
    font-weight: bold;
    font-size: 1.2em;
    min-width: 1.5em;
    text-align: left;
    font-size: 1.4rem;
    font-weight: 600;
    padding-right: 2%;
}

.ans-text {
    flex: 1;
    font-size: 1em;
    line-height: 1.6;
    padding-right: 5%;
}
.category-dropdown {
    max-width: max-content;
    margin: 0 auto;
    padding: 10px;
    text-align: left;
    display: inline;
}

#category-select {
    width: 100%;
    padding: 1rem 16px;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #f9f9f9;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%204%205'%3E%3Cpath%20fill='gray'%20d='M2%205L0%200h4z'/%3E%3C/svg%3E);
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
    margin-bottom: 5%;
}

@media (hover: hover) {
  #category-select:hover {
    border-color: #999;
    background-color: #f0f0f0;
  }
}

@media screen and (max-width: 600px) {
  #category-select {
    font-size: 14px;
    padding: 10px 14px;
  }
}
.barline {
  height: 1px;
  background-color: #e8e8e8;
  margin-top: 0;
  width: 100%;
}
/* 共通レイアウト */
.training-card-wrapper {
  width: 100%;
  padding: 2rem 0rem;
  box-sizing: border-box;
}

/* PC用：テーブル形式 */
.training-card-container {
  display: table;
  width: 100%;
  border-collapse: collapse;
}

.training-card-header {
  display: table-row;
  font-weight: bold;
  background-color: #ffd118;
}

.training-card-link {
  display: table-row;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.3s ease;
}

.training-card-link:hover {
  background-color: #f9f9f9;
}

.training-card-header > .training-card,
.training-card-link > .training-card {
  display: table-cell;
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #ddd;
  text-align: left;
  font-size: 0.95rem;
}
.ended-badge{
  display:inline-block;
  margin-left: .5em;
  padding: .15em .8em;
  border-radius: 999px;
  border: 1px solid #333;
  font-size: .85em;
  line-height: 1.4;
}

/* スマホ用：カード形式 */
@media (max-width: 768px) {
  .training-card-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .training-card-header {
    display: none; /* スマホでは非表示 */
  }

  .training-card-link {
    display: block;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    background-color: #fff;
    transition: background-color 0.3s ease;
  }

  .training-card-link:hover {
    background-color: #f9f9f9;
  }

  .training-card {
    display: block;
    padding: 0;
    margin-bottom: 0.5rem;
  }

  .training-card:first-child {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.3rem;
  }

  .training-card:nth-child(2),
  .training-card:nth-child(3) {
    font-size: 0.9rem;
    color: #555;
  }
}

</style>
<?php
// ====== ここから貼り替え用 View ======

// Controller から $status, $today を渡してない場合の保険
$status = isset($status) ? $status : ($this->request->getQuery('status') ?? 'upcoming');
$today  = isset($today) ? $today : date('Y-m-d');

// meta取得を「連想配列形式」「配列列挙形式」両対応で統一
function metaValue($post, $key) {
  if (isset($post['WpPostmeta'][$key]['meta_value'])) {
    return $post['WpPostmeta'][$key]['meta_value'];
  }
  if (!empty($post['WpPostmeta']) && is_array($post['WpPostmeta'])) {
    foreach ($post['WpPostmeta'] as $m) {
      if (($m['meta_key'] ?? null) === $key) return $m['meta_value'] ?? null;
    }
  }
  return null;
}
?>

<style>
/* プルダウン（必要最低限。既存CSSに合わせて調整OK） */
.training-filter {
  margin: 1.2rem 0 1.2rem;
  display: flex;
  justify-content: flex-end;
}
.training-filter select {
  border: 1px solid #333;
  border-radius: 30px;
  padding: .4rem 1rem;
  font-size: 0.95rem;
  background: #fff;
  font-weight: 500;
}

/* 開催終了バッジ */
.ended-badge{
  display:inline-block;
  margin-left: .6em;
  padding: .15em .8em;
  border-radius: 999px;
  border: 1px solid #333;
  font-size: .85em;
  line-height: 1.4;
  vertical-align: middle;
}

/* PCだけタイトル行を表示したい場合（既存と合わせる） */
@media (max-width: 768px) {
  .training-card-header { display: none; }
}
/* ===== TRAINING ヘッダー ===== */
.training-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.training-title-block {
  display: flex;
  flex-direction: column;
}

.training-filter {
  margin: 0;
}

/* select の見た目（既にあれば微調整だけ） */
.training-filter select {
  border: 1px solid #333;
  border-radius: 30px;
  padding: 0.4rem 1.2rem;
  font-size: 0.9rem;
  background: #fff;
  font-weight: 500;
  cursor: pointer;
}

/* ===== スマホは縦並び ===== */
@media (max-width: 768px) {
  .training-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .training-filter {
    align-self: flex-start;
  }

  .training-filter select {
    width: 100%;
  }
.inner {
    width: 90vw;
    margin: 0 auto;
    margin-top: 5%;
}
}
/* ===== TRAINING 一覧：スマホは縦並び ===== */
@media (max-width: 768px) {

  .training-card-container {
    display: block;
  }

  .training-card-link {
    display: block;
    margin-bottom: 1rem;
  }

  .training-card-link .training-card {
    width: 100%;
    min-height: auto;
    border: none;
    box-shadow: none;
    padding: 0rem 0;
    text-align: left;
  }
    .training-card-link .training-card:first-child {
        font-weight: 600;
        font-size: 1rem;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
        border-bottom: 1px solid #e5e5e5;
        margin-bottom: 0.6rem;
    }
  /* タイトルだけ強調 */
  .training-card-link .training-card:first-child {
    font-weight: 600;
    font-size: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 0.6rem;
  }

  /* 日時・開催地 */
  .training-card-link .training-card:nth-child(2),
  .training-card-link .training-card:nth-child(3) {
    font-size: 0.9rem;
    color: #333;
  }
a.training-card-link {
    display: grid;
}
}
