/* =========================================================
   mobile-home（中央スクロール内）専用
   - 基本は .iw-mhome 配下
   - Cover hero は保険として .iw-hero-* 単体でも効く
========================================================= */

:root {
  --mhome-gap: 12px;
  --mhome-radius: 16px;
  --mhome-shadow: 0 10px 22px rgba(0, 0, 0, .06);
  --mhome-border: rgba(0, 0, 0, .08);
  --mhome-text: #383838;
  --mhome-muted: rgba(0, 0, 0, .6);
  --mhome-bg: #fff;
}

.iw-mhome {
  display: block;
  color: var(--mhome-text);
  --vh100: calc(var(--vh, 1vh) * 100);
}

/* section helper（任意） */
.iw-mhome .iw-mhome-section {
  margin: 18px 0 0;
}

.iw-mhome .iw-mhome-title {
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: .02em;
  margin: 0 0 12px;
}

/* =========================================================
   A) Hero - Custom HTML version (.iw-mhome-hero)
========================================================= */
.iw-mhome .iw-mhome-hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--mhome-bg);
  border-radius: 18px;
}

.iw-mhome .iw-mhome-hero__img {
  width: 100%;
  height: auto;
  display: block;
}

/* 全面白fog（必要なら使う） */
.iw-mhome .iw-mhome-hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .0);
  pointer-events: none;
}

.iw-mhome .iw-mhome-hero.is-fog .iw-mhome-hero__overlay {
  background: rgba(255, 255, 255, .88);
}

/* コピー */
.iw-mhome .iw-mhome-hero__copy {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px 16px;
  pointer-events: none;
}

.iw-mhome .iw-mhome-hero__copyimg {
  width: min(92%, 520px);
  height: auto;
  display: block;
}

/* =========================================================
   B) Hero - Cover block version (.iw-hero-full)
   - Coverブロックに class: iw-hero-full
   - 白帯グループに class: iw-hero-band
   - SVG画像ブロックに class: iw-hero-copyimg
========================================================= */
.wp-block-cover.iw-hero-full,
.iw-mhome .wp-block-cover.iw-hero-full {
  min-height: calc(var(--vh, 1vh) * 100);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}

.wp-block-cover.iw-hero-full .wp-block-cover__inner-container,
.iw-mhome .wp-block-cover.iw-hero-full .wp-block-cover__inner-container {
  width: 100%;
}

.wp-block-cover.iw-hero-full .wp-block-cover__image-background,
.iw-mhome .wp-block-cover.iw-hero-full .wp-block-cover__image-background {
  object-fit: cover;
}

.iw-hero-band,
.iw-mhome .iw-hero-band {
  background: rgba(255, 255, 255, .75);
  padding: 28px 14px 14px;
  backdrop-filter: blur(5px);
  position: relative;
  margin-bottom: 40px;
}

.iw-hero-copyimg img,
.iw-mhome .iw-hero-copyimg img {
  width: min(92%, 520px);
  height: auto;
  display: block;
  margin: 0 auto;
}

@media (max-width: 768px) {

  .wp-block-cover.iw-hero-full,
  .iw-mhome .wp-block-cover.iw-hero-full {
    min-height: calc((var(--vh, 1vh) * 100) - 45px - env(safe-area-inset-bottom));
  }

}

/* =========================================================
   Contents（テキストボタン6個）
========================================================= */
.iw-mhome .iw-mhome-contents {
  margin-top: 14px;
}

.iw-mhome .iw-mhome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--mhome-gap);
}

.iw-mhome .iw-mhome-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 52px;
  padding: 14px 12px;
  border-radius: 14px;
  background: var(--mhome-bg);
  border: 1px solid var(--mhome-border);
  box-shadow: var(--mhome-shadow);
  text-decoration: none;
  color: var(--mhome-text);
  font-weight: 800;
  letter-spacing: .02em;
}

.iw-mhome .iw-mhome-btn:active {
  transform: translateY(1px);
}

/* =========================================================
   News（あなたのショートコードHTMLに一致）
   .iw-newsitem は article
   .iw-newsitem__link は a
========================================================= */
.iw-mhome .iw-newslist {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.iw-mhome .iw-newsitem {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.iw-mhome .iw-newsitem:last-child {
  border-bottom: none;
}

.iw-mhome .iw-newsitem__date {
  font-size: 12px;
  color: var(--mhome-muted);
  letter-spacing: .02em;
  white-space: nowrap;
}

.iw-mhome .iw-newsitem__link {
  display: inline-block;
  text-decoration: none;
  color: var(--mhome-text);
  font-weight: 500;
  line-height: 1.35;
  font-size: 14px;
}

.iw-mhome .iw-newsitem__link:hover {
  text-decoration: underline;
}

@media (max-width: 420px) {
  .iw-mhome .iw-newsitem {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* =========================================================
   SNS embed（遅延挿入想定）
========================================================= */
.iw-mhome .iw-embed {
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, .04);
  min-height: 180px;
  border: 1px solid rgba(0, 0, 0, .06);
}

.iw-mhome .iw-embed.is-loading {
  position: relative;
}

.iw-mhome .iw-embed.is-loading::before {
  content: "SNSを読み込み中...";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: rgba(0, 0, 0, .55);
  letter-spacing: .04em;
}

/* -------------------------------------------------
   Poster 1枚デザイン制御（830px基準）
------------------------------------------------- */

/* SP / タブレット（830px以下） */
@media (max-width: 830px) {

  .iw-mhome .iw-mhome-poster img {
    width: 100%;
    max-width: 480px;
    /* ← ここで止める */
    height: auto;
    display: block;
    margin: 0 auto;
  }

}

/* PC（831px以上） */
@media (min-width: 831px) {

  .iw-mhome .iw-mhome-poster img {
    width: 100%;
    max-width: 520px;
    /* 少し広げてもOK */
    margin: 0 auto;
  }

}

/* ================================
   Departments section
================================ */
.iw-mhome .iw-mhome-depts {
  position: relative;
  padding-right: 95px;
  /* 右の縦書き分 */
}

/* 右側縦書き */
.iw-mhome .iw-mhome-depts__rail {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 100%;
  display: flex;
  justify-content: center;
  padding-top: 10px;
  color: #2dccfc;
  font-weight: 800;
  letter-spacing: .08em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* カードリスト */
.iw-mhome .iw-mhome-depts__list {
  display: grid;
  gap: 22px;
}

/* カード本体 */
.iw-mhome .iw-dept-card {
  background: #fff;
}

/* 見出し（▶付き） */
.iw-mhome .iw-dept-card h3 {
  position: relative;
  margin: 0 0 6px;
  padding-left: 30px;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: .02em;
}

/* 左の赤い▶ */
.iw-mhome .iw-dept-card h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: .12em;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #2dccfc;
}

.iw-mhome .iw-dept-card h3::after {
  content: "";
  position: absolute;
  left: 7px;
  top: .36em;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #fff;
}

/* サブ文 */
.iw-mhome .iw-dept-card p {
  margin: 0 0 8px;
}

.iw-mhome .iw-dept-card p+p {
  margin-top: 2px;
}

/* 画像を角丸に */
.iw-mhome .iw-dept-card figure {
  margin: 10px 0 10px;
}

.iw-mhome .iw-dept-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
}

/* ハッシュタグ */
.iw-mhome .iw-dept-card .iw-dept-tags {
  font-weight: 700;
  color: rgba(0, 0, 0, .75);
}

/* =========================================================
   Departments（夢を叶える 2つの学科）
   - 830px基準（SP/Tablet）
   - .iw-mhome 配下のみ
========================================================= */

/* セクション外枠：左右余白 + 右帯のスペース確保 */
.iw-mhome .iw-mhome-depts {
  position: relative;
  padding: 0 18px;
  /* ← 左右の余白（ここが効く） */
  padding-right: 74px;
  /* ← 右の縦書き帯分 */
}

/* 右の縦書き「帯」 */
.iw-mhome .iw-mhome-depts__rail {
  position: absolute;
  top: 0;
  right: 12px;
  /* 画面右端から少し内側へ */
  height: 100%;
  width: 46px;

  display: flex;
  align-items: center;
  /* 縦方向センター（帯っぽく） */
  justify-content: center;

  writing-mode: vertical-rl;
  text-orientation: mixed;

  color: #2dccfc;
  font-weight: 900;
  letter-spacing: .14em;
  line-height: 1.15;

  /* 見本は“文字が細く長い”感じなので少し小さく */
  font-size: 30px;
}

/* 右帯の文字が「折り返して横並び」になる場合の保険 */
.iw-mhome .iw-mhome-depts__rail>* {
  writing-mode: inherit;
}

/* カードリスト */
.iw-mhome .iw-mhome-depts__list {
  display: grid;
  gap: 26px;
  /* カード間 */
  padding: 0;
  /* WP側の余白干渉回避 */
}

/* カード本体（余白を整える） */
.iw-mhome .iw-dept-card {
  background: transparent;
  padding: 0;
}

/* 見出し（▶＋英字） */
.iw-mhome .iw-dept-card h2,
.iw-mhome .iw-dept-card h3 {
  position: relative;
  margin: 0 0 10px;
  padding-left: 34px;
  font-weight: 900;
  letter-spacing: .01em;
  line-height: 1.05;

  /* 見本は太く大きめ */
  font-size: 36px;
}

/* 左の赤丸 */
.iw-mhome .iw-dept-card h2::before,
.iw-mhome .iw-dept-card h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: .22em;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #2dccfc;
}

/* ▶ */
.iw-mhome .iw-dept-card h2::after,
.iw-mhome .iw-dept-card h3::after {
  content: "";
  position: absolute;
  left: 8px;
  top: .46em;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #fff;
}

/* サブテキスト（科名/コース名） */
.iw-mhome .iw-dept-card p {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.55;
}

/* 画像：角丸と余白 */
.iw-mhome .iw-dept-card figure {
  margin: 14px 0 14px;
}

.iw-mhome .iw-dept-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
}

/* 「目指せる職業」などの見出しっぽい行 */
.iw-mhome .iw-dept-card .iw-dept-lead {
  margin-top: 12px;
  font-weight: 900;
  font-size: 20px;
}

/* タグ行 */
.iw-mhome .iw-dept-card .iw-dept-tags {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .02em;
}

/* ===== SP/Tablet（830px以下）は今の設計のまま ===== */
@media (max-width: 830px) {
  /* ここは必要なら追加調整だけ */
}

/* ===== PC（831px以上）は余白を少し広げる ===== */
@media (min-width: 831px) {
  .iw-mhome .iw-mhome-depts {
    padding-left: 22px;
    padding-right: 92px;
  }

  .iw-mhome .iw-mhome-depts__rail {
    right: 18px;
    font-size: 20px;
  }
}

/* 画像運用：学科セクション */
.iw-mhome .iw-mhome-depts {
  position: relative;
  padding: 0 18px;
  padding-right: 86px;
  /* 右の縦書き分の逃げ */
}

.iw-mhome .iw-dept-img img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  margin-top: 40px;
  /* 画像側で角丸作ってるなら0でOK */
}

.iw-mhome .iw-dept-rail-img {
  position: absolute;
  top: 0;
  right: 12px;
  width: 46px;
  height: auto;
}

.iw-mhome .iw-dept-rail-img img {
  width: 86%;
  height: auto;
  display: block;
}

/* 画像運用：学科セクション */
.iw-mhome .iwmnews {
  position: relative;
  padding: 0 18px;
}

/* =========================================================
   Square ticker (images flow right -> left)
========================================================= */
.iw-mhome .iw-mhome-ticker {
  margin: 18px 0 22px;
  overflow: hidden;
  background: #2dccfc;
  padding: 18px 0;
}

.iw-mhome .iw-mhome-ticker__track {
  display: flex;
  width: max-content;
  gap: 14px;
  will-change: transform;
  animation: iwTicker 26s linear infinite;
}

/* 画像行（2つ並べるのでrowは横並びのままでOK） */
.iw-mhome .iw-mhome-ticker__row {
  display: flex;
  gap: 14px;
}

/* 正方形画像 */
.iw-mhome .iw-mhome-ticker img {
  width: 120px;
  /* 正方形サイズ：ここで調整 */
  aspect-ratio: 1 / 1;
  /* 正方形固定 */
  object-fit: cover;
  display: block;
  border-radius: 14px;
}

/* 右→左へ流す */
@keyframes iwTicker {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* ユーザーが「アニメーション減らす」設定の場合は止める */
@media (prefers-reduced-motion: reduce) {
  .iw-mhome .iw-mhome-ticker__track {
    animation: none;
    transform: none;
  }
}

/* =========================================================
   Contents
========================================================= */
.iw-mhome .iw-mhome-contents,
.iw-mhome .iw-mhome-sns,
.iw-mhome .iw-mhome-news {
  margin: 48px 0 20px;
  padding: 0 18px;
  /* 左右の余白（見本の白ふち） */
}

.iw-mhome .iw-mhome-contents__title,
.iw-mhome .iw-mhome-sns__title,
.iw-mhome .iw-mhome-news__title {
  text-align: center;
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 34px;
  /* “Contents”を大きく */
  line-height: 1.05;
  color: #2dccfc;
  font-family: Urbanist, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
}

.iw-mhome .iw-mhome-contents__lead,
.iw-mhome .iw-mhome-sns__lead,
.iw-mhome .iw-mhome-news__lead {
  text-align: center;
  margin: 0 0 18px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(0, 0, 0, .75);
}

.iw-mhome .iw-mhome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 16px;
}

.iw-mhome .iw-mhome-btn {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 92px;
  /* 四角感 */
  padding: 14px 12px;
  border-radius: 10px;
  background: #fff;
  border: 2px solid #2dccfc;
  text-decoration: none;
  color: #2dccfc;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.iw-mhome .iw-mhome-btn:active {
  transform: translateY(1px);
}

.iw-mhome .iw-mhome-sns__icon {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 10px 0 20px;
}

.iw-mhome .iw-mhome-sns__img {
  width: 64px;
  height: auto;
  display: block;
}

.iw-mhome-card-slider {
  overflow: hidden;
  width: 100%;
  padding: 8px 0;
}

.iw-mhome-card-slider__track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: iw-mhome-card-slide 28s linear infinite;
}

.iw-mhome-card-slider__item {
  flex: 0 0 auto;
  width: 240px;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.iw-mhome-card-slider__item img {
  width: 100%;
  display: block;
}

@keyframes iw-mhome-card-slide {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* =========================
   Mobile Home Banner Slider
========================= */
.iw-mhome-slider-wrap {
  position: relative;
  padding: 14px 12px 18px;
  background:
    repeating-linear-gradient(-45deg,
      #fde8ee 0 8px,
      #f9dce6 8px 16px);
  border-radius: 0;
}

.iw-mhome-slider {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  cursor: grab;
  padding-bottom: 10px;
  /* スクロールバー分 */
}

.iw-mhome-slider.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.iw-mhome-slider__track {
  display: flex;
  gap: 16px;
  width: max-content;
  align-items: stretch;
}

.iw-mhome-slider__card {
  flex: 0 0 auto;
  width: 300px;
  display: block;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.iw-mhome-slider__card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.iw-mhome-slider__card img {
  display: block;
  width: 100%;
  height: auto;
}

/* スクロールバー調整 */
.iw-mhome-slider::-webkit-scrollbar {
  height: 10px;
}

.iw-mhome-slider::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
}

.iw-mhome-slider::-webkit-scrollbar-thumb {
  background: #9b8f8f;
  border-radius: 999px;
}

.iw-mhome-slider {
  scrollbar-color: #9b8f8f rgba(255, 255, 255, 0.65);
  scrollbar-width: thin;
}

/* SP */
@media (max-width: 767px) {
  .iw-mhome-slider-wrap {
    padding: 12px 10px 16px;
  }

  .iw-mhome-slider__track {
    gap: 12px;
  }

  .iw-mhome-slider__card {
    width: 260px;
  }
}

/* PCドラッグスクロール改善 */

.iw-mhome-slider img {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.iw-mhome-slider {
  cursor: grab;
}

.iw-mhome-slider:active {
  cursor: grabbing;
}