/* =================================
   ポケット手話
   Universal Design
   ================================= */

* {
    box-sizing: border-box;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f8f7f3;
    color: #222222;
    font-family:
        "Yu Gothic",
        "Hiragino Kaku Gothic ProN",
        Meiryo,
        sans-serif;
    font-size: 18px;
    line-height: 1.8;
}

/* 読みやすい横幅 */
.container {
    width: min(100% - 32px, 1000px);
    margin: 0 auto;
}

/* キーボード操作時にも分かりやすくする */
a:focus-visible,
button:focus-visible {
    outline: 4px solid #e59b45;
    outline-offset: 4px;
}

/* =================================
   ヘッダー
   ================================= */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #d8d8d8;
}

.site-header .container {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-logo {
    color: #174a5b;
    font-size: 1.35rem;
    font-weight: 700;
    text-decoration: none;
}

.main-nav ul,
.main-nav {
    margin: 0;
    padding: 0;
}

.main-nav {
    list-style: none;
}

.main-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.main-nav a {
    display: block;
    padding: 10px 14px;
    color: #222222;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
}

.main-nav a:hover {
    background: #e8f2f5;
    color: #174a5b;
}

/* =================================
   メインビジュアル
   ================================= */

.hero {
    padding: 96px 0;
    background: #e8f2f5;
}

.hero-label {
    margin-bottom: 12px;
    color: #174a5b;
    font-weight: 700;
}

.hero h1 {
    margin: 0 0 24px;
    color: #174a5b;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.4;
}

.hero p {
    max-width: 650px;
    margin-top: 0;
}

/* ボタン */
.button {
    display: inline-block;
    margin-top: 24px;
    padding: 14px 24px;
    background: #174a5b;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
}

.button:hover {
    background: #0f3744;
}

/* =================================
   セクション
   ================================= */

.section {
    padding: 72px 0;
    background: #ffffff;
    border-bottom: 1px solid #dddddd;
}

.section:nth-child(even) {
    background: #f8f7f3;
}

.section h2 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #174a5b;
    font-size: 2rem;
    line-height: 1.5;
}

.section p {
    max-width: 700px;
}

/* =================================
   フッター
   ================================= */

.site-footer {
    padding: 32px 0;
    background: #174a5b;
    color: #ffffff;
}

.site-footer p {
    margin: 0;
    font-size: 0.95rem;
}

/* =================================
   スマートフォン
   ================================= */

@media (max-width: 700px) {

    body {
        font-size: 17px;
    }

    .site-header .container {
        padding: 20px 0;
        display: block;
    }

    .site-logo {
        display: block;
        margin-bottom: 16px;
    }

    .main-nav {
        display: block;
    }

    .main-nav li {
        margin-bottom: 6px;
    }

    .main-nav a {
        padding: 10px 12px;
    }

    .hero {
        padding: 64px 0;
    }

    .section {
        padding: 56px 0;
    }

    .button {
        display: block;
        width: 100%;
        text-align: center;
    }
}
/* =================================
   手話を学ぶ：記事カード
   ================================= */

.section-lead {
    margin-bottom: 32px;
}

.article-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.article-card {
    background: #ffffff;
    border: 1px solid #d8d8d8;
    border-radius: 12px;
    overflow: hidden;
}

.article-card-content {
    padding: 28px;
}

.article-category {
    margin: 0 0 8px;
    color: #174a5b;
    font-size: 0.9rem;
    font-weight: 700;
}

.article-card h3 {
    margin: 0 0 12px;
    color: #222222;
    font-size: 1.35rem;
    line-height: 1.5;
}

.article-card p {
    margin-bottom: 20px;
}

.article-link {
    display: inline-block;
    padding: 10px 16px;
    color: #174a5b;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.article-link:hover {
    background: #e8f2f5;
    border-radius: 6px;
}

/* スマートフォンでは1列にする */

@media (max-width: 800px) {

    .article-list {
        grid-template-columns: 1fr;
    }
}
/* =================================
   個別記事ページ
   ================================= */

.article-date {
    color: #666666;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.article-body h2 {
    margin-top: 40px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8f2f5;
}

.step-list {
    padding-left: 20px;
}

.step-list li {
    margin-bottom: 16px;
}

.back-link-wrapper {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid #dddddd;
}
/* =================================
   記事内の画像・メディア
   ================================= */

.article-image-wrapper {
    margin: 32px 0;
    text-align: center;
}

.article-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid #d8d8d8;
}

figcaption {
    margin-top: 8px;
    color: #666666;
    font-size: 0.9rem;
}
/* =================================
   手話コラム・ブログについて
   ================================= */

.column-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.column-item {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #d8d8d8;
}

.column-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #e8f2f5;
    color: #174a5b;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 6px;
    margin-bottom: 12px;
}

.column-item h3 {
    margin: 0 0 12px;
    font-size: 1.25rem;
    color: #222222;
}

.column-item p {
    margin: 0;
}

.about-content {
    background: #ffffff;
    padding: 32px;
    border-radius: 12px;
    border: 1px solid #d8d8d8;
}

.about-content p:last-child {
    margin-bottom: 0;
}
/* =================================
   お問い合わせフォーム
   ================================= */

.contact-form {
    max-width: 650px;
    background: #ffffff;
    padding: 32px;
    border-radius: 12px;
    border: 1px solid #d8d8d8;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #174a5b;
}

.badge-required {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background: #e59b45;
    color: #ffffff;
    font-size: 0.75rem;
    border-radius: 4px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid #cccccc;
    border-radius: 8px;
    background: #fafafa;
}

.form-input:focus {
    outline: 3px solid #e59b45;
    border-color: #174a5b;
    background: #ffffff;
}

.button-submit {
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
}

/* 検索・フィルターデザイン */
.search-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 12px;
}

.search-container {
    margin-bottom: 1rem;
}

.search-label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 2px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
}

.search-input:focus-visible {
    outline: 3px solid #0056b3;
    border-color: #0056b3;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #0056b3;
    background-color: #fff;
    color: #0056b3;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: #0056b3;
    color: #fff;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background-color: #e9ecef;
    color: #495057;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.no-results {
    text-align: center;
    color: #6c757d;
    padding: 2rem 0;
    font-size: 1.1rem;
}

/* カードヘッダー（バッジとハートを左右に配置） */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* お気に入りボタンのデザイン */
.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    color: #e63946;
    padding: 0.2rem 0.5rem;
    border-radius: 50%;
    transition: transform 0.2s ease, color 0.2s ease;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorite-btn:focus-visible {
    outline: 2px solid #e63946;
}

/* お気に入り登録済み（ハートが赤く塗られる）状態 */
.favorite-btn.active .heart-icon {
    font-weight: bold;
}
/* カテゴリー一覧（いらすとや風） */
.category-section {
    padding: 30px 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* PCで3列表示 */
    gap: 16px;
    margin-top: 15px;
}

/* カテゴリーカードのデザイン */
.category-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    background-color: #f8f9fa;
    cursor: pointer;
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* アイコンとテキスト */
.cat-icon {
    font-size: 2rem;
    line-height: 1;
}

.cat-text {
    display: flex;
    flex-direction: column;
}

.cat-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
}

.cat-desc {
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

/* いらすとや風のパステルカラー背景設定 */
.cat-5kyu     { background-color: #e8f5e9; border-left: 6px solid #4caf50; }
.cat-4kyu     { background-color: #e3f2fd; border-left: 6px solid #2196f3; }
.cat-greeting { background-color: #fff3e0; border-left: 6px solid #ff9800; }
.cat-profile  { background-color: #f3e5f5; border-left: 6px solid #9c27b0; }
.cat-favorite { background-color: #ffebee; border-left: 6px solid #e91e63; }
.cat-all      { background-color: #f5f5f5; border-left: 6px solid #607d8b; }

/* スマホ対応（幅600px以下では2列表示に調整） */
@media (max-width: 600px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .category-card {
        padding: 12px;
        flex-direction: column;
        text-align: center;
    }
}
/* グリッド配置（横に複数並べたい場合は repeat を活用） */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* コンパクトに横並び */
    gap: 12px;
}

/* カード全体のスタイル設定 */
.article-card {
    position: relative; /* リンク拡張の基準 */
    padding: 12px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 単語名の文字サイズと位置 */
.article-card h3 {
    margin: 8px 0 0 0;
    font-size: 1.2rem;
    text-align: left;
}

/* カード全体をクリック可能にする設定 */
.article-card h3 a.card-link::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
}

/* お気に入りボタンを上に移動させて押しやすくする */
.favorite-btn {
    position: relative;
    z-index: 2;
}
/* ==========================================
   カード全体をタップ可能にする設定
   ========================================== */

/* 1. カード本体の位置基準とカーソル設定 */
.article-card {
    position: relative; /* リンクエリアを広げるための基準点 */
    cursor: pointer;    /* タップ／クリックできる手マークにする */
}

/* 2. カード内のリンクをカード全体まで広げる */
.article-card h3 a::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1; /* カード全体を透明なリンクで覆う */
}

/* 3. お気に入りボタン（ハートマーク）をリンクより上にする */
.favorite-btn {
    position: relative;
    z-index: 2; /* リンクの上に重ねて、ハートを押した時にページ移動しないようにする */
}
/* ==========================================
   リンクの下線を消す＆文字色の調整
   ========================================== */
.article-card h3 a {
    text-decoration: none; /* 下線を消す */
    color: #2b6cb0;        /* 文字色（好みの色に変更可） */
}

/* ホバー（マウスを載せた時）も下線を出さない */
.article-card h3 a:hover {
    text-decoration: none;
}

/* ==========================================
   カードの色変更（お好みのスタイルを選択）
   ========================================== */

/* パターンA：背景色をやわらかい色にする場合 */
.article-card {
    background-color: #f7fafc; /* 薄いグレー・ブルー系 */
    border: 1px solid #e2e8f0;   /* 枠線の色 */
}

/* 
  ★もしパステルカラーなどの柔らかい背景にしたい場合は以下を試してみてください！
  ピンク系：background-color: #fff5f5; border-color: #fed7d7;
  グリーン系：background-color: #f0fff4; border-color: #c6f6d5;
  イエロー系：background-color: #fffff0; border-color: #fefcbf;
  ブルー系：background-color: #ebf8ff; border-color: #bee3f8;
*/

/* ==========================================
   全カテゴリーカードのスタイルと色分け設定
   ========================================== */

/* グリッドレイアウトの設定 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

/* ボタン共通デザイン */
.category-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    background-color: #f8fafc;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.category-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.category-text strong {
    display: block;
    font-size: 1rem;
    color: #1e293b;
}

.category-text small {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}

/* --- カラーテーマ（左端のカラーバー＆背景色） --- */

/* 級別 */
.cat-5kyu { background-color: #f0fdf4; border-left: 5px solid #22c55e; } /* 緑 */
.cat-4kyu { background-color: #f0f9ff; border-left: 5px solid #0ea5e9; } /* 水色 */
.cat-3kyu { background-color: #eff6ff; border-left: 5px solid #3b82f6; } /* 青 */
.cat-2kyu { background-color: #fff7ed; border-left: 5px solid #f97316; } /* オレンジ */
.cat-1kyu { background-color: #fefce8; border-left: 5px solid #eab308; } /* 黄色/ゴールド */

/* ジャンル別 */
.cat-gimon     { background-color: #fff1f2; border-left: 5px solid #f43f5e; } /* 赤ピンク */
.cat-aisatsu   { background-color: #fffbeb; border-left: 5px solid #f59e0b; } /* アンバー/黄 */
.cat-family    { background-color: #ecfdf5; border-left: 5px solid #10b981; } /* エメラルド */
.cat-time      { background-color: #faf5ff; border-left: 5px solid #a855f7; } /* パープル */
.cat-emotion   { background-color: #f5f3ff; border-left: 5px solid #8b5cf6; } /* バイオレット */
.cat-direction { background-color: #f0fdfa; border-left: 5px solid #14b8a6; } /* ティール */
.cat-life      { background-color: #fff8f1; border-left: 5px solid #ea580c; } /* 濃いオレンジ */
.cat-yubimoji  { background-color: #f1f5f9; border-left: 5px solid #64748b; } /* スレート/グレー */

/* その他 */
.cat-fav { background-color: #fff1f2; border-left: 5px solid #ec4899; } /* ピンク */
.cat-all { background-color: #f8fafc; border-left: 5px solid #475569; } /* ダークグレー */
/* フッター全体のデザイン調整 */
.site-footer {
    background-color: #2d3748; /* 暗めの背景色で全体を引き締める */
    color: #ffffff;
    padding: 24px 0;
    text-align: center;
    font-size: 0.875rem;
}

/* フッター内のリンク指定 */
.site-footer a {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s;
}

/* ホバー時に少し透けさせる */
.site-footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}
/* 「手話をもっと身近に。」の下線アニメーション */
.hero h1 {
    position: relative;
    display: inline-block; /* 下線の長さを文字幅に合わせる */
}

.hero h1::after {
    content: '';
    position: absolute;
    bottom: -6px;          /* 文字と線の隙間 */
    left: 0;
    height: 2px;           /* 線の太さ */
    background-color: #174a5c; /* 文字色に合わせた濃い青緑（お好みの色に変更可） */
    border-radius: 2px;
    
    /* 左から右へ伸びるアニメーション設定 */
    animation: extendLine 0.8s ease-out forwards;
    animation-delay: 0.2s; /* 画面が開いて0.2秒後に伸び始める */
}

/* 0%から100%へ幅を広げる動き */
@keyframes extendLine {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}
/* すべてのページの動画の操作バー（音量ボタン等）を非表示にする */
video::-webkit-media-controls {
    display: none !important;
}
/* 動画の親枠（カーソルをポインターにして押しやすくする） */
.article-image-wrapper {
    position: relative;
    cursor: pointer;
    display: inline-block;
}

/* 動画本体の見た目調整 */
.article-image {
    display: block;
    max-width: 100%;
    height: auto;
}
/* 動画を囲む枠（正方形フォーマットに対応） */
.article-image-wrapper {
    position: relative;
    cursor: pointer;
    display: block;
    max-width: 400px; /* スマホやPCでの表示サイズ（お好みの大きさに調整OK） */
    width: 100%;
    margin: 0 auto 16px auto; /* 中央寄せ */
    border-radius: 12px; /* 角丸にしてカードっぽく見せる（不要なら消してOK） */
    overflow: hidden;    /* 枠からはみ出た部分をカット */
    background-color: #f5f5f5; /* 動画読み込み中の背景色 */
}

/* 動画本体のズレ防止設定 */
.article-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* 明示的に 1:1（正方形）を指定 */
    object-fit: cover;   /* 枠いっぱいに綺麗に収める */
}
/* --- ① 基本設定（スマホなど画面が狭いとき）：中央寄せで見やすく --- */
.article-image-wrapper {
    position: relative;
    cursor: pointer;
    display: block;
    width: 100%;
    max-width: 360px; /* スマホでちょうどいいサイズ */
    margin: 0 auto 24px auto; /* スマホでは中央寄せ */
    text-align: center;
}

.article-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
}

.article-image-wrapper figcaption {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666666;
    text-align: center;
}

/* --- ② パソコン設定（画面幅が768px以上のとき）：左寄せで文章と流れるように --- */
@media (min-width: 768px) {
    .article-image-wrapper {
        margin-left: 0;   /* 左寄せにする */
        margin-right: auto;
        max-width: 400px;  /* PCで見やすい適切なサイズ */
    }
    
    .article-image-wrapper figcaption {
        text-align: left; /* キャプションも左寄せ */
    }
}
/* 動画の長押し・ドラッグ・選択を無効化 */
.article-image {
    -webkit-touch-callout: none; /* iOS Safariの長押しメニュー禁止 */
    -webkit-user-select: none;   /* テキスト・画像の選択禁止 */
    user-select: none;
    pointer-events: auto;        /* タップ（クリック）イベントは許可 */
}
/* ==========================================
   お気に入り（♡）ボタンのクリック判定復旧
   ========================================== */

/* カードのヘッダー部分を手前に配置 */
.card-header {
    position: relative;
    z-index: 10 !important; /* 透明リンク(z-index: 1)より確実に上に配置 */
}

/* ♡ボタンを確実にクリック可能にする */
.favorite-btn {
    position: relative;
    z-index: 11 !important;
    cursor: pointer;
    pointer-events: auto !important; /* クリックイベントを強制許可 */
}

.favorite-btn .heart-icon {
    pointer-events: none; /* アイコン自体ではなくボタン本体で判定を取る */
}
/* ♡ボタンのクリック判定を一番手前に引き上げる */
.card-header {
    position: relative;
    z-index: 10 !important;
}

.favorite-btn {
    position: relative;
    z-index: 20 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* ♡マーク自体のクリック判定を消してボタン本体で受ける */
.favorite-btn * {
    pointer-events: none !important;
}
/* ヘッダー右上のシンプル指文字ボタン */
.header-yubi-btn-simple {
    display: inline-block;
    padding: 6px 14px;
    background-color: #457b9d; /* 落ち着いた青色 */
    color: #ffffff !important;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

/* マウスを乗せた時だけ少し濃く */
.header-yubi-btn-simple:hover {
    background-color: #1d3557;
}