/* ============================================== */
/* 01. グローバル設定 / 基本レイアウト */
/* ============================================== */

html {
    /* スクロールバーの挙動を明確にし、スムーズスクロールを適用 */
    overflow-y: scroll;
    scroll-behavior: smooth;
}

body {
    font-family: "Noto Serif JP", serif;
    background-color: #f7f4ef;
    color: #333;
    line-height: 1.7;
    padding: 40px 20px;
    position: relative;
    scroll-behavior: smooth; /* スムーズスクロール (再確認) */
}

/* ===== 和紙＋墨滲みレイヤー (Fixed Background) ===== */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;

    /* 和紙テクスチャと滲み */
    background-color: #f7f7f7;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,0.03),
            rgba(255,255,255,0.03) 1px,
            transparent 1px,
            transparent 3px
        ),
        radial-gradient(circle at 20% 30%, rgba(0,0,0,0.15) 0%, transparent 40%),
        radial-gradient(circle at 70% 40%, rgba(0,0,0,0.12) 0%, transparent 45%),
        radial-gradient(circle at 50% 75%, rgba(0,0,0,0.10) 0%, transparent 50%);
    background-repeat: no-repeat;
    background-size: cover;
}

/* ===== 中央ロゴ (Fixed) ===== */
body::after {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    width: 30vw;
    height: 40vw;
    max-width: 230px;
    max-height: 300px;
    transform: translate(-50%, -50%);
    background-image: url('logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.1;
    pointer-events: none;
    z-index: 1;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 100;
}

/* ============================================== */
/* 02. スクロールバー設定 */
/* ============================================== */

/* ====== Webkit系（Chrome / Edge / Safari） ====== */
::-webkit-scrollbar {
    width: 10px;
    background: transparent;
}
body:hover::-webkit-scrollbar {
    background: rgba(0,0,0,0.02);
}
::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 5px;
    transition: background 0.4s ease;
}
body:hover::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.25);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.35);
}

/* ===== Firefox用 ===== */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.25) transparent;
}
html:not(:hover) * {
    scrollbar-color: transparent transparent;
}

/* ============================================== */
/* 03. 汎用要素 / タイポグラフィ */
/* ============================================== */

/* ===== 見出し ===== */
h1 {
    font-size: 1.6em;
    margin-bottom: 0.4em;
    font-weight: 500;
}
h1, .work-title a {
    color: #222;
    text-shadow:
        1px 1px 0 rgba(0,0,0,0.05),
        2px 2px 0 rgba(0,0,0,0.03),
        3px 3px 0 rgba(0,0,0,0.02);
}

/* ===== リンク ===== */
a {
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #777;
}
a:hover {
    opacity: 0.7;
}
.body-content a {
    color: #555;
    border-bottom: 1px dotted #aaa;
}
.body-content a:hover {
    opacity: 0.7;
}

/* ===== ボタン (汎用) ===== */
button {
    padding: 8px 16px;
    font-family: "Noto Serif JP", serif;
    background: #444;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1em;
    border-radius: 4px;
    transition: opacity 0.2s, background 0.2s;
}
button:hover {
    opacity: 0.85;
    background: #333;
}

/* ===== 通知・情報ボックス ===== */
.notice-box {
    background: #f5f3f0;
    padding: 14px;
    margin: 15px 0;
    font-size: 0.9em;
    border-left: 4px solid #aaa;
    border-radius: 4px;
}
.notice-box.error-box {
    border-left-color: #900;
}
.notice-box.success-box {
    border-left-color: #383;
}


/* ============================================== */
/* 04. 作品リスト / タグ / メタ情報 */
/* ============================================== */

/* ===== ページ内ナビゲーションメニューのスタイル ===== */
.menu-filter-box {
    margin: 0 auto 30px;
    max-width: 800px;
    padding: 5px 0;
    border-bottom: 1px solid #e0dcd2;
}
.nav-button {
    text-decoration: none;
    padding: 2px 6px;
    margin-right: 6px;
    background: #e2e2e2;
    border-radius: 3px;
    font-size: 0.8em;
    color: #444;
    border: 1px solid #999;
}
.nav-button:hover {
    background: #e2e2e2;
    border-color: #999;
    opacity: 0.8;
}
.nav-button.active {
    background: #444;
    color: #fff;
    border-color: #400;
    box-shadow: 0 0 5px rgba(100, 0, 0, 0.4);
}

/* グリッド化 */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

/* 作品カード */
.work-item {
    background: rgba(255, 253, 248, 0.2);
    border: 1px solid #e0dcd2;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.15s, box-shadow 0.15s;
}
.work-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.work-title {
    font-weight: bold;
    font-size: 1em;
    margin-bottom: 6px;
}
.work-length {
    font-weight: normal;
    color: #888;
    font-size: 0.65em;
}

/* メタ情報 */
.meta {
    font-size: 0.85em;
    color: #555;
    margin-top: 0.2em;
}
.tag-filter {
    margin-bottom: 10px;
}
.tag {
    text-decoration: none;
    padding: 2px 6px;
    margin-right: 6px;
    background: #e2e2e2;
    border-radius: 3px;
    font-size: 0.8em;
    color: #444;
    border: 1px solid #999;
}
.tag.selected {
    background: #444;
    color: #fff;
}
.tag-all {
    text-decoration: none;
    padding: 2px 6px;
    margin-right: 6px;
    background: #ccc;
    border-radius: 3px;
    font-size: 0.8em;
    color: #222;
}
.tag-all:hover { opacity: 0.8; }

.rating {
    font-size: 0.8em;
    color: #a33;
    margin-left: 6px;
}

/* 作品本文・サマリー */
.summary {
    margin: 0.2em 0 0.6em 0;
    color: #555;
}

/* 管理者リンク */
.admin-links {
    margin-top: 8px;
    font-size: 0.85em;
}
.admin-links a {
    margin-right: 8px;
    color: #333;
    text-decoration: none;
}
.admin-links a:hover {
    text-decoration: underline;
}

/* 一覧に戻るリンク */
.back-link {
    display: inline-block;
    margin-top: 20px;
    font-size: 0.9em;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #777;
    transition: opacity 0.2s;
}
.back-link:hover {
    opacity: 0.7;
}

/* 更新履歴用 */
.update-log {
    font-size: 0.8em;
    color: #666;
    margin-top: 12px;
    border-top: 1px dashed #ccc;
    padding-top: 6px;
}

/* === SNS === */
.sns-box a {
    color: #333;
    text-decoration: none;
    margin-right: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.3);
    padding-bottom: 2px;
}
.sns-box a:hover {
    opacity: 0.7;
}

/* ============================================== */
/* 05. 同人誌関連 (Book Card) */
/* ============================================== */

/* 小見出し */
.small-sec {
    font-size: 18px;
    margin-top: 28px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.15);
    padding-bottom: 3px;
}

/* 全体ボックス */
.book-card {
    background: rgba(255,255,255,0.45);
    padding: 12px 14px;
    border-left: 3px solid rgba(0,0,0,0.25);
    border-radius: 3px;
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 14px;
}

/* タイトル & メタ（横並び） */
.book-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.book-title {
    font-weight: bold;
    font-size: 15px;
}
.book-meta {
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: 10px;
}

/* あらすじ */
.book-desc {
    margin-bottom: 8px;
    color: #444;
    font-size: 14px;
}

/* BOOTHアイコン */
.book-link {
    margin-top: 4px;
}
.book-link a, .book-link a .booth-icon {
    text-decoration: none !important;
    border: none;
}
.booth-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url('booth.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.85;
    text-decoration: none;
}
.booth-icon:hover {
    opacity: 0.6;
    text-decoration: none;
}

/* 注文リンクの装飾 */
.book-order-link {
    margin-top: 10px;
    text-align: right;
}
.book-order-link a {
    border-bottom: 2px solid rgba(136, 0, 0, 0.5);
    padding: 2px 0;
    font-size: 13px;
    display: inline-block;
}
.book-order-link a:hover {
    border-color: rgba(136, 0, 0, 0.7);
    opacity: 1.0;
}

/* ============================================== */
/* 06. サイト情報 (簡潔版) */
/* ============================================== */

.site-info-subtle {
    margin: 30px auto;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid #e0dcd2;
    border-radius: 4px;
    box-shadow: none;
}
.site-info-subtle h3 {
    font-size: 1em;
    font-weight: normal;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 5px;
    margin-bottom: 10px;
    color: #555;
}
.info-list {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 5px 10px;
    margin: 0;
    padding: 0;
    font-size: 0.9em;
}
.info-list dt {
    font-weight: bold;
    color: #600;
    text-align: right;
    grid-column: 1 / 2;
}
.info-list dd {
    margin: 0;
    color: #333;
    word-break: break-all;
    grid-column: 2 / 3;
}
.subtle-disclaimer {
    font-size: 0.75em;
    color: #888;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #ccc;
}


/* ============================================== */
/* 07. フォーム関連 / 注文関連 */
/* ============================================== */

/* === フォーム全体 === */
.form-wrapper {
    padding: 25px;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}
.form-group .required {
    color: #900;
    font-size: 0.8em;
}

/* フォーム要素の基本スタイル */
input[type="text"], input[type="email"], textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    background: #fffdfa;
    font-family: "Noto Serif JP", serif;
    font-size: 1em;
    box-sizing: border-box;
    border-radius: 2px;
    transition: border-color 0.2s, background-color 0.2s;
}
input:focus, textarea:focus {
    border-color: #555;
    background: #fff;
    outline: none;
}
textarea {
    min-height: 120px;
    resize: vertical;
}

.book-info {
    font-weight: bold;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 10px;
    border-left: 3px solid rgba(0, 0, 0, 0.3);
}

.submit-button {
    width: 100%;
    padding: 12px 0;
    margin-top: 15px;
    font-size: 1.1em;
}
.back-link-box {
    text-align: center;
    margin-top: 25px;
}

/* 配送方法 */
.delivery-select {
    display: flex;
    gap: 10px;
}
.radio-button-style {
    flex-grow: 1;
    text-align: center;
    padding: 10px 15px;
    border: 1px solid #777;
    border-radius: 4px;
    background-color: #fcf8f0;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    font-size: 0.9em;
    display: flex;
    justify-content: center;
    align-items: center;
}
.radio-button-style input[type="radio"] {
    display: none;
}
.radio-button-style:hover {
    background-color: #fff9ed;
    border-color: #555;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.radio-button-style:has(input[type="radio"]:checked) {
    background-color: #600;
    color: #fff;
    border-color: #400;
    box-shadow: 0 0 8px rgba(100, 0, 0, 0.5);
}

/* 本の選択（チェックボックス） */
.book-select-label {
    display: block;
    position: relative;
}
.selectable-book-card {
    cursor: pointer;
    transition: background-color 0.2s;
}
.selectable-book-card:hover {
    background: rgba(255, 253, 248, 0.4);
}
.book-card-list input[type="checkbox"] {
    display: none;
}
.selectable-book-card:has(input[type="checkbox"]:checked) {
    border: 1px solid #600;
    box-shadow: 0 0 5px rgba(100, 0, 0, 0.3);
    background: #fff5e8;
}

/* 注文時の個別アイテム */
.book-item-group {
    border-left: 3px solid rgba(0,0,0,0.1);
    padding-left: 10px;
}
.selection-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #600;
    color: #fff;
    padding: 3px 8px;
    font-size: 0.7em;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.2s;
}
.book-select-label:has(input[type="checkbox"]:checked) {
    border: 1px solid #600;
    box-shadow: 0 0 5px rgba(100, 0, 0, 0.3);
    background: #fff5e8;
}
.book-select-label:has(input[type="checkbox"]:checked) .selection-indicator {
    opacity: 1;
}

/* 冊数入力フィールド */
input[type="number"].small-input {
    width: 55px;
    text-align: center;
    height: 40px;
    padding: 8px 5px;
    box-sizing: border-box;
    font-size: 1em;
    background: #fcf8f0;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="number"].small-input:focus {
    border-color: #555;
    background: #fff;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
    outline: none;
}
.form-group.book-item-group > div {
    align-items: center;
    display: flex;
    gap: 10px;
}
.form-group.book-item-group > div > span {
    white-space: nowrap;
    font-weight: bold;
    color: #555;
}

/* ============================================== */
/* 08. いいねボタン (newiine) - アニメーション含む */
/* ============================================== */

/* newiine_type01 */
button.newiine_btn {
    position: relative;
    cursor: pointer;
    background: transparent;
    border: 1px solid;
    color: #afa9aa;
    font-size: 0.85em;
    border-radius: 20px;
    padding: 3px 8px;
    -webkit-transition: 0.3s;
    transition: 0.3s;
    margin-right: 10px;
}
button.newiine_btn:hover {
    background: #f1f1f1;
}
button.newiine_btn span.material-icons-round {
    font-size: 18px;
    vertical-align: sub;
}
button.newiine_btn.newiine_clickedtoday {
    color: #ed5d78;
    border-color: #ed5d78;
}
button.newiine_btn.newiine_clickedtoday:hover {
    background: #fff3f5;
}
button.newiine_btn.newiine_clicked {
    color: #ffffff;
    background: #ed5d78;
    border-color: #ed5d78;
}
button.newiine_btn.newiine_clicked:hover {
    background: #fd7f96;
    border-color: #fd7f96;
}
button.newiine_btn:before {
    position: absolute;
    content: "";
    display: block;
    margin: auto;
    visibility: hidden;
    width: 50px;
    height: 50px;
    border-radius: 50px;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: -1;
    -webkit-transition: all ease-out 0.5s;
    transition: all ease-out 0.5s;
    -webkit-transform: scale(0.5);
    transform: scale(0.5);
    background: #fd7f96;
}
button.newiine_btn:active {
    -webkit-transform: scale(0.92);
    transform: scale(0.92);
}
button.newiine_btn.newiine_animate:before {
    z-index: 1;
    -webkit-animation: newiine_animation ease-out 0.5s forwards;
    animation: newiine_animation ease-out 0.5s forwards;
}
div.newiine_thanks img {
    max-width: 100%;
}

/* お礼メッセージ吹き出し */
button.newiine_btn div.newiine_thanks {
    min-width: 300px;
    background: white;
    color: #333;
    text-align: left;
    font-size: 15px;
    border: 1px solid #efefef;
    border-radius: 10px;
    padding: 10px;
    filter: drop-shadow(0 2px 8px #cccccc7d);
    position: absolute;
    opacity: 0;
    transition: 0.3s;
    animation-duration: .5s;
    animation-fill-mode: both;
    z-index: 5;
    pointer-events: none;
}
button.newiine_btn div.newiine_thanks:after {
    content: '';
    width: 0px;
    height: 0px;
    position: absolute;
    left: 20px;
}
button.newiine_btn div.newiine_thanks_up {
    bottom: 140%;
    animation-name: newiine_thanks-up;
}
button.newiine_btn div.newiine_thanks_up:after {
    border-bottom: 10px solid transparent;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
    top: calc(100% - 1px);
}
button.newiine_btn div.newiine_thanks_down {
    top: 140%;
    animation-name: newiine_thanks-down;
}
button.newiine_btn div.newiine_thanks_down:after {
    border-top: 10px solid transparent;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid white;
    bottom: calc(100% - 1px);
}
button.newiine_btn div.newiine_thanks_right {
    right: 0;
    left: auto;
}
button.newiine_btn div.newiine_thanks_right:after {
    left: auto;
    right: 20px;
}
button.newiine_btn div.newiine_thanks p {
    margin: 10px auto;
}
.newiine_fadeout {
    animation : newiine_fadeOut 1s !important;
    animation-fill-mode: both;
}

/* newiine_type02 */
button.newiine_btn.newiine_type02 {
    text-align: center;
    word-break: keep-all;
    height: 60px;
    width: 60px;
    padding: 3px;
    border-radius: 30px;
    background: #f1f1f1;
    border: none;
}
button.newiine_btn.newiine_type02:hover {
    color: #fd7f96;
}
button.newiine_btn.newiine_type02.newiine_clickedtoday {
    color: #fd7f96;
    background: #fff3f5;
}
button.newiine_btn.newiine_type02.newiine_clicked {
    background: #fd7f96;
    color: #ffffff;
}
button.newiine_btn.newiine_type02.newiine_clicked:hover {
    color: #fff3f5;
}
button.newiine_btn.newiine_type02.newiine_animate:before {
    z-index: 1;
    -webkit-animation: newiine_animation_type02 ease-out 0.5s forwards;
    animation: newiine_animation_type02 ease-out 0.5s forwards;
}

/* Keyframes */
@-webkit-keyframes newiine_animation {
    0% { visibility: visible; opacity: 1; -webkit-transform: scale(0.5); transform: scale(0.5); }
    100% { opacity: 0; -webkit-transform: scale(1.5); transform: scale(1.5); visibility: hidden; }
}
@keyframes newiine_animation {
    0% { visibility: visible; opacity: 1; -webkit-transform: scale(0.5); transform: scale(0.5); }
    100% { opacity: 0; -webkit-transform: scale(1.5); transform: scale(1.5); visibility: hidden; }
}

@-webkit-keyframes newiine_animation_type02 {
    0% { visibility: visible; opacity: 1; -webkit-transform: scale(1); transform: scale(1); }
    100% { opacity: 0; -webkit-transform: scale(2); transform: scale(2); visibility: hidden; }
}
@keyframes newiine_animation_type02 {
    0% { visibility: visible; opacity: 1; -webkit-transform: scale(1); transform: scale(1); }
    100% { opacity: 0; -webkit-transform: scale(2); transform: scale(2); visibility: hidden; }
}

@keyframes newiine_fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes newiine_thanks-up {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes newiine_thanks-down {
    0% { opacity: 0; transform: translateY(-40px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ============================================== */
/* 09. レスポンシブ調整 */
/* ============================================== */

@media screen and (max-width: 600px) {
    body {
        padding: 20px 10px;
    	font-size: 0.9em;
    }
    h1 {
        font-size: 1.4em;
    }
    .work-title a {
        font-size: 1.1em;
    }
    .meta, .tag, .rating, .summary {
        font-size: 0.8em;
    }
    .notice-box {
        font-size: 0.85em;
        padding: 10px;
    }
    button {
        font-size: 0.9em;
        padding: 6px 12px;
    }
    .back-link {
        font-size: 0.85em;
    }

    /* サイト情報（スマホ対応） */
    .info-group {
        flex-wrap: wrap;
    }
    .info-group h4 {
        flex-basis: 100%;
    }
    .info-group button {
        order: 3;
    }
    .info-input {
        order: 2;
    }

    /* ナビゲーション（スマホ対応） */
    .menu-filter-box {
        margin-bottom: 20px;
    }
    .nav-button {
        margin: 4px 3px;
    }
}