/* 小学館スクウェア トップページ
   2026-12 ギャラリーの入り口を追加し、3つが並ぶレイアウトに変更。
   見た目の雰囲気（白地・黒枠のボタン・画像に重なる名前）は従来のものを引き継ぐ。
   以前は幅1080px固定で、481〜1080pxの画面では横にはみ出していたため、可変幅にした。 */

*, *::before, *::after { box-sizing: border-box; }

body, html {
  font-size: 14px;
  font-family: 'Noto Sans JP', sans-serif;
  color: #222;
  margin: 0;
  padding: 0;
  height: 100%;
}
#container {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.contents { flex: 1 0 auto; }

.contents_wrap {
  max-width: 1128px;     /* 中身1080px＋左右の余白 */
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 見出し・ご案内 ---------- */
.title_area {
  text-align: center;
  margin-top: 60px;
}
.title_area h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}
.title_en {
  font-size: 12px;
  color: #666;
}
.title_area p {
  margin: 20px 0 0;
  line-height: 1.75;
}

/* ---------- 入り口（3つ並び） ---------- */
ul.select {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 48px;
}
ul.select li {
  flex: 0 1 calc((100% - 96px) / 3);
  text-align: center;
}
ul.select--2 li { flex-basis: 400px; }  /* ギャラリーの入り口を出さないとき */

figure.hover-parent {
  position: relative;
  margin: 0 0 24px;
  overflow: hidden;
}
figure.hover-parent a { display: block; }
figure.hover-parent img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;    /* 3枚の画像の比率を揃える */
  object-fit: cover;
}
figcaption.hover-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .5);
  transition: opacity .3s;
  opacity: 0;
}
.hover-mask h2 {
  margin: 0;
  padding: 0 12px;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
}
figure.hover-parent:hover figcaption.hover-mask,
figure.hover-parent a:focus-visible figcaption.hover-mask { opacity: 1; }

.btn {
  display: inline-block;
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 600;
  color: #000;
  text-decoration: none;
  background: transparent;
  border: 2px solid #000;
  transition: all .3s ease;
}
.btn:hover,
.btn:focus-visible {
  background: #000;
  color: #fff;
}

/* ---------- フッター ---------- */
.footer_area {
  width: 100%;
  background-color: #eee;
  margin: 100px 0 0;
  padding: 20px 0 100px;
}
.copylight {
  font-size: 12px;
  margin: 0;
  text-align: center;
  word-wrap: break-word;
}

/* ---------- タブレット ---------- */
@media screen and (max-width: 1000px) {
  ul.select { gap: 24px; }
  ul.select li { flex-basis: calc((100% - 48px) / 3); }
  .btn { font-size: 14px; padding: 9px 14px; }
  .hover-mask h2 { font-size: 18px; }
}

/* ---------- スマートフォン（縦に並べる） ---------- */
@media screen and (max-width: 760px) {
  .contents_wrap { padding: 0 20px; }
  .title_area { margin-top: 32px; }
  .title_area p { text-align: left; }   /* 狭い画面では長い行を左揃えで折り返す */
  /* スマホでは写真を出さず、ボタンだけを並べる（スクロールしなくても3つが見えるように。12/1 菊池様） */
  ul.select { flex-direction: column; align-items: center; gap: 16px; margin-top: 28px; }
  ul.select li, ul.select--2 li { flex-basis: auto; width: 100%; max-width: 400px; }
  figure.hover-parent { display: none; }
  ul.select .btn { display: block; }
  .btn { font-size: 16px; padding: 10px 22px; }
  .hover-mask h2 { font-size: 20px; }
  .footer_area { margin-top: 64px; padding: 16px 8px 40px; }
  .text { display: block; }
}
