/* ===== 整理版アニメーションCSS（TOPページ専用） ===== */

/* 基本アニメーションクラス - シンプル化 */
.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
}

.slide-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.slide-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-right {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s ease;
}

.slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ===== ヒーローセクション - 控えめに ===== */
.hero-content {
    animation: heroFadeIn 1.5s ease;
}

.hero-title {
    animation: heroTitleSlide 1s ease 0.2s both;
}

.hero-subtitle {
    animation: heroSubtitleFade 0.8s ease 0.5s both;
}

@keyframes heroFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes heroTitleSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroSubtitleFade {
    from { opacity: 0; }
    to { opacity: 0.9; }
}

/* ===== 福祉セクション - 必要最小限 ===== */
.office-intro-new,
.section-title-new {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.office-intro-new.visible,
.section-title-new.visible {
    opacity: 1;
}

/* ストーリーアイテム - 下から上のみ */
.story-item {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease;
}

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

/* ストーリー内部要素は遅延なし */
.story-content p {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.story-item.visible .story-content p {
    opacity: 1;
}

/* ハイライトテキスト - シンプルな下線のみ */
.highlight-text {
    position: relative;
    background: linear-gradient(transparent 60%, rgba(153, 122, 79, 0.2) 60%);
}

/* ===== ボタンホバー + リップル効果 ===== */
.button,
.button2,
.button3 {
    position: relative;
    overflow: visible;
    padding: 10px 15px;
    transition: transform 0.3s ease;
}

.button::before,
.button2::before,
.button3::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.5s ease;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.button:hover::before,
.button2:hover::before,
.button3:hover::before {
    width: 250px;
    height: 250px;
}

.button img,
.button2 img,
.button3 img {
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.button:hover img,
.button2:hover img,
.button3:hover img {
    transform: scale(1.05);
    filter: drop-shadow(3px 8px 15px rgba(0, 0, 0, 0.2));
}

/* リップルエフェクト用アニメーション */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== マウス追従エフェクト ===== */
#global-cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background: rgba(73, 150, 92, 0.2);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: background 0.3s ease;
  transform: translate3d(-50%, -50%, 0) scale(1);
  will-change: transform;
}

/* ===== サービスカード - シンプル化 ===== */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 上部の線エフェクト - 維持 */
@media (min-width: 769px) {
    .service-content {
        position: relative;
    }

    .service-content::before {
        content: '';
        position: absolute;
        left: -10px;
        top: 0;
        width: 3px;
        height: 0;
        background: linear-gradient(180deg, #49965c, #9B7B4F);
        transition: height 0.6s ease;
        border-radius: 2px;
    }

    .service-content.visible::before {
        height: 100%;
    }
}

/* ===== お知らせアイテム - シンプル化 ===== */
.top-news-item {
    transition: all 0.3s ease;
}

.top-news-item:hover {
    transform: translateX(8px);
    background: linear-gradient(90deg, #f8f9fa, #ffffff);
    border-left: 3px solid #49965c;
    padding-left: 12px;
}

/* ===== コンタクトメソッド - ホバー維持 ===== */
.contact-method {
    transition: all 0.3s ease;
    position: relative;
}

.contact-method::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(73, 150, 92, 0.1) 0%, transparent 70%);
    transition: all 0.6s ease;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 0;
}

.contact-method:hover::after {
    width: 200px;
    height: 200px;
}

.contact-method:hover .contact-icon {
    transform: scale(1.1) rotate(5deg);
}

.contact-method:hover .contact-icon img {
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

.contact-icon {
    transition: transform 0.3s ease;
}

.contact-icon img {
    transition: filter 0.3s ease;
}


/* ===== モバイル最適化 ===== */
@media (max-width: 768px) {
    /* マウスフォロワーを無効化 */
    #global-cursor-follower {
        display: none !important;
    }
    
    /* ホバー効果を無効化 */
    .button::before,
    .button2::before,
    .button3::before,
    .contact-method::after {
        display: none;
    }
    
    /* アニメーション時間を短縮 */
    .fade-in,
    .slide-up,
    .slide-right,
    .story-item {
        transition-duration: 0.4s;
    }
    
    /* ホバー削除 */
    .service-card:hover,
    .news-item:hover,
    .contact-method:hover {
        transform: none;
    }
    
    /* タップ時のみ軽い反応 */
    .service-card:active {
        opacity: 0.8;
    }
}

/* ===== アクセシビリティ対応 ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01s !important;
        transition-duration: 0.01s !important;
    }
    
    #global-cursor-follower,
    .button::before,
    .button2::before,
    .button3::before,
    .contact-method::after,
    .service-content::before {
        display: none !important;
    }
}



/* ===== 会社情報ページ専用アニメーションCSS ===== */

/* ===== 会社概要テーブル（程よいアニメーション） ===== */
.company-table {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    visibility: hidden;
}

.company-table.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.company-table tr {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.company-table.visible tr {
    opacity: 1;
    transform: translateY(0);
}

/* 行ごとに少しずつ遅延（控えめ） */
.company-table.visible tr:nth-child(1) { transition-delay: 0.05s; }
.company-table.visible tr:nth-child(2) { transition-delay: 0.08s; }
.company-table.visible tr:nth-child(3) { transition-delay: 0.11s; }
.company-table.visible tr:nth-child(4) { transition-delay: 0.14s; }
.company-table.visible tr:nth-child(5) { transition-delay: 0.17s; }
.company-table.visible tr:nth-child(6) { transition-delay: 0.20s; }
.company-table.visible tr:nth-child(7) { transition-delay: 0.23s; }
.company-table.visible tr:nth-child(8) { transition-delay: 0.26s; }

/* ===== スマホ対応 ===== */
@media (max-width: 768px) {
    .company-table {
        transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        transform: translateY(30px);
    }
    
    .company-table tr {
        transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
}


/* ===== 沿革タイムライン ===== */
.history-timeline {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s ease;
    position: relative;
    visibility: hidden;
}

.history-timeline.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* タイムライン縦線 */
.history-timeline::before {
    content: '';
    position: absolute;
    left: 150px;
    top: 0;
    width: 2px;
    height: 100%;
    background: #9B7B4F;
    border-radius: 1px;
    z-index: 1;
}

/* 沿革アイテム */
.history-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: relative;
    padding-left: 170px;
    margin-bottom: 25px;
    visibility: hidden;
}

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

/* 順次表示用のディレイ */
.history-item:nth-child(1) { transition-delay: 0.1s; }
.history-item:nth-child(2) { transition-delay: 0.2s; }
.history-item:nth-child(3) { transition-delay: 0.3s; }
.history-item:nth-child(4) { transition-delay: 0.4s; }
.history-item:nth-child(5) { transition-delay: 0.5s; }
.history-item:nth-child(6) { transition-delay: 0.6s; }
.history-item:nth-child(7) { transition-delay: 0.7s; }
.history-item:nth-child(8) { transition-delay: 0.8s; }
.history-item:nth-child(9) { transition-delay: 0.9s; }
.history-item:nth-child(10) { transition-delay: 1.0s; }

.history-content {
    line-height: 1.7;
    color: #333;
    position: relative;
    padding-left: 20px;
}

/* ===== 理念アイテム ===== */
.philosophy-item-company {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

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

/* ===== 目標アイテム ===== */
.vision-card {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.6s ease-out;
}

.vision-card.visible {
    opacity: 1;
    transform: translateY(0);
} 

/* ===== アクセスセクション ===== */
.access-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    visibility: hidden;
}

.access-section.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.access-title {
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    visibility: hidden;
}

.access-title.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.office-info,
.transport-info {
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    visibility: hidden;
}

.office-info {
    transform: translateX(20px);
}

.transport-info {
    transform: translateX(-20px);
    padding: 0 20px;
}

.office-info.visible,
.transport-info.visible {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
}

.transport-list li {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    padding-left: 20px;
    visibility: hidden;
}

.transport-list li.visible {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
}

.transport-list li:nth-child(1) { transition-delay: 0.1s; }
.transport-list li:nth-child(2) { transition-delay: 0.2s; }
.transport-list li:nth-child(3) { transition-delay: 0.3s; }

/* ===== 地図アニメーション ===== */
.access-map {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    position: relative;
    visibility: hidden;
}

.access-map.visible {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
}

.access-map iframe {
    transition: all 0.3s ease;
}

/* ===== タブパネルアニメーション ===== */
.tab-panel {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tab-panel:not(.active) {
    opacity: 0;
    transform: translateY(15px);
    pointer-events: none;
}

/* ===== スマホ対応 ===== */
@media (max-width: 768px) {
    .company-table {
        transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        transform: translateY(20px);
    }
    
    .company-table tr {
        transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        transform: translateX(25px);
    }
    
    .history-timeline {
        transition: all 0.5s ease;
        transform: translateY(30px);
    }
    
    .history-timeline::before {
        left: 30px;
        width: 2px;
    }
    
    .history-item {
        padding-left: 50px;
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.5s ease, transform 0.5s ease;
    }
    
    .office-info,
    .transport-info {
        transform: translateY(20px);
        transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .access-map {
        transform: scale(0.92);
        transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
}

/* ===== アクセシビリティ対応 ===== */
@media (prefers-reduced-motion: reduce) {
    .company-table,
    .company-table tr,
    .history-timeline,
    .history-item,
    .access-section,
    .access-title,
    .office-info,
    .transport-info,
    .transport-list li,
    .access-map,
    .tab-panel,
    .philosophy-item-company,
    .vision-card {
        transition-duration: 0.1s !important;
        animation-duration: 0.1s !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .history-timeline::before {
        height: 100% !important;
        opacity: 1 !important;
    }
}

/* ===== JavaScriptが無効な場合 ===== */
.no-js .company-table,
.no-js .company-table tr,
.no-js .history-timeline,
.no-js .history-item,
.no-js .access-section,
.no-js .access-title,
.no-js .office-info,
.no-js .transport-info,
.no-js .transport-list li,
.no-js .access-map,
.no-js .philosophy-item-company,
.no-js .vision-card {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    transition: none !important;
}

.no-js .history-timeline::before {
    height: 100% !important;
}

/* ===================================================
   役員紹介セクション - アニメーション
   ================================================ */

/* セクション全体のフェードイン */
.introduce-section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    visibility: hidden;
}

.introduce-section.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* 見出しのアニメーション */
.introduce-intro {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    visibility: hidden;
}

.introduce-intro.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* 役員アイテムのアニメーション */
.executive-item {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    visibility: hidden;
}

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

/* 各役員アイテムへの遅延設定 */
.executive-item:nth-child(1) {
    transition-delay: 0.1s;
}

.executive-item:nth-child(2) {
    transition-delay: 0.3s;
}

/* 写真のスケールイン効果 */
.executive-photo-wrapper {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.executive-item.visible .executive-photo-wrapper {
    opacity: 1;
    transform: scale(1);
}

/* バッジのスライドイン */
.executive-badge {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.executive-item.visible .executive-badge {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.2s;
}

/* 情報セクションのフェードイン */
.executive-info {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.executive-item.visible .executive-info {
    opacity: 1;
    transform: translateX(0);
}

/* 名前のアニメーション */
.executive-name {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.executive-item.visible .executive-name {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.15s;
}

/* 英名のアニメーション */
.executive-name-en {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.executive-item.visible .executive-name-en {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

/* メッセージボックスのアニメーション */
.executive-message {
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.executive-item.visible .executive-message {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.25s;
}

/* メッセージ内部テキストの段階的表示 */
.message-title {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.executive-item.visible .message-title {
    opacity: 1;
    transition-delay: 0.35s;
}

.message-content {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.executive-item.visible .message-content {
    opacity: 1;
    transition-delay: 0.4s;
}

/* ===================================================
   レスポンシブ対応（768px以下）
   ================================================ */
@media (max-width: 768px) {
    .introduce-section {
        transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        transform: translateY(25px);
    }
    
    .introduce-intro {
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        transform: translateY(15px);
    }
    
    .executive-item {
        transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        transform: translateY(30px);
    }
    
    .executive-item:nth-child(1) {
        transition-delay: 0.1s;
    }

    .executive-item:nth-child(2) {
        transition-delay: 0.25s;
    }
    
    .executive-photo-wrapper {
        transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    
    .executive-item.visible .executive-photo-wrapper {
        transition-delay: 0.1s;
    }
}

/* ===================================================
   アクセシビリティ対応
   ================================================ */
@media (prefers-reduced-motion: reduce) {
    .introduce-section,
    .introduce-intro,
    .executive-item,
    .executive-photo-wrapper,
    .executive-badge,
    .executive-info,
    .executive-name,
    .executive-name-en,
    .executive-message,
    .message-title,
    .message-content {
        transition-duration: 0.1s !important;
        animation-duration: 0.1s !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===================================================
   JavaScriptが無効な場合
   ================================================ */
.no-js .introduce-section,
.no-js .introduce-intro,
.no-js .executive-item,
.no-js .executive-photo-wrapper,
.no-js .executive-badge,
.no-js .executive-info,
.no-js .executive-name,
.no-js .executive-name-en,
.no-js .executive-message,
.no-js .message-title,
.no-js .message-content {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    transition: none !important;
}