/* --- 全体設定・基本スタイル --- */
body {
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    color: #000000;
}
a {
    text-decoration: none;
    color: inherit;
}

/* --- 文字スタイル --- */
h1 {
    font-size: 100px;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
h2 {
    font-size: 30px;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    margin-bottom: 0.5em;
}
h3 {
    font-size: 20px;
    font-weight: bold;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
h4 {
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
}
p1, p2, p3 {
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
p1 {
    font-size: 14px;
}
p2 {
    font-size: 16px;
    color: #000000be;
}
p3 {
    font-size: 16px;
    color: #ffffff;
    padding-top: 1vh;
}


/* --- ヘッダー --- */
header {
    width: 100%;
    background: #fff;
    transition: height 0.5s, box-shadow 0.5s; /* JSと連携 */
}
.header_cont {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 110px;
    padding: 0 2vw;
    transition: height 0.5s;
}
hr.header-bottom-line {
    margin: 0;
    border: 1px solid #000;
}

/* ヘッダー */
#top_head.fixed {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
#top_head.fixed .header_cont {
    height: 70px;
}
#top_head.fixed h1 {
    font-size: 60px;
}

/* ハンバーガーメニュー */
.hamburger {
    width: 15%;
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 20px;
}
#nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    background-color: rgba(0,0,0,0.95);
    transform: translateX(-100%); /* 左に隠す */
    transition: transform 0.5s;
    z-index: 200;
    padding: 20px;
    overflow-y: auto;
}
#nav.in {
    transform: translateX(0);
}
#nav ul {
    padding-top: 20px;
}
#nav ul li {
    font-size: 22px;
    margin-top: 20px;
}
#nav a {
    color: #ffffff;
    padding: 10px;
    transition: 0.3s;
}
#nav li a:hover {
    color: #000000;
    background: #ffffff;
    border-radius: 5px;
}

/*メニュー内検索フォーム */
.nav_search_form {
    margin-top: 80px;
    margin-bottom: 30px;
}
.nav_search_form form {
    display: flex;
    border: 1px solid #555;
    border-radius: 5px;
    overflow: hidden;
}
.nav_search_form input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    padding: 10px 15px;
    font-size: 16px;
    outline: none;
}
.nav_search_form button {
    background: #fffd8fb7; /* 検索ボタン背景 */
    border: none;
    color: #fff;
    padding: 0 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.nav_search_form button:hover {
    background: #a9f2ff; /* ホバー時の色 */
}


#hamburger_line {
    display: block;
    width: 40px;
    height: 30px;
    cursor: pointer;
    position: relative;
    z-index: 201;
}
.inner_line {
    display: block;
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #000000;
    transition: 0.3s;
    border-radius: 4px;
}
#line01 {
    top: 0;
}
#line02 {
    top: 50%;
    transform: translateY(-50%);
}
#line03 {
    bottom: 0;
}

.is-active .inner_line {
    background: #fff;
}
.is-active #line01 {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}
.is-active #line02 {
    opacity: 0;
}
.is-active #line03 {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* ロゴとログインエリア */
.tonai {
    width: 70%;
    text-align: center;
}
.right_menu {
    width: 15%;
    display: flex;
    justify-content: flex-end;
}
.login_box {
    display: flex;
    align-items: center;
    border: 1px solid #000;
    padding: 8px;
    min-height: 50px;
}
.login_box_bf {
    display: block;
    border: 1px solid #000;
    padding: 8px 12px;
}

.login_box_bf a:first-of-type {
    margin-bottom: 4px;
    display: inline-block;
}
.login_myimg {
    width: 35px;
    height: 35px;
    border-radius: 10%;
    flex-shrink: 0;
}
.login_myimg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10%;
}
.login_text {
    padding-left: 10px;
}

/* --- メインコンテンツ --- */
main {
    width: 90vw;
    margin: 0 auto;
}
.m03, .m04, .m05, .recommended_posts_by_tag {
    width: 60vw;
    margin: 5vh auto 0;
}
.m03 > hr, .m04 > hr {
    border: 0;
    border-top: 2px solid black;
}
.m02 {
    margin: 20px 0;
}
.contents ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2vw;
}
.contents li {
    list-style: none;
}
.content_box {
    border: 1px solid #9691ff;
}
.content_img img {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
    object-fit: contain;
    display: block;
}


/* --- 記事一覧 --- */
.news ol {
    display: grid;
    grid-template-columns: repeat(2, 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%;
    background: #fff;
}
.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 {
    font-size: 18px;
    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_position .tag-link.tag1, .tags_position .tags_name01 a {
    background-color: #ffaaaa;
    color: #aaffff;
}
.tags_position .tag-link.tag2, .tags_position .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;
}
.tag_category_section > h3 {
    font-size: 24px;
    margin-top: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
hr.section-divider {
    border: 0;
    border-top: 1px solid #ccc;
    margin: 40px 0;
}
.view_btn {
    text-align: center;
    margin-top: 2vw;
}
.view_all {
    display: inline-block;
    padding: 10px 30px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    background-color: #fff;
    border: none;
}
.view_all:hover {
    text-decoration: underline;
}
.add {
    width: 60vw;
    margin: 5vh auto;
}

/* --- フッター --- */
footer {
    width: 100%;
    margin-top: 10vh;
    background-color: #000000;
    color: #ffffff;
    padding: 2vh 0;
}
.ft {
    display: flex;
    flex-wrap: wrap;
    width: 90vw;
    margin: 0 auto;
}
.f01, .f02, .f03, .f04 {
    padding: 1vw;
    box-sizing: border-box;
}
.f01, .f02, .f03 {
    width: 20%;
}
.f04 {
    width: 40%;
}
.ft01_text, .ft02_text, .ft03_text {
    padding-top: 1vh;
    display: grid;
    gap: 1vh;
}
.copyright {
    margin-top: 2vh;
    text-align: center;
}
.mobile_box {
    display: flex;
    width: 60%;
}


/* --- レスポンシブ設定 --- */
@media screen and (max-width: 768px) {
    main, .m03, .m04, .m05, .add, .recommended_posts_by_tag {
        width: 90vw;
    }
    .contents ol, .news ol {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 520px) {
    h1 {
        font-size: 35px;
    }
    h2 {
        font-size: 20px;
    }
    h3 {
        font-size: 16px;
    }
    h4 {
        font-size: 14px;
    }
    p1, p2, p3 {
        font-size: 12px;
    }
    .header_cont, #top_head.fixed .header_cont {
        height: 60px;
    }
    #top_head.fixed h1 {
        font-size: 35px;
    }
    #nav {
        width: 100%;
    }
    .login_box, .login_box_bf {
        padding: 8px;
        min-height: 0;
    }
    .login_myimg {
        width: 35px;
        height: 35px;
    }
    main, .m03, .m04, .m05, .add, .recommended_posts_by_tag {
        width: 95vw;
    }
    .contents ol {
        gap: 10px;
    }
    .content_box {
        border: none;
    }
    .content_img img {
        aspect-ratio: 16 / 9;
    }
    .news ol {
        gap: 15px;
    }
    .news_box {
        flex-direction: column;
    }
    .news_img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .news_right {
        width: 100%;
        padding: 10px;
    }
    .news_text h3 {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
    .view_all {
        font-size: 18px;
    }
    .ft {
        flex-direction: column;
    }
    .mobile_box {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
    .f01, .f02, .f03, .f04 {
        width: 100%;
    }
    .f01, .f02, .f03 {
        width: 32%;
    }
    .f04 {
        margin-top: 20px;
    }
}