/*
 Theme Name: AI秘書室の子テーマ
 Theme URI: https://www.yuushin.biz/
 Description: AI秘書室による高度なカスタマイズ用子テーマ
 Author: AI秘書室
 Author URI: https://www.yuushin.biz/
 Template: astra
 Version: 1.1.0
 License: GNU General Public License v2 or later
 License URI: https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: ai-hishoshitsu-child
*/

/* ==========================================================================
   0. CSS カスタムプロパティ（ブランドカラー一元管理）
   ========================================================================== */

:root {
    --aihc-primary: #0067FF;
    --aihc-primary-dark: #005EE9;
    --aihc-bg-light: #E7F6FF;
    --aihc-bg-white: #FFFFFF;
    --aihc-text-dark: #0F172A;
    --aihc-text-gray: #364151;
    --aihc-accent-line: #06C755;
    --aihc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --aihc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --aihc-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --aihc-radius-sm: 8px;
    --aihc-radius-md: 12px;
    --aihc-radius-lg: 16px;
    --aihc-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   1. スムーズスクロール & テキスト描画最適化
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ==========================================================================
   2. リンク・ボタンのトランジション統一
   ========================================================================== */

a,
button,
input[type="submit"],
.ast-button,
.ast-custom-button,
.wp-block-button__link {
    transition: all var(--aihc-transition);
}

/* フォーカスリングの視認性向上（アクセシビリティ） */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.wp-block-button__link:focus-visible {
    outline: 2px solid var(--aihc-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ==========================================================================
   3. 画像の最適化表示
   ========================================================================== */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

figure {
    margin: 0;
}

/* ==========================================================================
   4. CTAボタン強化（LINE緑）
   ========================================================================== */

.aihc-cta-line,
a[href*="lin.ee"],
a[href*="line.me"] {
    background-color: var(--aihc-accent-line) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--aihc-radius-sm) !important;
    font-weight: 700 !important;
    box-shadow: var(--aihc-shadow-sm);
}

a[href*="lin.ee"]:hover,
a[href*="line.me"]:hover,
.aihc-cta-line:hover {
    background-color: #05b14a !important;
    box-shadow: var(--aihc-shadow-md);
    transform: translateY(-2px);
}

/* ==========================================================================
   5. カード・コンテナの統一シャドウ
   ========================================================================== */

.ast-article-post .ast-article-inner,
.wp-block-group.has-background,
.wp-block-cover {
    border-radius: var(--aihc-radius-md);
    overflow: hidden;
}

.ast-separate-container .ast-article-post {
    box-shadow: var(--aihc-shadow-sm);
    transition: box-shadow var(--aihc-transition), transform var(--aihc-transition);
    border-radius: var(--aihc-radius-md);
}

.ast-separate-container .ast-article-post:hover {
    box-shadow: var(--aihc-shadow-md);
    transform: translateY(-2px);
}

/* ==========================================================================
   6. テーブルの読みやすさ改善
   ========================================================================== */

.entry-content table {
    border-collapse: collapse;
    width: 100%;
    border-radius: var(--aihc-radius-sm);
    overflow: hidden;
    box-shadow: var(--aihc-shadow-sm);
}

.entry-content table th {
    background-color: var(--aihc-bg-light);
    color: var(--aihc-text-dark);
    font-weight: 700;
    padding: 12px 16px;
    text-align: left;
}

.entry-content table td {
    padding: 10px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.entry-content table tbody tr:last-child td {
    border-bottom: none;
}

.entry-content table tbody tr:hover {
    background-color: rgba(0, 103, 255, 0.03);
}

/* ==========================================================================
   7. 引用ブロックの見た目統一
   ========================================================================== */

blockquote,
.wp-block-quote {
    border-left: 4px solid var(--aihc-primary) !important;
    background: var(--aihc-bg-light);
    padding: 1.2em 1.5em;
    margin: 1.5em 0;
    border-radius: 0 var(--aihc-radius-sm) var(--aihc-radius-sm) 0;
    font-style: normal;
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   8. スクロールトップボタン
   ========================================================================== */

#ast-scroll-top {
    background-color: var(--aihc-primary) !important;
    border-radius: 50% !important;
    box-shadow: var(--aihc-shadow-md);
    transition: all var(--aihc-transition);
}

#ast-scroll-top:hover {
    background-color: var(--aihc-primary-dark) !important;
    transform: translateY(-3px);
    box-shadow: var(--aihc-shadow-lg);
}

/* ==========================================================================
   9. モバイルレスポンシブ改善
   ========================================================================== */

@media (max-width: 768px) {
    /* タッチターゲット最低44px確保（WCAG 2.5.5） */
    a,
    button,
    input[type="submit"],
    .menu-link {
        min-height: 44px;
        min-width: 44px;
    }

    /* モバイルでのテーブル横スクロール */
    .entry-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* フッターのパディング調整 */
    .site-below-footer-wrap {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* ==========================================================================
   10. セレクション（テキスト選択時）の色
   ========================================================================== */

::selection {
    background-color: var(--aihc-primary);
    color: #fff;
}

::-moz-selection {
    background-color: var(--aihc-primary);
    color: #fff;
}

/* ==========================================================================
   11. アニメーション — フェードイン（軽量）
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    .ast-article-post,
    .entry-content > .wp-block-group,
    .entry-content > .wp-block-columns,
    .entry-content > .wp-block-cover {
        animation: aihc-fade-up 0.5s ease-out both;
    }

    @keyframes aihc-fade-up {
        from {
            opacity: 0;
            transform: translateY(12px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ==========================================================================
   12. 印刷スタイル
   ========================================================================== */

@media print {
    header,
    footer,
    .ast-above-header,
    .ast-below-header,
    #ast-scroll-top,
    .ast-mobile-header-wrap,
    nav,
    .sidebar,
    .comments-area,
    .post-navigation {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000 !important;
        background: #fff !important;
    }

    a {
        color: #000 !important;
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #555;
    }

    .entry-content {
        max-width: 100% !important;
    }
}

/* ==========================================================================
   13. ユーティリティクラス（子テーマ内で使用可能）
   ========================================================================== */

.aihc-text-primary { color: var(--aihc-primary); }
.aihc-text-dark    { color: var(--aihc-text-dark); }
.aihc-text-gray    { color: var(--aihc-text-gray); }
.aihc-bg-light     { background-color: var(--aihc-bg-light); }
.aihc-bg-white     { background-color: var(--aihc-bg-white); }
.aihc-shadow-sm    { box-shadow: var(--aihc-shadow-sm); }
.aihc-shadow-md    { box-shadow: var(--aihc-shadow-md); }
.aihc-rounded      { border-radius: var(--aihc-radius-md); }
.aihc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
