/* =====================================
    共通レイアウト　ここから
===================================== */

/* ベーススタイル */
body{
  margin: 0;
  /* 日本語の明朝体を優先指定 */
    font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "HGS Mincho E", serif;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

main > div {
  max-width: 100%; /* コンテンツの最大横幅 */
  padding: 20px 20px; /* 上下の間隔と、スマホ用の左右余白 */
}

br.pc-br{
  display: inline;
}

br.sp-br{
  display: none;
}

.sp-display{
  display: none;
}

img{
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  height: auto;
  display: block;
}

.title,.sub_title,.image{
    display: flex;
    justify-content: center; /* 横方向の中央寄せ */
    align-items: center;     /* 縦方向の中央寄せ（必要に応じて） */
    width: 100%;
    margin-bottom: 30px;     /* 下のコンテンツとの間隔 */
}

/* タイトル内の画像も確実に中央に配置 */
.title img,.sub_title img{
    display: block;
    width: 60%;
}

.image img{
    margin-left: auto;
    margin-right: auto;
    width: 65%;
}

h2{
  margin: 15px auto;
}

h3{
  color: #40210f;
  font-size: 21px;
}

p{
  font-size: 18px;
}

#work_introduction{
  background-image: linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)),url(../img/top_background3.jpg);
}

/* =====================================
    共通レイアウト　ここまで
===================================== */


/* =====================================
    ヘッダー　ここから
===================================== */

header{
  position: relative;
  height: 10vh;
  
}

header .inner {
    /* 常に画面上部に固定する設定 */
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 10%;
    /* 重なり順を一番上にする（他のコンテンツに隠れないように） */
    z-index: 9999; 

    /* 以下は元のデザインを維持 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px; /* 固定時は少しスリムな方が綺麗なので微調整 */
    box-sizing: border-box; /* 横幅がはみ出さないように追加 */
    
    /* 上部の文字を見やすくするための黒いグラデーション */
    background-color: #604C3F;
}

/* ロゴ */
.logo{
  flex-shrink: 0; 
  min-width: 0; 
  margin-left: 0.3em;
}

.logo img{
  height: auto;
  max-height: 50px; 
  max-width: 100%;  
  display: block;
}

/*　メニュー */
.header-right{
  display: flex;
  align-items: center;
  flex-grow: 1; 
  justify-content: flex-end; 
  margin-right: 0.3em;
}

header nav{
    flex-shrink: 1; 
}

header nav ul.navi{
  list-style: none;
  display: flex;
  margin: 0 auto;
  padding: 0;
  justify-content: center; 
}

header nav ul.navi li{
  margin-left: 3vw; 
  position: relative;
}

header nav ul.navi li:first-child{
    margin-left: 0;
}

header nav ul.navi li + li::before{
  content: "/";
  position: absolute;
  left: -1.8vw; 
  top: 50%;
  transform: translateY(-50%);
  color: #fff; 
  background: none;
  width: auto;
  height: auto;
}

header nav ul.navi a {
  text-decoration: none;
  font-size: 1.3vw;
  color: #fff;
  font-weight: 600; 
  transition: color 0.2s;
  letter-spacing: 0.2em;
}

#company #nav_company a,#products #nav_products a,#affiliated #nav_affiliated a,#support #nav_support a,#recrut #nav_recrut a,header nav ul.navi a:hover {
  color: #87cefa;
}

/* ハンバーガーアイコン（PCでは非表示） */
.ac_menu{
  display: none;
  width: 35px;   
  height: 25px;  
  cursor: pointer;
  z-index: 10000;
  position: relative;
}

.ac_menu span,
.ac_menu span::before,
.ac_menu span::after{
  position: absolute;
  content: "";
  left: 0;
  width: 35px; 
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.ac_menu span{
  top: 50%;
  transform: translateY(-50%);
}

.ac_menu span::before{
  top: -9px; 
}

.ac_menu span::after{
  bottom: -9px; 
}

.ac_menu.active span{
  background: transparent;
}

.ac_menu.active span::before{
  transform: rotate(45deg);
  top: 0;
}

.ac_menu.active span::after{
  transform: rotate(-45deg);
  bottom: 0;
}

/* パンくずリスト */
.breadcrumb{
  font-size: 0.9rem;
  margin: 20px 5%;
}
.breadcrumb ul{
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}
.breadcrumb li + li::before{
  content: "＞";
  margin: 0 0.5em;
  color: #aaa;
}
.breadcrumb a{
  text-decoration: none;
  font-family: "din-2014-narrow", sans-serif; 
  font-weight: 600; 
  transition: color 0.2s;
  letter-spacing: 0.2em;
}
.breadcrumb li:last-child{
  text-decoration: none;
  color: #87cefa;
  font-family: "din-2014-narrow", sans-serif; 
  font-weight: 600; 
  transition: color 0.2s;
  letter-spacing: 0.2em;
}

/* =====================================
    ヘッダー　ここまで
===================================== */


/* =====================================
    著書　ここから
===================================== */
/* スライダー全体の枠 */
.bookSwiper {
    width: 30%;          /* 元々の .image img の指定に合わせる */
    margin: 0 auto 50px; /* 中央寄せと下の余白 */
    overflow: hidden;    /* はみ出しを隠す（必須） */
    position: relative;
}
 
/* スライド（親要素）の設定 */
.bookSwiper .swiper-slide {
    display: flex;          /* 中身を整列させる */
    justify-content: center; /* 左右の中央寄せ */
    align-items: center;     /* 縦方向の中央寄せ（これが重要！） */
    background: #f9f9f9;    /* 横長画像の上下にできる余白の色（お好みで） */
    height: auto;           /* 高さを揃える */
}
 
/* スライド内の画像設定 */
.bookSwiper .swiper-slide img {
    width: auto;            /* 横幅を自動に */
    max-width: 100%;        /* 枠からはみ出さない */
    max-height: 400px;      /* スライドの最大高さを決める（画像サイズに合わせて調整） */
    height: auto;           /* アスペクト比を維持 */
    object-fit: contain;    /* 枠内に収める */
}
 
/* 3. 配置の微調整（画像の下の余白に配置） */
.bookSwiper .swiper-pagination {
    position: relative;
    bottom: 0 !important;
    margin-top: 20px;       /* 画像との距離 */
}
 
.bookSwiper .swiper-pagination-bullet {
    width: 1em;
    height: 1em;
    background: #ccc;      /* ヘッダーと同じ待機色 */
    opacity: 1;            /* 透過させずにはっきり出す */
    margin: 0 15px !important; /* アイコンの間隔 */
    transition: background-color 0.3s ease; /* 色の変化を滑らかに */
}
 
/* 2. アクティブなアイコン（表示中の画像） */
.bookSwiper .swiper-pagination-bullet-active {
    background-color: #40210f; /* ヘッダーと同じ茶色 */
    width: 1em;
    height: 1em;               /* 楕円にせず正円を維持 */
    opacity: 1;
}
 
/* --- 矢印・クリックエリアの設定 --- */
 
/* スライダー本体：外側への余白は不要なのでシンプルに */
.bookSwiper {
    width: 40%;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0 auto 20px;
    position: relative;
}
 
/* クリックエリア：画像の左右にかぶせる */
.bookSwiper .swiper-button-prev,
.bookSwiper .swiper-button-next {
    width: 25%;              /* 画像幅の左右25%をクリック可能に */
    height: 100%;
    top: 0;
    margin-top: 0;
    opacity: 1;
    background: none;
    z-index: 10;
}
 
.bookSwiper .swiper-button-prev { left: 0; }
.bookSwiper .swiper-button-next { right: 0; }
 
/* 矢印アイコンは非表示 */
.bookSwiper .swiper-button-prev::after,
.bookSwiper .swiper-button-next::after {
    display: none;
}
 
/* ホバー時：画像端にグラデーションをふわっと出す */
.bookSwiper .swiper-button-prev::before,
.bookSwiper .swiper-button-next::before {
    content: "";
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}
 
.bookSwiper .swiper-button-prev::before {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.15), transparent);
}
.bookSwiper .swiper-button-next::before {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.15), transparent);
}
 
.bookSwiper:hover .swiper-button-prev::before,
.bookSwiper:hover .swiper-button-next::before {
    opacity: 1;
}


/* ズーム時のマウスカーソルを「拡大」アイコンにする */
.swiper-zoom-container {
    cursor: zoom-in;
}

/* もし、元々の .image クラスの設定が干渉する場合は以下でリセット */
#book .image {
    display: block; /* 中央寄せをスライダー側で制御するため */
}


#book .container{
  width: 90%;           /* 画面幅に対する割合 */
  max-width: 1050px;    /* 最大幅（profileと共通にする） */
  margin: 0 auto;       /* 中央寄せ */
  padding-left: 2em;
  box-sizing: border-box;
  margin-top: 2.5em;
}

#book .image img{
    width: 60%;
}

#book .text {
  
  /* widthを自由に変えても、margin: auto があれば中央に留まります */
  width: 85%; 
  max-width: 1000px;      /* 広がりすぎ防止 */
  margin-bottom: 5em;
  box-sizing: border-box; /* paddingで幅が広がらないように固定 */
}

/* 各段落の調整 */
#book .text p {
  width: 100% !important; /* 個別のwidth指定を無効化 */
  margin-left: 3em;
  margin-right: 2em;
  line-height: 2;
  margin-bottom: 1em;
}

#book .text h3{
  width: 100% !important;
  margin-left: 3em;
  margin-right: 2em;
  text-align: right;
}

#book_detail{
  margin-top: 2em;
  margin-bottom: 4em;
  text-align: center;
}

#book_detail table{
  /* テーブルをブロックレベル要素として扱い、左右マージンを自動調整 */
  margin: 1.5em auto;
  text-align: center;
}

#book_detail table tbody tr th{
    font-size: 22px;
    font-weight: bold;
    color: #40210f;
    white-space: nowrap; 
    text-align-last: justify;       /* Chrome・Firefox用 */
    text-justify: inter-ideograph; 
    line-height: 2em;
    vertical-align: top;
}

#book_detail table tbody td{
  font-size: 20px;
  color: #40210f;
  padding-left: 4em;
  text-align: left;
  line-height: 2em;
  vertical-align: top;
  letter-spacing: 0.1em;
}

.mekkemonomiyagi{
  margin: 4em auto;
  text-align: center;
}

.mekkemonomiyagi h3{
  font-size: 1.5em;
  letter-spacing: 0.3em;
  margin-bottom: 10px;
}

.mekkemonomiyagi img{
  width: 30%;
}

.mekkemonomiyagi .ecsite{
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 1em;
  width: 30%;
  margin: 1em auto;
}

.mekkemonomiyagi .ecsite a{
  margin: 0;
  width: 80%;
}

.mekkemonomiyagi .ecsite a img{
  margin: 0;
  width: 100%;
}



/* =====================================
    著書　ここまで
===================================== */

/* =====================================
    作品　ここから
===================================== */

#works .title{
  display: block;  
}

#works .title img{
  width: 25%;  
}

#works .title h2{
  text-align: center;
  font-size: 1.5em;
  line-height: 1.2;
  color: #40210f;
}

#works .container{
  width: 100%;           /* 画面幅に対する割合 */
  max-width: 1100px;    /* 最大幅（profileと共通にする） */
  margin: 0 auto;       /* 中央寄せ */
  padding-left: 2em;
  box-sizing: border-box;
  margin-top: 1em;
}

#works .image{
  display: block;
}

#works .image img,
#works .image p,
#works .image h3{
  margin: 0.6em auto;
  text-align: center;
}

#works .image h3{
  color: #333;
}

#works .image img{
  width: 70%;
  border: #fff 3px solid;
}

#works .text {
  margin: 0 auto;
  /* widthを自由に変えても、margin: auto があれば中央に留まります */
  width: 80%; 
  max-width: 1000px;      /* 広がりすぎ防止 */
  margin-bottom: 5em;
  box-sizing: border-box; /* paddingで幅が広がらないように固定 */
}

/* 各段落の調整 */
#works .text p {
  width: 100% !important; /* 個別のwidth指定を無効化 */
  line-height: 2.5;
  text-align: center;
}

#works .container .gallery{
  margin-bottom: 7em;
}

#works .container .gallery img{
  width: 40%;
}

#works .container .work1 img{
  width: 30%;
}


/* =====================================
    作品　ここまで
===================================== */


/* クリックで拡大できる画像にカーソルを変えて示す */
.bookSwiper .swiper-slide img,
#works .image img,
#works .gallery img {
  cursor: zoom-in;
}

/* =====================================
    フル機能ライトボックス（CSS）
==================================== */
.lightbox-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 画像とボタンを包む基準コンテナ */
.lightbox-container {
  position: relative; /* 矢印ボタンの配置基準 */
  display: inline-block;
}

/* 画像が入るフレーム */
.lightbox-frame {
  max-width: 90vw; /* 矢印ボタン用のスペースを確保 */
  max-height: 90vh;
  overflow: hidden; /* ★重要：拡大した画像がフレームからはみ出さないようにする */
  position: relative;
  background: #000; /* 拡大時の背景 */
  margin-top: 4em;
}

/* 拡大・移動する画像本体 */
.lightbox-img {
  max-width: 100%; /* フレーム内に収める */
  max-height: 90vh;
  display: block;
  user-select: none; /* テキスト選択を防ぐ */
  touch-action: none; /* ブラウザのデフォルトのタッチ動作を無効化 */
  transform-origin: center center; /* 中央を基準に拡大 */
  transition: transform 0.3s ease; /* ズームを滑らかに */
}

/* 拡大時（scale > 1）のカーソルを「移動」に変更 */
.lightbox-frame img[style*="scale(1)"] { cursor: zoom-in; }
.lightbox-frame img:not([style*="scale(1)"]) { cursor: grab; }
.lightbox-frame img:active { cursor: grabbing; }

/* --- 矢印ボタン（画像枠のすぐ横に配置） --- */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 30px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  width: 60px; height: 60px;
  cursor: pointer;
  z-index: 1010;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, color 0.3s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.lightbox-prev { left: -80px; } /* 画像枠から左へ80px */
.lightbox-next { right: -80px; } /* 画像枠から右へ80px */

/* --- 閉じるボタン（×） --- */
.lightbox-close {
  position: absolute;
  top: -40px;
  right: -40px;
  background: none; border: none;
  color: #fff; font-size: 40px;
  cursor: pointer;
}

/* 背景を固定 */
body.lightbox-open {
  overflow: hidden;
}

/* index.htmlの下に記号を出さないための保険 */
#home_page .lightbox-overlay:not(.active) {
  display: none !important;
}