/* 基本スタイル */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --font-family: "Zen Maru Gothic", sans-serif;
  --pink-bg: #ffb6c1;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: #000;
  background-color: #f8f8f8;
  opacity: 0;
  transition: opacity 1s ease;
}

body.loaded {
  opacity: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ヘッダー */
header {
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
}

header.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* ヘッダーレイアウト */
.header-layout {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 2rem;
  margin-bottom: 2rem;
}

.title-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: auto;
  align-items: flex-start;
}

.site-title {
  font-size: 0.9rem;
  color: #000;
  font-weight: bold;
  margin: 0 0 1rem 0;
}

.site-title-pc {
  display: inline;
}

.site-title-sp {
  display: none;
}

.main-title {
  height: 4rem;
  width: auto;
  margin: 0;
  display: block;
  padding: 0;
  align-self: flex-start;
}

.faculty-box {
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  background: white;
  min-width: 400px;
  text-align: left;
  flex-shrink: 0;
}

.faculty-box h3 {
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #000;
}

.faculty-names-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 0.5rem;
}

.faculty-text {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.faculty-names {
  font-size: 0.9rem;
  font-weight: bold;
  margin: 0;
  color: #000;
}

.faculty-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.university {
  font-size: 0.9rem;
  color: #000;
  font-style: normal;
  font-weight: 500;
  margin: 0;
}

.faculty-logos {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.sd-logo {
  height: 50px;
  width: auto;
}

/* メインタイトルセクション */
.main-title-section {
  margin-bottom: 3rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

/* 説明セクション */
.description-section {
  max-width: 100%;
  margin-bottom: 2rem;
  margin-left: 10%;
}

.description {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: #000;
}

.bold {
  font-weight: bold;
}

.note {
  font-size: 0.7rem;
  color: #666;
  margin-top: 2rem;
  text-align: right;
}

/* 年度セクション */
.year-section {
  margin-bottom: 4rem;
}

/* サムネイル一覧 */
.thumbnail-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.thumbnail-item {
  display: block;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transform: translateY(30px);
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.thumbnail-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.thumbnail {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 16/9;
}

.thumbnail:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.thumbnail:hover img {
  transform: scale(1.05);
}

/* キャプション */
.caption {
  font-family: var(--font-family);
}

.caption h3 {
  font-size: 1.2rem;
  font-weight: normal;
  font-family: var(--font-family);
}

.caption p {
  font-size: 0.9rem;
  color: #666;
  font-family: var(--font-family);
}

/* オーバーレイ */
.caption.overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.thumbnail:hover .caption.overlay {
  opacity: 1;
}

.caption.overlay h3 {
  margin-right: 1rem;
  font-size: 1.1rem;
}

.caption.overlay p {
  color: #ddd;
  white-space: nowrap;
}

/* モバイル用キャプション */
.caption.below {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.caption.below h3 {
  font-size: 1rem;
  margin-right: 1rem;
}

.caption.below p {
  color: #666;
  white-space: nowrap;
}

/* フッター */
footer {
  margin-top: 4rem;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  padding: 1rem 0;
  border-top: 1px solid #eee;
  font-family: var(--font-family);
}

.footer-pc {
  display: inline;
}

.footer-sp {
  display: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem;
  }

  .header-layout {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .site-title {
    font-size: 0.8rem;
  }

  .site-title-pc {
    display: none;
  }

  .site-title-sp {
    display: inline;
  }

  .faculty-box {
    min-width: auto;
    width: 100%;
    padding: 0.5rem;
  }

  .faculty-box h3 {
    font-size: 0.8rem;
    margin-bottom: 0;
  }

  .faculty-names-section {
    gap: 1rem;
  }

  .faculty-names {
    font-size: 1rem;
  }

  .university {
    font-size: 0.7rem;
  }

  .sd-logo {
    height: 40px;
  }

  .footer-pc {
    display: none;
  }

  .footer-sp {
    display: inline;
  }

  .main-title {
    height: 3rem;
  }

  .description-section {
    margin-left: 0;
  }

  .description {
    font-size: 0.8rem;
    line-height: 1.7;
  }

  .thumbnail-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* モバイルではオーバーレイを非表示にし、下部キャプションを表示 */
  .caption.overlay {
    display: none;
  }

  .caption.below {
    display: flex;
    pointer-events: none;
  }

  /* モバイルではホバーエフェクトを無効化 */
  .thumbnail:hover {
    transform: none;
  }

  .thumbnail:hover img {
    transform: none;
  }

  /* SP版でのタップ動作を修正 */
  .thumbnail-item {
    -webkit-tap-highlight-color: transparent;
  }

  .thumbnail {
    pointer-events: none;
  }
}
