/*
Theme Name: Coding Compass Theme
Author: takeharu koga
Description: Coding Compass学習サイトのオリジナルテーマです。
Version: 1.0
*/

/* ===== 1. CSSリセットと基本設定 ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
    /* JavaScriptのスムーススクロールを優先させるため、CSS側はリセット */
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", sans-serif;
    line-height: 1.7;
    color: #343A40;
    /* やや濃いグレー */
    background-color: #FFFFFF;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

a {
    color: #005A9C;
    /* アクセントカラー */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

hr {
    border: none; /* 枠線をすべて消す */
    border-top: 1px solid #E5E7EB; /* 上側だけに1pxの薄い線を再設定 */
    margin: 2.5em 0; /* 上下の余白は維持 */
}

ul li {
    margin-bottom: 15px;
}

/* ===== 2. サイト全体で使う部品（コンポーネント） ===== */

/* コンテナ（コンテンツの最大幅を制御） */
.container {
    width: 100%;
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* ボタン */
.button {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.button:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.button--primary {
    background-color: #005A9C;
    /* アクセントカラー */
    color: #FFFFFF;
}

.button--secondary {
    background-color: transparent;
    color: #343A40;
    border: 1px solid #dee2e6;
    /* 薄いグレー */
}

/* ===== 2.5 サイトの基本レイアウト ===== */

/* --- トップページのみ、メインコンテンツの上下余白をなくす --- */
.home .site-main {
    padding-top: 0;
    padding-bottom: 0;
}

.site-main {
    padding-top: 60px;
    /* ヘッダーとコンテンツの間の余白 */
    padding-bottom: 80px;
    /* コンテンツとフッターの間の余白 */
}

/* ===== 3. ヘッダー ===== */
.site-header {
    padding: 20px 0;
    border-bottom: 1px solid #dee2e6;
}

.site-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1280px;
    /* ヘッダーは少し広め */
    margin: 0 auto;
    padding: 0 40px;
}

.site-logo {
    display: flex;
    align-items: center;
    font-family: 'Rajdhani', sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #343A40;
    text-decoration: none;
}

.site-logo:hover {
    text-decoration: none;
}

.site-logo .material-symbols-outlined {
    margin-right: 8px;
    color: #005A9C;
    /* アイコンだけアクセントカラー */
}

/* PC用ナビゲーション */
.global-nav__list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 32px;
}

.global-nav__list a {
    color: #343A40;
    font-weight: 700;
    font-size: 16px;
}

/* SP用ハンバーガーメニューは今は非表示 */
.hamburger-menu {
    display: none;
}


/* ===== 4. フッター ===== */
.site-footer {
    padding: 40px 0;
    background-color: #f8f9fa;
    /* 薄いグレー */
    border-top: 1px solid #dee2e6;
}

.site-footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

.site-footer__copyright {
    margin: 0;
    color: #6c757d;
    /* やや薄いグレー */
    font-size: 14px;
}


/* ===== 5. トップページ（front-page.php）のスタイル ===== */
.hero-section {
    padding: 80px 0;
    background-color: #f8f9fa;
    background-image: linear-gradient(to top, #e9ecef 0%, #f8f9fa 100%);
}

.hero-section__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-section__title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 56px;
    margin: 0 0 16px;
    line-height: 1.2;
}

.hero-section__subtitle {
    font-size: 18px;
    margin: 0 0 32px;
    color: #495057;
}

.features-section {
    padding: 80px 0;
}

.features-section__inner {
    text-align: center;
}

.features-section__title {
    font-size: 36px;
    margin-bottom: 40px;
}

.features-section__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    text-align: left;
}

.feature-card {
    padding: 30px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background-color: #FFFFFF;
}

.feature-card__icon .material-symbols-outlined {
    font-size: 40px;
    color: #005A9C;
}

.feature-card__title {
    font-size: 20px;
    margin: 16px 0 8px;
}

.feature-card__description {
    margin: 0;
    color: #6c757d;
}

/* ===== 5. トップページ（front-page.php）のスタイル ===== */
.hero-section {
    padding: 60px 0;
    background-color: #f8f9fa;
    /* 薄い背景色 */
}

.hero-section__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-section__text-content {
    flex: 1;
}

.hero-section__visual {
    flex: 1;
    text-align: right;
}

.hero-section__visual img {
    max-width: 450px;
}

.hero-section__title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 64px;
    margin: 0 0 16px;
    line-height: 1.2;
}

.hero-section__subtitle {
    font-size: 18px;
    margin: 0 0 32px;
    color: #495057;
}

/* --- Features Section --- */
.features-section {
    padding: 80px 0;
    text-align: center;
}

.features-section__title {
    font-size: 36px;
    margin-bottom: 40px;
}

.features-section__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    text-align: left;
}

.feature-card {
    padding: 30px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background-color: #FFFFFF;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.feature-card__icon .material-symbols-outlined {
    font-size: 40px;
    color: #005A9C;
}

.feature-card__title {
    font-size: 20px;
    margin: 16px 0 8px;
}

.feature-card__description {
    margin: 0;
    color: #6c757d;
}


/* --- Info Section --- */
.info-section {
    padding: 60px 0;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.info-section__inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.info-card {
    background-color: #fff;
    padding: 30px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
}

.info-card__title {
    display: flex;
    align-items: center;
    font-size: 22px;
    margin: 0 0 16px;
}

.info-card__title .material-symbols-outlined {
    margin-right: 12px;
    color: #005A9C;
}

.info-card__description {
    margin: 0 0 24px;
    color: #6c757d;
}

.info-card__link {
    font-weight: 700;
    text-decoration: none;
}

.info-card__link:hover {
    text-decoration: underline;
}

/* ===== 6. 下層ページ（page.php）のスタイル ===== */

/* ページ全体の背景色 */
body.page .site-main {
    background-color: #fafafa;
    /* デザイン案の濃い背景色 */
    color: #3D4A59;
}

.page-container {
    width: 100%;
    max-width: 1280px;
    margin: 40px auto;
    /* 上下の余白 */
    padding: 0 40px;
}

.page-container__inner {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* --- メインコンテンツ（左カラム） --- */
.page-container__main {
    flex: 1;
    min-width: 0;
    background-color: #FFFFFF;
    color: #343A40;
    border-radius: 12px;
    padding: 40px;
    border: 1px solid #e5e5e5;
}

.entry-title {
    font-size: 32px;
    margin: 0 0 30px;
    font-family: 'Rajdhani', sans-serif;
}

.entry-content h3 {
    font-size: 24px;
    margin: 30px 0 16px;
    display: flex;
    align-items: center;
    color: #005A9C;
    font-weight: normal;
}

.entry-content h3 .material-symbols-outlined {
    margin-right: 8px;
    color: #6c757d;
}

/* h4の見出しスタイル（左に縦線） */
.entry-content h4 {
    font-size: 20px;
    font-weight: 700;
    margin-top: 2.5em;
    margin-bottom: 1em;
    padding-left: 1em; /* 縦線とテキストの間の余白 */
    border-left: 4px solid #005A9C; /* 縦線の太さと色 */
    color: #343A40; /* 文字色をリセット */
}

.entry-content p {
    margin: 0 0 1.5em;
    line-height: 1.8;
}

.entry-content pre {
    background-color: #1E2D3E;
    color: #FFFFFF;
    padding: 20px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'SF Mono', Consolas, 'Courier New', monospace;
}


/* --- サイドバー（右カラム） --- */
.page-container__sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 40px;
}

.sidebar-widget {
    background-color: #ffffff;
    /* サイドバーの背景色 */
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.sidebar-widget__title {
    font-size: 18px;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3D4A59;
    color: #343A40;
}

.sidebar-widget__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-widget__list li {
    margin-bottom: 10px;
}

.sidebar-widget__list a {
    color: #3D4A59;
    /* 薄い文字色 */
    text-decoration: none;
    font-weight: 700;
}

.sidebar-widget__list a:hover {
    color: #FFFFFF;
}

/* サイドバーの階層化されたリスト */
.sidebar-widget__list ul {
    list-style: none;
    padding-left: 20px;
    margin-top: 10px;
}

/* ===== 7. 8ステップガイドページ（page-guide.php）のスタイル ===== */

.guide-page-container {
    width: 100%;
    max-width: 1120px;
    margin: 40px auto;
    padding: 0 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-description {
    font-size: 18px;
    color: #495057;
    margin-top: 8px;
}

.guide-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    /* 画面幅に応じて列数を自動調整 */
    gap: 25px;
}

.step-guide-card {
    display: block;
    position: relative;
    padding: 25px 30px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    text-decoration: none;
    color: #343A40;
    background-color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.step-guide-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.07);
    text-decoration: none;
}

.step-guide-card__number {
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #005A9C;
    margin-bottom: 8px;
}

.step-guide-card__title {
    font-size: 22px;
    margin: 0 0 10px;
}

.step-guide-card__description {
    font-size: 15px;
    color: #6c757d;
    margin: 0;
    line-height: 1.6;
}

.step-guide-card__arrow {
    position: absolute;
    top: 25px;
    right: 25px;
    color: #adb5bd;
    transition: color 0.2s;
}

.step-guide-card:hover .step-guide-card__arrow {
    color: #005A9C;
}

/* --- トップページ 文字色修正 (統合版) --- */

/* ヒーローセクションのタイトルとサブタイトル */
.home .hero-section__title,
.home .hero-section__subtitle {
    color: #343A40;
    /* 濃いグレー */
}

/* Featuresセクションの各カードのタイトル */
.home .feature-card__title {
    color: #343A40;
    /* 濃いグレー */
}

/* Infoセクション（お知らせ等）のタイトルと説明文 */
.home .info-card__title,
.home .info-card__description {
    color: #343A40;
    /* 濃いグレー */
}

/* 各セクションのアイコンの色（念のため再設定） */
.home .feature-card__icon .material-symbols-outlined,
.home .info-card__title .material-symbols-outlined {
    color: #005A9C;
    /* アクセントのディープブルー */
}

/* ===== 8. 固定ページ内ステップガイドのスタイル ===== */

.entry-content .page-description {
    font-size: 16px;
    color: #495057;
    margin-bottom: 40px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 30px;
}

.steps-wrapper {
    display: grid;
    gap: 30px;
    /* カード間の余白 */
}

.step-content-card {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background-color: #fdfdfd;
}

.step-content-card__title {
    font-size: 24px;
    padding: 20px 25px;
    margin: 0;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
}

.step-content-card__number {
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    color: #005A9C;
    margin-right: 12px;
    background-color: #eaf5ff;
    padding: 4px 10px;
    border-radius: 20px;
}

.step-content-card__body {
    padding: 15px 25px;
    display: block;
    /* display: grid; の行ごと削除してもOKです */
}

.step-content-card__section h4 {
    font-size: 20px;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    color: #005A9C;
    font-weight: normal;
}

.step-content-card__section h4 .material-symbols-outlined {
    font-size: 20px;
    margin-right: 8px;
}

.step-content-card__section ul {
    font-size: 20px;
    list-style-type: '✓ ';
    padding-left: 1.2em;
    margin-top: 0;
    margin-bottom: 1.6em;
}

.step-content-card__section li,
.step-content-card__section p {
    font-size: 15px;
    color: #495057;
    line-height: 2.4;
}

.step-content-card__footer {
    padding: 20px 25px;
    text-align: right;
    border-top: 1px solid #dee2e6;
}

/* コードブロックのスタイル */
.code-block,
.entry-content pre {
    background-color: #2D3436;
    color: #FFFFFF;
    font-family: 'SF Mono', Consolas, 'Courier New', monospace;
    padding: 20px;
    border-radius: 8px;
    white-space: pre;
    overflow-x: auto;
    font-size: 15px;
    max-width: 100%;
    /* 親要素の幅を超えないようにする */
    box-sizing: border-box;
    /* paddingとborderを幅の内側で計算する */
}

/* --- おまけセクションのスタイル --- */
.wp-block-table {
    margin: 1.5em 0;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
}

.wp-block-table th,
.wp-block-table td {
    border: 1px solid #dee2e6;
    padding: 12px 15px;
    text-align: left;
}

.wp-block-table th {
    background-color: #f8f9fa;
    font-weight: 700;
}

.resource-links-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 1.5em 0;
}

.resource-category h4 {
    margin: 0 0 10px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 5px;
}

.resource-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-category li {
    margin-bottom: 8px;
}

/* --- サイドバー目次のスタイル --- */
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list__item {
    margin-bottom: 10px;
}

/* h2の目次項目（カテゴリ）のスタイル */
.toc-list__item--level-2 {
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 8px; /* 点線のためのスペース */
    margin-bottom: 12px;
    
    /* ▼▼▼ ここからが点線を引くためのスタイル ▼▼▼ */
    border: none; /* 元のborder-bottomは削除 */
    background-image: radial-gradient(circle, #3D4A59 1px, transparent 1px); /* 1pxの円を作成 */
    background-size: 8px 1px; /* 8pxごとに1pxの点を繰り返す（この8pxを大きくすると間隔が広がる） */
    background-position: 0 100%; /* 下端に配置 */
    background-repeat: repeat-x; /* 横方向のみに繰り返す */
}

/* h2のリンクは少し薄い色に */
.toc-list__item--level-2 a {
    color: #dee2e6;
    font-weight: 700;
}

/* h3の目次はインデントし、先頭に矢印アイコンを付ける */
.toc-list__item--level-3 {
    font-size: 0.9em;
    position: relative;
    padding-left: 3px; /* アイコン分のスペースを確保 */
}

.toc-list a {
    color: #495057;
    text-decoration: none;
    display: flex; /* ★Flexboxを使い、アイコンとテキストを横並びに */
    align-items: flex-start; /* ★上揃えにする */
    gap: 0.5em; /* アイコンとテキストの間の隙間 */
    transition: opacity 0.2s;
}

.toc-list a:hover {
    opacity: 0.8;
}

/* h3の目次項目の先頭に、Google Fontsのアイコンを付ける */
.toc-list__item--level-3 a::before {
    content: 'chevron_right';
    font-family: 'Material Symbols Outlined';
    font-size: 20px;
    font-weight: normal;
    line-height: 1.5; /* テキストの行の高さに合わせる */
}

/* --- 次のステップへ促すセクションのスタイル --- */
.next-step-prompt {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-top: 40px;
    border: 1px solid #dee2e6;
}

.next-step-prompt__main {
    display: flex;
    align-items: flex-start;
    gap: 25px;
}

.next-step-prompt__icon .material-symbols-outlined {
    font-size: 48px;
    color: #005A9C;
}

.next-step-prompt__text {
    flex: 1;
}

.next-step-prompt__title {
    margin: 0 0 10px;
    font-size: 22px;
}

.next-step-prompt__text p {
    margin: 0 0 1.2em;
    color: #495057;
}

.next-step-prompt__footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    /* ← 横並びにする */
    justify-content: center;
    /* ← 中央揃え */
    align-items: center;
    gap: 16px;
    /* ← ボタン間の余白 */
    flex-wrap: wrap;
    /* 画面が狭いときに折り返す */
}

/* --- ボタン内のアイコン位置を微調整 --- */
.button .material-symbols-outlined {
    /* vertical-alignの代わりに、flexboxの中央揃えで対応 */
    position: relative;
    top: 6px;
    /* アイコンを少しだけ下にずらす */
}

/* ===== 9. レスポンシブ対応（モバイル表示） ===== */

/* 画面幅が820px以下の場合に適用 */
@media (max-width: 820px) {

    /* --- ヘッダー --- */
    .site-header__inner {
        padding: 0 20px;
        /* モバイルではヘッダーの左右の余白を狭くする */
    }

    /* PC用のナビゲーションと右側のボタンを非表示に */
    .site-header__nav,
    .site-header__actions {
        display: none;
    }

    /* ハンバーガーボタンを表示 */
    .hamburger-menu {
        display: block;
        /* display: none; から変更 */
        position: relative;
        width: 40px;
        height: 40px;
        border: none;
        background: transparent;
        cursor: pointer;
        z-index: 100;
        /* メニューが開いたときも前面に */
    }

    .hamburger-menu__bar {
        display: block;
        width: 30px;
        height: 2px;
        background-color: #343A40;
        /* ボタンの線の色 */
        margin: 6px auto;
        transition: transform 0.3s, opacity 0.3s;
    }

    /* ハンバーガーボタンが active になった時（×印にする） */
    .hamburger-menu.is-active .hamburger-menu__bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger-menu.is-active .hamburger-menu__bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.is-active .hamburger-menu__bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }


    /* --- モバイル用ナビゲーションメニューのパネル --- */
    .global-nav {
        display: block;
        /* display: none; から変更 */
        position: fixed;
        /* 画面に固定 */
        top: 0;
        right: -300px;
        /* 初期状態では画面の右側に隠す */
        width: 300px;
        height: 100vh;
        /* 画面の高さ一杯に */
        padding-top: 80px;
        background-color: rgba(255, 255, 255, 0.98);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 50;
        transition: transform 0.3s ease-in-out;
    }

    /* メニューが開いた時（is-active クラスが付いた時） */
    .global-nav.is-active {
        transform: translateX(-300px);
        /* 画面内にスライドイン */
    }

    /* メニュー項目のリスト */
    .global-nav__list {
        display: block;
        /* 縦並びに変更 */
        text-align: center;
    }

    .global-nav__list li {
        margin-bottom: 20px;
    }


    /* --- 下層ページの2カラムレイアウトを1カラムに変更 --- */
    .page-container__inner {
        flex-direction: column;
        /* 縦積みに変更 */
    }

    .page-container__sidebar {
        width: 100%;
        position: static;
        /* position: sticky; を解除 */
        margin-top: 40px;
    }

    /* --- 下層ページの2カラムレイアウトを1カラムに変更 --- */
    .page-container {
        padding: 0 20px;
        /* ← ★この行を追加 */
    }

    .page-container__inner {
        flex-direction: column;
    }

    .page-container__main {
        padding: 30px 20px;
        /* ← ★この行を追加 */
    }

    .page-container__sidebar {
        width: 100%;
        position: static;
        margin-top: 40px;
    }

    /* Tipsページのカードを1カラムに */
    .tips-card-container {
        grid-template-columns: 1fr;
    }
}

/* --- ガイドページ（/guide/）のレイアウト最終調整 --- */

/* .entry-content 自体の幅が親要素を超えないようにする */
.page-template-page-guide .entry-content {
    width: 100%;
    box-sizing: border-box;
}

/* カード型コンテンツの計算方法を変更し、はみ出しを防止 */
.page-template-page-guide .step-content-card {
    box-sizing: border-box;
    /* paddingとborderを幅の内側で計算するようにする */
    max-width: 100%;
    /* 親の幅を絶対に超えないようにする */
}

/* モバイル表示の際に、メインコンテンツ自体の余白を調整 */
@media (max-width: 820px) {
    .page .page-container__main {
        padding: 30px 15px;
        /* 左右の余白をさらに狭くする */
    }
}

@media (max-width: 820px) {

    /* ヒーローを縦積みに切り替え */
    .hero-section__inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        /* 好きな余白に */
    }

    /* 子要素が縮むように */
    .hero-section__text-content,
    .hero-section__visual {
        width: 100%;
        min-width: 0;
    }

    /* 画像を親幅いっぱいに */
    .hero-section__visual img {
        max-width: 100%;
        height: auto;
    }

    /* --- トップページ Featuresセクションのモバイル対応 --- */
    .features-section__grid {
        grid-template-columns: 1fr;
        /* 3列から1列のグリッドに変更 */
    }

    /* --- トップページ Infoセクションのモバイル対応 --- */
    .info-section__inner {
        grid-template-columns: 1fr;
        /* 2列から1列のグリッドに変更 */
    }

    /* --- フッターのモバイル対応 --- */
    .site-footer__inner {
        flex-direction: column;
        /* 横並びから縦積みに変更 */
        gap: 20px;
        /* ロゴとコピーライトの間の余白 */
    }
}

/* ===== 10. レイアウトの最終調整（はみ出し防止） ===== */

/* --- テーブルのはみ出し防止 --- */
/* テーブルを囲むdivを追加することを想定（WordPressが自動で追加する場合もある）*/
.wp-block-table,
.entry-content .table-responsive-wrapper {
    /* 追記：テーブルをdivで囲むことを推奨 */
    width: 100%;
    overflow-x: auto;
    /* 横スクロールを可能にする */
    -webkit-overflow-scrolling: touch;
    /* モバイルでのスクロールを滑らかに */
    margin-bottom: 1.5em;
}

.wp-block-table table {
    min-width: 600px;
    /* テーブルが極端に縮まないように最小幅を指定 */
}

/* --- コードブロックのはみ出しを再確認 --- */
.entry-content .code-block,
.entry-content pre {
    max-width: 100%;
    box-sizing: border-box;
}

/* --- モバイル表示でのメインコンテンツの余白を再調整 --- */
@media (max-width: 820px) {

    .page .page-container__main,
    .page-template-template-step-detail .page-container__main {
        padding: 30px 20px;
        /* 左右の余白を20pxに統一 */
    }
}

/* ===== 11. はみ出し防止の最終手段 ===== */

/*
  サイトのすべての要素の幅計算を、
  paddingとborderを幅の内側に含める方式に統一します。
  これがすべての基本です。
*/
*,
*::before,
*::after {
    box-sizing: border-box;
}

/*
  メインコンテンツ（白い背景のエリア）の中にあるすべての直接の子要素に対して、
  親の幅を超えないように強制します。
*/
.page-container__main>* {
    max-width: 100%;
}

/*
  特にテーブルは、中身が長いとレイアウトを崩す最大の原因になります。
  テーブルを囲むdivに、横スクロールを強制的に適用します。
*/
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* モバイルでのスクロールを滑らかに */
}

/* ===== コードブロックのスタイル（はみ出し最終対策版） ===== */
.code-block,
.entry-content pre {
    background-color: #2D3436;
    color: #FFFFFF;
    font-family: 'SF Mono', Consolas, 'Courier New', monospace;
    padding: 20px;
    border-radius: 8px;
    font-size: 15px;

    /* --- はみ出し防止のための設定 --- */
    max-width: 100%;
    /* 1. 親要素の幅を超えない */
    box-sizing: border-box;
    /* 2. paddingを幅の内側で計算 */

    /* --- テキストの強制折り返し設定 --- */
    white-space: pre-wrap;
    /* 3. preの性質を保ちつつ、自動で改行する */
    word-wrap: break-word;
    /* 4. 長い単語の途中でも強制的に改行する */
    overflow-x: auto;
    /* 5. 万が一はみ出た場合でもスクロールさせる（安全装置） */
}

/* --- 拡張機能リスト（dl, dt, dd）のスタイル --- */
.extension-list {
    margin: 1.5em 0;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    /* 角丸を内側にも適用するため */
}

.extension-list dt {
    font-weight: 700;
    background-color: #f8f9fa;
    /* 薄いグレー */
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
}

.extension-list dd {
    padding: 12px 15px;
    margin: 0;
    /* ddタグが持つデフォルトの余白をリセット */
    border-bottom: 1px solid #dee2e6;
}

/* 最後の項目の下の線を消す */
.extension-list dd:last-of-type {
    border-bottom: none;
}

/* --- タグ説明リストのスタイル --- */
.tag-list {
    margin: 1.5em 0;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.tag-list dt {
    font-size: 1.1em;
    background-color: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
}

.tag-list dt code {
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
}

.tag-list dd {
    padding: 15px;
    margin: 0;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
}

.tag-list dt:last-of-type,
.tag-list dd:last-of-type {
    border-bottom: none;
}

/* --- よくある間違いリストのスタイル --- */
.common-mistake-list {
    margin: 1.5em 0;
    border: 1px solid #e9a8a8;
    /* 注意を促すため、少し赤みのある枠線に */
    border-radius: 8px;
}

.common-mistake-list dt {
    font-weight: 700;
    background-color: #fff8f8;
    /* 注意を促すため、少し赤みのある背景色に */
    padding: 12px 15px;
    border-bottom: 1px solid #e9a8a8;
}

.common-mistake-list dt code {
    background-color: #ffeaea;
    padding: 2px 6px;
    border-radius: 4px;
    color: #c0392b;
}

.common-mistake-list dd {
    padding: 15px;
    margin: 0;
    border-bottom: 1px solid #e9a8a8;
    background-color: #fff;
    color: #495057;
}

.common-mistake-list dd:last-of-type {
    border-bottom: none;
}

/* --- 要素説明リストのスタイル --- */
.element-list {
    margin: 1.5em 0;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.element-list dt {
    font-weight: 700;
    background-color: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
}

.element-list dd {
    padding: 15px;
    margin: 0;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
}

.element-list dd:last-of-type {
    border-bottom: none;
}

/* ===== Tips集ページのスタイル (横長スリムバナー形式) ===== */

.tips-category-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 28px;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
}
.tips-category-title:first-of-type {
    margin-top: 0;
}

.tips-banner-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.tip-banner {
    display: flex;
    border-radius: 12px;
    text-decoration: none;
    color: #1F2937;
    border: 1px solid #E5E7EB;
    background-color: #FFFFFF;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    align-items: stretch;
}

.tip-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    border-color: #005A9C;
}

.tip-banner__content {
    padding: 16px 25px; /* 上下の余白を狭く */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.entry-content h3.tip-banner__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px; /* 下の余白を狭く */
}

.tip-banner__description {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

.tip-banner__aside {
    background-color: #005A9C;
    color: #FFFFFF;
    padding: 16px 25px; /* 上下の余白を狭く */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    white-space: nowrap;
}

/* モバイル表示 */
@media (max-width: 768px) {
    .tip-banner {
        flex-direction: column;
    }
}

/* --- 記事内ライブサンプルのスタイル --- */
.live-sample {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 1.5em 0;
}

/* タブボタンのリスト */
.tab-list {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #dee2e6;
}
.tab-button {
  padding: 10px 20px;
  border: 1px solid transparent;
  border-bottom: none;
  background-color: transparent;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  font-size: 16px;
  font-weight: 700;
  color: #6B7280;
}
/* アクティブなタブボタンのスタイル */
.tab-button.is-active {
  background-color: #FFFFFF;
  border-color: #dee2e6;
  color: #1F2937;
}

/* 表示パネル */
.tab-panels {
    padding: 20px;
    background-color: #FFFFFF;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
}
.tab-panel {
  display: none; /* 普段は非表示 */
}
.tab-panel.is-active {
  display: block; /* is-activeクラスが付いたら表示 */
}

/* ===== アコーディオンUIのスタイル（最終版） ===== */

.accordion-container {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #fff;
}
.accordion-container:last-child {
    margin-bottom: 0;
}

.accordion-header {
    margin: 0;
    padding: 0;
}

.accordion-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1em 1.2em;
    font-weight: 700;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    border: none;
    background: transparent;
    color: inherit;
    border-radius: 8px; /* 角丸をボタン自体に */
}

.accordion-title {
    padding-right: 1em;
}

/* --- アイコン（＋マーク）のスタイル --- */
.accordion-icon {
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s ease-out; /* 回転アニメーション */
}
.accordion-icon::before,
.accordion-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 2px;
    background-color: #343A40;
    transform: translate(-50%, -50%);
}
.accordion-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

/* is-activeになったらアイコンを45度回転させる */
.accordion-trigger.is-active .accordion-icon {
    transform: rotate(45deg);
}


/* --- 開閉するパネルのスタイル（最重要） --- */
.accordion-panel {
    visibility: hidden; /* ★普段は完全に非表示 */
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease-out, visibility 0s 0.3s, opacity 0.3s 0s;
}

/* is-activeになったら表示 */
.accordion-panel.is-active {
    visibility: visible;
    max-height: 500px; /* 十分な高さを確保 */
    opacity: 1;
    transition: max-height 0.4s ease-in, visibility 0s 0s, opacity 0.3s 0.1s;
}

/* パネル内のコンテンツの余白 */
.accordion-content {
    overflow: hidden;
    padding: 0 1.2em 1em;
}
.accordion-content > *:last-child {
    margin-bottom: 0;
}

/* ===== UIコンポーネント：モーダルウィンドウ ===== */

/* --- 記事内ライブサンプルの枠 --- */
.live-sample {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 1.5em 0;
}

/* --- モーダルウィンドウのコンテナ --- */
.modal-container {
    position: fixed; /* 画面全体を覆うように固定 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000; /* サイトの他のどの要素よりも手前に表示 */
    
    /* 普段は非表示（透明でクリックできない状態） */
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s;
}
/* is-activeクラスが付いたら表示 */
.modal-container.is-active {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s 0s, opacity 0.3s;
}

/* --- 半透明の背景オーバーレイ --- */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer; /* カーソルをポインターにしてクリックできることを示す */
}

/* --- モーダルのコンテンツ部分 --- */
.modal-content {
    position: relative; /* オーバーレイより手前に表示 */
    width: 90%;
    max-width: 500px;
    background: #fff;
    padding: 2em;
    border-radius: 8px;
    
    /* 表示時のアニメーション */
    transform: scale(0.95);
    transition: transform 0.3s;
}
.modal-container.is-active .modal-content {
    transform: scale(1);
}

/* --- 閉じるボタン --- */
.modal-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close-button .material-symbols-outlined {
    font-size: 28px;
    color: #888;
}
.modal-close-button:hover .material-symbols-outlined {
    color: #333;
}

/* --- モーダル内のタイトル --- */
.modal-title {
    font-size: 22px;
    margin: 0 0 1em;
}

/* ===== UIコンポーネント：ドロップダウンメニュー ===== */

.dropdown-sample-nav {
    position: relative;
    z-index: 10; /* 他の要素より手前に */
    background: #f8f9fa;
    padding: 0 1em;
    height: 60px;
    display: flex;
    align-items: center;
}
.main-menu-sample {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 1em;
}
.main-menu-sample a {
    display: block;
    padding: 1em;
    text-decoration: none;
    color: #333;
    font-weight: bold;
}
.has-submenu {
    position: relative;
}
.has-submenu > a {
    cursor: pointer;
}

/* サブメニュー */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    list-style: none;
    padding: 0.5em;
    margin: 10px 0 0;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    
    /* 普段は非表示 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

.submenu a {
    padding: 0.8em 1em;
    border-radius: 4px;
}
.submenu a:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

/* is-openクラスが付いたら表示 */
.has-submenu.is-open > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ===== UIコンポーネント：画像スライダー（Swiper.js） ===== */

.swiper-container-sample {
  width: 100%;
  height: 400px;
  border-radius: 8px;
}
.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  background-color: #f0f0f0;
}
.swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 矢印ボタンの色をサイトのテーマに合わせる */
.swiper-button-next,
.swiper-button-prev {
    color: #005A9C;
}
/* ページネーションのドットの色を合わせる */
.swiper-pagination-bullet-active {
    background: #005A9C;
}

/* ===== UIコンポーネント：ツールチップ ===== */

.tooltip-container {
  position: relative;
  display: inline-block;
}

/* 吹き出しの本体 */
.tooltip-container::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 10px;
  
  background: #343A40;
  color: #fff;
  font-size: 14px;
  font-weight: normal;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 4px;
  white-space: nowrap;
  
  /* 普段は非表示 */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 10;
}

/* 吹き出しの三角形 */
.tooltip-container::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  
  border: 6px solid transparent;
  border-top-color: #343A40;

  /* 普段は非表示 */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 10;
}

/* ホバーされたら表示 */
.tooltip-container:hover::before,
.tooltip-container:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ===== フォーム実装サンプルのスタイル ===== */
.form-group {
    margin-bottom: 1.5em;
}
.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5em;
}
.form-input, .form-textarea {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #005A9C;
    box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.2);
}
.form-actions {
    text-align: center;
    margin-top: 2em;
}

/* --- サンプル2：ダークモードフォーム --- */
.sample-form-2-container { max-width: 400px; margin: 0 auto; }
.sample-form-2 label { color: #9CA3AF; }
.form-input-dark {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #4B5563;
    border-radius: 6px;
    background-color: #1F2937;
    color: #F9FAFB;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input-dark:focus {
    outline: none;
    border-color: #EC4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.3);
}

/* --- サンプル3：カスタムチェックボックス・ラジオボタン --- */
.form-fieldset { border: none; padding: 0; margin: 0 0 1.5em; }
.form-fieldset legend { font-weight: 700; margin-bottom: 0.75em; padding: 0; }
.checkbox-group, .radio-group { display: flex; flex-direction: column; gap: 0.75em; }
.custom-checkbox, .custom-radio { display: inline-flex; align-items: center; cursor: pointer; }
.custom-checkbox input, .custom-radio input {
    appearance: none;
    width: 1.25em;
    height: 1.25em;
    border: 2px solid #D1D5DB;
    margin-right: 0.5em;
    flex-shrink: 0;
    position: relative;
}
.custom-checkbox input { border-radius: 4px; }
.custom-radio input { border-radius: 50%; }
.custom-checkbox input:checked, .custom-radio input:checked {
    border-color: #005A9C;
    background-color: #005A9C;
}
.custom-checkbox input:checked::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9em;
}
.custom-radio input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.6em;
    height: 0.6em;
    background-color: white;
    border-radius: 50%;
}

/* ===== UIコンポーネント：transformサンプル（追加版） ===== */

.live-sample .transform-sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    padding: 20px;
    align-items: center;
    justify-items: center;
}

.transform-sample-box {
    width: 150px;
    height: 150px;
    background-color: #005A9C;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease-out, box-shadow 0.3s;
    position: relative; /* ラベルの基準点 */
    overflow: hidden; /* 画像のはみ出し防止 */
}

.transform-sample-box .sample-label {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 12px;
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 1. 浮き上がるサンプル */
.sample-translate:hover {
    transform: translateY(-10px) scale(1.1);
    box-shadow: 0 15px 30px rgba(0, 90, 156, 0.3);
}

/* 2. 回転するサンプル */
.sample-rotate:hover {
    transform: rotate(15deg);
}

/* 3. 拡大するサンプル */
.transform-sample-box.sample-scale {
    padding: 0;
}
.sample-scale img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-out;
}
.sample-scale:hover img {
    transform: scale(1.2);
}

/* 4. 傾くサンプル */
.sample-skew:hover {
    transform: skew(-10deg, -5deg);
}

/* ===== UIコンポーネント：キーフレームアニメーションサンプル ===== */

.live-sample .animation-sample-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 30px;
    min-height: 200px;
    flex-wrap: wrap;
}

.animation-sample-box {
    width: 150px;
    height: 100px;
    background-color: #005A9C;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* --- アニメーションの定義 --- */

/* 1. フェードイン */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.anim-fade-in {
    /* 1秒かけて、0.2秒後に再生 */
    animation: fadeIn 1s ease-out 0.2s backwards;
}

/* 2. スライドイン */
@keyframes slideIn {
  from { transform: translateX(-50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.anim-slide-in {
    /* 1秒かけて、0.4秒後に再生 */
    animation: slideIn 1s ease-out 0.4s backwards;
}

/* 3. フワフワ浮遊 */
@keyframes floatAnimation {
  0% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0); }
}
.anim-float {
    /* 3秒かけて、無限に往復再生 */
    animation: floatAnimation 3s ease-in-out infinite;
}

/* ===== UIコンポーネント：box-shadowサンプル ===== */

.live-sample .shadow-sample-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 30px;
    min-height: 250px;
    flex-wrap: wrap;
}

.shadow-sample-box {
    width: 180px;
    height: 180px;
    background-color: #FFFFFF;
    color: #333;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid #eee;
    transition: box-shadow 0.3s, transform 0.3s;
}

/* サンプル1：シンプルな影 */
.shadow-sample-box.shadow-simple:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* サンプル2：リアルな影 */
.shadow-sample-box.shadow-realistic:hover {
    transform: translateY(-5px);
    box-shadow: 
      0 4px 6px -1px rgba(0, 0, 0, 0.1), 
      0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

/* ===== UIコンポーネント：グラデーションサンプル ===== */

.live-sample .gradient-sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.gradient-sample-box {
    height: 150px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

/* サンプル1: to right */
.gradient-sample-box.grad-1 {
    background: linear-gradient(to right, #3b82f6, #14b8a6);
}

/* サンプル2: 135deg */
.gradient-sample-box.grad-2 {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

/* サンプル3: Subtle */
.gradient-sample-box.grad-3 {
    background: linear-gradient(to top right, #f8fafc, #e2e8f0);
    color: #334155; /* 文字色を変更 */
    text-shadow: none;
    border: 1px solid #e2e8f0;
}

/* サンプル4: Vibrant */
.gradient-sample-box.grad-4 {
    background: linear-gradient(to right, #f97316, #fde047);
}

/* ===== UIコンポーネント：グラスモーフィズムサンプル ===== */

.glassmorphism-sample-bg {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 40px;
    border-radius: 8px;
    background-image: linear-gradient(135deg, #a855f7, #ec4899);
}

.glass-card {
    width: 100%;
    max-width: 400px;
    padding: 2em;
    border-radius: 16px;

    /* グラスモーフィズムのスタイル */
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.glass-card__title {
    color: #fff;
    font-size: 24px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
    margin: 0 0 10px;
}
.glass-card__text {
    color: #f9fafb;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
    margin: 0;
}

/* ===== UIコンポーネント：グラデーションテキストサンプル ===== */

.gradient-text-sample {
    font-size: 48px;
    font-weight: 900;
    text-align: center;
    
    /* グラデーションの指定 */
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    
    /* テキストで背景を切り抜き */
    -webkit-background-clip: text;
            background-clip: text;
            
    /* 文字色を透明に */
    -webkit-text-fill-color: transparent;
}

/* ===== UIコンポーネント：ローディングアニメーションサンプル ===== */

.live-sample .loader-sample-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 40px;
    min-height: 150px;
    flex-wrap: wrap;
}

/* 1. スピナー */
.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 90, 156, 0.2);
    border-top: 5px solid #005A9C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 2. ドット */
.loader-dots {
    display: flex;
    gap: 10px;
}
.loader-dots > div {
    width: 14px;
    height: 14px;
    background-color: #005A9C;
    border-radius: 100%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.loader-dots > div:nth-child(1) { animation-delay: -0.32s; }
.loader-dots > div:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* 3. リング */
.loader-ring {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 60px;
}
.loader-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    margin: 4px;
    border: 4px solid #005A9C;
    border-radius: 50%;
    animation: ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #005A9C transparent transparent transparent;
}
.loader-ring div:nth-child(1) { animation-delay: -0.45s; }
.loader-ring div:nth-child(2) { animation-delay: -0.3s; }
.loader-ring div:nth-child(3) { animation-delay: -0.15s; }
@keyframes ring {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== UIコンポーネント：スクロール連動アニメーション ===== */

.scroll-animation-sample {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.scroll-item {
    padding: 40px;
    background-color: #005A9C;
    color: white;
    font-weight: bold;
    font-size: 24px;
    text-align: center;
    border-radius: 8px;
}

/* アニメーションの初期状態（画面外） */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* 画面内に入った時の最終状態 */
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== UIコンポーネント：filterプロパティサンプル ===== */

.live-sample .filter-sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.filter-sample-item {
    text-align: center;
}
.filter-sample-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    transition: filter 0.3s ease-out;
}
.filter-sample-item span {
    display: block;
    margin-top: 8px;
    font-weight: bold;
}

/* 各エフェクトのホバースタイル */
.filter-sample-item:hover .filter-blur {
    filter: blur(5px);
}
.filter-sample-item:hover .filter-grayscale {
    filter: grayscale(100%);
}
.filter-sample-item:hover .filter-sepia {
    filter: sepia(100%);
}
.filter-sample-item:hover .filter-brightness {
    filter: brightness(1.5);
}

/* ===== ダウンロード画像コンポーネント ===== */
.download-image-wrapper {
    position: relative;
    max-width: 100%; /* 画像の最大幅 */
    margin: 1.5em 0;
}
.download-image-wrapper img {
    display: block;
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}
.download-icon-link {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: background-color 0.2s;
}
.download-icon-link:hover {
    background-color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
}
.download-icon-link .material-symbols-outlined {
    font-size: 28px;
}