/* 既存サイト（gt-recruit.com）のトンマナに合わせた配色
   - メインカラー：#008ca3（ティールブルー）
   - サブカラー  ：#21b6bc（ライトティール、見出しなどに使用）
   - アクセント  ：#FF9900（CTA系オレンジ）
   - テキスト    ：#333333
   - 罫線        ：#e2e2e2
*/
:root {
  --main: #008ca3;
  --main-dark: #00718a;
  --main-light: #cce8ed;
  --accent: #21b6bc;
  --accent-dark: #1b8a8f;
  --cta: #FF9900;
  --cta-dark: #d97800;
  --bg: #f7f7f7;
  --bg-soft: #ffffff;
  --text: #333333;
  --muted: #707070;
  --line: #e2e2e2;
}

.manga-container {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

/* ==========【ヒーロー画像（manga ページ専用）】==========
   既存サイトの #hero-image は image / inner ともに 518px。
   manga ページではそれを約75%（390px）に抑える。
   さらに h1 を絶対配置でセンター寄せ＋高さauto化し、
   .bottom スパン1つしか入れていない場合の余白を消す。 */
.manga #hero-image img {
  height: 390px;                   /* 518px × 0.75 ≒ 390px */
}
.manga #hero-image .container .inner {
  height: 390px;
}
@media screen and (max-width: 1280px) and (max-height: 700px) {
  .manga #hero-image img,
  .manga #hero-image .container .inner {
    height: 350px;                 /* 468px × 0.75 ≒ 350px */
  }
}
@media only screen and (max-width: 750px) {
  .manga #hero-image img,
  .manga #hero-image .container .inner {
    height: 45.5vw;                /* 60.6vw × 0.75 ≒ 45.5vw */
  }
}

.manga #hero-image .container .inner h1 {
  /* 中央配置 */
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  /* サイズは内容に合わせる（PCで折り返さないよう nowrap） */
  width: auto;
  max-width: 95%;
  height: auto;
  padding: 18px 40px;
  white-space: nowrap;
  /* テキストもセンター */
  text-align: center;
  justify-content: center;
}
@media screen and (max-width: 1280px) and (max-height: 700px) {
  .manga #hero-image .container .inner h1 {
    top: 50%;                      /* 既存の top: 320px 上書き */
  }
}
@media only screen and (max-width: 750px) {
  .manga #hero-image .container .inner h1 {
    display: block;            /* flex の縮小フィット挙動を回避 */
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: 80vw;               /* SP では改行入れた前提で少しコンパクトに */
    max-width: none;
    height: auto;
    padding: 2vw 3vw;
    box-sizing: border-box;
    white-space: normal;       /* SPでは折り返しを許可 */
    line-height: 1.4;
  }
}

.hero {
  padding: 56px 0 34px;
  text-align: center;
}

.hero__label {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 16px;
  color: #fff;
  background: var(--main);
  border-radius: 999px;
  font-family: "Oswald", sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .08em;
}

.hero h1 {
  margin: 0 0 14px;
  color: var(--main-dark);
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 600;
  line-height: 1.35;
}

.hero p {
  margin: 0;
  color: var(--text);
  line-height: 1.8;
}

/* マンガ一覧ページ：article直下のリード文 */
.manga-lead {
  max-width: 1080px;
  margin: 24px auto 48px;
  padding: 0 20px;
  color: var(--main-dark);
  font-size: 24px;
  font-weight: 500;
  text-align: center;
  line-height: 1.8;
}

.manga-menu {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;                /* カード（=manga-card__thumb 含む）の左右間隔を広めに */
  padding: 24px 0 70px;
}

.manga-card {
  overflow: hidden;
  display: flex;            /* 子を縦並びにして、本文の縦位置を 3 枚で揃えるための土台 */
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 140, 163, .08);
  transition: transform .2s ease, box-shadow .2s ease;
}

.manga-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 140, 163, .15);
}

.manga-card__thumb {
  display: block;
  background: linear-gradient(135deg, var(--main-light), #ffffff);
  border-bottom: 1px solid var(--line);
}

.manga-card__thumb img {
  display: block;
  width: 100%;
  height: auto;             /* SVGの自然な縦比率（縦長）で表示 */
}

/* 本文は flex column で、説明文 P とボタンの縦位置を 3 枚で揃える */
.manga-card__body {
  flex: 1 1 auto;           /* カード残り高さいっぱいに伸びる */
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.manga-card__label {
  color: var(--main);
  font-family: "Oswald", sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .08em;
}

/* 既存サイトの #page h2 (2.25rem) と article h2 (text-align center) を上書き。
   2 行分の min-height でタイトル長が違っても下の説明文 P が同じ Y 位置に揃う */
#page.manga .manga-card h2 {
  margin: 8px 0 10px;
  color: var(--main-dark);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  min-height: calc(16px * 1.5 * 2);
}

.manga-card p {
  margin: 0 0 18px;
  color: var(--text);
  line-height: 1.7;
  font-size: 14px;
}

.manga-card__button {
  margin-top: auto;         /* カード下端に押し下げ → 3 枚でボタンの縦位置が揃う */
  align-self: center;       /* ブロック内で左右センター寄せ */
  display: inline-block;
  padding: 10px 28px;
  color: #fff;
  background: var(--main);
  border-radius: 999px;     /* 丸ピル型 */
  font-weight: 600;
  font-size: 14px;
}

/* 近日公開（製作中）カード：リンク無効・ホバー効果なし・ボタングレーアウト */
.manga-card--coming {
  cursor: default;
}
.manga-card--coming:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(0, 140, 163, .08);
}
.manga-card__button--disabled {
  background: #bbb;
  color: #fff;
  cursor: default;
}

.viewer-wrap {
  width: min(780px, 100%);
  margin: 0 auto;
  padding: 28px 20px 56px;
}

/* 拡大前のビューワは少し小さく表示（タップ/クリックでの拡大に意味を持たせる） */
.manga-swiper {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.viewer-title {
  margin: 0 0 18px;
  color: var(--main-dark);
  text-align: center;
  font-size: clamp(22px, 3.6vw, 30px);
  font-weight: 600;
  line-height: 1.4;
}

/* 操作の案内（PC=クリックで拡大 / SP=タップで拡大・横スワイプでページ送り） */
.viewer-zoom-note {
  margin: 0 0 20px;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
}
.viewer-zoom-note .zoom-sp { display: none; }   /* PCでは「クリックで拡大」を表示 */

.manga-swiper {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 140, 163, .10);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  transition: height .35s ease;   /* autoHeight：ページ切替で高さをなめらかに */
}
/* autoHeight：各ページが自分の高さを保つ（上揃え＝下の余白を出さない） */
.manga-swiper .swiper-wrapper {
  align-items: flex-start;
}

.swiper-wrapper {
  display: flex;
  width: 100%;
  will-change: transform;
}

.swiper-slide {
  position: relative;
  display: block;
  flex: 0 0 100%;
  width: 100%;
  background: #fff;
}

.swiper-slide img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

.manga-cta {
  width: 100%;
  padding: 28px 20px 32px;
  background: var(--main-light);
  border-top: 1px solid var(--line);
  text-align: center;
}

.manga-cta__text {
  margin: 0 0 18px;
  color: var(--main-dark);
  font-weight: 600;
  line-height: 1.7;
}

.manga-cta__buttons {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* CTAボタン：1番目は既存サイトのオレンジ系（求人検索ボタン）、2番目はメインカラー反転スタイル */
.manga-cta__button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 220px;
  padding: 14px 28px;
  color: #fff;
  background: var(--cta);
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(255, 153, 0, .25);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.manga-cta__button:hover {
  background: var(--cta-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(255, 153, 0, .30);
}

.manga-cta__button--sub {
  background: #fff;
  color: var(--main);
  border: 2px solid var(--main);
  box-shadow: none;
}

.manga-cta__button--sub:hover {
  color: #fff;
  background: var(--main);
  box-shadow: 0 4px 12px rgba(0, 140, 163, .25);
}

.viewer-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
}

.swiper-button-prev,
.swiper-button-next {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 22px;
  color: #fff;
  background: var(--main);
  border-radius: 8px;
  font-weight: 600;
}

.swiper-button-prev::after,
.swiper-button-next::after {
  font-size: 14px;
  font-weight: 600;
}

.swiper-pagination {
  position: static;
  width: auto;
  min-width: 60px;
  color: var(--main-dark);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;        /* 「3 / 4」を折り返さない */
}

@media (max-width: 767px) {

  .manga-container {
    width: min(100% - 28px, 1080px);
  }

  .hero {
    padding: 36px 0 22px;
    text-align: left;
  }

  .manga-menu {
    grid-template-columns: 1fr;
    gap: 48px;                /* SPは漫画カード同士の上下間隔を広めに */
    padding-bottom: 44px;
  }
  /* SPは表紙画像（カード）を少し小さく中央寄せ */
  .manga-card {
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }

  .viewer-wrap {
    padding: 20px 0 42px;
  }

  .viewer-title,
  .viewer-zoom-note {
    padding: 0 16px;
  }
  .viewer-zoom-note .zoom-pc { display: none; }   /* SPでは「タップで拡大・スワイプ」を表示 */
  .viewer-zoom-note .zoom-sp { display: inline; }

  .manga-swiper {
    width: 84%;              /* SPはタップ前を縮小し、左右に余白を作る */
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 12px;     /* インセット表示なので角丸・枠線を戻す */
    border: 1px solid var(--line);
  }

  .swiper-button-prev,
  .swiper-button-next {
    display: none;
  }

  .viewer-controls {
    margin-top: 14px;
  }
}

.swiper-button-disabled {
  opacity: .35;
  cursor: default;
  pointer-events: none;
  filter: grayscale(1);
}

.viewer-bottom-nav {
  margin-top: 24px;
  text-align: center;
}

/* マンガ一覧に戻るリンク */
.viewer-bottom-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--main);
  background: #fff;
  border: 1px solid var(--main);
  font-weight: 600;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.viewer-bottom-nav a:hover {
  background: var(--main);
  color: #fff;
  transform: translateY(-2px);
}

.swiper-button-disabled {
  background: #c4c3c3 !important;
  color: #ffffff !important;
  opacity: .55;
  filter: none;
}

.manga-swiper {
  cursor: grab;
}

.manga-swiper.is-dragging {
  cursor: grabbing;
}

.swiper-wrapper {
  transform: translateX(0);
}

/* Modal manga viewer */
.manga-modal {
  position: fixed;
  inset: 0;
  z-index: 100000; /* 既存サイトの header/modal (z-index: 10001) より上に */
  display: none;
  background: rgba(0,0,0,.92);
}

.manga-modal.is-open {
  display: block;
}

.manga-modal__inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.manga-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 20;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.manga-modal .swiper {
  width: 100%;
  height: 100%;
  background: transparent;
}

.manga-modal .swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
}

.manga-modal .swiper-slide img {
  max-width: min(94vw, 1200px);
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}

.manga-modal .viewer-controls {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 30;
}

.manga-modal .swiper-button-prev,
.manga-modal .swiper-button-next {
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
}

.manga-modal-trigger {
  cursor: zoom-in;
  pointer-events: auto !important;
}

@media (max-width: 767px) {
  .manga-modal .swiper-slide img {
    max-width: 100vw;
    max-height: 100vh;
  }

  .manga-modal__close {
    top: auto;
    bottom: 80px;
    right: 14px;
  }
}

.manga-modal__controls {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
}

.manga-modal__prev,
.manga-modal__next {
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 22px;
  color: #fff;
  background: var(--main);         /* 既存サイトと同じティール */
  border-radius: 8px;              /* 本体ビューワの swiper-button と同じ */
  font-weight: 600;
  white-space: nowrap;             /* 「戻る」「次へ」を折り返さない */
  cursor: pointer;
  user-select: none;
  transition: background .2s ease;
}

.manga-modal__prev:hover,
.manga-modal__next:hover {
  background: var(--main-dark);
}

.manga-modal__prev::after {
  content: "次へ";
  font-size: 14px;
  font-weight: 600;
}

.manga-modal__next::after {
  content: "戻る";
  font-size: 14px;
  font-weight: 600;
}

.manga-modal__pagination {
  color: #fff;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;     /* 「3 / 4」を1行で表示（縦積み防止） */
  flex-shrink: 0;          /* 左右ボタンに圧縮されて折り返さないように */
}

.manga-swiper .swiper-wrapper,
.manga-modal-swiper .swiper-wrapper {
  flex-direction: row-reverse;
}
