/* ============================================================
   main.css — 公開ページ共通スタイル
   対象: index.php / graves.php
   ============================================================ */

/* ===== VARIABLES ===== */
:root {
    --gold: #c9a84c;
    --gold-light: #e8cc7a;
    --gold-dark: #8b6914;
    --ink: #0d0a05;
    --paper: #1a1208;
    --paper-mid: #231a0c;
    --paper-light: #2e2210;
    --text-main: #e8dcc8;
    --text-sub: #a89070;
    --red-accent: #8b1a1a;
}

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--ink);
    color: var(--text-main);
    font-family: 'Noto Serif JP', 'Yu Mincho', '游明朝', serif;
    overflow-x: hidden;
    animation: page-fadein 1.4s ease forwards;
}
@keyframes page-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes hero-text-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== HERO + NAV WRAPPER ===== */
.hero-nav-wrap {
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
}

/* ===== HERO ===== */
header {
    position: relative;
    min-height: unset;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background:
        radial-gradient(ellipse at center, rgba(201,168,76,0.08) 0%, transparent 60%),
        linear-gradient(180deg, #0d0a05 0%, #1a0f04 50%, #0d0a05 100%);
    overflow: hidden;
}

/* ===== SLIDESHOW BACKGROUND ===== */
header.has-slideshow {
    background: #0d0a05;
}

.bg-slideshow {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.bg-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2.5s ease-in-out;
    filter: saturate(0.45);
}

.bg-slide.active {
    opacity: 1;
}

/* 元の背景フィルター＋左右黒グラデーション */
.bg-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(13,10,5,0.65) 0%, transparent 28%, transparent 72%, rgba(13,10,5,0.65) 100%),
        radial-gradient(ellipse at center, rgba(201,168,76,0.08) 0%, transparent 60%),
        linear-gradient(180deg, rgba(13,10,5,0.60) 0%, rgba(26,15,4,0.35) 50%, rgba(13,10,5,0.60) 100%),
        rgba(15, 35, 70, 0.3);
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(201,168,76,0.03) 60px, rgba(201,168,76,0.03) 61px),
        repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(201,168,76,0.03) 60px, rgba(201,168,76,0.03) 61px);
    pointer-events: none;
}

.hero-content { position: relative; z-index: 2; padding: 2rem; }

.hero-sub,
.hero-title,
.hero-content .gold-line {
    opacity: 0;
    animation: hero-text-in 1.2s ease 0.5s forwards;
}
.hero-tagline,
.hero-btns {
    opacity: 0;
    animation: hero-text-in 1.2s ease 1.1s forwards;
}

.hero-kamon {
    font-size: clamp(40px, 8vw, 72px);
    color: var(--gold);
    margin-bottom: 1.5rem;
    display: block;
    text-shadow: 0 0 40px rgba(201,168,76,0.5);
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(201,168,76,0.3); }
    to   { text-shadow: 0 0 60px rgba(201,168,76,0.7), 0 0 100px rgba(201,168,76,0.3); }
}

.hero-sub {
    font-family: 'Cinzel', serif;
    font-size: clamp(12px, 2vw, 16px);
    letter-spacing: 0.45em;
    line-height: 2.0;
    color: var(--gold-light);
    margin-bottom: 1rem;
    text-shadow: 0 0 24px rgba(0,0,0,1), 0 0 12px rgba(0,0,0,1), 0 2px 6px rgba(0,0,0,0.9);
}

.hero-title {
    font-size: clamp(28px, 7vw, 80px);
    font-weight: 900;
    letter-spacing: 0.15em;
    line-height: 1.2;
    color: var(--text-main);
    text-shadow: 0 0 30px rgba(0,0,0,1), 0 2px 12px rgba(0,0,0,0.9), 2px 2px 0 rgba(0,0,0,0.8);
    margin-bottom: 0.5rem;
}
.hero-title span { color: var(--gold); }
.hero-title .hero-title-sub { font-style: normal; }

.hero-tagline {
    font-size: clamp(15px, 2.5vw, 20px);
    color: #fff;
    letter-spacing: 0.25em;
    margin-bottom: 3rem;
    font-weight: 600;
    text-shadow: 0 0 24px rgba(0,0,0,1), 0 0 12px rgba(0,0,0,1), 0 2px 6px rgba(0,0,0,0.9);
}

.hero-btns { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }

.scroll-hint {
    position: absolute;
    bottom: 2rem; left: 50%;
    transform: translateX(-50%);
    color: var(--gold);
    font-size: 1rem;
    letter-spacing: 0.3em;
    animation: bounce 2s ease-in-out infinite;
    z-index: 2;
    text-shadow: 0 0 20px rgba(0,0,0,1), 0 0 10px rgba(0,0,0,1);
    text-decoration: none;
}
.scroll-hint::after { content: '▼'; display: block; text-align: center; margin-top: 0.4rem; }

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(8px); }
}

/* ===== DECORATIVE ===== */
.corner-deco { position: absolute; width: 60px; height: 60px; pointer-events: none; z-index: 2; }
.corner-deco.tl { top: 2rem; left: 2rem; border-top: 1px solid var(--gold-dark); border-left: 1px solid var(--gold-dark); }
.corner-deco.tr { top: 2rem; right: 2rem; border-top: 1px solid var(--gold-dark); border-right: 1px solid var(--gold-dark); }
.corner-deco.bl { bottom: 2rem; left: 2rem; border-bottom: 1px solid var(--gold-dark); border-left: 1px solid var(--gold-dark); }
.corner-deco.br { bottom: 2rem; right: 2rem; border-bottom: 1px solid var(--gold-dark); border-right: 1px solid var(--gold-dark); }

/* ===== NAV ===== */
nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(10, 7, 2, 0.95);
    border-bottom: 1px solid var(--gold-dark);
    backdrop-filter: blur(8px);
}
nav.nav-fixed {
    position: fixed; top: 0; left: 0; right: 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    animation: nav-slide-in 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}
nav.nav-slide-out {
    position: fixed; top: 0; left: 0; right: 0;
    animation: nav-slide-out 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes nav-slide-in {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}
@keyframes nav-slide-out {
    from { transform: translateY(0); }
    to   { transform: translateY(-100%); }
}
.nav-inner {
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.9rem 2rem;
}
.nav-logo { font-size: 1.05rem; font-weight: 700; color: var(--text-main); letter-spacing: 0.12em; text-decoration: none; }
.nav-logo .logo-highlight { color: var(--gold); }
.nav-logo small { display: block; font-size: 0.78rem; color: var(--text-sub); letter-spacing: 0.25em; font-weight: 400; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { color: var(--text-main); text-decoration: none; font-size: 1rem; letter-spacing: 0.15em; font-weight: 600; transition: color 0.2s; position: relative; }
.nav-links a::after { content: ''; position: absolute; bottom: -3px; left: 0; width: 0; height: 1px; background: var(--gold); transition: width 0.3s; }
.nav-links a:hover { color: var(--gold); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.nav-active { color: var(--gold); }
.nav-links a.nav-active::after { width: 100%; }

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-block;
    padding: 0.85rem 2.2rem;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-dark));
    color: var(--ink);
    font-family: 'Noto Serif JP', serif;
    font-weight: 900; font-size: 1.05rem; letter-spacing: 0.2em; text-shadow: 0 1px 4px rgba(255,255,255,0.4);
    text-decoration: none; border: none; cursor: pointer;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    transition: filter 0.3s, transform 0.2s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.btn-primary:hover { filter: brightness(1.2); transform: translateY(-2px); }

.btn-outline {
    display: inline-block;
    padding: 0.85rem 2.2rem;
    background: rgba(201,168,76,0.1);
    color: var(--gold-light);
    font-family: 'Noto Serif JP', serif;
    font-weight: 900; font-size: 1rem; letter-spacing: 0.2em;
    text-shadow: 0 0 12px rgba(201,168,76,0.5);
    text-decoration: none;
    border: 1px solid var(--gold);
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.btn-outline:hover { background: rgba(201,168,76,0.15); transform: translateY(-2px); }
button.btn-outline { cursor: pointer; appearance: none; -webkit-appearance: none; background: rgba(201,168,76,0.1); }

/* ===== SECTION COMMON ===== */
section { max-width: 1100px; margin: 0 auto; padding: 5rem 2rem; }
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-label { font-family: 'Cinzel', serif; font-size: 0.82rem; letter-spacing: 0.5em; color: var(--text-sub); text-transform: uppercase; margin-bottom: 0.8rem; }
.section-title { font-size: clamp(22px, 4vw, 36px); font-weight: 700; letter-spacing: 0.2em; color: var(--text-main); margin-bottom: 1rem; display: table; margin-left: auto; margin-right: auto; }
.section-title span { color: var(--gold); }
.section-desc { font-size: 1rem; color: var(--text-sub); line-height: 1.9; max-width: 600px; margin: 0 auto; }
.gold-line { width: 120px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 1.5rem auto; }
.divider { border: none; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dark), transparent); margin: 0; }

/* ===== FILTER ===== */
/* スタンドアロン（index.php） */
.filter-form {
    display: flex; align-items: flex-end; gap: 1.2rem; flex-wrap: wrap;
    margin-bottom: 2.5rem;
    padding: 1.4rem 1.6rem;
    background: var(--paper-light);
    border: 1px solid rgba(201,168,76,0.15);
}

/* filter-bar内（graves.php） */
.filter-bar {
    background: var(--paper-mid);
    border-bottom: 1px solid rgba(201,168,76,0.15);
    padding: 1.5rem 2rem;
}
.filter-bar .filter-form {
    max-width: 1100px; margin: 0 auto;
    background: none; border: none; padding: 0; margin-bottom: 0;
}
.view-toggle-wrap {
    max-width: 1100px;
    margin: 1rem auto 0;
}
.sort-toggle {
    max-width: 1100px; margin: 0.5rem auto 0;
    display: flex; align-items: center; gap: 0.4rem;
}
.sort-label {
    font-size: 1rem; color: var(--text-sub); letter-spacing: 0.15em; margin-right: 0.3rem;
}
.sort-btn {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(201,168,76,0.25);
    color: var(--text-sub);
    font-family: 'Noto Serif JP', serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.sort-btn:hover { background: rgba(201,168,76,0.08); color: var(--gold); border-color: rgba(201,168,76,0.4); }
.sort-btn.active { background: rgba(201,168,76,0.15); color: var(--gold); border-color: rgba(201,168,76,0.45); }
.sort-arrow { margin-left: 0.3em; font-size: 0.85em; opacity: 0.85; }

.per-page-toggle {
    max-width: 1100px; margin: 0.7rem auto 0;
    display: flex; align-items: center; gap: 0.4rem;
}
.per-page-label {
    font-size: 1rem; color: var(--text-sub); letter-spacing: 0.15em; margin-right: 0.3rem;
}
.per-btn {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(201,168,76,0.25);
    color: var(--text-sub);
    font-family: 'Noto Serif JP', serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.per-btn:hover { background: rgba(201,168,76,0.08); color: var(--gold); border-color: rgba(201,168,76,0.4); }
.per-btn.active { background: rgba(201,168,76,0.15); color: var(--gold); border-color: rgba(201,168,76,0.45); }

.filter-field { display: flex; flex-direction: column; gap: 0.4rem; }
.filter-field label { font-size: 1rem; color: var(--text-sub); letter-spacing: 0.2em; }
.filter-field input,
.filter-field select {
    background: var(--paper-mid); border: 1px solid rgba(201,168,76,0.25);
    color: var(--text-main); padding: 0.6rem 0.9rem;
    font-family: inherit; font-size: 1rem; outline: none;
    transition: border-color 0.2s; min-width: 200px;
    border-radius: 0;
}
.filter-bar .filter-field input,
.filter-bar .filter-field select { background: var(--paper-light); min-width: 220px; }
.filter-field input:focus, .filter-field select:focus { border-color: rgba(201,168,76,0.6); }
.filter-field select option { background: var(--paper-mid); }

.filter-actions { display: flex; align-items: center; gap: 0.8rem; padding-bottom: 1px; }

.btn-filter-submit {
    padding: 0.6rem 1.6rem;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-dark));
    color: var(--ink); font-family: 'Noto Serif JP', serif; font-weight: 700;
    font-size: 1rem; letter-spacing: 0.15em; border: none; cursor: pointer;
    clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
    transition: filter 0.2s, transform 0.2s;
}
.btn-filter-submit:hover { filter: brightness(1.15); transform: translateY(-1px); }

.btn-filter-reset { font-size: 1rem; color: var(--text-sub); letter-spacing: 0.1em; text-decoration: none; transition: color 0.2s; }
.btn-filter-reset:hover { color: var(--gold); }

.filter-result-count { font-size: 1rem; color: var(--text-sub); letter-spacing: 0.15em; margin-top: -1.5rem; margin-bottom: 1.5rem; }
.filter-bar .filter-result-count { max-width: 1100px; margin: 0.9rem auto 0; }
.filter-result-count span { color: var(--gold); font-size: 1rem; font-weight: 700; }

.no-results { text-align: center; padding: 4rem 2rem; color: var(--text-sub); font-size: 1rem; letter-spacing: 0.2em; }
.no-results .no-results-icon { font-size: 2.5rem; opacity: 0.3; display: block; margin-bottom: 1rem; }

/* ===== POSTS SECTION ===== */
#posts,
#about,
#books-section,
#contact { scroll-margin-top: 70px; }

#posts { background: var(--paper); }
#posts > * { max-width: 1100px; margin-left: auto; margin-right: auto; padding-left: 2rem; padding-right: 2rem; }
#posts-inner { max-width: 1100px; margin: 0 auto; padding: 5rem 2rem; }

.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-bottom: 3rem; }
/* card-lg = 大（3列、デフォルトと同じ） */
.posts-grid.posts-card-lg { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
/* card-md = 中（4列） */
.posts-grid.posts-card-md { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

.post-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    scroll-margin-top: 80px;
}

.post-card {
    background: var(--paper-mid); border: 1px solid rgba(201,168,76,0.15);
    overflow: hidden; position: relative;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    display: flex; flex-direction: column; height: 100%;
}
.post-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0; transition: opacity 0.3s;
}
.post-card:hover { transform: translateY(-6px); border-color: rgba(201,168,76,0.4); box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 20px rgba(201,168,76,0.05); }
.post-card:hover::before { opacity: 1; }

.post-card img { width: 100%; aspect-ratio: 3 / 2; height: auto; object-fit: cover; display: block; filter: sepia(30%) brightness(0.85); transition: filter 0.3s; }
.post-card:hover img { filter: sepia(10%) brightness(1); }

.post-card-no-image {
    width: 100%; aspect-ratio: 3 / 2; height: auto;
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 0.4rem;
    background: var(--paper-light); color: var(--text-sub);
    font-size: 1rem; letter-spacing: 0.2em; font-family: 'Cinzel', serif;
    border-bottom: 1px solid rgba(201,168,76,0.1);
}
.post-card-no-image .no-image-icon { font-size: 1.8rem; opacity: 0.35; }

.post-body { padding: 1.4rem; }
.post-name { font-size: 1.2rem; font-weight: 700; color: var(--gold); letter-spacing: 0.1em; margin-bottom: 0.3rem; }
.post-location { font-size: 1rem; color: var(--text-sub); letter-spacing: 0.08em; margin-bottom: 0.3rem; }
.post-location .year-ad { font-size: 0.8em; }
.post-date { font-size: 1rem; color: var(--gold-dark); letter-spacing: 0.1em; margin-bottom: 0.9rem; font-family: 'Cinzel', serif; }
.post-pref { font-size: 1rem; color: var(--text-sub); letter-spacing: 0.1em; margin-top: 0.25rem; }
.post-comment { font-size: 1rem; color: var(--text-sub); line-height: 1.85; border-left: 2px solid var(--gold-dark); padding-left: 0.9rem; }
.posts-cta { text-align: center; }
.era-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; margin-top: 2rem; }

/* ===== GRAVES PAGE ===== */
.page-header {
    background:
        radial-gradient(ellipse at center, rgba(201,168,76,0.06) 0%, transparent 60%),
        linear-gradient(180deg, #0d0a05 0%, #1a0f04 50%, #0d0a05 100%);
    padding: 5rem 2rem 4rem;
    text-align: center; position: relative; overflow: hidden;
    border-bottom: 1px solid rgba(201,168,76,0.1);
}
.page-header::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(201,168,76,0.03) 60px, rgba(201,168,76,0.03) 61px),
        repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(201,168,76,0.03) 60px, rgba(201,168,76,0.03) 61px);
    pointer-events: none;
}
.page-header-content { position: relative; z-index: 1; }

.record-count { display: inline-block; margin-top: 1rem; font-family: 'Cinzel', serif; font-size: 1rem; letter-spacing: 0.3em; color: var(--gold-dark); }
.record-count span { color: var(--gold); font-size: 1.1rem; font-weight: 700; }

/* ===== VIEW TOGGLE BUTTON ===== */
.view-toggle {
    display: flex;
    align-items: center;
    gap: 0;
    width: fit-content;
    border: 1px solid rgba(201,168,76,0.3);
    overflow: hidden;
    align-self: flex-start;
    flex-shrink: 0;
}
.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-family: 'Noto Serif JP', serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.view-btn:hover { background: rgba(201,168,76,0.08); color: var(--gold); }
.view-btn.active { background: rgba(201,168,76,0.15); color: var(--gold); }
.view-btn + .view-btn { border-left: 1px solid rgba(201,168,76,0.3); }

/* ===== LIST VIEW ===== */
.posts-grid.posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.posts-grid.posts-list .post-card-link {
    display: block;
    border-bottom: 1px solid rgba(201,168,76,0.1);
}
.posts-grid.posts-list .post-card-link:first-child {
    border-top: 1px solid rgba(201,168,76,0.1);
}
.posts-grid.posts-list .post-card {
    flex-direction: row;
    height: auto;
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 0;
    transition: background 0.2s;
}
.posts-grid.posts-list .post-card::before { display: none; }
.posts-grid.posts-list .post-card:hover {
    transform: none;
    box-shadow: none;
    background: rgba(201,168,76,0.05);
    border: none;
}
.posts-grid.posts-list .post-card img,
.posts-grid.posts-list .post-card-no-image {
    width: 56px;
    height: 56px;
    aspect-ratio: 1;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 2px;
    margin: 0.6rem 1rem 0.6rem 0.8rem;
    filter: sepia(30%) brightness(0.85);
}
.posts-grid.posts-list .post-card-no-image {
    font-size: 0;
    background: var(--paper-mid);
    border: 1px solid rgba(201,168,76,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}
.posts-grid.posts-list .post-card-no-image .no-image-icon {
    font-size: 1.2rem;
    opacity: 0.3;
}
.posts-grid.posts-list .post-card-no-image span:not(.no-image-icon) { display: none; }
.posts-grid.posts-list .post-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    padding: 0;
    flex: 1;
    flex-wrap: wrap;
}
.posts-grid.posts-list .post-name {
    font-size: 1rem;
    width: 8em;
    flex-shrink: 0;
    margin: 0;
}
.posts-grid.posts-list .post-location {
    font-size: 1rem;
    margin: 0;
    width: 13em;
    flex-shrink: 0;
}
.posts-grid.posts-list .post-pref {
    font-size: 1rem;
    margin: 0;
    color: var(--gold-dark);
    border: 1px solid rgba(201,168,76,0.2);
    padding: 0.1rem 0.5rem;
    display: inline-block;
    align-self: center;
}
.post-comment-list {
    display: none;
}
.posts-grid.posts-list .post-comment-list {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1rem;
    color: var(--text-sub);
    line-height: 1.6;
    flex: 1;
    min-width: 0;
}

.main-content {
    background: var(--paper);
    padding: 4rem 2rem 5rem;
    border-bottom: 1px solid transparent;
    background-clip: padding-box;
}
.main-content + hr.divider { display: none; }
.main-inner { max-width: 1100px; margin: 0 auto; }
.back-cta { text-align: center; margin-top: 3rem; }

/* ===== SCROLL ANCHOR OFFSET ===== */
#filter-bar { scroll-margin-top: 5rem; }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 3rem;
    background: var(--paper);
    border: none;
}
.page-btn {
    display: inline-block;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0.55rem 1.6rem;
    font-family: inherit;
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.page-btn:hover { background: var(--gold); color: var(--ink); }
.page-btn.disabled { border-color: rgba(201,168,76,0.2); color: rgba(201,168,76,0.25); pointer-events: none; }
.page-info { font-size: 1rem; color: var(--text-sub); letter-spacing: 0.1em; min-width: 4rem; text-align: center; }
.page-jump {
    display: flex;
    justify-content: center;
    margin-top: 1.2rem;
    margin-bottom: 1.2rem;
}
.page-jump select {
    background: var(--paper);
    border: 1px solid rgba(201,168,76,0.4);
    color: var(--gold);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    letter-spacing: 0.08em;
}
.page-jump select:focus { outline: none; border-color: var(--gold); }

/* ===== ABOUT / BIO ===== */
#about { background: var(--ink); padding: 5rem 2rem; }

.bio-wrap { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: 320px 1fr; gap: 5rem; align-items: center; }

.bio-photo { position: relative; overflow: hidden; background: #0a0705; }
.bio-photo::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(160deg, rgba(13,10,5,0.1) 0%, rgba(139,105,20,0.04) 50%, rgba(13,10,5,0.25) 100%);
    pointer-events: none;
}
.bio-photo img { width: 100%; height: 340px; object-fit: cover; object-position: center top; display: block; filter: saturate(0.75); }
.bio-photo-placeholder { width: 100%; height: 360px; display: flex; align-items: center; justify-content: center; font-size: 5rem; opacity: 0.12; background: linear-gradient(160deg, #1a1208 0%, #0a0705 100%); }

.bio-content { padding-top: 0.5rem; }
.bio-label { font-family: 'Cinzel', serif; font-size: 0.82rem; letter-spacing: 0.55em; color: var(--text-sub); text-transform: uppercase; margin-bottom: 0.9rem; }
.bio-name { font-size: clamp(28px, 3.5vw, 44px); font-weight: 700; color: var(--text-main); letter-spacing: 0.18em; line-height: 1.2; margin-bottom: 0.9rem; }
.bio-name span { color: var(--gold); }
.bio-name-en { font-family: 'Cinzel', serif; font-size: 0.82rem; color: var(--text-sub); letter-spacing: 0.5em; margin-bottom: 2rem; }
.bio-name-en span { color: var(--gold); }
.bio-body { margin-bottom: 2.5rem; }
.bio-body p { font-size: 1rem; color: var(--text-sub); line-height: 2.3; letter-spacing: 0.08em; margin-bottom: 1rem; filter: brightness(1.35); }

.bio-more { margin: 2rem auto; text-align: center; max-width: 1000px; padding: 0 2rem; }
.bio-timeline-block { display: flex; flex-direction: column; gap: 1.5rem; padding: 3rem 2rem; max-width: 1000px; margin: 0 auto; }
.bio-tl-header { display: flex; flex-direction: column; align-items: flex-start; }
.bio-tl-label { font-family: 'Cinzel', serif; font-size: 0.82rem; letter-spacing: 0.5em; color: var(--text-sub); text-transform: uppercase; margin-bottom: 0.6rem; }
.bio-tl-title { font-size: 1.3rem; font-weight: 700; letter-spacing: 0.2em; color: var(--text-main); margin-bottom: 0.8rem; }
.bio-tl-title span { color: var(--gold); }
.bio-tl-header .gold-line { margin: 0.8rem 0 0 0; }
.bio-timeline { position: relative; padding-left: 1.6rem; border-left: 1px solid rgba(201,168,76,0.2); }
.bio-tl-item { position: relative; padding: 0 0 1.6rem 1.2rem; }
.bio-tl-item:last-child { padding-bottom: 0; }
.bio-tl-item::before { content: ''; position: absolute; left: calc(-1.6rem - 4px); top: 0.3rem; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(201,168,76,0.5); }
.bio-tl-year { font-family: 'Cinzel', serif; font-size: 1rem; letter-spacing: 0.35em; color: var(--gold); margin-bottom: 0.2rem; }
.bio-tl-text { font-size: 1rem; color: var(--text-sub); letter-spacing: 0.06em; line-height: 1.6; filter: brightness(1.35); }

/* ===== BIO EXTRA (アコーディオン) ===== */
.bio-extra { max-width: 1000px; margin: 0 auto; padding: 0 2rem; overflow: hidden; max-height: 0; opacity: 0; transition: max-height 0.5s ease, opacity 0.4s ease; }
.bio-extra.is-open { max-height: 2000px; opacity: 1; }
.bio-extra-section { margin: 0 auto 2rem; max-width: 100%; padding: 1.5rem 0; }
.bio-extra .profile-divider { border: none; border-top: 1px solid rgba(201,168,76,0.12); margin: 2.5rem 0; }
.bio-extra .profile-meta-list { display: grid; gap: 0; }
.bio-extra .profile-meta-item { display: flex; gap: 1.5rem; align-items: baseline; border-bottom: 1px solid rgba(201,168,76,0.1); padding: 0.75rem 0; }
.bio-extra .profile-meta-label { font-family: 'Cinzel', serif; font-size: 1rem; letter-spacing: 0.25em; color: var(--gold); white-space: nowrap; min-width: 7em; }
.bio-extra .profile-meta-value { font-size: 1rem; color: var(--text-sub); letter-spacing: 0.08em; line-height: 1.8; filter: brightness(1.35); }
.bio-extra .cert-list { list-style: none; margin-top: 2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.6rem 2rem; }
.bio-extra .cert-item { font-size: 1rem; color: var(--text-sub); letter-spacing: 0.06em; padding: 0.55rem 0 0.55rem 0.8rem; background: none; line-height: 1.6; position: relative; filter: brightness(1.35); display: flex; align-items: center; }
.bio-extra .cert-item::before { content: ''; position: absolute; left: -5px; top: 50%; transform: translateY(-50%); width: 7px; height: 7px; border-radius: 50%; background: var(--gold); opacity: 0.6; }

/* ===== BOOKS ===== */
#books-section { background: var(--paper); }
.books-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; max-width: 100%; margin: 0 auto; }

.book-card-link { display: block; text-decoration: none; color: inherit; }
.book-card { display: flex; flex-direction: row; background: var(--paper-mid); border: 1px solid rgba(201,168,76,0.15); overflow: hidden; transition: border-color 0.3s, transform 0.3s; position: relative; }
.book-card:hover { border-color: rgba(201,168,76,0.35); transform: translateY(-4px); }
.book-cover-img { width: 200px; flex-shrink: 0; aspect-ratio: 3 / 4; object-fit: contain; display: block; background: var(--paper-mid); padding: 0.5rem; filter: sepia(20%) brightness(0.88); transition: filter 0.3s; }
.book-card:hover .book-cover-img { filter: sepia(5%) brightness(1); }
.book-stock-row { height: 1.8rem; display: flex; align-items: center; margin-bottom: 0.4rem; }
.book-stock-badge { display: inline-block; font-size: 0.8rem; letter-spacing: 0.12em; font-weight: 700; padding: 0.25rem 0.7rem; border-radius: 2px; }
.book-stock-on  { background: rgba(139,100,20,0.2); color: #c9a84c; border: 1px solid rgba(201,168,76,0.4); }
.book-stock-off { background: rgba(80,50,10,0.3);  color: #8b6914; border: 1px solid rgba(139,105,20,0.35); }
.book-no-image { width: 200px; flex-shrink: 0; aspect-ratio: 3 / 4; background: var(--paper-light); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; color: var(--text-sub); font-size: 1rem; letter-spacing: 0.1em; }
.book-no-image .no-image-icon { font-size: 1.8rem; opacity: 0.3; }
.book-body { display: flex; flex-direction: column; justify-content: flex-start; padding: 1.4rem 1.6rem; }
.book-title { font-size: 1.05rem; font-weight: 700; color: var(--text-main); letter-spacing: 0.08em; margin-bottom: 0.3rem; line-height: 1.5; }
.book-price { font-size: 1.05rem; color: var(--text-main); letter-spacing: 0.08em; margin-bottom: 0.4rem; }
.book-desc { font-size: 1rem; color: var(--gold); line-height: 1.95; }
.book-buy-row { display: flex; gap: 0.7rem; margin-top: 1.2rem; flex-wrap: wrap; }
.btn-buy { display: inline-block; padding: 0.55rem 1.2rem; font-size: 0.9rem; letter-spacing: 0.12em; font-family: inherit; cursor: pointer; border: 1px solid rgba(201,168,76,0.55); text-decoration: none; transition: background 0.2s, color 0.2s, border-color 0.2s; clip-path: polygon(6px 0%,100% 0%,calc(100% - 6px) 100%,0% 100%); }
.btn-buy-mail  { background: transparent; color: var(--gold); }
.btn-buy-mail:hover  { background: rgba(201,168,76,0.12); border-color: var(--gold); }
.btn-buy-form  { background: rgba(201,168,76,0.15); color: var(--gold); }
.btn-buy-form:hover  { background: rgba(201,168,76,0.28); border-color: var(--gold); }

/* ===== BOOKS BENEFIT CTA ===== */
.books-benefit-cta { text-align: center; margin-top: 2.4rem; }
.btn-benefit {
    display: inline-block;
    padding: 0.85rem 2.6rem;
    background: linear-gradient(135deg, rgba(139,105,20,0.25), rgba(201,168,76,0.18));
    border: 1px solid rgba(201,168,76,0.55);
    color: var(--gold);
    font-family: inherit;
    font-size: 0.95rem;
    letter-spacing: 0.2em;
    text-decoration: none;
    clip-path: polygon(10px 0%,100% 0%,calc(100% - 10px) 100%,0% 100%);
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-benefit:hover {
    background: rgba(201,168,76,0.28);
    border-color: var(--gold);
    color: var(--gold-light);
    transform: translateY(-2px);
}

/* ===== PURCHASE MODAL ===== */
.pmodal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.25s; padding: 1rem; }
@media (max-width: 600px) { .pmodal-overlay { padding: 0.25rem; } .pmodal-box { padding: 1.5rem 1rem 1.5rem; } }
.pmodal-overlay.is-open { opacity: 1; pointer-events: auto; }
.pmodal-box { position: relative; background: var(--paper-mid); border: 1px solid rgba(201,168,76,0.3); width: 100%; max-width: 700px; max-height: 90vh; overflow-y: auto; padding: 2.2rem 1.5rem 2rem; }
.pmodal-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg,transparent,var(--gold),transparent); }
.pmodal-close { position: absolute; top: 0.8rem; right: 1rem; background: none; border: none; color: var(--text-sub); font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 0.2rem 0.4rem; }
.pmodal-close:hover { color: var(--gold); }
.pmodal-title { font-size: 1rem; letter-spacing: 0.3em; color: var(--gold); border-bottom: 1px solid rgba(201,168,76,0.25); padding-bottom: 0.6rem; margin-bottom: 1.4rem; }
.pmodal-book-info { background: rgba(0,0,0,0.2); border: 1px solid rgba(201,168,76,0.15); padding: 0.9rem 1.1rem; margin-bottom: 1.2rem; }
.pmodal-label { font-size: 0.78rem; color: var(--text-sub); letter-spacing: 0.15em; margin-bottom: 0.3rem; }
.pmodal-book-title { font-size: 1rem; font-weight: 700; color: var(--text-main); letter-spacing: 0.06em; margin-bottom: 0.2rem; }
.pmodal-book-price { font-size: 0.95rem; color: var(--text-main); letter-spacing: 0.06em; }
.pmodal-note { font-size: 0.9rem; color: #c8b89a; line-height: 1.85; margin-bottom: 1.4rem; letter-spacing: 0.06em; }
.pmodal-field-note { font-size: 0.82rem; color: #b8996a; letter-spacing: 0.05em; margin-top: 0.4rem; margin-bottom: 0; }
.pmodal-cancel { display: block; width: 100%; margin-top: 0.8rem; padding: 0.75rem; background: transparent; border: 1px solid rgba(201,168,76,0.25); color: #a89070; font-family: inherit; font-size: 0.95rem; letter-spacing: 0.1em; cursor: pointer; transition: border-color 0.2s, color 0.2s; }
.pmodal-cancel:hover { border-color: rgba(201,168,76,0.5); color: #c8a860; }
.pmodal-postal-status { display: block; font-size: 0.78rem; margin-top: 0.3rem; letter-spacing: 0.05em; min-height: 0; line-height: 1.4; }
.pmodal-postal-status.searching { color: #a89070; }
.pmodal-postal-status.ok  { color: #6dbe6d; }
.pmodal-postal-status.err { color: #d97070; }
.pmodal-errors { background: rgba(139,26,26,0.25); border: 1px solid rgba(200,50,50,0.4); color: #e88; font-size: 0.9rem; padding: 0.7rem 1rem; margin-bottom: 1rem; list-style: none; }
.pmodal-field { margin-bottom: 1rem; }
.pmodal-field label { display: block; font-size: 0.88rem; color: #c8b89a; letter-spacing: 0.1em; margin-bottom: 0.35rem; }
.pmodal-req { color: #c9a84c; font-size: 0.78rem; margin-left: 0.3em; }
.pmodal-field input, .pmodal-field textarea { width: 100%; background: #4a3a1c; border: 1px solid rgba(201,168,76,0.45); color: #f0e8d4; padding: 0.65rem 0.9rem; font-family: inherit; font-size: 0.95rem; outline: none; box-sizing: border-box; transition: border-color 0.2s; resize: vertical; }
.pmodal-field input:focus, .pmodal-field textarea:focus { border-color: var(--gold); }
.pmodal-field input::placeholder, .pmodal-field textarea::placeholder { color: #7a6040; }
.pmodal-opt { color: #8b7a56; font-size: 0.78rem; margin-left: 0.3em; }
.pmodal-submit { width: 100%; margin-top: 0.5rem; padding: 0.75rem; background: rgba(201,168,76,0.18); border: 1px solid rgba(201,168,76,0.6); color: var(--gold); font-family: inherit; font-size: 1rem; letter-spacing: 0.2em; cursor: pointer; transition: background 0.2s; }
.pmodal-submit:hover { background: rgba(201,168,76,0.3); }

/* ===== PURCHASE TOAST ===== */
.purchase-toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%); padding: 0.9rem 2rem; font-size: 0.95rem; letter-spacing: 0.08em; z-index: 3000; transition: opacity 0.6s; border: 1px solid; }
.purchase-toast-ok  { background: rgba(20,60,20,0.9); color: #8ecf8e; border-color: rgba(100,180,100,0.4); }
.purchase-toast-err { background: rgba(80,10,10,0.9); color: #e88; border-color: rgba(200,50,50,0.4); }

/* ===== QUOTE BANNER ===== */
.quote-banner {
    background: #000;
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.quote-spotlight {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
        ellipse 110% 140% at 50% 50%,
        rgba(201,168,76,0.22) 0%,
        rgba(201,168,76,0.08) 40%,
        transparent 70%
    );
    z-index: 0;
}
.quote-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, transparent 25%, transparent 75%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
    z-index: 1;
}
.quote-banner-inner {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
    z-index: 2;
}
.quote-mark-open {
    display: block;
    font-size: 5rem;
    line-height: 1;
    color: var(--gold);
    opacity: 0.5;
    font-family: Georgia, serif;
    margin-bottom: -1rem;
}
.quote-banner-text {
    font-size: 1.15rem;
    line-height: 2.4;
    color: var(--text-main);
    font-weight: 400;
    letter-spacing: 0.12em;
    border: none;
    padding: 0;
    margin: 0 auto 1.6rem;
}
.quote-banner-attr {
    font-size: 1rem;
    letter-spacing: 0.2em;
    color: var(--gold);
    opacity: 0.75;
}

/* ===== ABOUT PLACE ===== */
#about-place { background: var(--paper); }
.about-place-inner { max-width: 800px; margin: 0 auto; padding: 5rem 2rem; }
.about-place-body { line-height: 2.0; color: var(--text-sub); }
.about-place-body p + p { margin-top: 1.5rem; }
.about-place-address {
    display: block;
    font-style: normal;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-sub);
    letter-spacing: 0.12em;
    border-top: 1px solid rgba(201,168,76,0.15);
    padding-top: 1.5rem;
    margin-top: 2rem;
}

/* ===== CONTACT ===== */
#contact { max-width: none; width: 100%; }
.contact-section-title {
    max-width: 560px; margin: 2rem auto 1rem;
    font-size: 1rem; letter-spacing: 0.3em; color: var(--gold-light, #d4a94a);
    font-family: 'Noto Serif JP', serif; font-weight: 600;
    padding-bottom: 0.5rem; border-bottom: 1px solid rgba(201,168,76,0.2);
}
#contact .contact-block { max-width: 560px; margin: 0 auto; display: grid; gap: 1rem; }
#contact .contact-item { display: flex; gap: 1.4rem; align-items: flex-start; padding: 1.2rem 1.6rem; background: var(--paper-mid); border: 1px solid rgba(201,168,76,0.18); transition: border-color 0.3s; }
#contact .contact-item:hover { border-color: rgba(201,168,76,0.4); }
#contact .contact-icon { font-size: 1rem; color: var(--gold); flex-shrink: 0; width: 1.4rem; text-align: center; padding-top: 0.1rem; }
#contact .contact-item p, #contact .contact-item span { font-size: 1rem; color: var(--text-main); letter-spacing: 0.08em; line-height: 1.9; }
#contact .contact-name { color: var(--text-main); font-weight: 600; }#contact .contact-link { font-size: 1rem; color: var(--gold-light); letter-spacing: 0.08em; text-decoration: none; border-bottom: 1px solid rgba(201,168,76,0.3); transition: border-color 0.2s, color 0.2s; line-height: 1.9; }
#contact .contact-link:hover { color: #fff; border-color: rgba(201,168,76,0.7); }

/* ===== CONTACT FORM ===== */
.contact-form-wrap {
    max-width: 560px; margin: 2.5rem auto 0;
    border-top: 1px solid rgba(201,168,76,0.15); padding-top: 2rem;
}
.contact-msg {
    padding: 0.9rem 1.2rem; margin-bottom: 1.5rem;
    font-size: 1rem; letter-spacing: 0.08em; border-left: 3px solid;
}
.contact-msg--success { border-color: var(--gold); background: rgba(201,168,76,0.08); color: var(--gold); }
.contact-msg--error   { border-color: #c0392b; background: rgba(192,57,43,0.08); color: #e07060; }
.contact-errors {
    list-style: none; margin-bottom: 1.2rem;
    background: rgba(192,57,43,0.08); border-left: 3px solid #c0392b;
    padding: 0.8rem 1.2rem;
}
.contact-errors li { font-size: 1rem; color: #e07060; letter-spacing: 0.05em; line-height: 1.9; }

.contact-form { display: grid; gap: 2rem; }
.cform-row { display: flex; flex-direction: column; gap: 0.7rem; }
.cform-row label {
    font-size: 1rem; color: var(--text-main); letter-spacing: 0.2em;
}
.cform-req {
    font-size: 1rem; color: var(--gold); letter-spacing: 0.1em;
    border: 1px solid rgba(201,168,76,0.5); padding: 0.05rem 0.35rem; margin-left: 0.4rem; vertical-align: middle;
}
.cform-row input,
.cform-row textarea {
    background: var(--paper-light); border: 1px solid rgba(201,168,76,0.35);
    color: var(--text-main); padding: 0.65rem 0.9rem;
    font-family: inherit; font-size: 1rem; outline: none;
    transition: border-color 0.2s; resize: vertical;
}
.cform-row input::placeholder,
.cform-row textarea::placeholder { color: rgba(200,185,155,0.45); }
.cform-row input:focus,
.cform-row textarea:focus { border-color: rgba(201,168,76,0.6); }
.cform-row input:-webkit-autofill,
.cform-row input:-webkit-autofill:hover,
.cform-row input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #2e2210 inset;
    -webkit-text-fill-color: var(--text-main);
    border-color: rgba(201,168,76,0.35);
}
.pmodal-field input:-webkit-autofill,
.pmodal-field input:-webkit-autofill:hover,
.pmodal-field input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #4a3a1c inset;
    -webkit-text-fill-color: #f0e8d4;
    border-color: rgba(201,168,76,0.45);
}
.cform-submit { text-align: center; margin-top: 0.5rem; }

/* ===== SOCIAL ICONS ===== */
.social-icons { display: flex; justify-content: center; gap: 4rem; margin-top: 3rem; }
.social-icon-link { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-decoration: none; color: var(--gold); transition: color 0.3s; }
.social-icon-link:hover { color: var(--gold-light); }
.social-icon-circle {
    width: 72px; height: 72px;
    border-radius: 50%;
    border: 1px solid rgba(201,168,76,0.6);
    display: flex; align-items: center; justify-content: center;
    color: var(--gold-light);
    transition: border-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.social-icon-link:hover .social-icon-circle {
    border-color: rgba(201,168,76,0.6);
    color: var(--gold-light);
    box-shadow: 0 0 16px rgba(201,168,76,0.12);
}
.social-icon-label {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: inherit;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 200;
    width: 56px;
    height: 56px;
    background: rgba(10, 7, 2, 0.88);
    border: 1px solid rgba(201,168,76,0.5);
    color: var(--gold);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, background 0.2s, color 0.2s;
    backdrop-filter: blur(6px);
    border-radius: 50%;
}
.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.back-to-top:hover {
    background: rgba(201,168,76,0.15);
    color: var(--gold-light);
}

/* ===== FOOTER ===== */
footer { background: var(--ink); border-top: 1px solid rgba(201,168,76,0.15); text-align: center; padding: 3rem 2rem; }
.footer-mon { font-size: 2.5rem; color: rgba(201,168,76,0.2); margin-bottom: 1rem; }
.footer-name { font-size: 1rem; color: var(--gold); letter-spacing: 0.2em; margin-bottom: 0.5rem; }
.footer-place { max-width: 600px; margin: 1.2rem auto 1.5rem; border-top: 1px solid rgba(201,168,76,0.1); padding-top: 1.2rem; }
.footer-place-desc { font-size: 0.82rem; color: var(--text-sub); line-height: 1.9; margin-bottom: 0.6rem; }
.footer-place-address { display: block; font-style: normal; font-size: 0.78rem; color: var(--text-sub); opacity: 0.7; letter-spacing: 0.1em; }
.footer-copy { font-size: 0.8rem; color: var(--text-sub); letter-spacing: 0.15em; font-family: 'Cinzel', serif; }

/* ===== NAV FIXED (graves・detail ページ常時表示) ===== */
nav.nav-fixed.no-anim {
    animation: none;
}
.nav-spacer { height: 64px; }

/* ===== NAV OVERLAY ===== */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 98;
    transition: opacity 0.25s;
    opacity: 0;
}
.nav-overlay.open {
    display: block;
    opacity: 1;
}

/* ===== HAMBURGER ===== */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 6px;
    background: none;
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}
.nav-hamburger span {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--gold);
    transition: transform 0.3s, opacity 0.3s;
    transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== RESPONSIVE BR UTILITIES ===== */
br.br-tablet,
br.br-medium,
br.br-mobile,
br.br-small { display: none; }

@media (max-width: 960px) { br.br-tablet { display: block; } }
@media (max-width: 768px) { br.br-medium { display: block; } }
@media (max-width: 600px) { br.br-mobile { display: block; } }
@media (max-width: 375px) { br.br-small  { display: block; } }

/* ===== RESPONSIVE ===== */

/* ---- 1280px ワイドデスクトップ ---- */
@media (max-width: 1280px) {
    .posts-grid { grid-template-columns: repeat(4, 1fr); }
    .posts-grid.posts-card-lg { grid-template-columns: repeat(3, 1fr); }

}

/* ---- 960px タブレット ---- */
@media (max-width: 960px) {
    .nav-logo-full { display: none; }
    .bio-wrap { grid-template-columns: 1fr; gap: 2.5rem; }
    .bio-photo img { aspect-ratio: auto; height: auto; width: 50%; display: block; margin: 0 auto; }
    .posts-grid { grid-template-columns: repeat(3, 1fr); }

}

/* ---- 768px ---- */
@media (max-width: 768px) {
    .hero-title { line-height: 1.4; font-size: clamp(32px, 8vw, 56px); }
    .hero-title .hero-title-sub { font-size: 1.3em; font-style: normal; }
    #about { padding: 3rem 1.5rem; }
    .social-icons { gap: 2.5rem; }
    .filter-form { gap: 0.8rem; }
    .filter-field input,
    .filter-field select { min-width: 160px; }
    .bio-photo img { width: 65%; }
    .posts-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .posts-grid.posts-card-lg { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .posts-grid.posts-card-md { grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
    #posts-inner { padding: 3rem 1rem; }
    .main-content { padding: 3rem 1rem 4rem; }
    .post-body { padding: 1rem; }

    .nav-hamburger { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        flex-direction: column;
        gap: 0;
        background: rgba(10, 7, 2, 0.98);
        border-top: 1px solid rgba(201,168,76,0.2);
        border-bottom: 1px solid rgba(201,168,76,0.2);
        backdrop-filter: blur(8px);
        list-style: none;
        z-index: 99;
    }
    .nav-links.open { display: flex; }
    .nav-links li { border-bottom: 1px solid rgba(201,168,76,0.08); }
    .nav-links a {
        display: block;
        padding: 0.75rem 1.6rem;
        font-size: 0.85rem;
        letter-spacing: 0.15em;
        text-align: right;
    }

    nav { position: sticky; }

    /* ---- 768px 以下: スクロール方向でスライドイン/アウト ---- */
    nav.nav-fixed {
        transform: translateY(0);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    nav.nav-fixed .nav-hamburger {
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s, backdrop-filter 0.25s;
    }
    nav.nav-fixed.nav-hidden {
        transform: translateY(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    /* nav が消えてもハンバーガーだけ画面内に残す */
    nav.nav-fixed.nav-hidden .nav-hamburger {
        transform: translateY(var(--nav-h, 64px));
        background: rgba(10, 7, 2, 0.88);
        backdrop-filter: blur(6px);
        border-radius: 6px;
    }
    /* メニューオープン時は nav ごと戻す */
    nav.nav-fixed.nav-hidden:has(.nav-links.open) {
        transform: translateY(0);
    }
    nav.nav-fixed.nav-hidden:has(.nav-links.open) .nav-hamburger {
        transform: none;
        background: transparent;
        backdrop-filter: none;
    }

    /* 書籍カード：左上=写真、右上=バッジ+タイトル、下=内容 */
    .books-grid {
        grid-template-columns: 1fr;
        max-width: 680px;
        gap: 1.5rem;
    }
    .book-card {
        display: grid;
        grid-template-columns: 160px 1fr;
        grid-template-rows: auto auto auto;
    }
    .book-cover-img,
    .book-no-image {
        grid-column: 1;
        grid-row: 1 / 4;
        width: 160px;
        aspect-ratio: 3 / 4;
        align-self: start;
        object-fit: contain;
        background: var(--paper-mid);
    }
    .book-body {
        display: contents;
    }
    .book-title {
        grid-column: 2;
        grid-row: 1;
        padding: 0.5rem 1rem 0.1rem;
        margin-bottom: 0;
        align-self: end;
    }
    .book-price {
        grid-column: 2;
        grid-row: 2;
        padding: 0.1rem 1rem 0.1rem;
        margin-bottom: 0;
        align-self: center;
    }
    .book-stock-row {
        grid-column: 2;
        grid-row: 3;
        height: auto;
        padding: 0.1rem 1rem 0.2rem;
        margin-bottom: 0;
        align-self: start;
    }
    .book-desc {
        grid-column: 1 / -1;
        grid-row: 4;
        padding: 0.5rem 1rem 0.5rem;
    }
    .book-buy-row {
        grid-column: 1 / -1;
        grid-row: 5;
        padding: 0 1rem 1rem;
        margin-top: 0;
    }
    .book-buy-row .btn-buy { margin: 0.8rem 0.8rem 0.4rem; }
}

/* ---- 600px モバイル ---- */
@media (max-width: 600px) {
    .bio-extra .profile-meta-item { flex-direction: column; gap: 0.25rem; }
    .bio-extra .cert-list { gap: 0; }
    .bio-extra .cert-item { background: none; border-left: none; border-bottom: 1px solid rgba(201,168,76,0.1); padding-left: 0.8rem; }
    .bio-extra .cert-item::before { left: -0.8rem; }

    section { padding: 3rem 1.2rem; }
    .hero-content { padding-left: 0.8rem; padding-right: 0.8rem; width: 100%; box-sizing: border-box; }
    .hero-title {
        font-size: clamp(21px, calc((100vw - 2.6rem) / 9), 48px);
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .hero-btns { flex-direction: column; align-items: center; }
    .hero-btns .btn-primary,
    .hero-btns .btn-outline { width: 240px; text-align: center; padding-left: 1rem; padding-right: 1rem; }
    .filter-form { flex-direction: column; align-items: flex-start; }
    .filter-field input,
    .filter-field select { min-width: 100%; width: 100%; }
    .sort-toggle,
    .per-page-toggle { flex-wrap: wrap; }
    .sort-label,
    .per-page-label { width: 100%; margin-right: 0; }
    .posts-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem 0.3rem; }
    .posts-grid.posts-card-lg { grid-template-columns: repeat(2, 1fr); gap: 0.6rem 0.3rem; }
    .posts-grid.posts-card-md { grid-template-columns: repeat(3, 1fr); gap: 0.6rem 0.3rem; }
    .posts-grid.posts-list .post-comment-list { display: none; }
    #posts-inner { padding: 2rem 0.4rem; }
    .main-content { padding: 2rem 0.4rem 3rem; }
    .post-body { padding: 0.7rem; }
    .post-location { font-size: 0.9rem; }
    .bio-timeline-block { padding-left: 1rem; padding-right: 1rem; }
    .bio-extra { padding-left: 1rem; padding-right: 1rem; }
    .bio-photo img { width: 80%; }
    .books-grid { max-width: 100%; }
    .social-icons { gap: 1.5rem; }
    .social-icon-circle { width: 56px; height: 56px; }
    .pagination { gap: 0.8rem; }
    .quote-banner { padding-left: 0; padding-right: 0; }
}

/* ---- 375px 小型モバイル ---- */
@media (max-width: 375px) {
    .hero-title { font-size: clamp(21px, calc((100vw - 2.6rem) / 9), 48px); }
    .posts-grid,
    .posts-grid.posts-card-lg { grid-template-columns: 1fr; gap: 0.5rem; }
    .posts-grid.posts-card-md { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    #posts .posts-grid.posts-card-lg .post-card-link:nth-child(n+4) { display: none; }
    /* 一覧表示時は名前のみ表示 */
    .posts-grid.posts-list .post-location,
    .posts-grid.posts-list .post-pref,
    .posts-grid.posts-list .post-date,
    .posts-grid.posts-list .post-comment-list { display: none; }
    /* 1列表示時にカードを小さく */
    .posts-grid.posts-card-lg { padding: 0 1.5rem; }
    .posts-grid.posts-card-lg .post-body { padding: 0.7rem 0.9rem; }
    .posts-grid.posts-card-lg .post-name { font-size: 1rem; margin-bottom: 0.2rem; }
    .posts-grid.posts-card-lg .post-date { font-size: 0.85rem; margin-bottom: 0.3rem; }
    .posts-grid.posts-card-lg .post-location { font-size: 0.85rem; }
    .quote-banner { padding-left: 1rem; padding-right: 1rem; }
    .bio-timeline-block { padding-left: 1rem; padding-right: 1rem; }
    #about { padding-left: 1rem; padding-right: 1rem; }
    section { padding: 2.5rem 1rem; }
    .hero-btns .btn-primary,
    .hero-btns .btn-outline { width: auto; padding-left: 1.25rem; padding-right: 1rem; }
    .social-icon-circle { width: 48px; height: 48px; }
    .pagination { gap: 0.5rem; }
}
