@charset "UTF-8";
/*====================
Equipments(装置紹介)ページ専用のスタイル
 - 研究ページと同じ紺基調(--navy は style.css)
 - 一覧: 写真 + 紺の名称帯のカード。クリックで拡大表示(モーダル)
====================*/

#equipment { padding-top: clamp(40px, 6vw, 64px); }

/* 一時的に紺のヒーロー帯を非表示。戻す場合はこの上書きを無効化する。 */
.page-head.equipment-page-head {
  background: none;
  color: var(--m-fg);
}
.equipment-page-head .page-head-eyebrow { color: var(--navy); }
.equipment-page-head .page-head-title { color: var(--m-fg); }
.equipment-page-head .page-head-lead { color: var(--m-muted); }

/*-------------------------------------------
一覧
-------------------------------------------*/
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.equipment-card {
  background: #fff;
  box-shadow: 0 12px 28px #10253818;
  transition: transform .25s ease, box-shadow .25s ease;
}
.equipment-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px #10253830;
}

/* カード全体をボタンにして、キーボードでも開けるようにする */
.equipment-card__button {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.equipment-card__button:focus-visible {
  outline: 3px solid #517fa6;
  outline-offset: 4px;
}

.equipment-card__photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f2f5f8;
}

/* 装置名と「詳細を見る」を紺の帯にまとめる(研究概要のカードと同じ配色) */
.equipment-card__label {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  background: var(--navy);
  color: #fff;
  transition: background .25s;
}
.equipment-card__button:hover .equipment-card__label { background: var(--navy-hover); }
.equipment-card__name {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.5;
}
.equipment-card__more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #ffffff40;
  color: #d5e1ed;
  font-size: .9rem;
  letter-spacing: .04em;
}
.equipment-card__arrow { font-size: 1.3rem; line-height: 1; transition: transform .25s; }
.equipment-card__button:hover .equipment-card__arrow { transform: translate(3px, -3px); }

/*-------------------------------------------
拡大表示(モーダル)
-------------------------------------------*/
.equipment-modal {
  /* ress.css のリセットで中央寄せが消えるので指定し直す */
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(92vw, 960px);
  max-height: 90vh;
  padding: 0;
  border: 0;
  background: #fff;
  color: var(--m-fg);
  box-shadow: 0 20px 60px rgba(6, 17, 31, .5);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.equipment-modal::backdrop { background: rgba(6, 17, 31, .75); }
.equipment-modal[open] { animation: equipment-zoom .25s ease; }
@keyframes equipment-zoom {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}

.equipment-modal__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}
.equipment-modal__photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  background: #f2f5f8;
}
.equipment-modal__body { padding: 44px 32px 32px; }
.equipment-modal__name {
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 2px solid var(--navy);
  color: var(--navy);
  font-size: 1.5rem;
  line-height: 1.4;
}
.equipment-modal__detail p {
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 1.9;
  text-align: justify;
}
.equipment-modal__detail p:last-child { margin-bottom: 0; }

.equipment-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 44px; /* 指で押しやすい大きさ */
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 1.5rem;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  transition: background .25s;
}
.equipment-modal__close:hover { background: var(--navy-hover); }
.equipment-modal__close:focus-visible { outline: 3px solid var(--navy-accent); outline-offset: 2px; }

/* モーダル表示中は背景のページをスクロールさせない */
body.is-modal-open { overflow: hidden; }

/*----------------------------------------------
タブレット
------------------------------------------------*/
@media screen and (max-width: 959px) {
  .equipment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/*----------------------------------------------
SP (style.css と同じく600px以下)
------------------------------------------------*/
@media screen and (max-width: 600px) {
  .equipment-grid { gap: 16px; }
  .equipment-card__label { gap: 8px; padding: 12px 14px; }
  .equipment-card__name { font-size: 1rem; }
  .equipment-card__more { padding-top: 8px; font-size: .8rem; }

  /* モーダルは写真を上、説明を下に縦積み */
  .equipment-modal { width: 94vw; max-height: 88vh; }
  .equipment-modal__inner { display: block; }
  .equipment-modal__photo { height: auto; min-height: 0; max-height: 42vh; aspect-ratio: 4 / 3; }
  .equipment-modal__body { padding: 20px 18px 22px; }
  .equipment-modal__name { font-size: 1.25rem; }
}

/* スマホ縦の特に狭い画面は1列 */
@media screen and (max-width: 359px) {
  .equipment-grid { grid-template-columns: 1fr; }
}

/* アニメーションを減らす設定の端末では動きを止める */
@media (prefers-reduced-motion: reduce) {
  .equipment-card,
  .equipment-card__label,
  .equipment-card__arrow,
  .equipment-modal[open] { transition: none; animation: none; }
}
