body {
    font-family: sans-serif;
}
a {
    text-decoration: none;
    color: #000000;
}

/* --- 基本スタイル --- */
h1 { /*Tonai(header)*/
    font-size: 100px;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    color: #000000;
    text-align: center;
}
h2 { /*CONTENTS(.m03)*/
    font-size: 30px;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    color: #000000;
}
h3 { /*TOP NEWS(.m04)*/
    font-size: 20px;
    font-weight: bold;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    color: #000000;
}
p1 {
    font-size: 14px;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    color: #000000;
}
p2 {
    font-size: 14px;
    color: #0000ff;
}

/* --- レイアウト --- */
.tonai {
    width: 60vw;
    margin: 0 auto; /* 中央寄せ */
}
main {
    width: 90vw;
    margin: 0 auto; /* 全体を中央寄せ */
}
.pan_list {
    margin: 2em 0;
}

/* ---検索フォームのスタイル --- */
.search-container {
    margin: 20px 0 30px;
    text-align: center;
}
.search-container input[type="text"] {
    padding: 10px;
    width: 70%;
    max-width: 400px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}
.search-container button {
    padding: 10px 20px;
    border: none;
    background-color: #333;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-left: 5px;
}

/* ---絞り込み状態表示のスタイル --- */
.filter-status {
    margin: 0 0 30px;
    text-align: center;
    min-height: 30px;
}
.filter-status span {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 8px 15px;
    border-radius: 15px;
    margin: 5px;
    font-size: 14px;
}
.filter-status a {
    margin-left: 8px;
    color: #e53935;
    text-decoration: none;
    font-weight: bold;
}

/* --- 記事一覧のスタイル--- */
.news ol {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 記事を３列に */
    gap: 20px;
}
.news li {
    list-style: none;
    display: flex;
}
.news_box {
    display: flex;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
}
.news_img {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}
.news_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news_right {
    display: flex;
    flex-direction: column;
    padding: 15px;
    width: calc(100% - 150px);
}
.news_text {
    flex-grow: 1;
}
.news_text h3 {
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* --- タグのスタイル  --- */
.tags_position {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}
.tags_position a {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    transition: opacity 0.2s;
}
.tags_position a:hover {
    opacity: 0.8;
}
.tags_name01 a {
    background-color: #ffaaaa;
    color: #aaffff;
}
.tags_name02 a {
    background-color: #ffaabb;
    color: #aaffee;
}

/* ---ライター情報のスタイル --- */
.writer_info {
    display: flex;
    align-items: center;
    gap: 0.5em; /* アイコンとテキストの間隔 */
    margin-top: auto; /* 下端に配置 */
    padding-top: 10px;
    font-size: 14px;
}
.writer_info a:hover {
    text-decoration: underline;
}

/* --- レスポンシブ対応  --- */
@media screen and (max-width: 768px) {
    .news ol {
        grid-template-columns: repeat(2, 1fr); /* タブレットでは2列 */
    }
}

@media screen and (max-width: 520px) {
    h1 { font-size: 35px; }
    h2 { font-size: 20px; }
    h3 { font-size: 16px; }

    main { width: 95vw; }
    .news ol {
        grid-template-columns: 1fr; /* スマホでは1列 */
    }
    .news_box {
        height: 120px; /* 高さを固定 */
    }
    .news_img {
        width: 120px;
        height: 120px;
    }
    .news_right {
        width: calc(100% - 120px);
        padding: 10px;
    }
    .news_text h3 {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
    .tags_position a {
        font-size: 11px;
        padding: 4px 10px;
    }
    .writer_info {
        font-size: 12px;
    }
    .search-container input[type="text"] {
        width: 65%;
    }
    .search-container button {
        padding: 10px;
    }
}