/* ================================================================ */
/* DIARY スキン専用 CSS                                              */
/* ../css/style.css を継承した上で、てがろぐ用に加筆                  */
/* ================================================================ */

/* ---------------------------------------------------------------- */
/* navbar                                                            */
/* ---------------------------------------------------------------- */

.navbar .container {
    padding-left: 1rem;
    padding-right: 1rem;
}

.navbar .diary-label {
    color: #aaa;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
}

/* ---------------------------------------------------------------- */
/* nav-pills（カテゴリ切り替え）                                     */
/* style.cssで基本定義済み。ここではDIARY用の文言サイズだけ調整      */
/* ---------------------------------------------------------------- */

.nav-pills .nav-link[data-cat] {
    font-size: 1rem;
    letter-spacing: 0.1em;
    padding: 0.6rem 1rem;
}

.nav-pills .nav-link[data-cat].active {
    color: #222 !important;
    background-color: transparent !important;
    font-weight: 600;
}

/* ---------------------------------------------------------------- */
/* 状況見出し（カテゴリ別 / タグ別 / 検索結果などの表示時に出る）    */
/* ---------------------------------------------------------------- */

.situation-header {
    max-width: 700px;
    margin: 0 auto 2rem;
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
}

.situation-header:empty {
    display: none;
}

/* ---------------------------------------------------------------- */
/* 投稿フォーム（QUICKPOST）                                         */
/* ※非ログイン時はてがろぐ側の設定で非表示                          */
/* ---------------------------------------------------------------- */

.postarea {
    max-width: 700px;
    margin: 0 auto 3rem;
}

.postarea:empty {
    display: none;
}

.postarea form {
    background: transparent;
    padding: 1.5rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.postarea textarea,
.postarea input[type="text"] {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 2px;
    background: #fff;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #222;
    box-shadow: none;
    transition: border-color 0.2s;
}

.postarea textarea:focus,
.postarea input[type="text"]:focus {
    outline: none;
    border-color: #888;
}

/* QUICKPOST全ボタンの基本スタイル */
.postarea button,
.postarea input[type="submit"],
.postarea input[type="button"] {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 2px;
    color: #555;
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0.4rem 1rem;
    margin: 0.3rem 0.3rem 0.3rem 0;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    box-shadow: none;
    text-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.postarea button:hover,
.postarea input[type="submit"]:hover,
.postarea input[type="button"]:hover {
    background: #f5f5f5;
    border-color: #888;
    color: #222;
}

/* 「投稿する」ボタンだけ少しだけ強調（自分が一番使う） */
.postarea input[type="submit"][value*="投稿"],
.postarea button[type="submit"] {
    background: #222;
    border-color: #222;
    color: #fff;
    letter-spacing: 0.1em;
}

.postarea input[type="submit"][value*="投稿"]:hover,
.postarea button[type="submit"]:hover {
    background: #555;
    border-color: #555;
    color: #fff;
}

/* 「他のIDに切り替える」のような通常リンクは控えめに */
.postarea a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.85rem;
    margin: 0 0.5rem;
    transition: color 0.2s;
}

.postarea a:hover {
    color: #222;
}

/* ---------------------------------------------------------------- */
/* 投稿リスト（タイムライン）                                        */
/* ---------------------------------------------------------------- */

.diary-timeline {
    max-width: 700px;
    margin: 0 auto;
}

/* 日付境界バーの「この範囲を時系列順で読む」「この範囲をファイルに出力する」を非表示 */
.diary-timeline a[href*="order="],
.diary-timeline a[href*="output="],
.diary-timeline a[href*="download="],
.diary-timeline a[href*="export="] {
    display: none;
}

/* 日付境界バー（自動生成）：「2026年6月」などのラベル部分 */
.diary-timeline > p,
.diary-timeline > h2,
.diary-timeline > h3,
.diary-timeline > .dateboundary,
.diary-timeline > .datelabel,
.diary-timeline > div:not(.diary-entry) {
    color: #aaa;
    font-size: 0.85rem;
    margin: 2.5rem 0 1.5rem;
    letter-spacing: 0.05em;
    font-weight: normal;
}

.diary-timeline > p a,
.diary-timeline > h2 a,
.diary-timeline > h3 a,
.diary-timeline > .dateboundary a,
.diary-timeline > .datelabel a,
.diary-timeline > div:not(.diary-entry) a {
    color: #aaa !important;
    text-decoration: none;
    border-bottom: 1px dotted #ddd;
    transition: color 0.2s, border-color 0.2s;
}

.diary-timeline > p a:hover,
.diary-timeline > h2 a:hover,
.diary-timeline > h3 a:hover,
.diary-timeline > .dateboundary a:hover,
.diary-timeline > .datelabel a:hover,
.diary-timeline > div:not(.diary-entry) a:hover {
    color: #222 !important;
    border-bottom-color: #999;
}

/* 1投稿 = 1記事 */
.diary-entry {
    margin: 0 auto 4rem;
    padding: 0;
    background: transparent;
    border: none;
    line-height: 1.8;
}

/* 投稿ヘッダ：カテゴリ・日付（薄いグレー） */
.entry-meta {
    color: #aaa;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.entry-meta a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s;
}

.entry-meta a:hover {
    color: #666;
}

.entry-separator {
    margin: 0 0.5em;
    color: #ddd;
}

/* カテゴリ未設定投稿の場合、セパレータも消す */
.entry-categories:empty {
    display: none;
}

.entry-categories:empty + .entry-separator {
    display: none;
}

/* 投稿本文：明朝・#000 */
.entry-body {
    color: #000;
    font-size: 0.9rem;
    line-height: 1.85;
    margin-bottom: 1rem;
}

.entry-body p {
    margin-bottom: 1.2rem;
}

/* 本文中の画像（縦積み、現サイトに合わせて中央寄せ） */
.entry-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.5rem auto;
}

@media (min-width: 768px) {
    .entry-body img {
        max-width: 80%;
    }
}

/* 本文中のハッシュタグ */
.entry-body a[href*="tag="] {
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s;
}

.entry-body a[href*="tag="]:hover {
    color: #666;
}

/* 本文中の通常リンク */
.entry-body a:not([href*="tag="]) {
    color: rgba(0, 0, 0, 0.75);
    text-decoration: underline;
    text-decoration-color: #ddd;
    text-underline-offset: 0.2em;
    transition: color 0.2s, text-decoration-color 0.2s;
}

.entry-body a:not([href*="tag="]):hover {
    color: #000;
    text-decoration-color: #999;
}

/* 続きを読む（details/summary） */
.entry-body details {
    margin: 1rem 0;
}

.entry-body details summary {
    color: #aaa;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.3rem 0;
    list-style: none;
    transition: color 0.2s;
}

.entry-body details summary:hover {
    color: #666;
}

.entry-body details summary::-webkit-details-marker {
    display: none;
}

/* 旧形式：続きを読むボタン */
.entry-body .readmorebutton,
.entry-body .readmore {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.entry-body .readmorebutton:hover,
.entry-body .readmore:hover {
    color: #666;
}

/* 鍵付き投稿の鍵入力欄 */
.entry-body .lockedpostbody,
.entry-body .keyinputarea,
.entry-body input[type="password"] {
    font-family: inherit;
}

.entry-body .keyinputarea {
    padding: 1.5rem;
    margin: 1rem 0;
    background: rgba(0, 0, 0, 0.02);
    border-left: 2px solid #ddd;
    font-size: 0.9rem;
}

/* 投稿本文内のボタン（続きを読む、鍵入力の投稿を見る、など読者が押すもの） */
.entry-body button,
.entry-body input[type="submit"],
.entry-body input[type="button"] {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 2px;
    color: #555;
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0.4rem 1.2rem;
    margin: 0.3rem 0;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    box-shadow: none;
    text-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.entry-body button:hover,
.entry-body input[type="submit"]:hover,
.entry-body input[type="button"]:hover {
    background: #f5f5f5;
    border-color: #888;
    color: #222;
}

/* 鍵入力フォームの input（パスワード入力欄など） */
.entry-body input[type="password"],
.entry-body input[type="text"] {
    border: 1px solid #ddd;
    border-radius: 2px;
    background: #fff;
    padding: 0.4rem 0.6rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: #222;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.2s;
}

.entry-body input[type="password"]:focus,
.entry-body input[type="text"]:focus {
    outline: none;
    border-color: #888;
}

/* 引用 */
.entry-body blockquote {
    border-left: 2px solid #ddd;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    color: #555;
    font-size: 0.95rem;
}

/* 編集リンク（adminログイン時のみ意味を持つ） */
.entry-utility {
    text-align: right;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.entry-edit {
    color: #ccc !important;
    text-decoration: none;
}

.entry-edit:hover {
    color: #666 !important;
}

/* ---------------------------------------------------------------- */
/* 投稿状態別の装飾                                                  */
/* （[[POSTSTATUS]] が出力するクラス名で出し分け）                   */
/* ---------------------------------------------------------------- */

.diary-entry.pinned .entry-meta::before {
    content: "📌 ";
    opacity: 0.5;
}

.diary-entry.locked .entry-meta::before {
    content: "🔒 ";
    opacity: 0.5;
}

/* ---------------------------------------------------------------- */
/* ページナビゲーション                                              */
/* ---------------------------------------------------------------- */

.page-navi {
    max-width: 700px;
    margin: 4rem auto 0;
    text-align: center;
    padding-top: 2rem;
}

.page-navi a {
    color: #aaa;
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    transition: color 0.2s;
}

.page-navi a:hover {
    color: #222;
}

.page-prev-next,
.page-list,
.page-home {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.page-list a.currentpage,
.page-list .currentpage {
    color: #222;
    font-weight: 600;
}

/* ---------------------------------------------------------------- */
/* フッター                                                          */
/* ---------------------------------------------------------------- */

footer {
    background: transparent !important;
    margin-top: 6rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.footer-section {
    max-width: 500px;
    margin: 0 auto 2.5rem;
}

.footer-section-title {
    color: #aaa;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    margin-bottom: 1rem;
}

/* 検索窓 */
.footer-search input[type="text"],
.footer-search input[type="search"] {
    border: 1px solid #ddd;
    border-radius: 2px;
    padding: 0.4rem 0.6rem;
    background: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    width: 60%;
    text-align: left;
    color: #222;
    box-shadow: none;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.footer-search input[type="text"]:focus,
.footer-search input[type="search"]:focus {
    outline: none;
    border-color: #888;
}

.footer-search input[type="submit"],
.footer-search button {
    border: 1px solid #ddd;
    border-radius: 2px;
    background: transparent;
    color: #555;
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    margin-left: 0.3rem;
    box-shadow: none;
    text-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.footer-search input[type="submit"]:hover,
.footer-search button:hover {
    background: #f5f5f5;
    border-color: #888;
    color: #222;
}

/* 検索オプション（チェックボックス等） */
.footer-search label,
.footer-search input[type="checkbox"] {
    color: #aaa;
    font-size: 0.8rem;
    vertical-align: middle;
}

/* アーカイブ（プルダウン） */
.footer-archives select {
    border: 1px solid #ddd;
    border-radius: 2px;
    background: #fff;
    padding: 0.4rem 0.6rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: #222;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23888' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 1.8rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.footer-archives select:focus {
    outline: none;
    border-color: #888;
}

/* アーカイブの「表示」ボタン */
.footer-archives input[type="submit"],
.footer-archives button {
    border: 1px solid #ddd;
    border-radius: 2px;
    background: transparent;
    padding: 0.4rem 1rem;
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: #555;
    margin-left: 0.3rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    box-shadow: none;
    text-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.footer-archives input[type="submit"]:hover,
.footer-archives button:hover {
    background: #f5f5f5;
    color: #222;
    border-color: #888;
}

/* 並び順ラジオボタン */
.footer-archives label,
.footer-archives input[type="radio"] {
    color: #aaa;
    font-size: 0.8rem;
    margin-left: 0.3rem;
    vertical-align: middle;
}

/* タグ一覧 */
.footer-tags ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-tags li {
    display: inline-block;
    margin: 0 0.3em;
}

.footer-tags a {
    color: #aaa !important;
    text-decoration: none;
    margin: 0 0.4em;
    font-size: 0.85rem;
    line-height: 2;
    transition: color 0.2s;
}

.footer-tags a:hover {
    color: #222 !important;
}

/* タグ未登録時のメッセージ */
.footer-tags li:only-child {
    color: #ccc;
    font-size: 0.8rem;
    list-style: none;
}

/* 外部リンク */
.footer-external {
    margin-top: 3rem;
}

.footer-external a {
    color: rgba(0, 0, 0, 0.7) !important;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-external a:hover {
    color: #222 !important;
}

/* 本体サイトへ戻る */
.back-to-main {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.back-to-main a {
    color: #aaa !important;
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    transition: color 0.2s;
}

.back-to-main a:hover {
    color: #222 !important;
}

.copyright {
    color: rgba(0, 0, 0, 0.5) !important;
    font-size: 0.8rem;
}

.poweredby {
    color: #ddd;
    margin-top: 2rem;
    font-size: 0.75rem;
}

.poweredby a {
    color: #ddd !important;
    text-decoration: none;
}

/* ---------------------------------------------------------------- */
/* ラジオボタン・チェックボックス（全体共通）                        */
/* ---------------------------------------------------------------- */

input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border: 1px solid #ccc;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    vertical-align: -1px;
    margin: 0 0.3rem 0 0.5rem;
    transition: border-color 0.2s;
    position: relative;
    outline: none;
    box-shadow: none;
}

input[type="radio"]:hover {
    border-color: #888;
}

input[type="radio"]:checked {
    border-color: #555;
}

input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #555;
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: #fff;
    cursor: pointer;
    vertical-align: -1px;
    margin: 0 0.3rem 0 0.5rem;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    outline: none;
    box-shadow: none;
}

input[type="checkbox"]:hover {
    border-color: #888;
}

input[type="checkbox"]:checked {
    border-color: #555;
    background: #555;
}

input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-55%, -65%) rotate(45deg);
    width: 3px;
    height: 7px;
    border-right: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
}

/* ---------------------------------------------------------------- */
/* リアクションボタン（reaction_app）                                */
/* /diary/reaction.css のデフォルトを上書き                          */
/* ---------------------------------------------------------------- */

.reaction-buttons {
    max-width: 700px;
    margin: 1.5rem auto 0.5rem;
    gap: 6px;
    justify-content: flex-start;
    align-items: center;
}

.reaction-buttons button {
    margin: 0;
    padding: 0 0.8rem;
    border: 1px solid #ddd;
    border-radius: 2px;
    background: transparent;
    color: #555;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: normal;
    line-height: 2.2;
    height: 2.2em;
    letter-spacing: 0.02em;
    box-shadow: none;
    text-shadow: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.reaction-buttons button:hover {
    background: #f5f5f5;
    border-color: #888;
    color: #222;
}

.reaction-buttons button:active {
    background: #ddd;
    color: #222;
    border-color: #888;
}

.reaction-buttons button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
    pointer-events: none;
}

.reaction-buttons img {
    width: 1em;
    height: auto;
    vertical-align: middle;
}

/* +more（expand-button） */
.reaction-buttons .expand-button {
    min-width: auto;
    color: #aaa;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.reaction-buttons .expand-button:hover {
    color: #222;
}

/* カウント数字は読者には見せない */
.reaction-buttons button .count {
    display: none;
}

/* カウント表示は完全非表示（reaction_count版に切り替えた場合の保険） */
.reaction-counts {
    display: none !important;
}

/* ---------------------------------------------------------------- */
/* レスポンシブ                                                      */
/* ---------------------------------------------------------------- */

@media (max-width: 767px) {
    .diary-timeline {
        max-width: 100%;
        padding: 0 0.5rem;
    }

    .diary-entry {
        margin-bottom: 3rem;
    }

    main.container {
        padding-top: 2rem !important;
        padding-bottom: 3rem !important;
    }

    .nav-pills .nav-link[data-cat] {
        font-size: 1rem;
        padding: 0.5rem 0.5rem;
        letter-spacing: 0.05em;
    }
}
