/**
 * Front Page Styles (front-page.php)
 *
 * セクション構成:
 * - section1: ヒーローセクション（画像スライダー）
 * - section2: サービス紹介
 * - section2-1: 大切にしていること
 * - section3: メッセージセクション
 * - section3-news: ニュース一覧
 *
 * front-page専用の特殊設定:
 * - 動的vh対応
 * - 安全領域（セーフエリア）対応
 * - ヘッダー位置調整
 * - モバイルメニューz-index調整
 */

/* =====================================
   Front-Page Specific: ブラウザ間のヘッダー位置統一
===================================== */

/* ブラウザ間のヘッダー位置を統一 */
.header {
  position: absolute;
  bottom: 0;
  width: 100%;
  box-sizing: border-box;
}

.header-fixed {
  position: fixed !important;
  bottom: auto !important;
  top: 0 !important;
  transform: translateZ(0);
  transform: translateZ(0);
  padding-top: env(safe-area-inset-top, 0);
  height: calc(74px + env(safe-area-inset-top, 0px));
}

/* WordPress管理バー表示時のヘッダー位置調整 */
.admin-bar .header-fixed {
  top: 32px !important;
}

@media screen and (width <= 782px) {
  .admin-bar .header-fixed {
    top: 46px !important;
  }
}

/* front-page専用: モバイルメニューのz-index調整 */
.mobile-menu-overlay {
  z-index: 9998 !important;
}

.mobile-nav {
  z-index: 9999 !important;
}

/* front-page専用: ハンバーガーメニューボタンのz-index */
.hamburger-menu {
  z-index: 10000 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* front-page専用: SP版ハンバーガーメニュー調整 */
@media (width <= 700px) {
  .header-hamburger-menu {
    width: 60px !important;
    justify-content: center !important;
  }

  .hamburger-menu {
    width: 28px !important;
    margin: 0 auto !important;
  }
}

/* モバイルメニューの初期状態（非表示） */
.mobile-menu-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mobile-nav {
  transform: translateX(100%);
}

/* アクティブ時の表示 */
.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-nav.active {
  transform: translateX(0);
}

/* ヒーロー: 動的vh対応 + 安全領域で内容をクリップ */

/* セーフエリアは直接env()関数を使用（変数継承の問題を回避） */
.home .section1 {
  /* 古い環境は main.js の --vh フォールバック（すでに実装済み） */
  height: calc(var(--vh, 1vh) * 100);

  /* 新しいvhが使える環境を優先 */
  height: 100svh;
  height: 100dvh;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  overflow: hidden;
}

/* 背景レイヤーは領域一杯まで（安全域パディングの外側でもOK） */
.home .slider-bg-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.home .section1 .filter {
  height: 100%;
}

/* ヘッダーを常時固定している場合の食い込み防止（任意） */
.home .header-fixed+main {
  padding-top: calc(74px + env(safe-area-inset-top, 0px));
}

/* =====================================
   Section1: ヒーローセクション
===================================== */
.section1 {
  box-sizing: border-box;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  height: calc(var(--vh, 1vh) * 100);
  display: flex;
  align-items: center !important;
  position: relative;
  transition: background-image 1s ease-in-out;
  font-family: YakuHanJP, "Noto Sans Japanese", "Noto Sans", "Noto Sans CJK JP", sans-serif;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@supports (height: 100svh) {
  .section1 {
    height: 100svh;
  }
}

@supports (height: 100dvh) {
  .section1 {
    height: 100dvh;
  }
}

.section1 .slick-slider {
  width: 100%;
}

/* スライダー背景コンテナ用のスタイル */
.slider-bg-container {
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* スライダー背景要素 - エレガントなズーム＋ぼかしエフェクト用 */
.slider-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  z-index: 0;
  will-change: transform, opacity, filter;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* アクティブな背景 */
.slider-bg.active {
  opacity: 1;
  z-index: 1;
}

/* 背景画像に対する上品なオーバーレイ */
.slider-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgb(0 0 0 / 10%) 0%,
    rgb(0 0 0 / 0%) 30%,
    rgb(0 0 0 / 0%) 70%,
    rgb(0 0 0 / 30%) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* ズームエフェクト用のキーフレーム */
@keyframes smoothZoomIn {
  from {
    transform: scale(1.15) translateZ(0);
    filter: blur(5px);
  }

  to {
    transform: scale(1) translateZ(0);
    filter: blur(0);
  }
}

/* スライド＋ぼかしエフェクト用のキーフレーム */
@keyframes elegantSlide {
  from {
    transform: translateX(-50px) scale(1.05) translateZ(0);
    filter: blur(8px);
    opacity: 0;
  }

  to {
    transform: translateX(0) scale(1) translateZ(0);
    filter: blur(0);
    opacity: 1;
  }
}

.section1 .filter {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgb(0 0 0 / 60%) 0%,
    rgb(0 0 0 / 40%) 50%,
    rgb(0 0 0 / 70%) 100%
  );
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
}

.section1 .container {
  width: 100%;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 10;
  color: #fff;
  align-items: center;
}

.section1 h2 {
  font-size: 50px;
  letter-spacing: 0.2em;
  position: relative;
  z-index: 3;
  margin: auto;
}

.section1-subtitle-text {
  font-size: 22px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1.5s ease-out 0.6s forwards;
  text-align: center;
  margin: 0 auto;
  width: 100%;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======== 1文字ずつのテキストアニメーション ======== */

/* 注: 共通のアニメーションスタイルは base.css に移動済み */

/* front-page 専用のサブタイトルスタイル調整のみここに記載 */

/* サブタイトル専用のスタイル調整 */
.section1-subtitle-text.text-animated {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

@media (width <= 850px) {
  .section1 h2 {
    font-size: 36px;
  }

  .section1 .section1-subtitle-text {
    font-size: 14px;
  }
}

@media (width <= 550px) {
  .section1 h2 {
    font-size: 22px;
  }
}

/* =====================================
   Section2: サービス紹介
===================================== */
.section2 {
  margin: 0 auto;
}

.section2 .container {
  text-align: center;
  height: 100%;
}

.section2 .container .section2-title {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-top: 36px;
  margin-bottom: 0;
  text-align: center;
  color: #fff;
  padding: 0 14px;
}

.section2 .container .section2-title h2 {
  font-size: 32px !important;
  line-height: 1.4;
  letter-spacing: 0.3em;
  margin: 0;
  padding: 24px 0;
  text-align: center;
  font-family: "Yu Mincho", serif;
}

@media (width <= 650px) {
  .section2 .container .section2-title h2 {
    font-size: 24px !important;
  }
}

.section2 .container .section2-title .section2-title-p {
  margin-top: 8px;
  font-size: 16px;
}

@media (width <= 650px) {
  .section2 .container .section2-title .section2-title-p {
    font-size: 14px;
  }
}

.section2 .container .section2-title .section2-subtitle-row {
  max-width: 100%;
  margin: 0 auto;
}

.section2 .container .section2-subtitle-col {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  text-align: center;
}

.section2 .container .section2-subtitle-text {
  font-size: 24px;
  line-height: 48px;
  letter-spacing: 0.1em;
}

@media (width <= 600px) {
  .section2 .container .section2-subtitle-text {
    font-size: 16px;
    letter-spacing: normal;
    line-height: 32px;
  }
}

.section2 .title {
  line-height: 20px;
  font-size: 32px;
  position: relative;
  display: inline-block;
  padding-bottom: 5px;
}

@media (width <= 650px) {
  .section2 .title {
    font-size: 24px;
  }
}

@media (width <= 400px) {
  .section2 .title {
    font-size: 20px;
  }
}

.section2 h3.title {
  margin: 32px 0 0;
}

.section2 .message-container {
  background-color: #fff;
  position: relative;
}

.section2 .message-container .container {
  color: #000;
}

.section2 .message-container .container .title {
  line-height: 20px;
  font-size: 24px;
  display: inline-block;
  margin-top: 0;
}

@media (width <= 600px) {
  .section2 .message-container .container .title {
    font-size: 18px;
    line-height: 24px;
  }
}

.section2 .message-container .container .title h3 {
  position: relative;
  display: inline-block;
  padding: 0 40px;
  margin-top: 36px;
  font-size: 32px;
}

@media (width <= 600px) {
  .section2 .message-container .container .title h3 {
    font-size: 20px;
  }
}

.section2 .message-container .container .title h3::before {
  left: 0;
}

.section2 .message-container .container .title h3::after {
  right: 0;
}

.section2 .message-container .container .title .message {
  color: #000;
  font-size: 28px;
  line-height: 56px;
  letter-spacing: 0.2em;
  margin: 0 0 36px;
}

@media (width <= 750px) {
  .section2 .message-container .container .title .message {
    font-size: 24px;
    line-height: 48px;
    letter-spacing: 0.1em;
  }
}

@media (width <= 600px) {
  .section2 .message-container .container .title .message {
    font-size: 16px;
    line-height: 32px;
    letter-spacing: normal;
  }
}

.section2 .fade-text {
  display: block;
  font-size: 30px;
  line-height: 1.4;
  margin-bottom: 40px;
  color: transparent;
  background-clip: text;
  background-clip: text;
  background-size: 200% 100%;
  opacity: 0;
  transform: translateY(50px);
}

.section2 .to__up.animate {
  background-position: 200% center;
  animation: slideUp var(--duration, 2.4s) var(--ease, ease-out)
    var(--delay, 0.6s) forwards;
}

@keyframes slideUp {
  to {
    color: #fff;
    transform: translateY(0);
    background-position: -100% center;
    opacity: 1;
  }
}

/* =====================================
   Section2-1: 大切にしていること
===================================== */
.section2-1 {
  margin: 0;
  background-color: #fff;
  color: linear-gradient(135deg, #26262f 0%, #16161a 50%, #090912 100%);
  padding-top: 18px;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

/* 追加動きのある背景 */
.section2-1::before {
  content: "";
  position: absolute;
  width: 700px;
  height: 800px;
  border-radius: 50%;
  background: #f0f0f0;
  opacity: 0.5;
  top: 0;
  left: -350px;
  animation: float 15s ease-in-out infinite alternate;
}

/* 追加 */
.section2-1::after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: #f0f0f0;
  opacity: 0.3;
  bottom: -150px;
  right: -150px;
  z-index: 0;
  animation: float 12s ease-in-out infinite alternate-reverse;
}

/* 動きを大きくした float アニメーション */
@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(50px, 35px) scale(1.08);
  }

  100% {
    transform: translate(20px, 70px) scale(0.92);
  }
}

/* --------シェイブのCSS-------- */
.section2-1 .shape-divider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 1;
}

.section2-1 .shape-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 18px;
}

.section2-1 .shape-divider .shape-fill {
  fill: #16161a;
}

.section2-1 .container {
  background-color: #fff;
}

.section2-1 h3 {
  font-size: 32px;
  line-height: 1.4;
  letter-spacing: 0.1em;
  margin: 0;
  padding: 24px 0;
  text-align: center;
  color: #16161a;
}

/* 親コンテナに固定高さを設定 */
.section2-1 .message-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  flex-direction: row;
  padding: 20px 0;
  height: 320px;
  padding-bottom: 20px;
  padding-top: 20px;
}

.section2-1 .message-row:nth-child(2) {
  padding-top: 20px;
}

.section2-1 .message-col {
  border-radius: 12px;
  width: 48%;
  min-width: 280px;
  color: #16161a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  box-sizing: border-box;
  background-color: #fff;
  box-shadow: 0 8px 30px rgb(0 0 0 / 8%);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  position: relative;
  border: 1px solid #e5e5e5;
  z-index: 1;
}

.section2-1 .message-col:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgb(0 0 0 / 12%);
}

.section2-1 .message-col::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #e5e5e5, #d4d2d2);
}

.section2-1 .message-col img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  box-sizing: border-box;
}

.section2-1 .message {
  margin: 0;
  padding: 20px 28px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  box-sizing: border-box;
}

.section2-1 .message h4 {
  font-size: 22px;
  margin: 0;
  padding-bottom: 16px;
  position: relative;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #333;
}

.section2-1 .message h4::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #e5e5e5, #d4d2d2);
  border-radius: 3px;
}

.section2-1 .message p {
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
  color: #555;
}

.section2-1 hr {
  position: relative;
  z-index: 5;
}

/* レスポンシブ対応 */
@media (width <= 768px) {
  .section2-1 .message-row {
    flex-direction: column;
    height: auto;
  }

  .section2-1 .message-row:nth-child(4) {
    flex-direction: column-reverse;
    height: auto;
  }

  .section2-1 .message-col {
    width: 100%;
    height: 320px;
    margin-bottom: 20px;
  }

  .section2-1 .message-row:nth-child(2) {
    padding-top: 20px;
  }
}

@media (width <= 650px) {
  .section2-1 .title h3 {
    font-size: 24px;
  }
}

/* =====================================
   Section3: メッセージセクション
===================================== */
.section3 {
  text-align: center;
  position: relative;
  padding-top: 18px;
  background-color: #cf0d37;
  overflow: hidden;
}

/* 追加動きのある背景 */
.section3::after {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  filter: brightness(1.2);
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.15;
  bottom: 20px;
  right: -80px;
  border-radius: 0;
  animation: rotate-center 180s linear infinite;
}

/* 新しい回転アニメーション */
@keyframes rotate-center {
  0% {
    transform: rotate(15deg);
  }

  100% {
    transform: rotate(375deg);
  }
}

.section3 .shape-divider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 1;
}

.section3 .shape-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 19px;
}

.section3 .shape-divider .shape-fill {
  fill: #fff;
}

.section3 .message-container {
  background-color: #cf0d37;
  position: relative;
}

.section3 .message-container .title {
  line-height: 20px;
  font-size: 24px;
  display: inline-block;
  margin-top: 0;
}

.section3 .message-container .title h3 {
  position: relative;
  display: inline-block;
  padding: 0 40px;
  margin-top: 36px;
  margin-bottom: 24px;
  color: #fff;
  font-size: 32px;
  line-height: 1.4;
  letter-spacing: 0.1em;
  z-index: 2;
}

.section3 .message-container .title h3::before {
  left: 0;
}

.section3 .message-container .title h3::after {
  right: 0;
}

.section3 .message-container .title .section3-message {
  color: #fff;
  font-size: 24px;
  line-height: 48px;
  letter-spacing: 0.1em;
  margin: 0 0 36px;
  z-index: 2;
  position: relative;
}

@media (width <= 750px) {
  .section3 .message-container .title h3 {
    font-size: 32px;
  }
}

@media (width <= 650px) {
  .section3 .message-container .title h3 {
    font-size: 24px;
  }
}

@media (width <= 600px) {
  .section3 .message-container .title {
    font-size: 18px;
    line-height: 24px;
  }

  .section3 .message-container .title .section3-message {
    font-size: 16px;
    line-height: 32px;
    letter-spacing: normal;
  }
}

.section3 .fade-text {
  display: block;
  font-size: 30px;
  line-height: 1.4;
  margin-bottom: 40px;
  color: transparent;
  background-clip: text;
  background-clip: text;
  background-size: 200% 100%;
  opacity: 0;
  transform: translateY(50px);
}

.section3 .to__up.animate {
  background-position: 200% center;
  animation: slideUp var(--duration, 2.4s) var(--ease, ease-out)
    var(--delay, 0.6s) forwards;
}

/* =====================================
   Section3-News: お知らせ一覧
===================================== */
.section3-news {
  padding: 4px 0 36px;
  color: #000;
  letter-spacing: 0.1em;
  background-color: #CF0D37;
}

.section3-news .container {
  text-align: center;
  background-color: #fff;
  padding: 32px 24px !important;
  width: 80%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

.section3-news .section3-news-title {
  padding: 0 !important;
  margin: 0 0 16px;
}

.section3-news .section3-news-title h2 {
  margin: 0 0 8px;
  padding: 0;
}

.section3-news #animatedtext1-5 {
  padding: 0;
  margin: 0 0 8px;
  font-family: "Yu Mincho", serif;
}

.section3-news .section3-news-subtitle {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 14px;
}

.section3-news .section3-news-content-detail {
  text-align: left;
  padding: 8px 12px;
  margin: 0 -12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  border-left: 3px solid transparent;
}

.section3-news .section3-news-content-detail:hover {
  border-left-color: #CF0D37;
  padding-left: 16px;
}

.news-hr {
  border: 0.3px solid #ccc;
  margin:8px 0 0!important;
}

.section3-news .news-date {
  font-size: 12px;
  margin: 0;
  color: #666;
  transition: color 0.3s ease;
}

.section3-news-content-detail:hover .news-date {
  color: #CF0D37;
}

.section3-news .news-title {
  margin: 0;
  font-size: 14px;
  transition: color 0.3s ease;
}

.section3-news-content-detail:hover .news-title {
  color: #CF0D37;
  font-weight: 500;
}

.section3-news-content-detail a {
  color: #000;
  text-decoration: none;
  display: block;
  transition: all 0.4s ease;
  position: relative;
}

.section3-news .news-link {
  color: #333;
  border-bottom: 0.5px solid #333;
}

.section3-news .news-link-text {
  margin: 4px 0 8px;
  font-size: 12px;
}

.section3-news .btn-container {
  margin:0 auto;
}

.section3-news .news-button {
  background-color: #000;
  max-width: 150px;
  margin: 24px auto 0;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgb(0 0 0 / 20%);
  position: relative;
  overflow: hidden;
}

.section3-news .news-button:hover {
  box-shadow: 0 6px 20px rgb(0 0 0 / 30%);
}

.section3-news .news-btn {
  display: inline-block;
  padding: 8px;
  text-decoration: none;
  color: #fff;
  text-align:center;
  font-size: 14px;
}

.news-hr {
  margin: 8px 0 !important;
}

/* ======== スクロールトリガー フェードインアニメーション ======== */
.fade-in-scroll {
  opacity: 0;
  transform: translateY(30px);
}

.fade-in-scroll.visible {
  animation: fadeInUpScroll 1.5s ease-out forwards;
}

@keyframes fadeInUpScroll {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================================
   GSAP Animations Enhancements
===================================== */

/* セクション2-1: カードホバーエフェクト強化 */
.section2-1 .message-col {
  will-change: transform;
  cursor: pointer;
}

.section2-1 .message-col img {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.section2-1 .message-col:hover img {
  transform: scale(1.05);
}

/* セクション3: メッセージライン */
.message-line {
  display: inline-block;
}

/* ニュースアイテム: ホバーエフェクト */
.section3-news-content-detail {
  transition: background-color 0.3s ease;
  border-radius: 4px;
  padding: 4px 0;
}

.section3-news-content-detail:hover {
  background-color: rgb(0 0 0 / 2%);
}

.section3-news-content-detail a {
  display: block;
  transition: all 0.3s ease;
}

.section3-news-content-detail .news-title {
  transition: color 0.3s ease;
}

.section3-news-content-detail:hover .news-title {
  color: #CF0D37;
}

/* ボタンホバーエフェクト強化 */
.news-button {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.news-button:hover {
  transform: translateY(-2px) scale(1.02);
}

/* パフォーマンス最適化 */
.char,
.message-line,
.section2-1 .message-col,
.section3-news-content-detail {
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* アニメーション用の初期状態 */
.gsap-init {
  opacity: 0;
  visibility: hidden;
}

.gsap-init.gsap-active {
  opacity: 1;
  visibility: visible;
}
