/*
--- 星薬MOVIE GALLERY のカード一覧・動画モーダル（2026-11 新設）
--- ギャラリーページ（admission-sub.css に見出し・タブ）とトップページのMovie欄で共用
--- template-layout-common/layout-movie-cards.php / layout-movie-modal.php
---------------------------------------------------------------------------*/
.mg__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 65px 25px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}
.mg__item {
  margin: 0;
  padding: 0;
}
.mg__item::before {
  content: none;
}
.mg__item[hidden] {
  display: none;
}
.mg__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
  color: #231815;
  text-decoration: none;
  transition: opacity .3s;
}
.mg__card:hover {
  opacity: .75;
  text-decoration: none;
}
.mg__card::after {
  content: none !important; /* main a の別タブアイコンを付けない */
}
.mg__card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #eee;
}
.mg__card__thumb img:not(.mg__card__play) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mg__card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70px;
  height: 70px;
  margin: -35px 0 0 -35px;
}
.mg__card__body {
  display: block;
  padding: 18px 26px 26px;
}
.mg__card__cat {
  display: inline-block;
  border-bottom: 1px solid currentColor;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.5;
}
.mg__card__title {
  display: block;
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.5;
}

/* モーダル */
.mg-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000; /* サイトの固定ヘッダー・サイドメニューより前面 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .7);
}
.mg-modal[hidden] {
  display: none;
}
.mg-modal__inner {
  position: relative;
  width: 774px; /* 動画750 + 白枠12×2 */
  max-width: 100%;
  padding: 12px;
  background: #fff;
}
.mg-modal__frame {
  aspect-ratio: 16 / 9;
  background: #000;
}
.mg-modal__frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.mg-modal__close {
  position: absolute;
  top: -46px;
  right: -4px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.mg-modal__close::before,
.mg-modal__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 2px;
  margin: -1px 0 0 -15px;
  background: #fff;
  transform: rotate(45deg);
}
.mg-modal__close::after {
  transform: rotate(-45deg);
}
.mg-modal__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
html.mg-modal-open {
  overflow: hidden;
}

@media screen and (max-width: 767px) {
  .mg__list {
    grid-template-columns: 1fr;
    gap: 35px;
    padding: 0 12px;
  }
  .mg__card__body {
    padding: 22px 26px 30px;
  }
  .mg-modal {
    padding: 12px;
  }
  .mg-modal__inner {
    padding: 8px;
  }
}
