/**
 * はとはとプロジェクト トップページ
 * コンテンツテーブル用スタイル（既存デザインに馴染む透過スタイル）
 */

/* ========================================
   コンテンツテーブルセクション
   ======================================== */
.contents-table-section {
    margin-top: 30px;
}

.contents-table-section h2 {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    font-family: 'Orbitron', 'M PLUS 1p', sans-serif;
    letter-spacing: 0.1em;
}

/* テーブルラッパー */
.table-wrapper {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* フィルタバー */
.table-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.table-filter-bar input[type="text"] {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}

.table-filter-bar input:focus {
    outline: none;
    border-color: #1a365d;
}

.table-filter-bar select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
}

.table-sort-buttons {
    display: flex;
    gap: 5px;
}

.table-sort-btn {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.table-sort-btn:hover,
.table-sort-btn.active {
    background: #1a365d;
    color: #fff;
    border-color: #1a365d;
}

/* 件数表示 */
.table-result-count {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
}

/* ========================================
   コンテンツテーブル
   ======================================== */
.contents-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

.contents-table thead {
    background: #f5f5f5;
}

.contents-table th {
    text-align: left;
    padding: 12px 10px;
    font-weight: 500;
    color: #333;
    border-bottom: 2px solid #1a365d;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.contents-table th:hover {
    background: #eee;
}

.contents-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.contents-table tbody tr:hover {
    background: rgba(26, 54, 93, 0.05);
}

.contents-table tbody tr.hidden {
    display: none;
}

/* カラム幅 */
.contents-table .col-title { width: 26%; }
.contents-table .col-category { width: 10%; }
.contents-table .col-desc { width: 42%; }
.contents-table .col-scale { width: 7%; text-align: center; }
.contents-table .col-audio { width: 7%; text-align: center; }
.contents-table .col-link { width: 8%; text-align: center; }

/* データセルも中央揃え */
.contents-table td:nth-child(4),
.contents-table td:nth-child(5),
.contents-table td:nth-child(6) {
    text-align: center;
}

/* 音声列 */
.audio-yes {
    color: #16a34a;
    font-weight: bold;
}

.audio-no {
    color: #94a3b8;
}

/* タイトルリンク */
.contents-table .title-link {
    color: #1a365d;
    text-decoration: none;
    font-weight: 500;
    word-break: break-word;
}

.contents-table .title-link:hover {
    text-decoration: underline;
}

/* カテゴリバッジ */
.category-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.75rem;
    border-radius: 12px;
    white-space: nowrap;
}

.category-badge.cat-ai { background: #e8f0fe; color: #1a56db; }
.category-badge.cat-dev { background: #fef3e2; color: #b45309; }
.category-badge.cat-infra { background: #e6f4ea; color: #0d7340; }
.category-badge.cat-math { background: #fce8f3; color: #9d174d; }
.category-badge.cat-tool { background: #f3e8ff; color: #6b21a8; }
.category-badge.cat-other { background: #f1f5f9; color: #475569; }

/* 説明文 */
.contents-table .desc-text {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
}

/* リンクボタン */
.contents-table .table-link-btn {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.75rem;
    color: #1a365d;
    border: 1px solid #1a365d;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.contents-table .table-link-btn:hover {
    background: #1a365d;
    color: #fff;
}

/* ========================================
   レスポンシブ - タブレット (900px以下)
   ======================================== */
@media screen and (max-width: 900px) {
    /* 概要列を非表示 */
    .contents-table th:nth-child(3),
    .contents-table td:nth-child(3) {
        display: none !important;
    }
    .contents-table .col-title { width: 38% !important; }
    .contents-table .col-category { width: 17% !important; }
    .contents-table .col-scale { width: 12% !important; }
    .contents-table .col-audio { width: 13% !important; }
    .contents-table .col-link { width: 20% !important; }
}

/* ========================================
   レスポンシブ - スマートフォン (600px以下)
   ======================================== */
@media screen and (max-width: 600px) {
    .table-wrapper {
        padding: 12px;
        margin: 0 -5px;
        border-radius: 6px;
    }
    
    .table-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .table-filter-bar input[type="text"] {
        width: 100% !important;
        min-width: unset;
    }
    
    .table-filter-bar select {
        width: 100% !important;
    }
    
    .table-sort-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .table-sort-btn {
        flex: 1;
        text-align: center;
    }
    
    /* テーブル本体 */
    .contents-table {
        font-size: 0.8rem;
        table-layout: auto;
    }
    
    .contents-table th,
    .contents-table td {
        padding: 10px 6px;
    }
    
    /* 概要と規模を非表示 */
    .contents-table th:nth-child(3),
    .contents-table td:nth-child(3),
    .contents-table th:nth-child(4),
    .contents-table td:nth-child(4) {
        display: none !important;
    }
    
    /* カラム幅調整 */
    .contents-table .col-title { width: 45% !important; }
    .contents-table .col-category { width: 20% !important; }
    .contents-table .col-audio { width: 10% !important; }
    .contents-table .col-link { width: 25% !important; }
    
    /* タイトルの折り返し */
    .contents-table .title-link {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    /* カテゴリバッジ */
    .category-badge {
        padding: 2px 6px;
        font-size: 0.65rem;
    }
    
    /* リンクボタン */
    .contents-table .table-link-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
}

/* ========================================
   レスポンシブ - 超小型画面 (400px以下)
   ======================================== */
@media screen and (max-width: 400px) {
    .table-wrapper {
        padding: 8px;
    }
    
    .contents-table th,
    .contents-table td {
        padding: 8px 4px;
    }
    
    .contents-table {
        font-size: 0.75rem;
    }
    
    /* 概要・規模・音声を非表示してタイトル・カテゴリ・リンクのみ */
    .contents-table th:nth-child(3),
    .contents-table td:nth-child(3),
    .contents-table th:nth-child(4),
    .contents-table td:nth-child(4),
    .contents-table th:nth-child(5),
    .contents-table td:nth-child(5) {
        display: none !important;
    }
    
    .contents-table .col-title { width: 50% !important; }
    .contents-table .col-category { width: 25% !important; }
    .contents-table .col-link { width: 25% !important; }
    
    .contents-table .title-link {
        font-size: 0.8rem;
    }
}
