/* ==============================================
   WORK SECTION - work.css
   ============================================== */

.content__work {
	background: url('../images/bg_work.png') no-repeat center center;
	-moz-background-size: cover;
	-o-background-size: cover;
	-webkit-background-size: cover;
	background-size: cover;
	min-height: 800px;
	position: relative;
}

.work__grid__wrapper {
	padding: 0 72px 60px;
}

/* flexbox で横並び・折り返し */
.work__grid {
	display: -webkit-flex;
	display: flex;
	-webkit-flex-wrap: wrap;
	flex-wrap: wrap;
	gap: 12px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* アイテム: インラインスタイルが優先されるが念のため */
.work__item {
	-webkit-flex: 0 0 220px !important;
	flex: 0 0 220px !important;
	width: 220px !important;
	max-width: 220px !important;
	min-width: 220px !important;
	position: relative;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
}

.work__item a {
	display: block;
	text-decoration: none;
}
.work__item a:hover {
	text-decoration: none;
	opacity: 1;
}

.work__thumb {
	position: relative;
	width: 220px !important;
	height: 220px !important;
	overflow: hidden;
	background: #1a1a1a;
	cursor: pointer;
}

.work__thumb img {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 220px !important;
	height: 220px !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover;
	display: block;
	-webkit-transition: transform 0.4s ease, opacity 0.4s ease;
	transition: transform 0.4s ease, opacity 0.4s ease;
}

/* オーバーレイ */
.work__overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.65);
	display: -webkit-flex;
	display: flex;
	-webkit-flex-direction: column;
	flex-direction: column;
	-webkit-justify-content: center;
	justify-content: center;
	-webkit-align-items: center;
	align-items: center;
	opacity: 0;
	-webkit-transition: opacity 0.35s ease;
	transition: opacity 0.35s ease;
	padding: 16px;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
}

.work__item:hover .work__overlay {
	opacity: 1;
}
.work__item:hover .work__thumb img {
	-webkit-transform: scale(1.05);
	transform: scale(1.05);
	opacity: 0.7;
}

.work__category {
	display: block;
	color: #f4d723;
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	margin-bottom: 8px;
	text-align: center;
}
.work__title__text {
	display: block;
	color: #ffffff;
	font-size: 14px;
	line-height: 1.5;
	text-align: center;
	word-break: break-all;
}
.work__empty {
	color: #888;
	font-size: 14px;
	text-align: left;
	padding: 40px 0;
}


/* ==============================================
   WORK MODAL OVERLAY  (AJAX方式・iframeなし)
   ============================================== */

body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

#work-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8000;
}

#work-modal.is-open {
  display: block;
}

/* 半透明オーバーレイ（元ページが透けて見える） */
#work-modal__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  -webkit-transition: opacity 0.35s ease;
  transition: opacity 0.35s ease;
}

#work-modal.is-open #work-modal__overlay {
  opacity: 1;
}

/* スクロールラッパー
   overflow-y: scroll で縦スクロール可能
   スクロールバーUIのみ非表示 */
#work-modal__scroll {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;

  /* スクロールバーUIを隠す（スクロール動作は維持） */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.25) transparent;
}

#work-modal__scroll::-webkit-scrollbar {
  width: 4px;
}

#work-modal__scroll::-webkit-scrollbar-track {
  background: transparent;
}

#work-modal__scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
}

/* コンテンツ本体（中央・最大720px） */
#work-modal__container {
  position: relative;
  z-index: 3;
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 28px 80px;
  min-height: 100%;

  opacity: 0;
  -webkit-transform: translateY(20px);
  transform: translateY(20px);
  -webkit-transition: opacity 0.35s ease 0.06s, -webkit-transform 0.35s ease 0.06s;
  transition: opacity 0.35s ease 0.06s, transform 0.35s ease 0.06s;
}

#work-modal.is-open #work-modal__container {
  opacity: 1;
  -webkit-transform: translateY(0);
  transform: translateY(0);
}

/* × 閉じるボタン：コンテンツ右外・常に画面上部固定 */
#work-modal__close {
  position: fixed;
  top: 24px;
  left: calc(50% + 360px + 20px);
  z-index: 8100;

  width: 50px;
  height: 50px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;

  opacity: 0;
  pointer-events: none;
  -webkit-transition: opacity 0.3s ease 0.1s, -webkit-transform 0.25s ease;
  transition: opacity 0.3s ease 0.1s, transform 0.25s ease;
}

#work-modal.is-open #work-modal__close {
  opacity: 1;
  pointer-events: auto;
}

#work-modal__close:hover {
  -webkit-transform: rotate(90deg);
  transform: rotate(90deg);
}

/* × を細い白線2本で描く */
#work-modal__close span {
  position: absolute;
  top: 50%;
  left: 10%;
  width: 80%;
  height: 1.5px;
  background: #ffffff;
  border-radius: 1px;
  display: block;
}

#work-modal__close span:nth-child(1) {
  -webkit-transform: translateY(-50%) rotate(45deg);
  transform: translateY(-50%) rotate(45deg);
}

#work-modal__close span:nth-child(2) {
  -webkit-transform: translateY(-50%) rotate(-45deg);
  transform: translateY(-50%) rotate(-45deg);
}

@media screen and (max-width: 900px) {
  #work-modal__close {
    left: auto;
    right: 12px;
    top: 12px;
  }
}
