/* リセット */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: sans-serif;
}

/* ヘッダー */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 100; /* 背景動画より前に表示 */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.header .logo a {
  color: #fff; /* ロゴは白文字 */
  font-size: 24px;
  text-decoration: none;
  font-weight: bold;
}

/* メインナビゲーション */
.header .navbar ul {
  list-style: none;
  display: flex;
  gap: 60px; /* HOME, WORKS の間隔 */
}

/* メニュー文字を白に & ホバーで拡大 */
.header .navbar ul li a {
  display: inline-block;
  text-decoration: none;
  color: #fff;
  font-size: 35px;
  transition: transform 0.3s ease; /* ホバー時に拡大 */
}

.header .navbar ul li a:hover {
  color: #fff;
  transform: scale(1.2);
}

/* ▼ サブメニュー(ドロップダウン) ▼ */
.header .navbar ul li.has-submenu {
  position: relative; /* サブメニューをabsolute配置するために相対位置 */
}

/* サブメニュー自体を初期非表示 */
.header .navbar ul li.has-submenu .sub-menu {
  display: none;      /* これが重要: 初期は非表示 */
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  list-style: none;
  margin: 0;
  padding: 8px;
  /* 縦に2行にするなら特にflex指定は不要。
     liがそのまま縦に積まれる。
  */
}

/* サブメニュー内の項目 */
.header .navbar ul li.has-submenu .sub-menu li a {
  display: block;
  color: #fff;
  font-size: 18px;
  text-decoration: none;
  padding: 8px 16px;
  transition: background 0.3s ease;
}

/* サブメニューの各項目にホバー */
.header .navbar ul li.has-submenu .sub-menu li a:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 親(WORKS)にマウスを乗せた時だけサブメニューを表示 */
.header .navbar ul li.has-submenu:hover .sub-menu {
  display: block;
}

/* ヒーローセクション */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  padding-top: 70px; /* ヘッダーの高さ分余白 */
}

/* 背景動画レイヤー */
.background-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: 1;
}
.background-layer.active {
  opacity: 1;
  z-index: 2;
}

/* コンテナエリア */
.container {
  width: 90%;
  height: 100%;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  background: linear-gradient(to right, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0));
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  color: #fff;
}

.info h1 {
  font-size: 50px;
  margin-bottom: 20px;
  margin-left: 60px;
}

.info p {
  font-size: 25px;
  line-height: 1.5;
  margin-left: 85px;
}

/* WORKSボタンとサブメニュー */
.hero-works {
  position: relative; /* サブメニューをabsolute配置するために相対位置 */
  display: inline-block;
  margin-top: 50px; /* 余白を追加 */
  margin-left: 110px;
}

.works-button {
  display: inline-block;
  padding: 1px 15px;
  background-color: rgb(0, 0, 0);
  color: #fff;
  font-size: 40px;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.works-button:hover {
  background-color: rgba(255, 255, 255, 0.295);
  transform: scale(1.1);
}

/* サブメニューのスタイル */
.hero-sub-menu {
  display: none; /* 初期は非表示 */
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  list-style: none;
  padding: 10px 0;
  margin: 5px 0 0 0;
  border-radius: 5px;
  min-width: 200px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  z-index: 100; /* ボタンより前に表示 */
}

.hero-sub-menu li a {
  display: block;
  padding: 10px 20px;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  transition: background-color 0.3s ease;
}

.hero-sub-menu li a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* マウスオーバー時にサブメニューを表示 */
.hero-works:hover .hero-sub-menu {
  display: block;
}

/* スライダー */
.slider {
  position: absolute;
  bottom: 20px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  gap: 20px;
}

#prev, #next {
  width: 20px;
  height: 40px;
  cursor: pointer;
}

.preview {
  display: flex;
  align-items: center;
  gap: 20px;
}

.thumbnail {
  width: 150px;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.thumbnail.active {
  opacity: 1;
  transform: scale(1.2);
  border: 2px solid #fff;
}

/* スムーズスクロールを有効化 */
html {
  scroll-behavior: smooth;
}
