/**
 * RIFF テーマのカスタムCSSファイル
 *
 * @package RIFF
 */

/* ヒーローセクションの新しいスタイル */
.hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  margin-top: 70px;
  background-color: #000;
}

/* 背景画像コンテナ - デフォルトでは非表示 */
.hero-backgrounds {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block; /* 常に表示するように変更 */
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.hero-background.active {
  opacity: 1;
  visibility: visible;
}

.hero-background .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent; /* オーバーレイを透明に */
}

.hero-image-container,
.hero-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-image,
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

/* グリッドアイテムのビデオ表示用スタイル */
.grid-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.grid-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ホバーモード時にはグリッドビデオを非表示 */
.hero-section.hover-mode .grid-video-container {
  opacity: 0;
}

/* オーバーレイをグリッドアイテム内に追加（軽量化） */
.hero-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.05);
  z-index: 2;
  pointer-events: none;
  transition: background-color 0.3s ease;
}

/* ホバー時のオーバーレイ調整 */
.hero-item:hover::after {
  background-color: transparent;
}

/* ホバーモード時のオーバーレイ */
.hero-section.hover-mode .hero-item::after {
  background-color: transparent;
}

.hero-section.hover-mode .hero-item.highlighted::after {
  background-color: transparent;
}

/* グリッドコンテナ */
.hero-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  z-index: 2;
}

/* グリッドレイアウトの種類 */
.hero-grid-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.hero-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 1fr;
}

.hero-grid-3 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr;
}

.hero-grid-4 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

/* グリッドアイテム */
.hero-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* スムーズなトランジション */
  z-index: 2;
  background-color: transparent;
  /* 各グリッドアイテムに背景画像を表示するためのスタイル */
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  border: 2px solid transparent;
}

.hero-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.hero-item.active {
  background-color: rgba(0, 0, 0, 0);
}

/* ホバーモード時のスムーズな切り替え */
.hero-section.hover-mode {
  transition: all 0.5s ease;
}

.hero-section.hover-mode .hero-item {
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ホバーモード時のボーダー表示 */
.hero-section.hover-mode .hero-item.highlighted {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 30px rgba(255, 255, 255, 0.15);
}

.hero-section.hover-mode .hero-item.dimmed {
  border-color: rgba(255, 255, 255, 0.1);
  opacity: 0.6;
  transform: scale(0.995);
}

/* 背景コンテナのスムーズな表示 */
.hero-backgrounds {
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.hero-backgrounds.visible {
  opacity: 1;
  visibility: visible;
}

/* ホバーモード時の調整 */
.hero-section.hover-mode .hero-item {
  background-image: none !important;
}

/* コンテンツスタイル - 通常時は非表示 */
.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 30px;
  color: #fff;
  z-index: 3;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  transform: translateY(100%);
  transition: transform 0.4s ease, opacity 0.4s ease, visibility 0.4s ease;
  opacity: 0;
  visibility: hidden;
}

/* 最初のグリッドアイテム（左上）のコンテンツは常に表示 */
.hero-item:first-child .hero-content {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* ホバー時にコンテンツを表示 */
.hero-item:hover .hero-content {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* ホバーモード時のコンテンツ表示制御 */
.hero-section.hover-mode .hero-content {
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
}

.hero-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.2;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 15px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.hero-button {
  display: inline-block;
  padding: 10px 25px;
  background-color: #1e73be;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 3px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.hero-button:hover {
  background-color: #3a97e4;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* スライダー関連のスタイル */
.hero-slider {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  z-index: 2;
}

.hero-slide-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

/* スライダーのコントロール */
.hero-slider-controls {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.hero-prev,
.hero-next {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 10px;
}

.hero-prev:hover,
.hero-next:hover {
  background: rgba(30, 115, 190, 0.8);
}

.hero-dots {
  display: flex;
  margin: 0 20px;
}

.hero-dot {
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  margin: 0 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hero-dot.active {
  background: #fff;
  transform: scale(1.2);
}

/* テキスト位置のバリエーション */
.hero-content-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hero-content-center-left {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  text-align: left;
  padding-left: 10%;
}

.hero-content-center-right {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  text-align: right;
  padding-right: 10%;
}

.hero-content-top-center {
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
}

.hero-content-top-left {
  top: 20%;
  left: 0;
  text-align: left;
  padding-left: 10%;
}

.hero-content-top-right {
  top: 20%;
  right: 0;
  text-align: right;
  padding-right: 10%;
}

.hero-content-bottom-center {
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
}

.hero-content-bottom-left {
  bottom: 20%;
  left: 0;
  text-align: left;
  padding-left: 10%;
}

.hero-content-bottom-right {
  bottom: 20%;
  right: 0;
  text-align: right;
  padding-right: 10%;
}

/* アニメーション効果 */
.hero-grid {
  opacity: 0;
  animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* グリッドアイテムのスライドイン */
.hero-item {
  opacity: 0;
  transform: translateY(30px);
  animation: slideUp 0.8s ease forwards;
}

.hero-item:nth-child(1) {
  animation-delay: 0.1s;
}

.hero-item:nth-child(2) {
  animation-delay: 0.2s;
}

.hero-item:nth-child(3) {
  animation-delay: 0.3s;
}

.hero-item:nth-child(4) {
  animation-delay: 0.4s;
}

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* レスポンシブ対応 - 改良版 */
@media (max-width: 1200px) {
  .hero-title {
    font-size: 22px;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .hero-button {
    padding: 9px 22px;
    font-size: 13px;
  }
}

@media (max-width: 991px) {
  .hero-title {
    font-size: 20px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .hero-button {
    padding: 8px 20px;
    font-size: 12px;
  }

  /* タブレットでのグリッド調整 */
  .hero-grid-3,
  .hero-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-grid-4 {
    grid-template-rows: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .hero-section {
    height: 90vh;
    min-height: 450px;
  }

  /* モバイルでのグリッドレイアウト */
  .hero-grid,
  .hero-grid-1,
  .hero-grid-2,
  .hero-grid-3,
  .hero-grid-4 {
    grid-template-columns: 1fr;
  }

  .hero-grid-2 {
    grid-template-rows: repeat(2, 1fr);
  }

  .hero-grid-3 {
    grid-template-rows: repeat(3, 1fr);
  }

  .hero-grid-4 {
    grid-template-rows: repeat(4, 1fr);
  }

  .hero-grid.mobile-layout .hero-item {
    min-height: 22.5vh;
  }

  /* コンテンツのサイズ調整 */
  .hero-content {
    padding: 15px;
  }

  .hero-title {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .hero-subtitle {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .hero-button {
    padding: 6px 15px;
    font-size: 11px;
  }

  /* モバイルでは常に最初のアイテムのコンテンツを表示 */
  .hero-item:first-child .hero-content {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  /* モバイルでのホバー効果の調整 */
  .hero-section.hover-mode .hero-item.dimmed {
    opacity: 0.6;
    filter: none;
    transform: none;
  }
}

@media (max-width: 480px) {
  .hero-section {
    height: 70vh;
    min-height: 350px;
  }

  .hero-content {
    padding: 10px;
  }

  .hero-title {
    font-size: 16px;
    margin-bottom: 5px;
  }

  .hero-subtitle {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .hero-button {
    padding: 5px 12px;
    font-size: 10px;
  }

  .hero-grid.mobile-layout .hero-item {
    min-height: 17.5vh;
  }
}

/* カスタムウィジェットスタイル */
.widget_riff_recent_posts ul.riff-recent-posts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.widget_riff_recent_posts ul.riff-recent-posts li {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px dotted #e5e5e5;
}

.widget_riff_recent_posts ul.riff-recent-posts li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.widget_riff_recent_posts .post-thumbnail {
  flex: 0 0 80px;
  margin-right: 15px;
}

.widget_riff_recent_posts .post-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 3px;
}

.widget_riff_recent_posts .post-content {
  flex: 1;
}

.widget_riff_recent_posts .post-title {
  display: block;
  font-size: 14px;
  font-weight: bold;
  line-height: 1.4;
  margin-bottom: 5px;
}

.widget_riff_recent_posts .post-date {
  display: block;
  font-size: 12px;
  color: #777;
}

/* ソーシャルアイコンウィジェット */
.widget_riff_social_icons ul.social-icons {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.widget_riff_social_icons ul.social-icons li {
  margin: 0 10px 10px 0;
  padding: 0;
  border: none;
}

.widget_riff_social_icons ul.social-icons li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background-color: #1e73be;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.widget_riff_social_icons ul.social-icons li a:hover {
  background-color: #3a97e4;
  transform: translateY(-3px);
}

/* お問い合わせ情報ウィジェット */
.widget_riff_contact_info ul.contact-info {
  margin: 0;
  padding: 0;
  list-style: none;
}

.widget_riff_contact_info ul.contact-info li {
  padding: 10px 0;
  border-bottom: 1px dotted #e5e5e5;
}

.widget_riff_contact_info ul.contact-info li:last-child {
  border-bottom: none;
}

.widget_riff_contact_info ul.contact-info li i {
  margin-right: 10px;
  color: #1e73be;
}

/* 検索フォームスタイル */
.search-form {
  position: relative;
}

.search-form .search-field {
  width: 100%;
  padding: 10px 15px;
  padding-right: 50px;
  border: 1px solid #e5e5e5;
  border-radius: 3px;
}

.search-form .search-submit {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  padding: 0 15px;
  background-color: #1e73be;
  color: #fff;
  border: none;
  border-radius: 0 3px 3px 0;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.search-form .search-submit:hover {
  background-color: #3a97e4;
}

/* 検索フォームの切り替え */
.search-toggle {
  display: inline-block;
  margin-left: 15px;
  cursor: pointer;
  color: #333;
}

.search-form-wrapper {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 300px;
  padding: 15px;
  background-color: #fff;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  z-index: 999;
}

.search-form-wrapper.active {
  display: block;
}

/* パンくずリスト */
.breadcrumbs {
  margin-bottom: 0px;
  padding: 12px 0;
  font-size: 14px;
  color: #777;
  border-bottom: 1px solid #f1f1f1;
}

.breadcrumbs a {
  color: #333;
}

.breadcrumbs a:hover {
  color: #1e73be;
}

/* 投稿ナビゲーション */
.post-navigation {
  margin: 50px 0;
  padding: 20px 0;
  border-top: 1px solid #f1f1f1;
  border-bottom: 1px solid #f1f1f1;
}

.post-navigation .nav-links {
  display: flex;
  justify-content: space-between;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
  flex: 0 0 48%;
}

.post-navigation .nav-next {
  text-align: right;
}

.post-navigation .nav-subtitle {
  display: block;
  margin-bottom: 5px;
  color: #777;
  font-size: 12px;
  text-transform: uppercase;
}

.post-navigation .nav-title {
  font-weight: bold;
}

.post-navigation a:hover .nav-title {
  color: #1e73be;
}

/* 著者情報 */
.author-bio {
  display: flex;
  align-items: flex-start;
  margin: 40px 0;
  padding: 30px;
  background-color: #f9f9f9;
  border-radius: 5px;
}

.author-avatar {
  flex: 0 0 100px;
  margin-right: 20px;
}

.author-avatar img {
  border-radius: 50%;
}

.author-description {
  flex: 1;
}

.author-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

.author-bio p {
  margin-bottom: 10px;
}

.author-link {
  font-weight: bold;
}

/* 関連記事 */
.related-posts {
  margin: 50px 0;
}

.related-posts h3 {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f1f1;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 30px;
}

.related-post {
  position: relative;
}

.related-post-thumbnail {
  display: block;
  margin-bottom: 15px;
}

.related-post-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 5px;
}

.related-post-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 5px;
}

.related-post-date {
  font-size: 12px;
  color: #777;
}

/* ソーシャルシェア */
.entry-share {
  margin: 30px 0;
}

.entry-share h4 {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
}

ul.social-share {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.social-share li {
  margin-right: 10px;
}

ul.social-share li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background-color: #1e73be;
  border-radius: 50%;
  transition: all 0.3s ease;
}

ul.social-share li a:hover {
  background-color: #3a97e4;
  transform: translateY(-3px);
}

/* ページネーション */
.pagination {
  margin-top: 50px;
  text-align: center;
}

.pagination .page-numbers {
  display: inline-block;
  padding: 8px 15px;
  margin: 0 5px;
  background-color: #f5f5f5;
  border-radius: 3px;
  color: #333;
  transition: all 0.3s ease;
}

.pagination .current {
  background-color: #1e73be;
  color: #fff;
}

.pagination a.page-numbers:hover {
  background-color: #e5e5e5;
}

/* 戻るボタン */
.back-to-top {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: #1e73be;
  color: #fff;
  border-radius: 3px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 99;
}

.back-to-top.show {
  display: block;
  opacity: 1;
}

.back-to-top:hover {
  background-color: #3a97e4;
  color: #fff;
}

/* モバイルメニュー */
@media (max-width: 767px) {
  .mobile-menu-toggle {
    display: block;
  }

  .mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .main-navigation {
    display: none;
  }

  .main-navigation.active {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
  }
}

/* レスポンシブスタイル */
@media (max-width: 991px) {
  .related-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .author-bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-avatar {
    margin-right: 0;
    margin-bottom: 20px;
  }

  .related-posts-grid {
    grid-template-columns: 1fr;
  }

  .post-navigation .nav-links {
    flex-direction: column;
  }

  .post-navigation .nav-previous,
  .post-navigation .nav-next {
    flex: 0 0 100%;
    margin-bottom: 15px;
    text-align: left;
  }
}

/* カスタム投稿タイプ：プラン */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 30px;
}

.plan-item {
  border: 1px solid #f1f1f1;
  border-radius: 5px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.plan-item:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-5px);
}

.plan-thumbnail {
  position: relative;
}

.plan-thumbnail img {
  width: 100%;
  height: auto;
}

.plan-category {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 5px 10px;
  background-color: #1e73be;
  color: #fff;
  font-size: 12px;
  border-radius: 3px;
}

.plan-content {
  padding: 20px;
}

.plan-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

.plan-meta {
  margin-bottom: 15px;
  font-size: 14px;
  color: #777;
}

.plan-excerpt {
  margin-bottom: 20px;
}

.plan-price {
  font-size: 24px;
  font-weight: bold;
  color: #1e73be;
  margin-bottom: 15px;
}

@media (max-width: 991px) {
  .plan-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .plan-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   固定ページのタイトル（H1）を非表示
   ========================================================================== */

/* 固定ページのメインタイトルを非表示 */
.page .entry-header,
.page .entry-title,
.page h1.entry-title {
  display: none !important;
}

/* より具体的なセレクタ */
body.page .site-main .entry-header,
body.page .site-main h1.entry-title {
  display: none !important;
}

/* タイトル削除後のコンテンツ調整 */
.page .entry-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* アイキャッチ画像がある場合の調整 */
.page .post-thumbnail {
  margin-top: 0 !important;
}

.page .post-thumbnail + .entry-content {
  margin-top: 20px;
}

/* レスポンシブ対応 */
@media (max-width: 1199px) {
  .page .entry-header,
  .page .entry-title {
    display: none !important;
  }
}

@media (max-width: 991px) {
  .page .entry-header,
  .page .entry-title {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .page .entry-header,
  .page .entry-title {
    display: none !important;
  }

  .page .entry-content {
    padding-top: 0 !important;
  }
}

@media (max-width: 480px) {
  .page .entry-header,
  .page .entry-title {
    display: none !important;
  }
}
