/* ========================================
   コラムページ専用レスポンシブスタイル
   ======================================== */

/* 全体のオーバーフロー制御 */
html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* メインコンテナ */
main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

article {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* コンテナの幅制御 */
.container {
    width: 100% !important;
    max-width: 1400px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* セクション内の全要素 */
.section > * {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* フレックスボックスのオーバーフロー対策 */
[style*="display: flex"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* グリッドレイアウトのオーバーフロー対策 */
[style*="display: grid"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* テキストコンテナ */
div[style*="background: white"][style*="padding"][style*="border-radius"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* ソーシャルシェアボタン */
.social-share-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.share-btn {
    flex: 1 1 auto !important;
    min-width: 100px !important;
    max-width: 200px !important;
    white-space: nowrap !important;
}

/* 医師プロフィールカード */
div[style*="doctor-suzuki"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 医師情報コンテナ */
div[style*="doctor-suzuki.webp"] > div:last-child {
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}

/* プロフィールリンクボタンラッパー */
.profile-link-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* プロフィールリンクボタン */
.profile-link-btn,
a[href*="doctor.html#suzuki"] {
    display: inline-block !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* モバイル専用スタイル */
@media (max-width: 768px) {
    /* 全てのコンテナ */
    .container,
    main,
    article,
    section {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* フレックスアイテム */
    .flow-item,
    [class*="flow-item"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* テキストブロック */
    div[style*="flex: 1"] {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }
    
    /* グリッドアイテム */
    [style*="grid-template-columns"] > * {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* 細胞老化フロー専用 */
    .cellular-aging-flow {
        width: 100% !important;
        max-width: 100% !important;
        padding: 1.5rem !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    .cellular-aging-flow > * {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* 数字アイコン */
    .flow-item > div:first-child {
        flex-shrink: 0 !important;
        width: 36px !important;
        height: 36px !important;
    }
    
    /* テキストコンテナ */
    .flow-item > div:last-child {
        flex: 1 !important;
        min-width: 0 !important;
        max-width: calc(100% - 50px) !important;
        overflow: hidden !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }
    
    /* ソーシャルシェアボタン（モバイル） */
    .social-share-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    .share-label {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 0.5rem !important;
    }
    
    .share-btn {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
    }
    
    /* 医師プロフィールカード（モバイル） */
    div[style*="doctor-suzuki.webp"] {
        flex-direction: column !important;
        text-align: center !important;
    }
    
    div[style*="doctor-suzuki.webp"] > div:last-child {
        align-items: center !important;
        text-align: center !important;
    }
    
    figure[style*="doctor-suzuki"] {
        margin: 0 auto !important;
    }
    
    /* プロフィールリンクボタンラッパー（モバイル） */
    .profile-link-wrapper {
        text-align: center !important;
        padding: 0.5rem 0 !important;
    }
    
    /* プロフィールリンクボタン（モバイル） */
    .profile-link-btn,
    a[href*="doctor.html#suzuki"] {
        display: inline-block !important;
        margin: 0 auto !important;
        width: auto !important;
        max-width: calc(100% - 2rem) !important;
        text-align: center !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
    }
}

/* 極小スマートフォン対応 */
@media (max-width: 390px) {
    .cellular-aging-flow {
        padding: 1rem !important;
    }
    
    .flow-item {
        gap: 0.5rem !important;
    }
    
    .flow-item > div:last-child {
        max-width: calc(100% - 45px) !important;
        font-size: 0.875rem !important;
    }
    
    /* ソーシャルシェアボタン（極小） */
    .social-share-container {
        padding: 1rem !important;
        gap: 0.5rem !important;
    }
    
    .share-btn {
        padding: 0.625rem 1rem !important;
        font-size: 0.8rem !important;
    }
    
    /* 医師プロフィールカード（極小） */
    div[style*="doctor-suzuki.webp"] {
        padding: 1rem !important;
        gap: 1rem !important;
    }
    
    /* プロフィールリンクボタン（極小） */
    .profile-link-btn,
    a[href*="doctor.html#suzuki"] {
        font-size: 0.7rem !important;
        padding: 0.4rem 0.75rem !important;
        max-width: calc(100% - 1.5rem) !important;
    }
    
    .profile-link-wrapper {
        padding: 0.5rem 0.5rem !important;
    }
}
