/*
Theme Name: なんだようオンライン
Author: Yuka Ogasawara
Description: なんだようオンラインのオリジナルテーマ
Version: 1.0.0
*/

/* ========================================
   全体
======================================== */

* {
    box-sizing: border-box;
}

body {
    max-width: 1200px;
    margin: 0 auto;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.8;
    color: #222;
    background: #fff;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

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

.site-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    background: #fff;
}

.header-inner {
    min-height: 150px;
    padding: 40px 6.3%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.skip-link {
    position: absolute;
    top: 10px;
    left: -9999px;
    z-index: 10000;
    padding: 12px 16px;
    background: #fff;
    color: #222;
    border: 2px solid #222;
    border-radius: 4px;
    text-decoration: none;
}

.skip-link:focus {
    left: 10px;
}

.site-logo-box {
    display: inline-block;
    flex-shrink: 0;
    line-height: 0;
}

.site-logo-box:hover {
    opacity: 0.7;
}

.site-logo {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
}

/* ========================================
   グローバルナビゲーション
======================================== */

.site-navigation {
    display: block;
    padding: 0 6.3% 24px;
}

.menu-list {
    display: flex;
    align-items: center;
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu-list > li {
    position: relative;
}

.menu-list a {
    display: block;
    color: #222;
    text-decoration: none;
    font-size: 17px;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.menu-list a:hover {
    opacity: 0.6;
}

/* 子メニュー */

.menu-list .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    display: block;
    min-width: 150px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
    z-index: 1001;
}

.menu-list .sub-menu li {
    width: 100%;
}

.menu-list .sub-menu a {
    padding: 10px 16px;
    white-space: nowrap;
    font-size: 15px;
}

/* ホバーまたはキーボード操作で子メニューを表示 */

.menu-list > li:hover > .sub-menu,
.menu-list > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* ハンバーガーメニュー */

.menu-toggle {
    display: none;
}

.menu-overlay {
    display: none;
}

.site-header.is-menu-open .site-navigation {
    display: flex;
}

.site-header.is-menu-open .menu-overlay {
    display: block;
}

/* ========================================
   メインコンテンツ
======================================== */

.main-contents {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* 本文と広告の2カラム */

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    align-items: start;
}

.main-column,
.sidebar {
    min-width: 0;
}

/* ========================================
   カテゴリーセクション
======================================== */

.category-section {
    margin-bottom: 36px;
    padding: 0;
}

/* カテゴリー見出し */

.category-heading {
    margin: 0 0 24px;
    font-family: "Potta One", system-ui;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.5;
}

/* まんがセクションの背景色 */

.category-manga {
    padding: 24px;
    background-color: #fff5e8;
    border-radius: 8px;
}

/* ========================================
   記事一覧
======================================== */

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

.post-item {
    display: flex;
    align-items: stretch;
    gap: 20px;
    min-width: 0;
    margin: 0;
}

/* 記事サムネイル */

.post-item > a {
    display: block;
    flex: 0 0 220px;
    width: 220px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f5f5f5;
}

.post-item .wp-post-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-item > a:hover .wp-post-image {
    transform: scale(1.04);
}

/* 記事タイトルと日付 */

.post-item .post-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.post-item .post-title {
    margin: 0 0 10px;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.post-title a {
    color: #222;
    text-decoration: none;
}

.post-title a:hover {
    opacity: 0.7;
}

.post-item .datetime {
    display: block;
    margin-top: auto;
    margin-bottom: 0;
    color: #777;
    font-size: 13px;
}

/* もっと見る */

.more-link {
    margin: 16px 0 0;
    text-align: right;
    font-size: 14px;
}

.more-link a {
    color: #222;
    text-decoration: none;
}

.more-link a:hover {
    text-decoration: underline;
}

/* ========================================
   サイドバー・広告
======================================== */

.sidebar-title {
    margin: 0 0 16px;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.ad-space {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 16px;
    border: 1px dashed #ccc;
    color: #888;
    font-size: 13px;
    text-align: center;
}

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

.site-footer {
    padding: 24px;
    text-align: center;
    font-size: 13px;
}

/* ========================================
   タブレット
======================================== */

@media screen and (max-width: 800px) {

    .content-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .sidebar {
        width: 100%;
    }

    .ad-space {
        min-height: 180px;
    }

    .post-item > a {
        flex-basis: 180px;
        width: 180px;
    }

}

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

@media screen and (max-width: 600px) {

    .header-inner {
        min-height: 100px;
        padding: 24px 5%;
        align-items: center;
    }

    .site-logo {
        width: 95px;
    }

    .site-navigation {
        display: none;
        padding: 20px 5%;
    }

    .site-header.is-menu-open .site-navigation {
        display: block;
    }

    .menu-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .menu-list a {
        font-size: 16px;
    }

    /* スマホでは子メニューを親項目の下に表示 */

    .menu-list .sub-menu {
        position: static;
        min-width: 0;
        margin-top: 8px;
        padding: 4px 0 4px 16px;
        border: none;
        border-radius: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        transition: none;
    }

    .menu-list .sub-menu a {
        padding: 8px 12px;
        font-size: 15px;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        padding: 8px;
        cursor: pointer;
    }

    .menu-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background: #222;
    }

.site-header.is-menu-open .menu-overlay {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1001;
}
    .main-contents {
        padding: 24px 16px;
    }

    .category-section {
        margin-bottom: 28px;
    }

    .category-heading {
        margin-bottom: 20px;
        font-size: 24px;
    }

    .category-manga {
        padding: 18px 14px;
    }

    .post-list {
        gap: 22px;
    }

    .post-item {
        gap: 12px;
    }

    .post-item > a {
        flex: 0 0 120px;
        width: 120px;
    }

    .post-item .post-title {
        font-size: 16px;
    }

    .more-link {
        font-size: 13px;
    }

}

/* もっと見るボタン */
.more-link {
    margin: 24px 0 0;
    text-align: center;
}

.more-link a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 200px;
    padding: 12px 28px;
    border: 1px solid #222;
    border-radius: 4px;
    background: #fff;
    color: #222;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease;
}

/* ホバー時 */
.more-link a:hover {
    background: #222;
    border-color: #222;
    color: #fff;
    text-decoration: none;
}

/* スマートフォン */
@media screen and (max-width: 600px) {
    .more-link {
        margin-top: 20px;
    }

    .more-link a {
        min-width: 180px;
        padding: 11px 22px;
        font-size: 13px;
    }
}

/* ========================================
   個別記事ページ
======================================== */

.single-article {
    min-width: 0;
}

.single-category {
    margin-bottom: 12px;
    color: #777;
    font-size: 13px;
}

.single-category a {
    text-decoration: none;
}

.single-title {
    margin: 0 0 12px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.single-date {
    display: block;
    margin-bottom: 24px;
    color: #777;
    font-size: 13px;
}

.single-thumbnail {
    margin: 0 0 32px;
}

.single-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* WordPress本文 */
.single-content {
    font-size: 16px;
    line-height: 2;
    overflow-wrap: anywhere;
}

.single-content p {
    margin: 0 0 1.5em;
}

.single-content h2 {
    margin: 2em 0 1em;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.5;
}

.single-content h3 {
    margin: 1.8em 0 0.8em;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.6;
}

.single-content img {
    max-width: 100%;
    height: auto;
}

.single-content figure {
    margin: 1.5em 0;
}

.single-content ul,
.single-content ol {
    margin: 1em 0 1.5em;
    padding-left: 1.5em;
}

.single-content ul {
    list-style: disc;
}

.single-content ol {
    list-style: decimal;
}

.single-content a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media screen and (max-width: 600px) {
    .single-title {
        font-size: 24px;
    }

    .single-date {
        margin-bottom: 20px;
    }

    .single-thumbnail {
        margin-bottom: 24px;
    }

    .single-content {
        font-size: 15px;
    }

    .single-content h2 {
        font-size: 21px;
    }

    .single-content h3 {
        font-size: 18px;
    }
}

/* ========================================
   ナビゲーション・リンク不具合対策
======================================== */

/* ヘッダーの重なり順 */
.site-header {
    position: relative;
    z-index: 1000;
}

/* ロゴとハンバーガーボタン */
.header-inner {
    position: relative;
    z-index: 1003;
}

.site-logo-box {
    position: relative;
    z-index: 1003;
    display: inline-block;
}

.site-logo {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ナビゲーション */
.site-navigation {
    position: relative;
    z-index: 1002;
}

.site-navigation a {
    position: relative;
    pointer-events: auto;
    cursor: pointer;
}

/* メニュー項目 */
.menu-list > li {
    position: relative;
}

/* サブメニュー */
.menu-list .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1005;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* マウス・キーボード操作 */
.menu-list > li:hover > .sub-menu,
.menu-list > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 背景オーバーレイ：閉じている間は無効 */
.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1001;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.35);
}

/* メニュー表示中の背景 */
.site-header.is-menu-open .menu-overlay {
    display: block;
}

/* メニュー表示中はナビゲーションを背景より前に */
.site-header.is-menu-open .site-navigation {
    position: relative;
    z-index: 1002;
}

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

@media (max-width: 800px) {

    .site-header {
        position: relative;
    }

    .header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .menu-toggle {
        position: relative;
        z-index: 1004;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        cursor: pointer;
    }

    .site-navigation {
        display: none;
        position: relative;
        z-index: 1002;
        width: 100%;
    }

    .site-header.is-menu-open .site-navigation {
        display: block;
    }

    .menu-list {
        display: flex;
        flex-direction: column;
    }

    .menu-list .sub-menu {
        position: static;
        display: block;
        min-width: 0;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* ========================================
   PC
======================================== */

@media (min-width: 801px) {

    .menu-toggle {
        display: none;
    }

    .site-navigation {
        display: block;
    }

    .menu-overlay {
        display: none !important;
        pointer-events: none;
    }
}

/* アーカイブページ */
.archive-header {
    margin-bottom: 32px;
}

.archive-title {
    margin-bottom: 16px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.5;
}

.archive-description {
    margin-top: 12px;
    line-height: 1.8;
}

/* 記事の抜粋 */
.post-excerpt {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.8;
}

/* 記事を読むリンク */
.read-more {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    border: 1px solid #222;
    color: #222;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.read-more:hover,
.read-more:focus-visible {
    background-color: #222;
    color: #fff;
}

/* ページ送り */
.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination a,
.pagination .current {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #222;
    text-decoration: none;
}

.pagination .current {
    background-color: #222;
    color: #fff;
}

.no-posts {
    padding: 32px 0;
    line-height: 1.8;
}

@media (max-width: 600px) {
    .archive-title {
        font-size: 24px;
    }

    .archive-header {
        margin-bottom: 24px;
    }
}

/* フッターのリンク */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 24px;
    margin-top: 24px;
    padding: 24px 16px;
    border-top: 1px solid #e5e5e5;
    font-size: 13px;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.site-footer {
    display: block;
    position: relative;
    width: 100%;
    padding: 32px 20px;
    margin-top: 48px;
    background: #f7f7f7;
    color: #333;
    text-align: center;
    clear: both;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 24px;
    margin-bottom: 20px;
}

.footer-links a {
    display: inline-block;
    color: #333;
    font-size: 14px;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.site-footer .copyright {
    margin: 0;
    font-size: 12px;
    line-height: 1.8;
}


/* 固定ページ共通レイアウト */
.site-main {
    width: 100%;
    padding: 48px 24px 80px;
    box-sizing: border-box;
}

.content-area {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* 固定ページのタイトル */
.page-title {
    margin: 0 0 32px;
    font-size: 32px;
    line-height: 1.5;
    font-weight: 700;
}

/* 固定ページの本文 */
.entry-content {
    font-size: 16px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.entry-content p {
    margin-bottom: 1.5em;
}

.entry-content h2 {
    margin: 2em auto 0.8em;
    padding: 10px;
    border: 3px solid #94601b;
    border-radius: 20px;
    font-size: 24px;
    line-height: 1.5;
}

.entry-content h3 {
    margin: 1.8em 0 0.7em;
    font-size: 20px;
    line-height: 1.5;
}

/* 画像が横にはみ出さないようにする */
.entry-content img {
    max-width: 100%;
    height: auto;
}

/* お問い合わせフォーム */
.entry-content .wpcf7 {
    width: 100%;
    max-width: 680px;
    margin: 32px auto;
}

/* スマートフォン */
@media (max-width: 600px) {
    .site-main {
        padding: 32px 18px 56px;
    }

    .page-title {
        margin-bottom: 24px;
        font-size: 26px;
    }

    .entry-content {
        font-size: 15px;
    }

    .entry-content h2 {
        font-size: 21px;
    }

    .entry-content h3 {
        font-size: 18px;
    }
}
/* スマホ：ハンバーガーメニューの子カテゴリー背景を透明にする */
@media (max-width: 800px) {
    .menu-list .sub-menu {
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .menu-list .sub-menu a {
        background: transparent;
        color: #222;
    }
}