/*
Theme Name: Natukano Tokyo
Theme URI: https://natukano.jp/
Description: ナチュカノ東京のオリジナルテーマ。Tailwind CSSビルド版 + カスタムCSS。Google Analytics & Search Console対応。本番環境最適化済み + スマホパフォーマンス改善。v1.5.3: スクロール最適化、ロゴ表示修正、キャッシュ実装、完全最適化版。
Author: Natukano Dev
Version: 1.6.1
Text Domain: natukano

最適化:
✓ Tailwind CSSビルド版使用（350KB → 44KBに87%削減）
✓ 使用クラスのみを含む最小化済みCSS
✓ スマホスクロールパフォーマンス大幅改善
✓ GPU加速最適化
✓ 固定背景の軽量化
*/

/* ---------------------------------------------------------
   WordPress 標準設定
--------------------------------------------------------- */
.aligncenter { display: block; margin: 0 auto; }
.alignleft { float: left; margin-right: 1.5em; }
.alignright { float: right; margin-left: 1.5em; }
.wp-caption { max-width: 100%; }

/* ---------------------------------------------------------
   ナチュカノ東京 カスタムスタイル
--------------------------------------------------------- */
body {
    background: #F0F9FF; /* 淡い水色 */
    color: #333;
    font-family: "Zen Kaku Gothic New", sans-serif !important;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* bodyにロゴパターン背景を追加（パフォーマンス最適化版） */
body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -1;
    background-image: url('http://natukano.jp/wp-content/uploads/2026/01/cropped-名称未設定のデザイン-3.png');
    background-size: 120px auto;
    background-repeat: repeat;
    transform: rotate(-15deg);
    transform-origin: center;
    pointer-events: none;
    opacity: 0.3;
    /* GPU加速 */
    will-change: transform;
    transform: translateZ(0) rotate(-15deg);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ロゴパターンの上に薄い白色のオーバーレイ（パフォーマンス最適化） */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    /* GPU加速 */
    will-change: opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* タイトル用フォント */
.font-hand {
    font-family: "Zen Kurenaido", sans-serif !important;
}
.font-serif {
    font-family: "Playfair Display", serif !important;
}

/* コンテンツ全体を少し浮かせる */
main, header, footer {
    position: relative;
    z-index: 10;
}

/* mainをflex-growで伸ばす */
main {
    flex: 1;
}

/* footerを下に固定 */
footer {
    margin-top: auto;
}

/* 
   =========================================
   背景設定（パフォーマンス最適化版）
   =========================================
*/

/* オーロラ背景（トップページ用 - モバイル最適化） */
.bg-aurora {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0; 
    background: 
        radial-gradient(at 0% 0%, hsla(339, 100%, 94%, 1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(37, 100%, 94%, 1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339, 100%, 94%, 1) 0, transparent 50%),
        radial-gradient(at 0% 50%, hsla(37, 100%, 96%, 1) 0, transparent 50%),
        radial-gradient(at 100% 50%, hsla(339, 100%, 96%, 1) 0, transparent 50%),
        radial-gradient(at 0% 100%, hsla(339, 100%, 94%, 1) 0, transparent 50%),
        radial-gradient(at 50% 100%, hsla(37, 100%, 96%, 1) 0, transparent 50%),
        radial-gradient(at 100% 100%, hsla(339, 100%, 94%, 1) 0, transparent 50%);
    background-size: 200% 200%;
    opacity: 0.6;
    pointer-events: none;
    /* GPU加速とパフォーマンス最適化 */
    will-change: background-position;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* PC版のみアニメーション有効 */
@media (min-width: 768px) {
    .bg-aurora {
        animation: aurora 20s ease infinite alternate;
    }
}

/* モバイルではアニメーションを無効化してパフォーマンス向上 */
@media (max-width: 767px) {
    .bg-aurora {
        background-position: 0% 50%;
        animation: none;
    }
}

@keyframes aurora {
    0% { background-position: 0% 50% }
    50% { background-position: 100% 50% }
    100% { background-position: 0% 50% }
}

/* おしゃれな背景（幾何学模様 - パフォーマンス最適化） */
.bg-stylish {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #f8faff;
    background-image: 
        radial-gradient(at 15% 15%, hsla(339, 100%, 93%, 0.4) 0px, transparent 50%),
        radial-gradient(at 85% 15%, hsla(190, 60%, 92%, 0.6) 0px, transparent 50%),
        radial-gradient(at 85% 85%, hsla(339, 100%, 93%, 0.4) 0px, transparent 50%),
        radial-gradient(at 15% 85%, hsla(190, 60%, 92%, 0.6) 0px, transparent 50%);
    background-attachment: fixed;
    pointer-events: none;
    /* GPU加速 */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* モバイルでは幾何学模様を簡略化 */
@media (max-width: 767px) {
    .bg-stylish::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: 
            linear-gradient(30deg, #dce7f3 12%, transparent 12.5%, transparent 87%, #dce7f3 87.5%, #dce7f3),
            linear-gradient(150deg, #dce7f3 12%, transparent 12.5%, transparent 87%, #dce7f3 87.5%, #dce7f3);
        background-size: 80px 140px;
        background-position: 0 0, 40px 70px;
        opacity: 0.1;
        pointer-events: none;
    }
}

/* PC版は複雑な模様 */
@media (min-width: 768px) {
    .bg-stylish::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: 
            linear-gradient(30deg, #dce7f3 12%, transparent 12.5%, transparent 87%, #dce7f3 87.5%, #dce7f3),
            linear-gradient(150deg, #dce7f3 12%, transparent 12.5%, transparent 87%, #dce7f3 87.5%, #dce7f3),
            linear-gradient(30deg, #dce7f3 12%, transparent 12.5%, transparent 87%, #dce7f3 87.5%, #dce7f3),
            linear-gradient(150deg, #dce7f3 12%, transparent 12.5%, transparent 87%, #dce7f3 87.5%, #dce7f3),
            linear-gradient(60deg, #dce7f377 25%, transparent 25.5%, transparent 75%, #dce7f377 75%, #dce7f377),
            linear-gradient(60deg, #dce7f377 25%, transparent 25.5%, transparent 75%, #dce7f377 75%, #dce7f377);
        background-size: 80px 140px;
        background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;
        opacity: 0.15;
        pointer-events: none;
    }
}

/* セクション限定の背景（トップページ用 - パフォーマンス最適化） */
.bg-stylish-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #f8faff;
    background-image: 
        radial-gradient(at 15% 15%, hsla(339, 100%, 93%, 0.4) 0px, transparent 50%),
        radial-gradient(at 85% 15%, hsla(190, 60%, 92%, 0.6) 0px, transparent 50%),
        radial-gradient(at 85% 85%, hsla(339, 100%, 93%, 0.4) 0px, transparent 50%),
        radial-gradient(at 15% 85%, hsla(190, 60%, 92%, 0.6) 0px, transparent 50%);
    pointer-events: none;
    /* GPU加速 */
    transform: translateZ(0);
}

/* ロゴパターン背景（リクルートページなど） */
.bg-logo-pattern {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -2;
    background-image: url('http://natukano.jp/wp-content/uploads/2026/01/cropped-名称未設定のデザイン-3.png');
    background-size: 120px auto;
    background-repeat: repeat;
    transform: rotate(-15deg); /* 回転角度を緩やかに（-30deg→-15deg） */
    transform-origin: center;
    pointer-events: none;
    opacity: 0.35; /* 少し濃くして存在感UP */
    /* GPU加速 */
    will-change: transform;
    transform: translateZ(0) rotate(-15deg);
    backface-visibility: hidden;
}

.bg-logo-pattern-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    /* GPU加速 */
    transform: translateZ(0);
}

/* 
   =========================================
   グラスモーフィズム パネル
   =========================================
*/
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* GPU加速 */
    will-change: transform;
    transform: translateZ(0);
}

/* 
   =========================================
   フェードイン アニメーション（最適化版 - スクロール干渉防止）
   =========================================
*/
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    backface-visibility: hidden;
}

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

/* 
   =========================================
   プライマリーカラー
   =========================================
*/
:root {
    --primary-color: #FF1493;
    --secondary-color: #FF69B4;
}

.bg-primary { background-color: var(--primary-color); }
.text-primary { color: var(--primary-color); }
.border-primary { border-color: var(--primary-color); }

.bg-secondary { background-color: var(--secondary-color); }
.text-secondary { color: var(--secondary-color); }

/* 
   =========================================
   ボタンとホバーエフェクト（最適化版）
   =========================================
*/
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    /* GPU加速 */
    will-change: transform, box-shadow;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 14px rgba(255, 20, 147, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 20, 147, 0.5);
}

/* カード ホバーエフェクト（最適化版） */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    backface-visibility: hidden;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* 画像 ホバーエフェクト（最適化版） */
.image-hover {
    transition: transform 0.2s ease;
    overflow: hidden;
}

.image-hover img {
    transition: transform 0.2s ease;
    backface-visibility: hidden;
}

.image-hover:hover img {
    transform: scale(1.05);
}

/* 
   =========================================
   タグとバッジ
   =========================================
*/
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    background: rgba(255, 20, 147, 0.1);
    color: var(--primary-color);
}

/* 
   =========================================
   スクロールバーのスタイリング（オプション）
   =========================================
*/
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 
   =========================================
   モバイル最適化（タッチ操作のスムーズ化）
   =========================================
*/
@media (max-width: 767px) {
    /* スクロールのスムーズ化 - smooth削除してネイティブ動作に */
    html {
        -webkit-overflow-scrolling: touch;
        /* scroll-behavior: smooth; を削除 - 干渉を防ぐ */
    }
    
    /* タップハイライトを無効化 */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* アニメーションを軽量化 */
    .fade-in-up {
        transition: all 0.4s ease-out;
    }
    
    /* ホバーエフェクトを簡略化 */
    .card-hover:hover,
    .image-hover:hover,
    .btn:hover {
        transform: none;
    }
    
    /* 固定背景をシンプルに */
    body::before {
        opacity: 0.2;
        background-size: 100px auto;
    }
}

/* 
   =========================================
   パフォーマンス向上のための追加最適化
   =========================================
*/

/* 画像の遅延読み込みサポート */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* レイアウトシフト防止 */
img {
    max-width: 100%;
    height: auto;
}

/* フォント読み込み最適化 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* === Performance Patch (2026-01-04) === */
/* TOPページのみ：ロゴ回転背景（body::before/after）を無効化（デザイン要件により削除） */
.home body::before,
.home body::after {
    content: none !important;
}

/* TOPページのキャストセクション：スクロール時の再描画範囲を局所化（見た目は維持） */
.home #cast .reveal-on-scroll,
.home #cast [class*="backdrop-blur"] {
    contain: paint;
    isolation: isolate;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 
   =========================================
   タグカラー設定（v1.5.0）
   =========================================
*/
.tag-swimwear {
    background-color: #E0F2FE !important; /* 淡い水色 */
    color: #0369A1 !important;            /* 深い青 */
    font-weight: 600;
    border: 1px solid #BAE6FD;
}

.tag-cosplay {
    background-color: #FCE7F3 !important; /* 淡いピンク */
    color: #BE185D !important;            /* 深いピンク */
    font-weight: 600;
    border: 1px solid #FBCFE8;
}

.tag-photo {
    background-color: #F3E8FF !important; /* 淡い紫 */
    color: #7E22CE !important;            /* 深い紫 */
    font-weight: 600;
    border: 1px solid #E9D5FF;
}

/* 
   =========================================
   画像切り替えアニメーション（v1.5.0）
   =========================================
*/
#main-image {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    will-change: opacity, transform;
    backface-visibility: hidden;
}

#main-image.changing {
    opacity: 0;
    transform: scale(0.98);
}

/* サムネイルのホバーエフェクト強化 */
.thumbnail-item {
    transition: all 0.2s ease;
    will-change: transform, box-shadow;
    backface-visibility: hidden;
}

.thumbnail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 
   =========================================
   SNSアイコン（v1.5.0 - 常時表示対応）
   =========================================
*/
.sns-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    transition: all 0.2s ease;
    text-decoration: none;
    will-change: transform, box-shadow;
    backface-visibility: hidden;
    position: relative;
}

.sns-icon.active:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.sns-icon.inactive {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.sns-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}

.sns-instagram.inactive {
    background: #D1D5DB;
    color: #9CA3AF;
}

.sns-x {
    background: #000000 !important;
    color: #FFFFFF !important;
    border: 2px solid #000000 !important;
}

.sns-x i,
.sns-x .fa-brands,
.sns-x .fa-x-twitter {
    color: #FFFFFF !important;
    background: none !important;
    -webkit-text-fill-color: #FFFFFF !important;
}

.sns-x.inactive {
    background: #D1D5DB !important;
    color: #9CA3AF !important;
    border: 2px solid #D1D5DB !important;
}

.sns-x.inactive i,
.sns-x.inactive .fa-brands,
.sns-x.inactive .fa-x-twitter {
    color: #9CA3AF !important;
    -webkit-text-fill-color: #9CA3AF !important;
}

.sns-tiktok {
    background: #000000;
    color: #FFFFFF;
    border: 2px solid #000000;
}

.sns-tiktok.inactive {
    background: #D1D5DB;
    border: 2px solid #D1D5DB;
}

.sns-tiktok.inactive i {
    color: #9CA3AF !important;
    background: none !important;
    -webkit-text-fill-color: #9CA3AF !important;
}

.sns-tiktok.active i {
    color: #FFFFFF;
    background: none;
    -webkit-text-fill-color: #FFFFFF;
}

/* トップページのスクロールパフォーマンス最適化 */
@media (max-width: 767px) {
    /* モバイルでアニメーションを軽量化（但し過度な短縮はしない） */
    .fade-in-up {
        transition-duration: 0.4s !important;
    }
    
    /* スクロール時のリフロー削減 */
    .fade-in-up {
        contain: layout style paint;
    }
    
    /* スクロール位置の自動調整を無効化 */
    html {
        scroll-padding-top: 0;
        overflow-anchor: none; /* スクロールアンカーを無効化 */
    }
    
    body {
        overflow-anchor: none;
    }
}

/* 
   =========================================
   運営コメント折りたたみアニメーション
   =========================================
*/
details summary {
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details[open] summary i.fa-chevron-down {
    transform: rotate(180deg);
}

details summary:hover {
    background-color: rgba(255, 105, 180, 0.1);
}

/* 折りたたみコンテンツのアニメーション */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

details[open] > *:not(summary) {
    animation: slideDown 0.3s ease-out;
}

/* 
   =========================================
   v1.5.4 スクロール最適化（カクつき防止）
   =========================================
*/

/* スクロールのスムーズ化とカクつき防止 */
html {
    scroll-behavior: auto !important;
    overflow-anchor: none;
}

body {
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

/* iOS向けスクロール最適化 */
@supports (-webkit-touch-callout: none) {
    body {
        /* position: fixed; を削除 - スクロールを阻害 */
        /* overflow-y: scroll; */
        /* width: 100%; */
        /* height: 100%; */
        -webkit-overflow-scrolling: touch;
    }
}

/* スクロール時のレイアウトシフト防止 */
* {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* GPU加速の最適化（必要最小限に） */
.card-hover,
.image-hover,
.btn-primary {
    transform: translateZ(0);
}

/* アニメーション中のみwill-changeを適用 */
.reveal-on-scroll.revealed {
    will-change: auto;
}

/* Intersection Observer用の最適化 */
img[loading="lazy"] {
    content-visibility: auto;
}

