:root {
    --primary-color: #2a80b9;
    --primary-color-dark: #1e5a8a;
    --accent-color: #3498db;
    --error-color: #d9534f;
    --background-color: #f9f9f9;
    --text-color: #333;
    --border-radius: 6px;
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.1);

    /* 強調色パターン */
    --strong-red: #e74c3c;
    --strong-blue: #3498db;
    --strong-green: #27ae60;
    --strong-orange: #e67e22;
    --strong-purple: #9b59b6;
    --strong-gray: #7f8c8d;

    /* 追加色 */
    --strong-navy: #1a2a4f;
    --strong-teal: #008080;
    --strong-brown: #8e5e3b;
    --strong-gold: #bfa046;
    --strong-olive: #556b2f;
}

strong {
    font-weight: bold;
    color: var(--strong-navy);
}

/* 強調色クラス */
strong.red {
    color: var(--strong-red);
}
strong.blue {
    color: var(--strong-blue);
}
strong.green {
    color: var(--strong-green);
}
strong.orange {
    color: var(--strong-orange);
}
strong.purple {
    color: var(--strong-purple);
}
strong.gray {
    color: var(--strong-gray);
}
strong.navy {
    color: var(--strong-navy);
}
strong.teal {
    color: var(--strong-teal);
}
strong.brown {
    color: var(--strong-brown);
}
strong.gold {
    color: var(--strong-gold);
}
strong.olive {
    color: var(--strong-olive);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

footer {
    margin-top: auto;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    min-height: auto; /* 高さを自動的に調整 */
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header h1 {
    font-size: 1.2rem;
    margin: 0;
}

header h1 a {
    color: inherit;
    text-decoration: none;
}

nav {
    margin-top: 0;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: var(--primary-color-dark);
}

/* モバイル対応（必要であれば） */
@media (max-width: 600px) {
    nav ul {
        flex-direction: column;
        background-color: var(--primary-color);

        top: 100%;
        right: 0;
        display: none;
    }

    nav ul.show {
        display: flex;
    }

    nav a {
        padding: 1rem;
    }
}

/* ハンバーガーメニューのスタイル */
.menu-toggle {
    font-size: 2rem;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    display: none; /* デフォルトでは非表示 */
}

/* === 記事作成ページの調整用上書き === */
main,
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    background: none; /* 二重枠を防ぐため背景は消す */
    box-shadow: none; /* 二重の影も防ぐ */
    border-radius: 0; /* 必要なければリセット */
}

.login-container {
    max-width: 960px;

    margin: 2rem auto;
    padding: 0 1rem;
    background: none; /* 二重枠を防ぐため背景は消す */
    box-shadow: none; /* 二重の影も防ぐ */
    border-radius: 0; /* 必要なければリセット */
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    padding: 3rem 2rem;
}

.article-date {
    color: #666;
    font-size: 0.9rem;
    min-width: 120px;
    text-align: center;
}

.article-actions a {
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
    border: 1px solid var(--primary-color);
    padding: 0.3rem 0.6rem;
    border-radius: var(--border-radius);
    transition: background-color 0.3s, color 0.3s;
}

.article-actions a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.article-date {
    color: #666;
    font-size: 0.9rem;
    text-align: center;
}

.article-actions a {
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
    border: 1px solid var(--primary-color);
    padding: 0.3rem 0.6rem;
    border-radius: var(--border-radius);
    transition: background-color 0.3s, color 0.3s;
}

.article-actions a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* 日付と編集の間を少し空ける */
}

.article-date {
    color: #666;
    font-size: 0.9rem;
    white-space: nowrap;
}

.article-actions a {
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
    border: 1px solid var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: background-color 0.3s, color 0.3s;
}

.article-actions a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.article-title a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-title a:hover {
    text-decoration: none;
    color: var(--strong-gold);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.3rem; /* 日付と編集の間隔も詰める */
}

.article-date {
    color: #666;
    font-size: 0.9rem;
    white-space: nowrap;
}

.article-actions a {
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
    border: 1px solid var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: background-color 0.3s, color 0.3s;
}

.article-actions a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.article-table th,
.article-table td {
    border: 1px solid #ddd;
    padding: 0.5rem 0.7rem;
    text-align: left;
}

.article-table th {
    background-color: #f2f2f2;
}

.actions a {
    margin-right: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
    border: 1px solid var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    transition: background-color 0.3s, color 0.3s;
}

.actions a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-create {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.btn-create:hover {
    background-color: var(--primary-color-dark);
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.95rem;
}

.danger-message {
    background: #f8d7da;
    color: #721c24;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    text-align: center;
}

.btn-create {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-create:hover {
    background-color: var(--primary-color-dark);
}

.btn-danger {
    background-color: #d9534f;
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
}

.btn-danger:hover {
    background-color: #c9302c;
}

.btn-cancel {
    background-color: #6c757d;
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    margin-left: 1rem;
}

.btn-cancel:hover {
    background-color: #5a6268;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.article-table th,
.article-table td {
    border: 1px solid #ddd;
    padding: 0.5rem 0.7rem;
    text-align: left;
}

.article-table th {
    background-color: #f2f2f2;
}

.actions a {
    margin-right: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
    border: 1px solid var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background-color 0.3s, color 0.3s;
}

.actions a:hover {
    background-color: var(--primary-color);
    color: #fff;
}
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.95rem;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.article-table th,
.article-table td {
    border: 1px solid #ddd;
    padding: 0.5rem 0.7rem;
    text-align: left;
}

.article-table th {
    background-color: #f2f2f2;
}

.actions a {
    margin-right: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
    border: 1px solid var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background-color 0.3s, color 0.3s;
}

.actions a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-create {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-create:hover {
    background-color: var(--primary-color-dark);
}

.dashboard ul {
    list-style: none;
    padding: 0;
}

.dashboard li {
    margin: 0.5rem 0;
    text-align: center;
}

.dashboard-link {
    display: inline-block;
    width: 220px; /* ボタン幅統一 */
    padding: 0.9rem 1.5rem;
    background-color: #2a80b9; /* はっきりしたブルー単色 */
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* 文字の輪郭を強調 */
    transition: background-color 0.3s, transform 0.2s;
}

.dashboard-link:hover {
    background-color: #1e5a8a; /* ダークブルーに変化 */
    transform: translateY(-2px);
}

@media (max-width: 600px) {
    .dashboard-link {
        width: 100%;
        max-width: 300px; /* モバイルは広がりすぎ防止 */
    }
}

.dashboard ul {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
}

/* ここから */

.dashboard ul li a.dashboard-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 260px;
    height: 50px;
    background-color: #3b9cdc; /* ← 薄いブルーに変更 */
    color: white;
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    border: none;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    gap: 0.5rem; /* アイコンとテキストの間隔 */
}

.dashboard-btn:hover {
    background-color: #3498db; /* 濃いめのブルーに変化 */
    color: #28a745;
    transform: scale(1.02);
}

.dashboard-btn span {
    position: relative;
    z-index: 1;
}

/* ここから追加トップページ */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&family=Zen+Kaku+Gothic+New:wght@700&display=swap");

body {
    font-family: "Noto Sans JP", sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
}

main,
.container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    padding: 3rem 2rem;
    margin: 3rem auto;
    max-width: 960px;
}

main h2 {
    font-family: "Zen Kaku Gothic New", sans-serif;
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
    border-left: 5px solid var(--primary-color);
    padding-left: 0.75rem;
    color: var(--primary-color-dark);
}

main p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.9;
    text-align: justify;
}

.latest-articles h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.latest-articles .article-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
    padding: 0;
    margin: 0 auto; /* 中央揃え */
}

.article-row {
    background: #ffffff;
    padding: 1rem 1.2rem;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.article-row:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.article-date {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.all-articles-link {
    text-align: center;
    margin-top: 2rem;
}

.all-articles-link a {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, transform 0.2s;
}

.all-articles-link a:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap; /* 折り返さないようにする */
}
.actions a {
    white-space: nowrap; /* テキストを1行で表示 */
}
.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center; /* 高さ中央寄せ */
    height: 100%; /* 行と同じ高さに */
}

.actions a {
    white-space: nowrap; /* 折り返し防止 */
    padding: 0.3rem 0.6rem;
    line-height: 1.4;
    font-size: 0.85rem;
}

/* ここからスマホ用追加 */

@media (max-width: 600px) {
    header {
        min-height: 60px; /* スマホでは高さを少し小さく */
        padding: 5px 15px; /* スマホ用にパディングを調整 */
    }

    header h1 {
        font-size: 1.2rem;
        padding-right: 2.5rem;
        margin-bottom: 0;
    }

    .menu-toggle {
        display: block;
    }

    nav ul {
        flex-direction: column;
        display: none;
        background-color: #111;
        margin-top: 1rem;
        gap: 0;
        padding: 1rem;
    }

    nav ul.show {
        display: flex;
    }

    nav a {
        font-size: 1rem;
        padding: 0.8rem 1rem;
        border: none;
        border-bottom: 1px solid #444;
        width: 100%;
        text-align: left;
    }

    main,
    .container {
        padding: 1.5rem 1rem;
        margin: 5rem 1rem 2rem;
    }

    h1 {
        font-size: 1rem;
    }

    h2 {
        font-size: 0.9rem;
    }

    p {
        font-size: 0.8rem;
    }

    .article-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-item .meta-info {
        margin-top: 0.3em;
        text-align: left;
    }

    .article-item .article-link {
        white-space: normal;
    }

    .img-center img {
        width: 100%;
    }
    .main-container {
        padding: 0 10px; /* スマホ向けにパディングを調整 */
    }

    .latest-articles {
        padding: 0 10px; /* 記事一覧の余白調整 */
    }
}

/* スマホなど狭い画面で縦並びに */
@media (max-width: 600px) {
    header nav form {
        display: flex;
        margin: 0.5rem 0 0 0;
        justify-content: center;
        width: 100%;
    }

    header nav form input[type="text"] {
        width: 70%;
        border-radius: 6px 0 0 6px;
    }

    header nav form button {
        border-radius: 0 6px 6px 0;
        width: 30%;
    }
}

/* 本文内の画像を調整する */
.article-content img {
    max-width: 100%; /* 画像が親要素の幅を超えないようにする */
    height: auto; /* 高さは自動で調整 */
    display: block; /* インライン要素として表示されるのを防ぐ */
    margin-left: auto; /* 左の余白を自動設定して中央揃え */
    margin-right: auto; /* 右の余白を自動設定して中央揃え */
}

/* 引用部分のスタイル */
blockquote {
    font-style: italic;
    background-color: #f9f9f9; /* 背景色を薄く設定 */
    border-left: 5px solid #3498db; /* 左側に色付きの線 */
    padding: 10px;
    margin: 20px 0;
    quotes: "“" "”" "‘" "’"; /* 引用符をカスタマイズ */
}

blockquote p {
    margin: 0; /* 引用部分の段落のマージンをリセット */
}

blockquote cite {
    display: block; /* <cite> をブロック要素として表示 */
    text-align: center; /* <cite> 内のテキストを中央揃え */
    margin-top: 10px; /* 上部に少し余白を追加 */
}

/* ヘッダー全体のスタイル */
header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

/* メニューのリスト */
nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: var(--primary-color-dark);
}

/* 通常のデスクトップメニュー（デスクトップでは常に表示） */
nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* デスクトップでは通常表示 */
    background-color: #333;
}

/* モバイル用メニューのスタイル */
@media (max-width: 600px) {
    .menu-toggle {
        display: block; /* スマホ画面ではハンバーガーメニューを表示 */
    }

    nav ul {
        flex-direction: column;
        background-color: var(--primary-color);
        top: 100%;
        right: 0;
        width: 100%;
        display: none; /* 初期状態で非表示 */
    }

    nav ul.show {
        display: flex; /* `.show` クラスが付与された場合に表示 */
    }

    nav a {
        padding: 1rem;
        text-align: center;
        border-bottom: 1px solid #444;
    }
}

.login-form {
    max-width: 800px;
    margin: 0rem auto;
    padding: 1rem;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.login-form h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--primary-color);
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
}

.login-form button {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
}

.login-form button:hover {
    background-color: var(--primary-color-dark);
}

/* カテゴリーリンクのスタイル */
.article-category a {
    color: var(--strong-green);
    text-decoration: none; /* 下線を削除 */
    font-size: 1rem;
}

.article-category a:hover {
    color: var(--strong-gold);
}

.category-row a {
    color: var(--strong-green);
    font-weight: bold;
    font-size: 1.1rem;
    background: #ffffff;
    padding: 1rem 1.2rem;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-row:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.category-row a {
    text-decoration: none; /* 下線を削除 */
}
.category-box {
    display: block; /* aタグをブロック要素にして、全体をクリック対象に */
    background-color: #f0f0f0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: #333;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ホバー時のエフェクト */
.category-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.category-box:hover {
    color: #3498db; /* ホバー時にリンクの色変更 */
}

.article-box {
    display: block; /* aタグをブロック要素にして、全体をクリック対象に */
    text-decoration: none; /* 下線を削除 */
    background-color: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
}

/* ホバー時のエフェクト */
.article-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    background-color: #f9f9f9; /* ホバー時に背景色を少し変える */
    color: var(--strong-gold); /* ホバー時にリンクの色変更 */
}

/* メール一日一記事配信フォーム */

form label {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}

form input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 15px;
}

form button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color, #2a80b9);
    color: #fff;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

form button:hover {
    background-color: var(--primary-color-dark, #1e5a8a);
}

.success {
    background-color: #e6ffed;
    border: 1px solid #27ae60;
    color: #2c662d;
    padding: 15px;
    border-radius: 6px;
    font-size: 0.95rem;
}

.error {
    background-color: #ffe6e6;
    border: 1px solid #e74c3c;
    color: #c0392b;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 0.95rem;
}

/* reCAPTCHA の余白調整 */
.g-recaptcha {
    margin-bottom: 20px;
}
