/* =========================================================
   ST-AR Project — app.css (refactored)
   -----------------------------------------------------------
   - カラー/フォント/レイアウト値を :root の変数に集約
   - body / floating-popup-buttons / support 等の重複定義を統合
   - Phase 1〜7 のパッチを各セクション本体にマージ
   - 不要な !important を削除（保険コード・詳細度都合のみ残置）
   ========================================================= */

/* =========================================
   0. Design Tokens (CSS Variables)
   ========================================= */
:root {
  /* --- Brand colors --- */
  --color-primary: #2A4198;        /* メインの青 */
  --color-primary-dark: #1E326F;   /* 濃い青（hover等） */
  --color-primary-deep: #002972;   /* さらに濃い青 */
  --color-accent: #FABC1C;         /* アクセントの黄 */

  /* --- Text colors --- */
  --color-text: #363636;
  --color-text-body: #484845;
  --color-text-muted: #7A7A7A;
  --color-text-faint: #BFBFBF;

  /* --- UI colors --- */
  --color-bg-pale-blue: #F4FBFF;
  --color-bg-light-blue: #E7F5FF;
  --color-bg-faint: #f9f9f9;
  --color-line: #989898;
  --color-line-light: #ccc;
  --color-link-heading: #0B3C91;

  /* --- Status / button colors --- */
  --color-green: #5EB158;
  --color-red: #F95C5C;
  --color-red-alt: #F56560;
  --color-yellow-btn: #F6CA45;
  --color-blue-btn: #3D89D6;

  /* --- Circle palette --- */
  --circle-1: #E7F5FF;
  --circle-2: #9BD6F9;
  --circle-3: #0071BC;
  --circle-4: #2A4198;
  --circle-5: #131169;

  /* --- Fonts --- */
  --font-jp: "Hiragino Kaku Gothic Pro", sans-serif;
  --font-maru: 'Hiragino Maru Gothic Pro', sans-serif;

  /* --- Layout --- */
  --container-max: 1230px;
  --content-max: 900px;
  --header-height: 90px;
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-pill: 999px;
}

/* =========================================
   1. Font helper classes
   ========================================= */
.noto-serif-jp {
  font-family: "Noto Serif JP", serif;
  font-optical-sizing: auto;
  font-style: normal;
}
.roboto {
  font-family: "Roboto", sans-serif;
  font-style: normal;
}
.noto-sans-jp {
  font-family: "Noto Sans JP", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
}
.playfair-display-sc {
  font-family: "Playfair Display SC", serif;
  font-style: normal;
}

/* =========================================
   2. Base / Reset
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

/* body は元の3重定義を統合。
   width:100vw → 100% に確定（横スクロール対策）。
   padding-top はヘッダー（fixed）の高さ分。 */
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  color: var(--color-text-body);
  font-size: 16px;
  line-height: 175%;
  padding-top: var(--header-height);
}

div {
  box-sizing: border-box;
}

ul {
  list-style: none;
  margin-bottom: 0;
  padding: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

h1, h2, h3, h4, h5, h6, p {
  margin-top: 0;
  margin-bottom: 0;
}

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

.c-container {
  max-width: var(--container-max);
  padding: 0 15px;
  margin: auto;
}

/* 表示切り替えユーティリティ */
.sp-only,
.sp-only-f { display: none; }
.pc-only   { display: block; }
.pc-only-f { display: flex; }

.yellow { color: var(--color-accent); }

/* =========================================
   3. Header
   ========================================= */
.header {
  width: 100%;
  background-color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  box-shadow: 0 4px 2px -2px gray;
  z-index: 9999;
  position: fixed;
  top: 0;
}

.header__logo h1 {
  font-size: 24px;
  color: var(--color-text);
}

.header__nav {
  display: flex;
}

.header__menu {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
}

.header__menu li {
  display: inline-block;
}

.header__menu a {
  text-decoration: none;
  color: var(--color-text);
  font-size: 1rem;
}

.header__menu a.contact-btn,
.header__menu a.donation-btn,
.header__menu a.lab-btn,
.header__menu a.student-btn,
.header__menu li.contact-btn > a,
.header__menu li.donation-btn > a,
.header__menu li.lab-btn > a,
.header__menu li.student-btn > a {
  padding: 8px 16px;
  color: #fff;
  border-radius: var(--radius-sm);
}

.header__menu a.contact-btn,
.header__menu li.contact-btn > a  { background-color: var(--color-green); }

.header__menu a.donation-btn,
.header__menu li.donation-btn > a { background-color: var(--color-red-alt); }

.header__menu a.lab-btn,
.header__menu li.lab-btn > a      { background-color: var(--color-yellow-btn); }

.header__menu a.student-btn,
.header__menu li.student-btn > a  { background-color: var(--color-blue-btn); }

.header__menu a:hover {
  color: var(--color-primary);
  cursor: pointer;
}

/* --- Hamburger --- */
.header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 21px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: var(--color-primary-deep);
  padding: 30px;
  position: absolute;
  right: 0;
  top: 0;
}

.header__hamburger span {
  position: absolute;
  height: 3px;
  background-color: #fff;
  transition: all 0.3s ease;
  left: 20%;
}
.header__hamburger span.line1 { top: 30%; width: 60%; }
.header__hamburger .line2     { top: 45%; width: 50%; }
.header__hamburger .line3     { top: 60%; width: 30%; }

.header__hamburger.active .line1 {
  width: 50%;
  top: 38%;
  left: 24%;
  transform: rotate(45deg) translate(5px, 5px);
}
.header__hamburger.active .line2 {
  opacity: 0;
}
.header__hamburger.active .line3 {
  width: 50%;
  top: 60%;
  left: 24%;
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Mobile menu --- */
.header__mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background-color: #fff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  transition: right 0.3s;
  padding: 50px 20px;
  z-index: 999;
}
.header__mobile-menu.active {
  right: 0;
}
.header__mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.header__mobile-menu ul li {
  border-bottom: 1px solid #ddd;
  padding: 15px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header__mobile-menu ul li a,
.header__mobile-menu ul li span {
  font-size: 18px;
  color: var(--color-text);
  text-decoration: none;
}
.header__mobile-menu .contact-btn,
.header__mobile-menu .donation-btn {
  width: 100%;
  text-align: center;
  padding: 15px 0;
  border-radius: 20px;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  margin: 20px 0;
}
.header__mobile-menu .contact-btn  { background-color: var(--color-green); }
.header__mobile-menu .donation-btn { background-color: var(--color-red); }

/* =========================================
   4. MV (Main Visual)
   ========================================= */
#mv-section {
  width: 100%;
  height: 100%;
  position: relative;
  background: var(--color-bg-light-blue);
}

.mv-section__bgcircles {
  background-image: url(../images/background-round.png);
  background-repeat: no-repeat;
  background-size: contain;
  width: 100vw;
  height: auto;
  aspect-ratio: 16 / 8;
}

.mv-section__image-container {
  width: 65%;
  height: auto;
  left: 65%;
  top: 10%;
  position: absolute;
  transform: translateX(-50%);
}

.mv-section__yellow-box {
  width: 55px;
  height: 52px;
  position: absolute;
  background: var(--color-accent);
}
.mv-section__yellow-box--top-right {
  right: 8%;
  top: 0;
}
.mv-section__yellow-box--bottom-left {
  left: 0;
  top: 94%;
  z-index: -1;
}

.mv-section__image {
  width: 90%;
  aspect-ratio: 810 / 527;
  left: 10px;
  top: 10px;
  position: relative;
}

.mv-section__text {
  left: 10%;
  top: 30%;
  position: absolute;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}
.mv-section__text--black,
.mv-section__text--blue {
  font-size: 2.4rem;
  font-family: var(--font-maru);
  font-weight: 400;
  letter-spacing: 8px;
  word-wrap: break-word;
}
.mv-section__text--black {
  color: black;
  line-height: 2.4rem;
}
.mv-section__text--blue {
  color: var(--color-primary-deep);
  line-height: 68px;
}

/* =========================================
   5. Shared section title
   ========================================= */
.h-section__title {
  margin: 0 auto 20px;
  text-align: center;
}

.h-section__title-text {
  color: var(--color-text);
  font-size: 2rem;
  font-family: var(--font-jp);
  font-weight: 600;
  position: relative;
  margin: 0 auto;
  width: fit-content;
}
.h-section__title-text::before {
  content: "";
  position: absolute;
  left: -80px;
  top: 50%;
  width: 60px;
  height: 5px;
  background-color: var(--color-accent);
}

/* =========================================
   6. Project section
   ========================================= */
.project-section {
  width: 100%;
  background-color: white;
  padding: 50px 20px;
  text-align: center;
  margin-bottom: 50px;
}

.project-section__title-border {
  width: 80px;
  height: 5px;
  margin: 10px auto;
  background-color: var(--color-accent);
}

.project-section__quote-text {
  color: var(--color-primary);
  font-size: 24px;
  font-family: var(--font-jp);
  font-weight: 600;
  margin-bottom: 30px;
}

.project-section__mission-text {
  color: var(--color-text);
  font-size: 24px;
  font-family: var(--font-jp);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: 40px;
}

.project-section__sub-paragraph,
.project-section__paragraph {
  color: var(--color-text);
  font-size: 16px;
  font-family: var(--font-jp);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: 40px;
}
.project-section__sub-paragraph {
  width: 80%;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}

.project-section__main-text {
  width: 80%;
  max-width: var(--content-max);
  margin: 0 auto;
}

/* --- color circles (shared pattern) --- */
.project-section__color-circles,
.intern-section__color-circles {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-bottom: 50px;
}
.project-section__circle,
.intern-section__circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.project-section__circle--light-blue,
.intern-section__circle--light-blue   { background-color: var(--circle-1); }
.project-section__circle--blue,
.intern-section__circle--blue          { background-color: var(--circle-2); }
.project-section__circle--dark-blue,
.intern-section__circle--dark-blue     { background-color: var(--circle-3); }
.project-section__circle--darker-blue,
.intern-section__circle--darker-blue   { background-color: var(--circle-4); }
.project-section__circle--deep-blue,
.intern-section__circle--deep-blue     { background-color: var(--circle-5); }

/* =========================================
   7. About section
   ========================================= */
.about-section {
  width: 100%;
  padding: 50px 20px;
  background: var(--color-bg-pale-blue);
  text-align: center;
}

.about-section__title {
  margin-bottom: 30px;
}
.about-section__title-text {
  color: var(--color-text);
  font-size: 32px;
  font-family: var(--font-jp);
  font-weight: 600;
}
.about-section__title-border {
  width: 80px;
  height: 5px;
  background-color: var(--color-accent);
  margin: 10px auto;
}

.about-section__info {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.about-section__info-item {
  width: 80%;
  max-width: var(--content-max);
  border-bottom: 1px solid var(--color-line);
  padding: 20px 0;
}
.about-section__info-content {
  display: flex;
  justify-content: space-between;
  color: var(--color-text);
  font-size: 14px;
  font-family: var(--font-jp);
  font-weight: 300;
  text-align: left;
}
.about-section__info-representative {
  font-size: 16px;
  font-weight: 500;
}
.about-section__info-position {
  margin-top: 5px;
  font-size: 14px;
  color: var(--color-text);
  font-family: var(--font-jp);
  font-weight: 300;
}

/* =========================================
   8. Information section
   ========================================= */
.information-section {
  width: 100%;
  padding: 50px 20px;
  background-color: white;
}

.information-section__title {
  text-align: center;
  margin-bottom: 20px;
}
.information-section__title-heading {
  display: inline-flex;
  align-items: center;
}
.information-section__heading-line {
  width: 50px;
  height: 5px;
  background-color: var(--color-accent);
  margin-right: 10px;
}
.information-section__title-letter {
  color: var(--color-text);
  font-size: 32px;
  font-family: var(--font-jp);
  font-weight: 600;
  text-transform: capitalize;
}

.information-section__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.information-section__item {
  width: 80%;
  max-width: var(--content-max);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-line);
}
.information-section__label {
  background-color: var(--color-primary);
  color: white;
  font-size: 14px;
  font-family: var(--font-jp);
  font-weight: 600;
  padding: 5px 10px;
  width: 120px;
  text-align: center;
}
.information-section__date {
  color: #DDDDDD;
  font-size: 14px;
  font-family: var(--font-jp);
  font-weight: 600;
}
.information-section__text {
  color: var(--color-text);
  font-size: 14px;
  font-family: var(--font-jp);
  font-weight: 300;
  line-height: 27px;
  flex-grow: 1;
  margin-left: 20px;
}

/* =========================================
   9. Intern section
   ========================================= */
.intern-section {
  width: 100%;
  background-color: var(--color-bg-pale-blue);
  padding: 50px 20px;
  text-align: center;
}

.intern-section__title-border {
  width: 80px;
  height: 5px;
  margin: 10px auto;
  background-color: var(--color-accent);
}

.intern-section__quote-text {
  color: var(--color-primary);
  font-size: 24px;
  font-family: var(--font-jp);
  font-weight: 600;
  margin-bottom: 30px;
}

.intern-section__mission-text {
  color: var(--color-text);
  font-size: 24px;
  font-family: var(--font-jp);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: 40px;
}

.intern-section__sub-paragraph,
.intern-section__paragraph {
  color: var(--color-text);
  font-size: 16px;
  font-family: var(--font-jp);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: 40px;
}
.intern-section__sub-paragraph {
  width: 80%;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}

.intern-section__main-text {
  width: 80%;
  max-width: var(--content-max);
  margin: 0 auto;
}

.intern-section__button-container {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  margin-bottom: 30px;
  gap: 30px;
}
.intern-section__button {
  font-size: 16px;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-jp);
}
.intern-section__button--poster { background-color: var(--color-green); }
.intern-section__button--apply  { background-color: var(--color-primary); }

.intern-section__close-date {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text);
}

/* =========================================
   10. Laboratory section
   ========================================= */
.laboratory-section {
  width: 100%;
  padding: 50px 20px;
  background-color: white;
}

/* --- フィルタUI --- */
.lab-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: var(--content-max);
  margin: 0 auto 32px;
}
.lab-filter__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}
.lab-filter__label {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-jp);
  color: var(--color-primary);
}
.lab-filter__select {
  padding: 10px 14px;
  border: 1px solid var(--color-line-light);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-jp);
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.lab-filter__select:focus {
  border-color: var(--color-primary);
  outline: none;
}

/* --- カードグリッド --- */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.lab-card {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lab-card:hover,
.lab-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  outline: none;
}
.lab-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(42, 65, 152, 0.4);
}

/* サムネイル */
.lab-card__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: #f0f0f0;
}
.lab-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lab-card__noimage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    #ededed,
    #ededed 10px,
    #f5f5f5 10px,
    #f5f5f5 20px
  );
  color: #aaa;
  font-size: 14px;
  font-family: var(--font-jp);
  letter-spacing: 0.05em;
}

/* 分野バッジ（サムネイル左上） */
.lab-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--color-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-jp);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  line-height: 1.3;
}

/* カード本文 */
.lab-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
}
.lab-card__pref {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.06);
  font-size: 12px;
  font-weight: 650;
  font-family: var(--font-jp);
  line-height: 1;
}
.lab-card__name {
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-jp);
  color: var(--color-text);
  line-height: 1.4;
  word-break: break-word;
}
.lab-card__institute {
  font-size: 13px;
  font-family: var(--font-jp);
  color: var(--color-text-muted);
  word-break: break-word;
}
.lab-card__title {
  font-size: 14px;
  font-family: var(--font-jp);
  color: var(--color-text);
  font-weight: 300;
  line-height: 1.6;
  word-break: break-word;
}

/* 0件メッセージ */
.lab-grid__empty {
  text-align: center;
  font-family: var(--font-jp);
  color: var(--color-text-muted);
  margin: 40px auto 0;
}

/* =========================================
   11. FAQ section
   ========================================= */
.faq-section {
  width: 100%;
  padding: 50px 20px;
  background: var(--color-bg-pale-blue);
  text-align: center;
}

.faq-section__title {
  margin-bottom: 30px;
}
.faq-section__title-text {
  color: var(--color-text);
  font-size: 32px;
  font-family: var(--font-jp);
  font-weight: 600;
}
.faq-section__title-border {
  width: 80px;
  height: 5px;
  background-color: var(--color-accent);
  margin: 10px auto;
}

.faq-section__info {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.faq-section__info-question {
  width: 80%;
  max-width: var(--content-max);
  border-bottom: 0.5px dotted #d3d3d3;
  padding: 20px 0;
}
.faq-section__info-answer {
  width: 80%;
  max-width: var(--content-max);
  border-bottom: 1px solid var(--color-line);
  padding: 20px 0;
}
.faq-section__info-content {
  display: flex;
  justify-content: space-between;
  color: var(--color-text);
  font-size: 14px;
  font-family: var(--font-jp);
  font-weight: 300;
  text-align: left;
}
.faq-section__info-representative {
  font-size: 16px;
  font-weight: 500;
}
.faq-section__info-position {
  margin-top: 5px;
  font-size: 14px;
  color: var(--color-text);
  font-family: var(--font-jp);
  font-weight: 300;
}

.faq-section__quote {
  color: var(--color-primary);
  font-size: 24px;
  font-family: var(--font-jp);
  font-weight: 600;
  margin-bottom: 30px;
  text-align: center; /* ← これが抜けていた */
}

.faq-section__category {
  color: var(--color-text);
  font-size: 16px;
  font-family: var(--font-jp);
  font-weight: 600;
  margin-bottom: 10px;
  margin-top: 30px;
}
.faq-section__sub-paragraph {
  width: 80%;
  max-width: var(--content-max);
  margin: 0 auto 40px;
  color: var(--color-text);
  font-size: 16px;
  font-family: var(--font-jp);
  font-weight: 300;
  line-height: 1.8;
}

.faq-section__button-container {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  margin-bottom: 30px;
  gap: 30px;
}
.faq-section__button {
  font-size: 16px;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-jp);
  background-color: var(--color-primary);
}

/* --- FAQ featured (動的出力) — 左寄せ強制 ---
   テーマ側が生成するマークアップの都合で詳細度・上書きが
   必要なため、このブロックの !important は残置している。 */
.faq-section__info--dynamic .faq-section__info-answer {
  justify-content: flex-start !important;
  align-items: flex-start !important;
  gap: 8px !important;
  text-align: left !important;
}
.faq-section__info--dynamic .faq-section__info-answer::before {
  content: none !important;
}
.faq-section__info--dynamic .faq-section__info-answer .faq-section__info-content {
  display: block !important;
  flex: 1 1 auto !important;
  width: auto !important;
  max-width: 100% !important;
  text-align: left !important;
  margin: 0 !important;
  padding: 0 !important;
}
.faq-section__info--dynamic .faq-section__info-answer .faq-section__info-content,
.faq-section__info--dynamic .faq-section__info-answer .faq-section__info-content * {
  text-align: left !important;
}
/* "A." 直後の最初の <p> だけ inline 化して改行を潰す */
.faq-section__info--dynamic .faq-section__info-answer .faq-section__info-content > p:first-child {
  display: inline !important;
  margin: 0 !important;
}
.faq-section__info--dynamic .faq-section__info-answer .faq-section__info-content > p {
  margin: 0 !important;
}

/* --- FAQ アコーディオン（トップページ / lab ページ共通） --- */
.faq-section__info--dynamic .faq-section__info-question {
  cursor: pointer;
  position: relative;
  padding-right: 40px;
  transition: background-color 0.2s ease;
}
.faq-section__info--dynamic .faq-section__info-question:hover {
  background-color: #f0f4fa;
}
.faq-section__info--dynamic .faq-section__info-question::after {
  content: '＋';
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--color-primary);
}
.faq-section__info--dynamic .faq-section__info-question.is-open::after {
  content: '−';
}
/* 回答は初期状態で非表示。.is-open で表示。
   .faq-section__info-answer は上の featured ルールで
   flex 化しているため、開いた状態も flex に揃える。 */
.faq-section__info--dynamic .faq-section__info-answer {
  display: none !important;
}
.faq-section__info--dynamic .faq-section__info-answer.is-open {
  display: flex !important;
}

/* =========================================
   12. Message section
   ========================================= */
.message-section {
  width: 100%;
  padding: 50px 0;
  background-color: var(--color-bg-pale-blue);
}

.message-section__heading {
  text-align: center;
  margin-bottom: 50px;
}
.message-section__heading-text {
  display: inline-block;
  text-align: center;
}
.message-section__heading-letter {
  color: var(--color-text);
  font-size: 32px;
  font-family: var(--font-jp);
  font-weight: 600;
  text-transform: capitalize;
}
.message-section__heading-border {
  width: 80px;
  height: 5px;
  background-color: #E9DAB4;
  margin: 10px auto 0;
}

.message-section__content {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  padding: 0 20px;
}

.message-section__image-container {
  position: relative;
  width: 479px;
  height: 600px;
}
.message-section__yellow-box {
  position: absolute;
  width: 55px;
  height: 52px;
  background-color: var(--color-accent);
  z-index: 1;
}
.message-section__yellow-box--top-left {
  top: -10px;
  left: -10px;
}
.message-section__yellow-box--bottom-right {
  bottom: -10px;
  right: -10px;
}
.message-section__image {
  width: 100%;
  height: auto;
  z-index: 2;
  position: relative;
}

.message-section__description {
  max-width: 600px;
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
}
.message-section__subtitle {
  color: var(--color-primary);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}
.message-section__highlight {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 1rem;
}
.message-section__text {
  font-weight: 300;
  color: var(--color-text);
}
.message-section__professor,
.message-section__representative {
  margin-top: 20px;
  font-size: 14px;
  font-weight: 300;
  color: var(--color-text);
}

/* =========================================
   13. Support section
   -----------------------------------------
   旧 .wrapper__support-img（flex版）と
   section#support .support-logos（grid版）が併存していた。
   現行で使われている grid 版（6カラム優先度レイアウト）に統一。
   ========================================= */
.support-section {
  width: 100%;
  padding: 50px 0;
}

/* 旧 flex 版（後方互換のため残置。新規マークアップでは grid 版を使用） */
.wrapper__support-img {
  display: flex;
  justify-content: space-between;
  max-width: 80%;
  margin: 0 auto;
  flex-wrap: wrap;
}
.wrapper__support-img img {
  width: 16%;
  margin: 1rem 1.4rem;
}

/* grid 版（現行） */
section#support .support-logos {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  margin: 24px auto 0;
  width: 100%;
  max-width: 1000px;
}
section#support .support-logo {
  display: block;
}
section#support .support-logo__box {
  background: #ffffff;
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
section#support .support-logo__img {
  max-width: 85%;
  max-height: 85%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* 優先度別の幅・形状 */
section#support .support-logo--p1 { grid-column: span 2; }
section#support .support-logo--p1 .support-logo__box { aspect-ratio: 1 / 1; }
section#support .support-logo--p2 { grid-column: span 4; }
section#support .support-logo--p2 .support-logo__box { aspect-ratio: 5 / 2; }
section#support .support-logo--p3 { grid-column: 1 / -1; }
section#support .support-logo--p3 .support-logo__box { aspect-ratio: 3 / 1; }

/* =========================================
   14. Pick Up section
   -----------------------------------------
   Phase 5/6 のパッチを本体に統合済み。
   見出しは縦並び・中央寄せ、カルーセルは全幅。
   ========================================= */
.pickup-section {
  width: 100%;
  padding: 50px 0;
  background-color: var(--color-bg-pale-blue);
}

.pickup-section__wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pickup-section__heading {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  margin: 0 auto 20px;
  text-align: center;
}
.pickup-section__heading-line {
  width: 50px;
  height: 5px;
  background-color: var(--color-accent);
  margin-bottom: 10px;
}
.pickup-section__heading-text {
  font-size: 24px;
  font-family: var(--font-jp);
  font-weight: 600;
  margin: 0 auto 10px;
  text-align: center;
}
.pickup-section__heading-subtext {
  font-size: 18px;
  font-family: var(--font-jp);
  font-weight: 300;
  margin: 0 auto 10px;
  text-align: center;
}

.pickup-section__color-circles {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px auto 0;
  gap: 10px;
}
.pickup-section__circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 10px;
}
.pickup-section__circle--light-blue  { background-color: #D3E9F6; }
.pickup-section__circle--blue        { background-color: var(--circle-2); }
.pickup-section__circle--dark-blue   { background-color: var(--circle-3); }
.pickup-section__circle--darker-blue { background-color: var(--circle-4); }
.pickup-section__circle--deep-blue   { background-color: var(--circle-5); }

.pickup-section__carousel-wrapper {
  width: 100%;
  max-width: 1200px;
  position: relative;
  margin: 0 auto;
  padding: 0 20px;
}
.pickup-section__carousel {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}
.pickup-section__carousel-item {
  width: 300px;
  height: 200px;
  margin-right: 20px;
  position: relative;
}
.pickup-section__image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.pickup-section__overlay {
  position: absolute;
  bottom: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.5);
  color: #000;
  text-align: center;
  padding: 10px;
}

.pickup-section__button-container {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}
.pickup-section__button {
  background-color: var(--color-primary);
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font-jp);
}

/* --- Swiper (汎用) --- */
.swiper-container {
  width: 100%;
  margin: 0 auto;
  overflow-x: hidden;
}
.swiper-slide {
  width: auto;
  height: auto;
}
/* 汎用Swiperスライド画像 — aspect-ratioは各コンポーネントで上書き */
.swiper-slide img {
  width: 100%;
  object-fit: cover;
}

/* トップバナースライダー専用 */
.top-banner-slider .swiper-slide img {
  aspect-ratio: auto; /* 画像本来の比率を維持 */
  max-height: 500px;  /* PCで大きくなりすぎる場合の上限 */
  object-fit: cover;
  object-position: center;
}

.swiper-button-next::after,
.swiper-button-prev::after {
  content: '';
}
.swiper-button {
  position: relative;
  height: 80px;
}

/* Pick Up 内の Swiper 画像は 32:9 ではなく 16:10 に上書き */
.pickup-section .swiper-slide img {
  aspect-ratio: 16 / 10;
  width: 100%;
  height: auto;
  object-fit: cover;
}
.pickup-section .swiper-slide {
  height: auto;
}

/* --- Top banner slider --- */
.top-banner-slider {
  width: 100%;
  aspect-ratio: 32 / 9;
  overflow: hidden;
  margin-top: 0;
}
.top-banner-slider .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================================
   15. Contact section
   ========================================= */
.contact-section {
  width: 100%;
  padding: 50px 0;
  background-color: white;
  text-align: center;
}
.contact-section__heading {
  margin-bottom: 30px;
}
.contact-section__heading-line {
  width: 50px;
  height: 5px;
  background-color: var(--color-accent);
  margin: 0 auto 10px;
}
.contact-section__heading-text {
  font-size: 24px;
  font-family: var(--font-jp);
  font-weight: 600;
  margin-bottom: 10px;
}
.contact-section__subtext {
  font-size: 16px;
  font-family: var(--font-jp);
  color: var(--color-primary);
  margin: 1rem auto;
}
.contact-section__buttons {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 20px;
}
.contact-section__button {
  padding: 15px 40px;
  font-size: 16px;
  color: white;
  text-decoration: none;
  border-radius: 20px;
  font-family: var(--font-jp);
}
.contact-section__button--inquiry { background-color: var(--color-green); }
.contact-section__button--donate  { background-color: var(--color-red); }

/* =========================================
   16. Footer
   ========================================= */
.footer-section {
  width: 100%;
  padding: 20px 0;
  background-color: var(--color-bg-pale-blue);
  text-align: center;
  font-family: var(--font-jp);
}
.footer-section__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}
.footer-section__logo {
  font-size: 18px;
  font-weight: 600;
}
.footer-section__nav {
  display: flex;
  gap: 20px;
}
.footer-section__link {
  font-size: 14px;
  color: var(--color-text);
  text-decoration: none;
}
.footer-section__link:hover {
  text-decoration: underline;
}
.footer-section__copyright {
  font-size: 12px;
  color: var(--color-text);
  margin-top: 10px;
}

/* wp_nav_menu 出力のフッターナビを横並びに */
.footer-section__nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section__nav-list li {
  display: inline-block;
}

.footer-section__nav-list a {
  font-size: 14px;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}

.footer-section__nav-list a:hover {
  text-decoration: underline;
}

/* スマホは縦並びグリッドに */
@media (max-width: 768px) {
  .footer-section__nav-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
    margin: 0.5rem 1.5rem;
    width: auto;
  }

  .footer-section__nav-list li {
    width: auto;
    text-align: left;
    white-space: nowrap;
  }
}

/* =========================================
   17. Contact form page
   ========================================= */
.contact-form-section {
  padding: 50px;
  background-color: var(--color-bg-faint);
}

.title-header {
  text-align: center;
  margin: 1rem 6rem 30px;
}
.title-header .title-header-wrapper h1 {
  font-size: 1rem;
  color: var(--color-text);
  margin-right: 8rem;
}
.title-header .title-header-wrapper h2 {
  font-size: 2.4rem;
  color: var(--color-primary);
  font-weight: bold;
  display: inline-block;
  padding: 10px 30px;
}
.title-header-wrapper {
  border: 2px solid var(--color-primary);
  padding: 100px 50px;
}

/* breadcrumb は元ファイルで複数回定義されていたため統合 */
.breadcrumb {
  text-align: center;
  margin: 1rem 6rem 40px;
}
.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 14px;
}
.breadcrumb a:hover {
  text-decoration: underline;
}

/* contact-form-description も複数回定義されていたため統合 */
.contact-form-description {
  margin: 0 auto 80px;
  max-width: var(--content-max);
  font-size: 16px;
  color: var(--color-text);
  line-height: 1.6;
}
.contact-form-description p {
  margin-bottom: 10px;
  font-size: 18px;
  color: var(--color-text);
}

.contact-title {
  display: flex;
  align-items: center;
  margin-block: 60px;
  justify-content: center;
}
.contact-title__line {
  width: 50px;
  height: 5px;
  background-color: var(--color-accent);
  margin-right: 15px;
}
.contact-title__text {
  font-size: 24px;
  color: var(--color-text);
  font-weight: bold;
  line-height: 1.2;
}

.contact-form {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 20px;
  background-color: var(--color-bg-faint);
  border-radius: var(--radius-md);
}
.contact-form__memo {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--color-primary);
}
.contact-form__group p {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.contact-form__group.doui {
  justify-content: center;
  color: var(--color-primary-deep);
}
.contact-form__label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--color-primary);
  width: 20%;
  text-align: right;
}
.wpcf7-form-control-wrap {
  position: relative;
  width: 80%;
}
.contact-form__input,
.contact-form__textarea,
.contact-form__select {
  width: 80%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  font-size: 16px;
}
.contact-form__textarea {
  height: 100px;
}
.contact-form textarea {
  min-height: 150px;
}
.contact-form__checkbox {
  margin-right: 10px;
}
.contact-form__button {
  width: 100%;
  margin: 0 auto;
  text-align: center;
}
.contact-form__required {
  color: #fff;
  background-color: var(--color-primary);
  padding: 0.4rem;
  margin-left: 1rem;
}
.contact-form .consent {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.contact-form .consent input {
  margin-right: 10px;
}
.contact-form__button p input {
  width: 50%;
  padding: 12px;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
}
.contact-form__button p input:hover {
  background-color: #005a9c;
}

/* CF7 Turnstile */
.wpcf7 .cf7-turnstile-wrap {
  display: flex;
  justify-content: center;
  margin: 18px 0 10px;
}
.wpcf7 .cf7-turnstile-wrap .cf-turnstile,
.wpcf7 .cf7-turnstile-wrap iframe {
  margin: 0 auto !important;
  display: block;
}

/* =========================================
   18. Case study
   ========================================= */
.case-study-section {
  margin: 20px auto;
  width: 80%;
  display: flex;
  justify-content: space-between;
}
.case-study-header h1 {
  font-size: 24px;
  color: #333;
  margin-bottom: 10px;
}
.case-study-header h2 {
  font-size: 18px;
  color: #666;
}
.case-study-content {
  margin-right: 20px;
  width: 70%;
}
.case-study-link {
  display: flex;
  padding-top: 2rem;
}
.case-study-item {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-bg-light-blue);
  padding-bottom: 20px;
}
.case-study-image {
  width: 35%;
}
.case-study-image img {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 5px solid var(--color-accent);
  box-sizing: border-box;
}
.case-study-details {
  flex: 1;
  width: 70%;
  margin-left: 20px;
}
.case-study-details h3 {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 10px;
}
.case-study-details p {
  font-size: 14px;
  color: #333;
}
.case-study-date {
  color: var(--color-text-faint);
}
.case-study-sidebar {
  width: 25%;
}

/* --- Archive sidebar --- */
.archive-section {
  padding: 20px;
  margin: 20px 0;
}
.archive-section h3 {
  font-size: 20px;
  color: var(--color-link-heading);
  font-family: var(--font-jp);
  font-weight: 600;
  text-align: center;
  margin-bottom: 5px;
}
.archive-section .archive-subtitle {
  font-size: 14px;
  color: var(--color-accent);
  text-align: center;
  font-family: var(--font-jp);
  margin-bottom: 15px;
  letter-spacing: 1px;
}
.archive-section ul {
  list-style: none;
  padding-left: 0;
}
.archive-section li {
  font-size: 20px;
  color: var(--color-link-heading);
  font-family: var(--font-jp);
  font-weight: 600;
  margin-bottom: 10px;
  position: relative;
  cursor: pointer;
}
.archive-section li::after {
  content: "▼";
  font-size: 12px;
  color: var(--color-accent);
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* --- New posts sidebar --- */
.new-posts {
  text-align: center;
  padding: 20px;
  border-radius: var(--radius-md);
}
.new-posts h3 {
  font-size: 20px;
  color: var(--color-link-heading);
  font-family: var(--font-jp);
  font-weight: 600;
}
.new-posts .new-post-subtitle {
  font-size: 14px;
  color: var(--color-accent);
  letter-spacing: 1px;
  margin-bottom: 15px;
}
.recent-post {
  margin-bottom: 30px;
}
.recent-post a {
  text-decoration: none;
  color: inherit;
}
.recent-post-image {
  width: 100%;
  max-width: 180px;
  height: auto;
  margin: 0 auto 10px;
}
.recent-post img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 5px solid var(--color-accent);
}
.recent-post-date {
  font-size: 14px;
  color: var(--color-text-faint);
  display: block;
  margin-bottom: 10px;
}
.recent-post h4 {
  font-size: 16px;
  font-weight: bold;
  color: var(--color-primary-deep);
  margin: 0 auto 10px;
  max-width: 180px;
}

/* =========================================
   19. Privacy policy
   ========================================= */
.privacy-policy-section {
  max-width: 80vw;
  margin: 0 auto;
}
.privacy-policy-section h2 {
  font-size: 1.4rem;
  font-weight: bold;
  margin-top: 2rem;
}

/* =========================================
   20. Pagination
   ========================================= */
.pagination-container {
  text-align: center;
  margin-top: 40px;
}
.pagination-container .page-numbers {
  display: inline-block;
  margin: 0 5px;
  padding: 8px 12px;
  background: #eee;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
}
.pagination-container .page-numbers.current {
  background: #333;
  color: #fff;
  font-weight: bold;
}

/* =========================================
   21. Custom simple table
   ========================================= */
.custom-table-wrapper {
  max-width: 960px;
  margin: 0 auto 2rem;
  padding: 0 20px;
  box-sizing: border-box;
}
.custom-simple-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.custom-simple-table td {
  border-bottom: 1px solid var(--color-line-light);
  padding: 10px 15px;
  text-align: left;
}
.custom-simple-table tr:first-child td {
  font-weight: bold;
  background-color: #ffffff;
  border-bottom: 2px solid var(--color-line-light);
}

/* =========================================
   22. Floating popup buttons
   -----------------------------------------
   旧ファイルでは3ブロックに分かれていたものを統合。
   PC = 横並び / スマホ = 縦並び（レスポンシブ側で指定）。
   ========================================= */
.floating-popup-buttons {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: center;
}

.floating-popup-buttons .mailinglist-popup {
  position: relative;
  inset: auto;
  background-color: var(--color-primary);
  color: white;
  border-radius: 30px;
  font-family: var(--font-jp);
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  min-width: 240px;
  padding: 12px 20px;
  text-align: center;
}
.floating-popup-buttons .mailinglist-popup:hover {
  background-color: #2c6cad;
  transform: translateY(-3px);
}
.floating-popup-buttons .mailinglist-popup:active {
  transform: scale(0.95);
  box-shadow: 0 0 0 4px rgba(61, 137, 214, 0.3);
}

.mailinglist-popup__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.mailinglist-popup__inner p {
  margin: 0;
  line-height: 1.5;
}

#mailinglist {
  scroll-margin-top: 120px;
}

/* =========================================
   23. Lab modal (Popup Maker / popup ID:527)
   ========================================= */
#popmake-527.pum-container {
  width: min(1040px, calc(100vw - 40px)) !important;
  max-width: 1040px !important;
}
#popmake-527 .pum-content {
  padding: 24px 26px !important;
}
#popmake-527 .pum-title {
  display: none !important;
}

#popmake-527 .lab-modal__layout {
  display: grid;
  grid-template-columns: minmax(440px, 520px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  max-width: 920px;
  margin: 0 auto;
}
#popmake-527 .lab-modal__right {
  max-width: 440px;
}

#popmake-527 .lab-modal__titlebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 14px;
  row-gap: 6px;
  align-items: start;
  margin: 0 0 10px;
}
#popmake-527 .lab-modal__title {
  grid-column: 1;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.35;
  margin: 0;
  color: #222;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#popmake-527 .lab-modal__institute {
  grid-column: 1;
  font-size: 14px;
  font-weight: 650;
  opacity: 0.75;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#popmake-527 .lab-modal__program {
  grid-column: 1;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
  color: #333;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#popmake-527 .lab-modal__webbtn {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.06);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
#popmake-527 .lab-modal__webbtn:hover {
  background: rgba(0, 0, 0, 0.10);
}

#popmake-527 .lab-modal__divider {
  height: 1px;
  width: 100%;
  background: rgba(0, 0, 0, 0.10);
  margin: 0 0 14px;
}

#popmake-527 .lab-modal__gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
}
#popmake-527 .lab-modal__figure {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 18px;
  background: transparent;
}
#popmake-527 .lab-modal__img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block;
}

#popmake-527 .lab-modal__carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
#popmake-527 .lab-modal__slide {
  position: absolute;
  inset: 0;
  transform: translateX(100%);
  transition: transform 600ms ease;
  will-change: transform;
}
#popmake-527 .lab-modal__slide.is-active {
  transform: translateX(0);
}
#popmake-527 .lab-modal__slide.is-exit {
  transform: translateX(-100%);
}
#popmake-527 .lab-modal__slide.no-anim {
  transition: none !important;
}

#popmake-527 .lab-modal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.2;
}
#popmake-527 .lab-modal__meta > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.06);
}
#popmake-527 .lab-modal__meta strong {
  font-weight: 700;
  opacity: 0.7;
}
#popmake-527 .lab-modal__prefbadge {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.08);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

#popmake-527 .lab-modal__study {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.035);
}
#popmake-527 .lab-modal__study-label {
  font-size: 12px;
  font-weight: 750;
  opacity: 0.7;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
#popmake-527 .lab-modal__study-text {
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 8px;
}
#popmake-527 .lab-modal__study-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.06);
}
#popmake-527 .lab-modal__study-link:hover {
  background: rgba(0, 0, 0, 0.10);
}

#popmake-527 .lab-modal__body {
  font-size: 15px;
  line-height: 1.75;
  margin-top: 4px;
}
#popmake-527 .lab-modal__note {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
#popmake-527 .lab-modal__note-head {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0.8;
  margin-bottom: 10px;
}
#popmake-527 .lab-modal__note-body {
  font-size: 14px;
  line-height: 1.7;
}
#popmake-527 .lab-modal__note-empty {
  opacity: 0.55;
}

/* =========================================
   24. Safety net — 横スクロール封じ込め
   -----------------------------------------
   原因要素を個別特定する代わりに、画面幅を超える
   要素をまとめて抑え込む保険的コード。
   将来 MV 等を flex/grid で組み直して原因を解消できたら
   このブロックは削除を検討する。
   ========================================= */
@media (max-width: 768px) {
  body > * {
    max-width: 100vw;
    overflow-x: hidden;
  }
  .c-container,
  section,
  main {
    max-width: 100%;
  }
}

/* =========================================
   25. Responsive — max-width: 1024px
   ========================================= */
@media (max-width: 1024px) {
  .mv-section__text--black,
  .mv-section__text--blue {
    font-size: 1.8rem;
  }

  /* PC用ナビを隠してハンバーガーを表示 */
  .header__nav {
    display: none;
  }
  .header__hamburger {
    display: flex;
  }
  .header__hamburger.active {
    background-color: var(--color-primary-deep);
    z-index: 1000;
  }
}

/* =========================================
   26. Responsive — max-width: 768px
   -----------------------------------------
   元ファイルで複数箇所に散在していた 768px の
   メディアクエリを 1 ブロックに集約。
   ========================================= */
@media (max-width: 768px) {
  /* --- 表示切り替え --- */
  .sp-only   { display: block; }
  .sp-only-f { display: flex; }
  .pc-only   { display: none; }
  .pc-only-f { display: none; }

  /* --- 共通見出し --- */
  .h-section__title-text {
    font-size: 1.4rem;
  }
  .h-section__title-text::before {
    width: 30px;
    left: -40px;
  }

  /* --- header --- */
  .header {
    width: 100%;
    padding: 12px 16px;
  }

  /* --- project --- */
  .project-section__quote-text {
    width: fit-content;
    margin: 1rem auto;
    text-align: left;
  }
  .project-section__quote-text-font {
    font-size: 1.2rem;
  }
  .project-section__mission-text {
    font-size: 1rem;
  }

  /* --- title-header --- */
  .title-header {
    margin: 1rem;
  }
  .title-header-wrapper {
    padding: 50px;
  }
  .title-header .title-header-wrapper h1 {
    margin-right: 0;
  }
  .title-header .title-header-wrapper h2 {
    font-size: 1.8rem;
    padding: 0;
  }

  /* --- MV --- */
  #mv-section {
    height: auto;
  }
  .mv-section__bgcircles {
    background-size: cover;
    height: auto;
    aspect-ratio: 16 / 8;
  }
  .mv-section__image-container {
    width: 70%;
    top: 10%;
    position: absolute;
  }
  .mv-section__yellow-box--top-right,
  .mv-section__yellow-box--bottom-left {
    display: none;
  }
  .mv-section__image {
    left: auto;
    right: 0;
    top: 10%;
  }
  .mv-section__text {
    width: fit-content;
    left: 5%;
    top: 14%;
  }
  .mv-section__text--black,
  .mv-section__text--blue {
    font-size: 1.2rem;
    line-height: 1rem;
    letter-spacing: 0.3rem;
  }

  /* --- information --- */
  .information-section__item {
    display: block;
  }
  .information-section__text {
    margin-left: 0;
  }

  /* --- laboratory（旧 Phase 2 ④） --- */
  .laboratory-section__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 0;
  }
  .laboratory-section__text {
    margin-left: 0;
    width: 100%;
  }
  .laboratory-section__institute {
    white-space: normal;
    word-break: break-word;
    display: block;
    margin-left: 0;
    margin-top: 4px;
    font-size: 0.85em;
  }
  .laboratory-section__labelwrap {
    flex-direction: row;
    gap: 8px;
    align-items: center;
  }
  .laboratory-section__label {
    width: auto;
    padding: 5px 12px;
  }
  .laboratory-section__labname {
    word-break: break-word;
  }

  /* --- message --- */
  .message-section__content {
    display: block;
  }
  .message-section__image-container {
    width: 100%;
    height: auto;
    margin-bottom: 2rem;
  }

  /* --- support（旧 Phase 2 ⑥） --- */
  section#support .support-logos {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 16px;
  }
  section#support .support-logo--p1,
  section#support .support-logo--p2,
  section#support .support-logo--p3 {
    grid-column: 1 / -1;
  }
  section#support .support-logo--p1 .support-logo__box,
  section#support .support-logo--p2 .support-logo__box,
  section#support .support-logo--p3 .support-logo__box {
    aspect-ratio: 5 / 2;
    max-height: 180px;
  }
  section#support .support-logo__img {
    max-height: 130px;
  }

  /* --- pickup --- */
  .pickup-section {
    padding: 30px 10px;
  }
  .pickup-section__heading {
    text-align: center;
    padding: 0 16px;
  }
  .pickup-section__heading-subtext {
    font-size: 16px;
    margin-bottom: 5px;
  }
  .pickup-section__color-circles {
    gap: 5px;
    justify-content: center;
  }
  .pickup-section__circle {
    width: 8px;
    height: 8px;
  }
  .pickup-section__carousel {
    flex-direction: column;
    align-items: center;
  }
  .pickup-section__carousel-wrapper {
    width: 100%;
    padding: 0 16px;
  }
  .pickup-section__carousel-item {
    width: 100%;
    height: auto;
    margin-right: 0;
    margin-bottom: 15px;
  }
  .pickup-section__overlay {
    padding: 5px;
    font-size: 14px;
  }
  .pickup-section__button {
    font-size: 14px;
    padding: 8px 16px;
  }

  /* --- support 旧 flex 版 --- */
  .wrapper__support-img img {
    width: 38%;
    margin: 1rem;
  }

  /* --- breadcrumb --- */
  .breadcrumb {
    margin: 1rem;
  }
  .breadcrumb a {
    text-align: left;
  }

  /* --- contact form --- */
  .contact-form {
    padding: 0;
  }
  .contact-form__group p {
    display: block;
  }
  .contact-form__label {
    width: 100%;
    text-align: left;
  }
  .contact-form__input,
  .contact-form__textarea,
  .contact-form__select {
    width: 100%;
  }
  .contact-section__button {
    padding: 15px;
  }
  .wpcf7-spinner {
    display: none;
  }

  /* --- footer --- */
  .footer-section__nav {
    margin: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    text-align: left;
  }

  /* --- case study（旧 Phase 2 ⑤） --- */
  .case-study-section {
    display: block;
    width: 100%;
    padding: 0 16px;
    margin: 20px auto;
  }
  .case-study-content,
  .case-study-sidebar {
    width: 100%;
    margin: 0;
  }
  .case-study-link {
    flex-direction: column;
    padding-top: 1rem;
  }
  .case-study-image {
    width: 100%;
    margin-right: 0;
    margin-bottom: 1rem;
  }
  .case-study-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
  }
  .case-study-details {
    width: 100%;
    margin-left: 0;
  }
  .case-study-details h3 {
    font-size: 1.2rem;
  }

  /* --- 個別事例ページ（旧 Phase 3 ⑦） --- */
  .case-study-inner-wrapper {
    display: block;
    gap: 0;
    padding: 16px;
    max-width: 100%;
  }
  .single-case-study-content {
    width: 100%;
    margin: 0;
  }
  .single-case-study-item {
    padding: 0;
  }
  .case-study-title {
    font-size: 1.4rem;
    line-height: 1.4;
    word-break: break-word;
    margin-top: 16px;
  }
  .yellow-border-img {
    width: 100%;
  }
  .multiple-img {
    flex-wrap: wrap;
    gap: 8px;
  }
  .multiple-img-content {
    margin: 0;
    width: 100%;
  }
  .activity-row {
    flex-wrap: wrap;
  }
  .sky-blue-label {
    flex-basis: auto;
    margin-bottom: 8px;
  }

  /* --- floating popup buttons（旧 Phase 3 ⑧）--- */
  .floating-popup-buttons {
    right: 10px;
    bottom: 10px;
    left: auto;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100vw - 20px);
    align-items: flex-end;
  }
  .floating-popup-buttons .mailinglist-popup {
    min-width: 0;
    width: auto;
    max-width: 240px;
    font-size: 12px;
    padding: 8px 16px;
    min-height: 50px;
  }
  .mailinglist-popup__inner p {
    font-size: 12px;
    line-height: 1.3;
  }
}

/* =========================================
   27. Responsive — Lab modal / Support
   ========================================= */
@media (max-width: 900px) {
  /* Lab modal */
  #popmake-527 .lab-modal__layout {
    grid-template-columns: 1fr;
    max-width: none;
  }
  #popmake-527 .lab-modal__right {
    max-width: none;
  }
  #popmake-527.pum-container {
    width: calc(100vw - 24px) !important;
  }
  #popmake-527 .pum-content {
    padding: 18px !important;
  }

  /* Support — タブレットは4カラム */
  section#support .support-logos {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  section#support .support-logo--p1 { grid-column: span 2; }
  section#support .support-logo--p2 { grid-column: 1 / -1; }
  section#support .support-logo--p3 { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  /* Lab modal */
  #popmake-527 .lab-modal__titlebar {
    grid-template-columns: 1fr;
  }
  #popmake-527 .lab-modal__webbtn {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  /* Support — モバイルは1カラム */
  section#support .support-logos {
    grid-template-columns: 1fr;
  }
  section#support .support-logo--p1,
  section#support .support-logo--p2,
  section#support .support-logo--p3 {
    grid-column: 1 / -1;
  }
}

/* =========================================
   28. Laboratory グリッド レスポンシブ強制
   ========================================= */
@media (max-width: 768px) {
  section#laboratory .lab-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  section#laboratory .lab-filter {
    flex-direction: column;
    gap: 12px;
  }
  section#laboratory .lab-filter__group {
    min-width: 0;
    width: 100%;
  }
}

/* =========================================
   29. FAQ archive page (/faq/)
   -----------------------------------------
   archive-faq.php から移動。/faq/ ページ専用スタイル。
   ========================================= */

.faq-search-bar {
  max-width: var(--content-max);
  margin: 0 auto 30px;
  padding: 0 20px;
}

.faq-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background-color: #F6F9FC;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  margin: 20px 0;
}

.faq-filter-form input[type="text"],
.faq-filter-form select {
  padding: 10px 14px;
  border: 1px solid var(--color-line-light);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  flex: 1;
  min-width: 180px;
  background-color: #fff;
  transition: border-color 0.3s;
}

.faq-filter-form input[type="text"]:focus,
.faq-filter-form select:focus {
  border-color: var(--color-primary);
  outline: none;
}

.faq-filter-form button[type="submit"] {
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.faq-filter-form button[type="submit"]:hover {
  background-color: var(--color-primary-dark);
}

.faq-clear-btn {
  margin-left: 8px;
  background-color: #ccc;
  color: #333;
  padding: 10px 14px;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.faq-clear-btn:hover {
  background-color: #bbb;
}

.faq-current-filters {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #666;
}

.faq-category-selected {
  margin-top: 8px;
  margin-left: 4px;
  display: inline-block;
  padding: 6px 12px;
  background-color: var(--color-accent);
  color: #000;
  font-weight: bold;
  border-radius: 4px;
  font-size: 0.95rem;
}

/* --- FAQ アコーディオン（/faq/ページ） --- */
.faq-parent-category {
  max-width: var(--content-max);
  margin: 0 auto;
}

.faq-parent-toggle {
  width: 100%;
  text-align: left;
  background-color: #ffffff;
  color: #000000;
  border: none;
  font-weight: bold;
  font-size: 1.3rem;
  font-family: var(--font-jp);
  padding: 1rem 1.5rem;
  border-bottom: 4px solid var(--color-accent);
  margin-top: 2rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.faq-parent-toggle:hover {
  background-color: #f9f9f9;
}

.faq-child-category {
  margin-left: 1rem;
}

.child-toggle {
  width: 100%;
  text-align: left;
  background-color: #EEF3FA;
  color: var(--color-primary);
  padding: 0.9rem 1.3rem;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font-jp);
  border: none;
  border-left: 5px solid var(--color-primary);
  border-radius: var(--radius-sm);
  margin: 0.8rem 0 0.5rem 0;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.child-toggle:hover {
  background-color: #DCE6F3;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1rem 1.5rem;
  background: #EEF3FA;
  border: none;
  font-weight: 600;
  font-size: 1.1rem;
  font-family: var(--font-jp);
  color: #000;
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin-bottom: 5px;
  transition: background-color 0.3s ease;
}

.faq-question:hover {
  background-color: #DCE6F3;
}

.faq-accordion {
  margin-bottom: 2rem;
}

.faq-answer {
  display: none;
  padding: 1rem 1.5rem;
  background: #fff;
  border-left: 4px solid var(--color-primary);
  margin-bottom: 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.faq-answer a,
.faq-question a {
  color: var(--color-primary);
  font-weight: bold;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.faq-answer a:hover,
.faq-question a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.faq-child-wrapper {
  padding-bottom: 1rem;
}

.faq-answer,
.faq-child-wrapper,
.faq-accordion {
  display: none;
}

.faq-answer.open,
.faq-child-wrapper.open,
.faq-accordion.open {
  display: block;
}

.toggle-icon {
  float: right;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--color-link-heading);
}

/* scroll-to-top ボタン */
.scroll-to-top-container {
  position: fixed;
  bottom: 30px;
  right: 20px;
  z-index: 999;
}

#scroll-to-top {
  background-color: var(--color-primary);
  color: #fff;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
}

#scroll-to-top:hover {
  background-color: var(--color-primary-dark);
}

/* =========================================
   30. ユーザー選択モーダル (front-page.php)
   ========================================= */
#user-select-modal {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.modal-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}
.modal-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 2em;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  max-width: 90%;
  width: 400px;
}
.modal-logo {
  width: 300px;
  margin-bottom: 1em;
}
.modal-buttons button {
  display: block;
  width: 100%;
  margin: 0.5em auto;
  padding: 0.8em;
  font-size: 1em;
  line-height: 1.4;
  border: none;
  background-color: #005bac;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}
.modal-buttons button:hover {
  background-color: #004080;
}