/* AI ページ モバイル対応 CSS */

/* モバイル基本設定 (768px以下) */
@media (max-width: 768px) {
    /* 全体的なスペーシング調整 */
    .page-title, h1 {
        margin-bottom: 15px;
        font-size: 1.5rem;
    }
    
    /* 記事リストタイトルの調整 */
    .article-list-title {
        font-size: 1.3rem;
        margin: 15px 10px;
        line-height: 1.4;
    }
    
    /* パンくずリストの調整 */
    .breadcrumbs {
        font-size: 0.85rem;
        padding: 10px;
        white-space: nowrap;
        overflow-x: auto;
        margin-bottom: 10px;
    }
    
    /* 検索バーの調整 */
    .search-container {
        padding: 10px;
        margin-top: 15px;
    }
    
    .news-search-bar {
        width: 100%;
        max-width: none;
    }
    
    .news-search-bar input {
        font-size: 16px; /* iOSでのズーム防止 */
    }
    
    /* カテゴリフィルターのスクロール対応 */
    .main-categories {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding: 10px 0;
        margin-top: 10px;
        margin-bottom: 10px;
    }
    
    .main-categories button {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    /* もっと見るボタンの調整 */
    #more-categories-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    /* ニュースカードの縦並び */
    .news-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }
    
    /* 記事カードの調整 */
    .news-item {
        display: flex;
        flex-direction: column;
        padding: 15px;
    }
    
    /* アイコンサイズの調整 */
    .news-icon {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    /* ページネーションの調整 */
    .pagination {
        justify-content: center;
        padding: 20px 10px;
    }
    
    .pagination button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    /* メインコンテナの調整 */
    .main-container, main {
        padding-top: 20px;
    }
    
    /* テーブルのモバイル対応 */
    .articles-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    
    .articles-table thead {
        display: none; /* モバイルではヘッダーを非表示 */
    }
    
    .articles-table tbody {
        display: block;
    }
    
    .articles-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 15px;
        background-color: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        transition: all 0.2s ease;
    }
    
    .articles-table tr:hover {
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        background-color: #f8f9fa;
    }
    
    .articles-table td {
        display: block;
        text-align: left;
        padding: 8px 0;
        border: none;
        position: relative;
        padding-left: 35%;
        min-height: 30px;
    }
    
    /* ラベルがないセルのパディング調整 */
    .articles-table td[data-label="投稿日"],
    .articles-table td[data-label="概要説明"] {
        padding-left: 0;
    }
    
    .articles-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 30%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: #666;
        font-size: 0.85em;
    }
    
    /* 日付セルの調整 */
    .articles-table td[data-label="投稿日"] {
        padding-top: 0;
        font-size: 0.8em;
        color: #888;
    }
    
    .articles-table td[data-label="投稿日"]::before {
        display: none;
    }
    
    /* タイトルセルの調整 */
    .articles-table td[data-label="タイトル"] {
        padding-left: 0;
    }
    
    .articles-table td[data-label="タイトル"]::before {
        display: none;
    }
    
    /* 概要セルの調整 */
    .articles-table td[data-label="概要説明"] {
        margin-top: 10px;
    }
    
    .articles-table td[data-label="概要説明"]::before {
        display: none;
    }
}

/* 小さいモバイル (480px以下) */
@media (max-width: 480px) {
    /* さらに小さい画面用の調整 */
    .main-categories button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .news-item {
        padding: 12px;
    }
    
    /* テーブルのさらなる調整 */
    .articles-table tr {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .articles-table td {
        padding-left: 0;
        font-size: 0.9em;
    }
    
    .articles-table td::before {
        position: static;
        display: block;
        width: 100%;
        margin-bottom: 3px;
        padding-right: 0;
    }
    
    /* 日付と概要説明のラベルを非表示 */
    .articles-table td[data-label="投稿日"]::before,
    .articles-table td[data-label="概要説明"]::before {
        display: none;
    }
    
    /* タグの折り返し対応 */
    .articles-table td[data-label="タイトル"] span {
        display: inline-block;
        margin: 2px;
    }
}
