/**
 * スクロールアニメーション用CSS
 * TOPページの各セクション表示アニメーション
 */

/* テスト表示を強制的に無効化 */
body::before {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    content: none !important;
}



/* 基本的なアニメーションクラス */
.animate-section {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* 子要素のアニメーション */
.animate-child {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-child.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 左からスライドイン */
.animate-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* 右からスライドイン */
.animate-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* About me用スライドインアニメーション - 復活 */
.animate-slide-in-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-slide-in-left.animate-visible {
    opacity: 1;
    transform: translateX(0);
}

.animate-slide-in-right {
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.animate-slide-in-up {
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* フェードイン */
.animate-fade {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* スケールアップ */
.animate-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-scale.animate-visible {
    opacity: 1;
    transform: scale(1);
}

/* 回転しながらフェードイン */
.animate-rotate {
    opacity: 0;
    transform: rotate(-5deg) scale(0.95);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-rotate.animate-visible {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* タイピング効果のカーソル */
@keyframes typing-cursor {
    0%, 50% { border-color: transparent; }
    51%, 100% { border-color: currentColor; }
}

.typing-effect {
    display: inline-block;
}

/* About me画像用フェードインアップアニメーション */
.animate-fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.animate-fade-in-up.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-fade-in-up.image-1 {
    transition-delay: 0.2s;
}

.animate-fade-in-up.image-2 {
    transition-delay: 0.4s;
}

.animate-fade-in-up.image-3 {
    transition-delay: 0.6s;
}

/* フェードインスケールアニメーション（モバイル画像用） */
.animate-fade-in-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease-out;
}

.animate-fade-in-scale.animate-visible {
    opacity: 1;
    transform: scale(1);
}

/* 特別なアニメーション: パルス効果 */
.animate-pulse {
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    }
    100% {
        box-shadow: 0 0 40px rgba(255, 255, 255, 0.3), 0 0 60px rgba(255, 255, 255, 0.1);
    }
}

/* ホバー時の特別効果 */
.animate-hover-lift {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* 遅延アニメーション用のクラス */
.animate-delay-1 { transition-delay: 0.1s; }
.animate-delay-2 { transition-delay: 0.2s; }
.animate-delay-3 { transition-delay: 0.3s; }
.animate-delay-4 { transition-delay: 0.4s; }
.animate-delay-5 { transition-delay: 0.5s; }

/* 特定セクション用のカスタムアニメーション */

/* タイトルアンダーラインアニメーション - 文字数に正確に合わせて中央配置 */
/* About meタイトルを強制的に中央配置 */
body.home .about-section-title {
    position: relative !important;
    display: block !important;
    padding-bottom: 15px !important;
    width: fit-content !important;
    margin: 0 auto !important;
    text-align: center !important;
    font-size: 3rem !important;
    color: #333 !important;
    font-weight: 600 !important;
    letter-spacing: 2px !important;
    font-family: "游明朝", "Yu Mincho", "YuMincho", serif !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* お知らせとブログタイトルを強制的に中央配置 */
body.home .news__title,
body.home section#news .news__title,
body.home .news.animate-section .news__title {
    position: relative !important;
    display: block !important;
    padding-bottom: 15px !important;
    text-align: center !important;
    width: fit-content !important;
    margin: 40px auto 80px auto !important;
    font-size: 3rem !important;
    color: #333 !important;
    font-weight: 600 !important;
    letter-spacing: 2px !important;
    font-family: "游明朝", "Yu Mincho", "YuMincho", serif !important;
}

/* レスポンシブ時のNewsタイトルセンタリング強化 */
@media (max-width: 768px) {
    body.home .news__title,
    body.home section#news .news__title,
    body.home .news.animate-section .news__title {
        font-size: 2.5rem !important;
        margin: 30px auto 60px auto !important;
        text-align: center !important;
    }
}

@media (max-width: 480px) {
    body.home .news__title,
    body.home section#news .news__title,
    body.home .news.animate-section .news__title {
        font-size: 2rem !important;
        margin: 20px auto 40px auto !important;
        text-align: center !important;
    }
}

body.home .blog__title {
    position: relative !important;
    display: block !important;
    padding-bottom: 15px !important;
    width: fit-content !important;
    margin: 0 auto !important;
    text-align: center !important;
    font-size: 3rem !important;
    color: #333 !important;
    font-weight: 600 !important;
    letter-spacing: 2px !important;
    font-family: "游明朝", "Yu Mincho", "YuMincho", serif !important;
}

.main-name {
    position: relative !important;
    display: inline-block !important;
    padding-bottom: 10px !important;
    width: fit-content !important;
    margin: 0 auto !important;
    text-align: center !important;
}

/* 既存のAbout Meアニメーションを上書きして文字幅に合わせる */
.about-section-title::after {
    content: '' !important;
    position: absolute !important;
    bottom: 10px !important;
    left: 50% !important;
    width: 0 !important;
    height: 4px !important;
    background: #636363 !important;
    transform: translateX(-50%) !important;
    border-radius: 2px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    animation: none !important;
    transition: width 1.5s ease-out 0.5s !important;
}

/* 最強優先度でグレーライン強制適用 */
html body.home section#news .news__title::after,
html body.home .news.animate-section .news__title::after,
html body.home .news.animate-visible .news__title::after,
html body.home #news.news .news__title::after,
html body.home body section.news .news__title::after,
html body.home .news__title::after,
html body.home section#blog .blog__title::after,
html body.home .blog.animate-section .blog__title::after,
html body.home .blog.animate-visible .blog__title::after,
html body.home .blog__title::after,
html body.home .about-section-title::after,
html body.home .about-visual-section .about-section-title::after,
*::after[class*="title"]::after,
*[class*="title"]::after,
.news__title::after,
.blog__title::after,
.about-section-title::after {
    content: '' !important;
    position: absolute !important;
    bottom: 10px !important;
    left: 50% !important;
    width: 100% !important; /* 最初から100%表示 */
    height: 4px !important;
    background-color: #cccccc !important;
    background-image: none !important;
    background: #cccccc !important;
    background-attachment: initial !important;
    background-blend-mode: initial !important;
    background-clip: initial !important;
    background-origin: initial !important;
    background-position: initial !important;
    background-repeat: initial !important;
    background-size: initial !important;
    transform: translateX(-50%) !important;
    border-radius: 2px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    animation: none !important;
    transition: width 1.5s ease-out 0.5s !important;
}

/* 「ぱせり」の名前にもアンダーラインアニメーション */
.main-name::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 50% !important;
    width: 0 !important;
    height: 3px !important;
    background: #636363 !important;
    transform: translateX(-50%) !important;
    border-radius: 2px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    animation: none !important;
    transition: width 1.5s ease-out 0.8s !important;
}

body.home .about-visual-section.animate-visible .about-section-title::after,
body.home .about-visual-section.animate-visible .main-name::after,
body.home section#news.animate-visible .news__title::after,
body.home .news.animate-visible .news__title::after,
body.home .news.animate-section.animate-visible .news__title::after,
body.home #news.news.animate-visible .news__title::after,
body.home body section.news.animate-visible .news__title::after,
body.home section#blog.animate-visible .blog__title::after,
body.home .blog.animate-visible .blog__title::after,
body.home .blog.animate-section.animate-visible .blog__title::after {
    width: 100% !important;
}

/* 🎨 アンダーライン正常化：#636363でアニメーション付き */
html body.home .news__title::after,
html body.home .blog__title::after,
html body.home .about-section-title::after,
html body.home section#news .news__title::after,
html body.home section#blog .blog__title::after,
html body.home .news.animate-section .news__title::after,
html body.home .blog.animate-section .news__title::after,
html body.home .news.animate-visible .news__title::after,
html body.home .blog.animate-visible .blog__title::after,
html body.home #news.news .news__title::after,
html body.home body section.news .news__title::after,
html body.home .about-visual-section .about-section-title::after,
*[class*="title"]::after,
*[class*="news"]::after,
*[class*="blog"]::after,
.news__title::after,
.blog__title::after,
.about-section-title::after {
    content: '' !important;
    position: absolute !important;
    bottom: 10px !important;
    left: 50% !important;
    width: 0 !important; /* アニメーション用に初期幅0 */
    height: 4px !important;
    background: #636363 !important;
    background-color: #636363 !important;
    background-image: none !important;
    background-attachment: initial !important;
    background-blend-mode: initial !important;
    background-clip: initial !important;
    background-origin: initial !important;
    background-position: initial !important;
    background-repeat: initial !important;
    background-size: initial !important;
    border-image: none !important;
    border-image-source: none !important;
    transform: translateX(-50%) !important;
    border-radius: 2px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    transition: width 1.5s ease-out 0.5s !important;
}

/* About セクション */
.about-visual-section {
    opacity: 0;
    transform: translateY(60px);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.about-visual-section.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

/* About コンテナにオーバーフロー設定を修正 */
.about-visual-container {
    overflow: visible !important; /* テキストが完全に表示されるように変更 */
    position: relative !important;
}

.about-horizontal-layout {
    overflow: visible !important; /* テキストが完全に表示されるように変更 */
    position: relative !important;
    margin-top: 100px !important;
    margin-bottom: 40px !important;
    min-height: auto !important; /* 高さ制限を削除 */
}

/* About セクション全体の初期状態 */
.about-visual-section:not(.animate-visible) .about-text-box,
.about-visual-section:not(.animate-visible) .about-image-box {
    will-change: transform !important;
}

/* About セクション - テキスト完全表示優先 */
body.home .about-visual-section .about-text-box {
    opacity: 1 !important; /* 最初から表示 */
    transform: translateX(0) !important; /* 変形なし */
    transition: none !important; /* アニメーション完全無効化 */
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 25px !important;
    padding: 50px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    position: relative !important;
    overflow: visible !important; /* オーバーフロー表示 */
    margin: 0 !important; /* マージンをリセット */
    max-height: none !important; /* 最大高さ制限を削除 */
    height: auto !important; /* 高さを自動に */
    display: block !important; /* ブロック表示を確保 */
    visibility: visible !important; /* 可視性を確保 */
}

body.home .about-visual-section .about-text-box.animate-visible {
    opacity: 1;
    transform: translateX(0);
}

body.home .about-visual-section .about-image-box {
    opacity: 1; /* 最初から表示 */
    transform: translateX(0); /* 変形なし */
    transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 25px !important;
    padding: 50px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    position: relative !important;
    overflow: visible !important;
    margin: 0 !important; /* マージンをリセット */
}

body.home .about-visual-section .about-image-box.animate-visible {
    opacity: 1;
    transform: translateX(0);
}

/* ニュースセクション */
.news {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding-top: 80px !important;
}

.news.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

.news__card {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.news__card.animate-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ブログセクション */
.blog {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.blog.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

.blog__carousel-item {
    opacity: 0;
    transform: translateY(30px) rotate(-2deg);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.blog__carousel-item.animate-visible {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .animate-section {
        transform: translateY(30px);
    }
    
    .animate-slide-left,
    .animate-slide-right {
        transform: translateY(30px);
    }
    
    .animate-slide-left.animate-visible,
    .animate-slide-right.animate-visible {
        transform: translateY(0);
    }
    
    /* モバイル用のAboutセクションアニメーション調整 */
    body.home .about-visual-section .about-text-box {
        transform: translateX(-100%) !important;
        transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s !important;
    }
    
    body.home .about-visual-section .about-image-box {
        transform: translateX(100%) !important;
        transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s !important;
    }
}

/* プリファー・リデュースド・モーション対応 */
@media (prefers-reduced-motion: reduce) {
    .animate-section,
    .animate-child,
    .animate-slide-left,
    .animate-slide-right,
    .animate-fade,
    .animate-scale,
    .animate-rotate,
    .about-visual-section,
    .about-text-box,
    .about-image-box,
    .news,
    .news__card,
    .blog,
    .blog__carousel-item {
        transition: none;
        animation: none;
        transform: none;
        opacity: 1;
    }
}