@charset "UTF-8";

/* =========================================
   Blogs — 一覧・記事・エディタ
   サイト共通トークン (--jh-*) の上に構築し、
   記事ごとのアクセント色を --blog-accent で受け取る。
   ========================================= */

/* 表示幅の切り替えを滑らかにアニメーションさせるため、幅の変数を <length> として登録する */
@property --blog-measure { syntax: '<length>'; inherits: true; initial-value: 1200px; }
@property --blog-measure-wide { syntax: '<length>'; inherits: true; initial-value: 1440px; }
@property --blog-canvas { syntax: '<length>'; inherits: true; initial-value: 1240px; }

:root {
    --blog-accent: var(--jh-accent);
    --blog-accent-text: var(--jh-accent);
    --blog-measure: 1200px;
    --blog-measure-wide: 1440px;
    --blog-serif: var(--jh-font-serif);
}

.blog-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 72px 20px 96px;
    text-align: left;
}
.blog-page--narrow { max-width: 880px; }

.blog-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--jh-accent);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 24px;
}
.blog-back .material-symbols-outlined { font-size: 18px; }

.blog-btn-sm {
    padding: 10px 20px;
    font-size: 15px;
    gap: 6px;
}
.blog-btn-sm .material-symbols-outlined { font-size: 19px; }

.blog-kicker {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--blog-accent-text);
    margin-bottom: 8px;
}

/* ── Byline ─────────────────────────────── */
.blog-byline {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}
.blog-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--jh-on-tint);
    background: var(--jh-card-bg-3);
}
.blog-avatar--lg { width: 64px; height: 64px; font-size: 26px; }
.blog-byline-text { display: flex; flex-direction: column; line-height: 1.3; }
.blog-byline-name {
    color: var(--jh-text);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}
.blog-byline-name:hover { color: var(--blog-accent-text); }
.blog-byline-meta { color: var(--jh-text-muted); font-size: 13px; }

/* ── Cover fallback (画像なし) ───────────── */
.blog-cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--blog-accent) 22%, var(--jh-card-bg));
}
.blog-cover-fallback span {
    font-size: clamp(56px, 8vw, 96px);
    font-weight: 700;
    letter-spacing: -0.04em;
    color: rgba(var(--jh-text-rgb), 0.85);
}

/* =========================================
   一覧
   ========================================= */
.blog-index-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
}
.blog-index-lead { color: var(--jh-text-muted); font-size: 19px; margin: 0; }
.blog-index-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.blog-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    height: 48px;
    max-width: 420px;
    border-radius: 980px;
    background: rgba(var(--jh-fg-rgb), 0.06);
    border: 1px solid var(--jh-card-border);
    margin-bottom: 40px;
    transition: border-color 0.2s ease;
}
.blog-search:focus-within { border-color: var(--jh-accent); }
.blog-search .material-symbols-outlined { color: var(--jh-text-muted); font-size: 20px; }
.blog-search input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--jh-text);
    font-size: 16px;
    outline: none;
}

.blog-filter-note {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin: -16px 0 32px;
    font-size: 15px;
}
.blog-filter-note a { color: var(--jh-accent); text-decoration: none; }

/* カード全体をクリック可能に (内側の著者リンクは前面に残す) */
.blog-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Grid & cards */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}
.blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    overflow: hidden;
    background: var(--jh-card-bg);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.3s ease;
}
.blog-card:hover {
    transform: translateY(-4px);
    background-color: var(--jh-card-hover);
}
.blog-card-media { aspect-ratio: 16 / 10; overflow: hidden; }
.blog-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.blog-card:hover .blog-card-media img { transform: scale(1.04); }
.blog-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}
.blog-card-title {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0;
}
.blog-card-excerpt {
    color: var(--jh-text-muted);
    font-size: 15px;
    margin: 0 0 auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card .blog-byline { margin-top: 8px; }

.blog-empty {
    text-align: center;
    padding: 64px 24px;
    color: var(--jh-text-muted);
}
.blog-empty .material-symbols-outlined { font-size: 48px; color: var(--jh-accent); }
.blog-empty p { margin: 16px 0 24px; font-size: 17px; }

.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 56px;
    color: var(--jh-text-muted);
}

/* =========================================
   記事ページ
   ========================================= */
.blog-article { text-align: left; }

.blog-author-bar {
    position: fixed;
    left: 20px;
    bottom: 24px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
}

.blog-title,
.blog-title-input,
.blog-subtitle,
.blog-subtitle-input {
    font-family: var(--jh-font-display);
}
.blog-title {
    font-size: clamp(36px, 6vw, 68px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.06;
    margin: 0 0 16px;
}
.blog-subtitle {
    font-size: clamp(19px, 2.4vw, 24px);
    color: var(--jh-text-muted);
    line-height: 1.4;
    margin: 0 0 28px;
}

/* Feature */
.blog-hero--feature {
    position: relative;
    min-height: min(82vh, 760px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.blog-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.blog-hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(var(--jh-bg-rgb), 0) 30%, rgba(var(--jh-bg-rgb), 0.55) 65%, var(--jh-bg) 100%);
}
.blog-hero--feature .blog-hero-inner {
    position: relative;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px 56px;
}
.blog-hero--feature .blog-subtitle { color: rgba(var(--jh-text-rgb), 0.82); }

/* Classic */
.blog-hero--classic {
    max-width: 980px;
    margin: 0 auto;
    padding: 96px 20px 16px;
    text-align: center;
}
.blog-hero--classic .blog-byline { justify-content: center; }
.blog-hero--classic .blog-byline-text { text-align: left; }
.blog-hero-figure { margin: 56px 0 0; }
.blog-hero-figure img {
    width: 100%;
    max-height: 620px;
    object-fit: cover;
    border-radius: 28px;
}

/* Split */
.blog-hero--split {
    max-width: 1200px;
    margin: 0 auto;
    padding: 72px 20px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
}
.blog-hero--split .blog-title { font-size: clamp(34px, 4.6vw, 58px); }
.blog-hero-media {
    aspect-ratio: 4 / 5;
    border-radius: 28px;
    overflow: hidden;
}
.blog-hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* Minimal */
.blog-hero--minimal {
    max-width: var(--blog-measure);
    margin: 0 auto;
    padding: 120px 20px 8px;
}
.blog-hero--minimal .blog-title {
    font-family: var(--blog-serif);
    font-weight: 600;
    letter-spacing: -0.02em;
    font-size: clamp(40px, 6.5vw, 76px);
}
.blog-rule {
    width: 64px;
    height: 3px;
    border: none;
    opacity: 1;
    background: var(--blog-accent);
    margin: 8px 0 28px;
}

/* 英語で読む人向けの「自動翻訳です」の注記 */
.blog-translated-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: var(--blog-measure);
    margin: 24px auto 0;
    padding: 0 20px;
    color: var(--jh-text-muted);
    font-size: 14px;
    line-height: 1.5;
}
.blog-translated-note .material-symbols-outlined { font-size: 18px; }
.blog-translated-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.blog-translated-note a:hover { color: var(--jh-text-body); }

/* ── 本文 (記事ページ & エディタ共通) ───────── */
.blog-prose {
    max-width: var(--blog-measure);
    margin: 0 auto;
    padding: 40px 20px 24px;
    font-size: 19px;
    line-height: 1.8;
    color: var(--jh-text-body);
    overflow-wrap: anywhere;
}
.blog-prose p { margin: 0 0 1.3em; }
.blog-prose h2 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--jh-text);
    margin: 1.8em 0 0.6em;
}
.blog-prose h3 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--jh-text);
    margin: 1.6em 0 0.5em;
}
.blog-prose a {
    color: var(--blog-accent-text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.blog-prose strong { color: var(--jh-text); font-weight: 600; }
.blog-prose blockquote {
    margin: 1.8em 0;
    padding: 4px 0 4px 24px;
    border-left: 3px solid var(--blog-accent);
    font-size: 1.15em;
    font-style: italic;
    color: var(--jh-text);
}
.blog-prose pre {
    margin: 1.6em 0;
    padding: 20px 24px;
    border-radius: 16px;
    background: var(--jh-surface);
    border: 1px solid var(--jh-card-border);
    color: var(--jh-text-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
}
.blog-prose code {
    font-family: var(--jh-font-mono);
    font-size: 0.88em;
    background: rgba(var(--jh-fg-rgb), 0.08);
    padding: 2px 6px;
    border-radius: 6px;
}
.blog-prose pre code { background: none; padding: 0; }
.blog-prose ul,
.blog-prose ol { padding-left: 1.5em; margin: 0 0 1.3em; }
.blog-prose li { margin-bottom: 0.4em; }
.blog-prose li::marker { color: var(--blog-accent); }
.blog-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 18px;
    vertical-align: middle;
}
.blog-prose hr {
    border: none;
    height: 1px;
    opacity: 1;
    margin: 2.4em 0;
    background: var(--jh-line);
}
.blog-prose .ql-align-center { text-align: center; }
.blog-prose .ql-align-right { text-align: right; }
.blog-prose .ql-align-justify { text-align: justify; }
.blog-prose .ql-indent-1 { padding-left: 3em; }
.blog-prose .ql-indent-2 { padding-left: 6em; }
.blog-prose .ql-indent-3 { padding-left: 9em; }
.blog-prose .ql-indent-4 { padding-left: 12em; }
.blog-prose .ql-indent-5 { padding-left: 15em; }
.blog-prose .ql-indent-6 { padding-left: 18em; }
.blog-prose .ql-indent-7 { padding-left: 21em; }
.blog-prose .ql-indent-8 { padding-left: 24em; }

.blog-prose--dropcap > p:first-of-type::first-letter {
    float: left;
    font-family: var(--blog-serif);
    font-size: 4.2em;
    line-height: 0.85;
    font-weight: 600;
    padding: 0.08em 0.1em 0 0;
    color: var(--blog-accent-text);
}

/* ── 記事フッター ───────────────────────── */
.blog-article-footer {
    max-width: min(var(--blog-measure), 980px);
    margin: 0 auto;
    padding: 32px 20px 0;
}
.blog-author-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px;
}
.blog-author-card .blog-kicker { margin-bottom: 2px; }
.blog-author-name { font-size: 21px; font-weight: 600; margin: 0 0 4px; }
.blog-author-card a { color: var(--blog-accent-text); text-decoration: none; font-size: 15px; }
.blog-more { padding-top: 48px; }
.blog-more-title { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 28px; }

/* =========================================
   マイブログ
   ========================================= */
.blog-mine-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.blog-mine-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px;
    border-radius: 20px;
    background: var(--jh-card-bg);
}
.blog-mine-thumb {
    width: 96px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}
.blog-mine-thumb img { width: 100%; height: 100%; object-fit: cover; }
.blog-mine-thumb .blog-cover-fallback span { font-size: 28px; }
.blog-mine-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.blog-mine-title {
    color: var(--jh-text);
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.blog-mine-title:hover { color: var(--blog-accent-text); }
.blog-mine-meta { color: var(--jh-text-muted); font-size: 13px; }
.blog-mine-actions { display: flex; gap: 6px; }
.blog-mine-actions form { margin: 0; }

.blog-status {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 980px;
}
.blog-status--published { background: rgba(48, 209, 88, 0.15); color: color-mix(in srgb, #30d158, #000 var(--jh-accent-shade)); }
.blog-status--draft { background: rgba(255, 159, 10, 0.15); color: color-mix(in srgb, #ff9f0a, #000 var(--jh-accent-shade)); }

.blog-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(var(--jh-fg-rgb), 0.06);
    color: var(--jh-text);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.blog-icon-btn:hover { background: rgba(var(--jh-fg-rgb), 0.14); color: var(--jh-text); }
.blog-icon-btn--danger:hover { background: rgba(255, 59, 48, 0.2); color: var(--jh-red); }
.blog-icon-btn .material-symbols-outlined { font-size: 20px; }

/* =========================================
   エディタ
   ========================================= */
.blog-editor {
    max-width: calc(var(--blog-canvas) + 300px + 48px + 40px);
    margin: 0 auto;
    padding: 48px 20px 160px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 48px;
    text-align: left;
}
.blog-editor-canvas { min-width: 0; max-width: var(--blog-canvas); width: 100%; justify-self: center; }

.blog-form-errors {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 14px;
    background: rgba(255, 59, 48, 0.12);
    border: 1px solid rgba(255, 59, 48, 0.4);
    color: #ff6961;
    font-size: 15px;
}
.blog-form-errors p { margin: 0; }

/* Cover drop zone */
.blog-cover-drop {
    position: relative;
    aspect-ratio: 21 / 9;
    border-radius: 24px;
    border: 1.5px dashed rgba(var(--jh-fg-rgb), 0.18);
    background: rgba(var(--jh-fg-rgb), 0.03);
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 36px;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.blog-cover-drop:hover,
.blog-cover-drop:focus-visible,
.blog-cover-drop.is-dragover {
    outline: none;
    border-color: var(--blog-accent);
    background: color-mix(in srgb, var(--blog-accent) 8%, transparent);
}
.blog-cover-drop img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}
.blog-cover-drop.has-image { border-style: solid; border-color: transparent; }
.blog-cover-drop.has-image img { display: block; }
.blog-cover-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--jh-text-muted);
    font-size: 15px;
}
.blog-cover-empty .material-symbols-outlined { font-size: 36px; color: var(--blog-accent-text); }
.blog-cover-empty small { font-size: 12px; opacity: 0.8; }
.blog-cover-drop.has-image .blog-cover-empty { display: none; }
.blog-cover-remove {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
}
.blog-cover-drop.has-image .blog-cover-remove { display: inline-flex; }

/* Title / subtitle */
.blog-title-input,
.blog-subtitle-input {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--jh-text);
    resize: none;
    padding: 0;
}
.blog-title-input {
    font-size: clamp(34px, 5vw, 52px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.1;
    overflow: hidden;
    margin-bottom: 12px;
}
.blog-subtitle-input {
    font-size: 21px;
    color: var(--jh-text-muted);
    margin-bottom: 28px;
}
.blog-title-input::placeholder,
.blog-subtitle-input::placeholder { color: rgba(134, 134, 139, 0.6); }

/* Toolbar (Quill snow をダークテーマ化) */
/* 共通ツールバー (ブロックエディタ) */
.blog-toolbar {
    position: sticky;
    top: 76px;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 16px;
    background: rgba(var(--jh-glass-rgb), 0.86);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    margin-bottom: 8px;
}
.blog-toolbar .tb-group {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    padding-right: 5px;
    margin-right: 3px;
    border-right: 1px solid rgba(var(--jh-fg-rgb), 0.1);
}
.blog-toolbar .tb-group:last-child { border-right: none; }
.blog-toolbar button {
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--jh-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.blog-toolbar button .material-symbols-outlined { font-size: 20px; }
.blog-toolbar button:hover { background: rgba(var(--jh-fg-rgb), 0.1); }
.blog-toolbar button.is-active { color: var(--blog-accent-text); background: rgba(var(--jh-fg-rgb), 0.08); }
.blog-toolbar .tb-text { font-size: 13px; font-weight: 600; padding: 0 10px; }
.blog-toolbar .tb-md { font-family: var(--jh-font-mono); font-size: 13px; }

/* 各列のエディタ (Quill) — 記事ページの本文と同じ見た目で編集する */
.blog-blocks-editor .ql-container.ql-snow { border: none; font-family: inherit; font-size: inherit; }
.blog-blocks-editor .ql-editor {
    min-height: 1.8em;
    padding: 0;
    line-height: inherit;
    overflow: visible;
}
.blog-blocks-editor .ql-editor.ql-blank::before {
    left: 0;
    right: 0;
    font-style: normal;
    color: rgba(134, 134, 139, 0.55);
}
.blog-blocks-editor .ql-editor > :first-child { margin-top: 0; }
.blog-blocks-editor .ql-editor li[data-list] { margin-bottom: 0.4em; }
.blog-blocks-editor .ql-editor li > .ql-ui::before { color: var(--blog-accent-text); }
.blog-blocks-editor .ql-editor .ql-code-block-container {
    background: var(--jh-surface);
    color: var(--jh-text-body);
    border-radius: 16px;
    padding: 20px 24px;
    font-size: 15px;
}
.ql-snow .ql-tooltip {
    z-index: 40;
    background: var(--jh-card-bg);
    color: var(--jh-text);
    border: 1px solid var(--jh-glass-border);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.ql-snow .ql-tooltip input[type=text] {
    background: rgba(var(--jh-fg-rgb), 0.06);
    color: var(--jh-text);
    border: 1px solid var(--jh-card-border);
    border-radius: 8px;
}
.ql-snow .ql-tooltip a { color: var(--blog-accent-text); }

/* Settings sidebar */
.blog-editor-settings {
    position: sticky;
    top: 76px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.blog-settings-card {
    padding: 20px;
    border-radius: 20px;
    background: var(--jh-card-bg);
}
.blog-settings-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--jh-text);
    margin: 0 0 14px;
}
.blog-settings-tips ul { margin: 0; padding-left: 1.1em; color: var(--jh-text-muted); font-size: 13px; }
.blog-settings-tips li { margin-bottom: 6px; }
.blog-settings-meta { font-size: 13px; color: var(--jh-text-muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.blog-link-danger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 0;
    color: var(--jh-red);
    font-size: 14px;
    cursor: pointer;
}
.blog-link-danger .material-symbols-outlined { font-size: 18px; }

/* Template picker */
.blog-template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.blog-template-option {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border-radius: 14px;
    border: 1.5px solid transparent;
    background: rgba(var(--jh-fg-rgb), 0.04);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.blog-template-option:hover { background: rgba(var(--jh-fg-rgb), 0.08); }
.blog-template-option:has(input:checked) {
    border-color: var(--blog-accent);
    background: color-mix(in srgb, var(--blog-accent) 10%, transparent);
}
.blog-template-option:has(input:focus-visible) { outline: 2px solid var(--blog-accent); outline-offset: 2px; }
.blog-template-option input { position: absolute; opacity: 0; pointer-events: none; }
.blog-template-name { font-size: 13px; font-weight: 600; margin-top: 6px; }
.blog-template-desc { font-size: 11px; color: var(--jh-text-muted); line-height: 1.3; }

/* テンプレートのミニプレビュー: i = 画像, b = テキスト行 */
.blog-template-thumb {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    aspect-ratio: 4 / 3;
    padding: 8px;
    border-radius: 8px;
    background: var(--jh-surface-sunken);
    overflow: hidden;
}
.blog-template-thumb i {
    display: block;
    border-radius: 4px;
    background: var(--blog-accent);
}
.blog-template-thumb b { display: block; height: 4px; border-radius: 2px; background: rgba(var(--jh-text-rgb), 0.55); }
.blog-template-thumb b + b { width: 60%; background: rgba(var(--jh-fg-rgb), 0.3); }

.blog-template-thumb--feature { justify-content: flex-end; }
.blog-template-thumb--feature i { position: absolute; inset: 0; border-radius: 0; opacity: 0.85; }
.blog-template-thumb--feature b { position: relative; width: 75%; background: #fff; }

.blog-template-thumb--classic { align-items: center; }
.blog-template-thumb--classic b { width: 70%; }
.blog-template-thumb--classic i { width: 100%; flex: 1; margin-top: 4px; }

.blog-template-thumb--split { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto 1fr; column-gap: 6px; row-gap: 4px; align-content: center; }
.blog-template-thumb--split b { grid-column: 1; align-self: center; }
.blog-template-thumb--split b:first-child { margin-top: auto; }
.blog-template-thumb--split i { grid-column: 2; grid-row: 1 / 4; height: 100%; }

.blog-template-thumb--minimal { justify-content: center; padding-left: 12px; }
.blog-template-thumb--minimal b:first-child { height: 7px; width: 80%; background: #fff; }
.blog-template-thumb--minimal b:nth-child(2) { width: 16%; height: 2px; background: var(--blog-accent); margin: 3px 0; }
.blog-template-thumb--minimal b:nth-child(3) { width: 55%; }

/* Accent picker */
.blog-accent-row { display: flex; gap: 8px; flex-wrap: wrap; }
.blog-accent-option { position: relative; cursor: pointer; }
.blog-accent-option input { position: absolute; opacity: 0; pointer-events: none; }
.blog-accent-option span {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(var(--jh-fg-rgb), 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.blog-accent-option:hover span { transform: scale(1.1); }
.blog-accent-option input:checked + span { box-shadow: 0 0 0 2px var(--jh-bg), 0 0 0 4px var(--jh-text); }
.blog-accent-option input:focus-visible + span { outline: 2px solid var(--jh-text); outline-offset: 4px; }

/* Floating action bar */
.blog-actionbar {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 980px;
    background: rgba(var(--jh-glass-rgb), 0.72);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid var(--jh-glass-border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    max-width: calc(100vw - 32px);
}
.blog-actionbar-status {
    color: var(--jh-text-muted);
    font-size: 12px;
    padding: 0 10px;
    white-space: nowrap;
}
.blog-actionbar-status:empty { display: none; }
.blog-actionbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 980px;
    border: none;
    background: transparent;
    color: var(--jh-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease;
}
.blog-actionbar-btn:hover { background: rgba(var(--jh-fg-rgb), 0.1); color: var(--jh-text); }
.blog-actionbar-btn .material-symbols-outlined { font-size: 18px; }
.blog-actionbar-btn--primary { background: var(--blog-accent-text); color: #fff; font-weight: 600; }
.blog-actionbar-btn--primary:hover { background: color-mix(in srgb, var(--blog-accent-text) 85%, #fff); color: #fff; }

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 991px) {
    .blog-editor { grid-template-columns: 1fr; gap: 32px; }
    .blog-editor-settings { position: static; display: grid; grid-template-columns: 1fr 1fr; }
    .blog-settings-tips { display: none; }
    .blog-template-grid { grid-template-columns: repeat(4, 1fr); }
    .blog-hero--split { grid-template-columns: 1fr; gap: 32px; }
    .blog-hero-media { aspect-ratio: 4 / 3; order: -1; }
}

@media (max-width: 640px) {
    .blog-page { padding: 48px 16px 80px; }
    .blog-editor { padding: 32px 16px 140px; }
    .blog-editor-settings { grid-template-columns: 1fr; }
    .blog-template-grid { grid-template-columns: 1fr 1fr; }
    .blog-grid { grid-template-columns: 1fr; }
    .blog-prose { font-size: 17px; padding: 40px 16px 16px; }
    .blog-prose .ql-indent-1 { padding-left: 1.5em; }
    .blog-prose .ql-indent-2 { padding-left: 3em; }
    .blog-hero--classic { padding-top: 64px; }
    .blog-hero--minimal { padding-top: 72px; }
    .blog-hero-figure img { border-radius: 18px; }
    .blog-mine-thumb { width: 64px; height: 56px; }
    .blog-toolbar { top: 64px; }
    .blog-actionbar-btn { padding: 10px 14px; }
    .blog-actionbar-status { display: none; }
}

/* =========================================
   最新記事カルーセル (自動スクロール)
   トラックは画面右端まで広げ、左端はページ本文の位置に揃える
   ========================================= */
.blog-carousel {
    --slide-w: min(560px, calc(100vw - 72px));
    --slide-gap: 24px;
    --edge: max(20px, calc((100vw - 1200px) / 2 + 20px));
    margin: 8px calc(50% - 50vw) 72px;
}
.blog-carousel-head { padding: 0 var(--edge); margin-bottom: 20px; }
.blog-section-title {
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0;
}
.blog-section-title--grid { margin-bottom: 24px; }

.blog-carousel-track {
    position: relative;
    display: flex;
    gap: var(--slide-gap);
    padding: 4px var(--edge) 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline-start: var(--edge);
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    outline: none;
}
.blog-carousel-track::-webkit-scrollbar { display: none; }
/* 最後のスライドも左端に揃えられるよう、末尾に余白を足す */
.blog-carousel-track::after {
    content: "";
    flex: 0 0 max(0px, calc(100vw - var(--slide-w) - var(--edge) * 2 - var(--slide-gap)));
}

.blog-slide {
    position: relative;
    flex: 0 0 var(--slide-w);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    border-radius: 28px;
    overflow: hidden;
    background: var(--jh-card-bg);
    transition: background-color 0.3s ease;
}
.blog-slide:hover { background-color: var(--jh-card-hover); }
.blog-slide-media { aspect-ratio: 16 / 9; overflow: hidden; }
.blog-slide-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.blog-slide:hover .blog-slide-media img { transform: scale(1.03); }
.blog-slide-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 28px 32px 32px;
}
.blog-slide-body .blog-kicker { margin: 0; }
.blog-slide-title {
    font-size: clamp(22px, 2.2vw, 28px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin: 0;
}
.blog-slide-excerpt {
    color: var(--jh-text-muted);
    font-size: 16px;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-slide .blog-byline { margin-top: auto; }

/* ── Controls: ドットのピル + 再生ボタン (リファレンスのデザイン) ── */
.blog-carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
    padding: 0 var(--edge);
}
.blog-carousel-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 56px;
    padding: 0 18px;
    border-radius: 980px;
    background: var(--jh-card-bg);
}
.blog-dot {
    position: relative;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* 非アクティブ: 小さな丸 / アクティブ: 横長のピルが進捗で満たされる */
.blog-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 980px;
    background: rgba(var(--jh-text-rgb), 0.4);
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease;
}
.blog-dot:hover::before { background: rgba(var(--jh-text-rgb), 0.7); }
.blog-dot.is-active { width: 64px; }
.blog-dot.is-active::before { width: 56px; background: rgba(var(--jh-text-rgb), 0.4); }
/* 進捗バー: scaleX で伸ばすと端の丸みが潰れるため、幅そのものを
   8px (= 高さ、真円) から伸ばして両端を常に半円に保つ */
.blog-dot-fill {
    position: absolute;
    left: 4px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-radius: 4px;
    background: var(--jh-text);
    opacity: 0;
}
.blog-dot.is-active .blog-dot-fill {
    opacity: 1;
    animation: blog-dot-progress var(--carousel-interval, 5000ms) linear forwards;
    animation-play-state: paused;
}
.blog-carousel.is-playing .blog-dot.is-active .blog-dot-fill { animation-play-state: running; }
@keyframes blog-dot-progress {
    from { width: 8px; }
    to   { width: calc(100% - 8px); } /* ボタン幅から左右 4px の余白を除いた長さ = 背景のピルと同じ */
}
.blog-dot:focus-visible { outline: 2px solid var(--jh-accent); outline-offset: 2px; border-radius: 980px; }

.blog-carousel-play {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--jh-text);
    background: var(--jh-card-bg);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
}
.blog-carousel-play:hover { background-color: var(--jh-card-bg-2); }
.blog-carousel-play:active { transform: scale(0.94); }
.blog-carousel-play:focus-visible { outline: 2px solid var(--jh-accent); outline-offset: 3px; }
.blog-carousel-play svg { width: 26px; height: 26px; fill: currentColor; }
.blog-carousel-play .icon-play { display: none; margin-left: 3px; }
.blog-carousel-play.is-paused .icon-play { display: block; }
.blog-carousel-play.is-paused .icon-pause { display: none; }

@media (max-width: 640px) {
    .blog-carousel { --slide-gap: 14px; margin-bottom: 56px; }
    .blog-slide-body { padding: 22px 22px 24px; }
    .blog-carousel-dots { height: 48px; padding: 0 14px; }
    .blog-carousel-play { width: 48px; height: 48px; }
    .blog-dot.is-active { width: 48px; }
    .blog-dot.is-active::before { width: 40px; }
}

/* =========================================
   ホーム (Blogs のランディング)
   ========================================= */
.landing-hero {
    position: relative;
    overflow: hidden;
    padding-top: 150px;
    padding-bottom: 96px;
    text-align: center;
}
.landing-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 0;
}
.landing-hero-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    /* 画像の明るさを活かすため、文字の背後だけを薄く落とし、下端は次のセクションへ溶かす */
    background:
        radial-gradient(ellipse 50% 40% at 50% 42%, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0) 30%, rgba(var(--jh-bg-rgb), 0) 70%, rgba(var(--jh-bg-rgb), 0.6) 100%);
}
.landing-hero .jh-eyebrow { color: #fff !important; }
.landing-hero-text { position: relative; z-index: 2; pointer-events: none; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35); }
.landing-hero .jh-hero-title { font-size: clamp(44px, 7.5vw, 92px); color: #fff; } /* 写真の上なのでどのスキームでも白 */
.landing-hero .jh-hero-subtitle { color: #f5f5f7; }
.landing-hero-btn {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    margin: 16px 8px 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}
.landing-hero-stats {
    position: relative;
    z-index: 2;
    margin: 32px 0 0;
    font-size: 14px;
    color: rgba(245, 245, 247, 0.7);
    pointer-events: none;
}

.landing-latest { padding-top: 72px; padding-bottom: 24px; }
.landing-latest .blog-carousel { margin-bottom: 32px; }
.landing-more { display: flex; justify-content: center; }

.landing-section { padding-top: 64px; padding-bottom: 32px; }
.landing-section .blog-section-title { margin-bottom: 32px; }

/* UI ツアー動画: 埋め込みに見えないよう、枠・角丸・影なしで画面幅いっぱいに敷く。
   動画の上下には、動画の端と同じ色 (landing-tour.js が再生中に取得) の帯を置き、
   その帯をページの黒へグラデーションで溶かす。動画の境目は同じ色の帯に消え、
   場面が変わるとページの背景ごと色が移り変わって見える。 */
@property --tour-top { syntax: "<color>"; inherits: true; initial-value: #000; }
@property --tour-bottom { syntax: "<color>"; inherits: true; initial-value: #000; }
.landing-tour {
    --tour-top: var(--jh-bg);
    --tour-bottom: var(--jh-bg);
    --tour-wash: clamp(96px, 14vw, 220px);
    position: relative;
    width: 100vw;
    margin: -32px 0 8px calc(50% - 50vw);
    transition: --tour-top 0.45s ease, --tour-bottom 0.45s ease;
}
.landing-tour-wash {
    height: var(--tour-wash);
    pointer-events: none;
}
/* 色の変化を滑らかにするため、直線ではなくイーズのかかった多段グラデーションにする */
.landing-tour-wash--top {
    background: linear-gradient(to bottom,
        transparent 0%,
        color-mix(in srgb, var(--tour-top) 12%, transparent) 30%,
        color-mix(in srgb, var(--tour-top) 45%, transparent) 60%,
        color-mix(in srgb, var(--tour-top) 85%, transparent) 88%,
        var(--tour-top) 100%);
}
.landing-tour-wash--bottom {
    background: linear-gradient(to top,
        transparent 0%,
        color-mix(in srgb, var(--tour-bottom) 12%, transparent) 30%,
        color-mix(in srgb, var(--tour-bottom) 45%, transparent) 60%,
        color-mix(in srgb, var(--tour-bottom) 85%, transparent) 88%,
        var(--tour-bottom) 100%);
}
.landing-tour-media {
    position: relative;
    /* 幅は常に画面いっぱい。高さは 16:9 だが画面の 88% までに抑える (はみ出た分は上下を切る) */
    width: 100%;
    height: min(56.25vw, 88vh);
    overflow: hidden;
    /* 1px の隙間や丸め誤差で黒い線が出ないよう、帯と同じ色を下地にする */
    background: linear-gradient(to bottom, var(--tour-top) 50%, var(--tour-bottom) 50%);
}
.landing-tour-still,
.landing-tour-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.landing-tour-video { opacity: 0; transition: opacity 1s ease; }
/* 帯と動画の境目に、帯の色から透明へのごく短いグラデーションを重ねる。
   読み取った色とブラウザが描く動画の色のわずかな差や、場面の切り替わりの遅れを線にしない。 */
.landing-tour-media::before,
.landing-tour-media::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    height: 48px;
    pointer-events: none;
}
.landing-tour-media::before { top: 0; background: linear-gradient(to bottom, var(--tour-top), transparent); }
.landing-tour-media::after { bottom: 0; background: linear-gradient(to top, var(--tour-bottom), transparent); }
.landing-tour.is-video .landing-tour-still { visibility: hidden; }
.landing-tour.is-video.is-playing .landing-tour-video { opacity: 1; }

.landing-tour-toggle {
    position: absolute;
    right: max(20px, calc(50vw - 580px));
    bottom: calc(var(--tour-wash) + 20px);
    z-index: 1;
    width: 44px;
    height: 44px;
    background: rgba(var(--jh-glass-rgb), 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.landing-tour-toggle svg { width: 20px; height: 20px; }

@media (max-width: 734px) {
    .landing-tour { --tour-wash: 72px; margin: -24px 0 0 calc(50% - 50vw); }
    .landing-tour-toggle { right: 12px; bottom: calc(var(--tour-wash) + 10px); width: 36px; height: 36px; }
    .landing-tour-toggle svg { width: 16px; height: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .landing-tour, .landing-tour-video { transition: none; }
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.landing-feature {
    padding: 36px;
    border-radius: 28px;
    background: var(--jh-card-bg);
}
.landing-feature h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 14px 0 10px; }
.landing-feature p { color: var(--jh-text-muted); font-size: 16px; line-height: 1.6; margin: 0; }
.landing-feature-icon { font-size: 36px; }
.landing-feature--wide {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 40px;
    align-items: center;
}
.landing-template-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.landing-template-row .blog-template-thumb { border-radius: 12px; padding: 10px; gap: 5px; }

.landing-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    counter-reset: none;
}
.landing-steps li { padding: 32px; border-radius: 28px; background: var(--jh-card-bg); }
.landing-steps h3 { font-size: 20px; font-weight: 700; margin: 18px 0 8px; }
.landing-steps p { color: var(--jh-text-muted); font-size: 15px; margin: 0; }
.landing-step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--jh-bg);
    background: var(--jh-text);
}

@media (max-width: 900px) {
    .landing-features { grid-template-columns: 1fr; }
    .landing-feature--wide { grid-template-columns: 1fr; gap: 28px; }
    .landing-steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .landing-hero { padding-top: 120px; padding-bottom: 72px; }
    .landing-feature { padding: 28px 24px; }
    .landing-template-row { gap: 8px; }
}

/* =========================================
   エディタ: 画像のサイズ変更・移動
   ========================================= */
.blog-blocks-editor .ql-editor img { cursor: grab; -webkit-user-drag: none; user-select: none; }
.blog-blocks-editor .ql-editor img.blog-img-selected { outline: 2px solid var(--blog-accent); outline-offset: 2px; }
.blog-img-dragging, .blog-img-dragging * { cursor: grabbing !important; }
/* ドラッグ中のプレビュー幅 (本文の DOM は変えず、コンテナの CSS 変数で見た目だけ変える) */
.ql-container.blog-img-resizing .ql-editor img.blog-img-selected { width: var(--blog-resize-w) !important; height: auto !important; }

.blog-img-overlay {
    position: absolute;
    z-index: 20;
    pointer-events: none;
    border-radius: 18px;
}
.blog-img-overlay.is-moving { opacity: 0.4; }
.blog-img-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--blog-accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    touch-action: none;
}
.blog-img-handle[data-corner="nw"] { left: -7px; top: -7px; cursor: nwse-resize; }
.blog-img-handle[data-corner="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
.blog-img-handle[data-corner="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; }
.blog-img-handle[data-corner="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }
.blog-img-size {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    padding: 3px 10px;
    border-radius: 980px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.blog-img-overlay.is-resizing .blog-img-size { opacity: 1; }

/* =========================================
   数式 (KaTeX) — エディタと記事ページ共通
   ========================================= */
.blog-prose .ql-formula { font-size: 1.05em; }
.blog-prose .ql-math-display {
    display: block;
    margin: 1.6em 0;
    text-align: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
}
.blog-prose .katex { color: var(--jh-text); }
.blog-blocks-editor .ql-editor .ql-formula,
.blog-blocks-editor .ql-editor .ql-math-display {
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}
.blog-blocks-editor .ql-editor .ql-formula:hover,
.blog-blocks-editor .ql-editor .ql-math-display:hover { background: rgba(var(--jh-fg-rgb), 0.08); }

/* Quill のリンク入力ツールチップを日本語に */
.ql-snow .ql-tooltip::before { content: "リンク先:"; }
.ql-snow .ql-tooltip[data-mode="link"]::before { content: "リンク先 URL:"; }
.ql-snow .ql-tooltip a.ql-action::after { content: "編集"; }
.ql-snow .ql-tooltip a.ql-remove::before { content: "解除"; }
.ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: "保存"; }

/* =========================================
   エディタのダイアログ (数式 / Markdown)
   ========================================= */
.blog-dialog {
    width: min(560px, calc(100vw - 32px));
    padding: 0;
    border: none;
    border-radius: 24px;
    background: var(--jh-card-bg);
    color: var(--jh-text);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.blog-dialog--wide { width: min(760px, calc(100vw - 32px)); }
.blog-dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.blog-dialog form { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.blog-dialog-title { font-size: 21px; font-weight: 600; margin: 0; }
.blog-dialog-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--jh-line);
    background: var(--jh-bg);
    color: var(--jh-text);
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
}
.blog-dialog-input:focus { outline: none; border-color: var(--jh-accent); box-shadow: 0 0 0 3px rgba(var(--jh-accent-rgb), 0.35); }
.blog-dialog-input--mono { font-family: var(--jh-font-mono); font-size: 15px; }
.blog-dialog-hint { margin: 0; font-size: 13px; color: var(--jh-text-muted); }
.blog-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.blog-math-preview {
    min-height: 64px;
    padding: 16px;
    border-radius: 12px;
    background: var(--jh-card-bg-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    font-size: 18px;
}
.blog-math-preview:empty::before { content: "プレビュー"; color: var(--jh-text-muted); font-size: 14px; }



/* =========================================
   ブロック (記事ページ・エディタ共通)
   クラスはすべて blocks.py の列挙値から生成される
   ========================================= */
.blog-prose.blog-blocks { max-width: none; padding: 40px 0 24px; }
.blog-blocks .bk {
    --bk-max: var(--blog-measure);
    --bk-pad-y: 0px;
    max-width: calc(var(--bk-max) + 40px);
    margin: 0 auto;
    padding: var(--bk-pad-y) 20px;
    box-sizing: border-box;
}
/* ブロック間の余白 */
.blog-blocks .bk-space-none { margin-block: 0; }
.blog-blocks .bk-space-s { margin-block: 8px; }
.blog-blocks .bk-space-m { margin-block: 20px; }
.blog-blocks .bk-space-l { margin-block: 56px; }
/* 幅 */
.blog-blocks .bk-w-wide { --bk-max: var(--blog-measure-wide); }
.blog-blocks .bk-w-full { --bk-max: 100vw; max-width: none; }

/* 列 */
.bk-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.bk-cols-2 .bk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bk-cols-2.bk-ratio-wide-left .bk-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.bk-cols-2.bk-ratio-wide-right .bk-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.bk-cols-3 .bk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
/* エディタで列の境界をドラッグして決めた比率 (blocks.py の widths → --bk-cols) */
.blog-blocks .bk.bk-custom-cols > .bk-grid { grid-template-columns: var(--bk-cols); }
.bk-valign-top .bk-grid { align-items: start; }
.bk-valign-center .bk-grid { align-items: center; }
.bk-valign-bottom .bk-grid { align-items: end; }
.bk-rule .bk-cell + .bk-cell { border-left: 1px solid var(--jh-line); padding-left: 32px; }
.bk-cols-3.bk-rule .bk-cell + .bk-cell { padding-left: 28px; }
.bk-cell { min-width: 0; }
.bk-cell > :first-child { margin-top: 0; }
.bk-cell > :last-child { margin-bottom: 0; }
.bk-cell img { display: inline-block; }

/* 文字サイズ */
.bk-size-s { font-size: 16px; line-height: 1.7; }
.bk-size-l { font-size: 23px; line-height: 1.6; }
.bk-size-l h2 { font-size: 40px; }

/* 背景 (色面のあるブロックは内側に余白と角丸を持つ) */
.blog-blocks .bk[class*="bk-bg-"]:not(.bk-bg-none) { --bk-pad-y: 40px; }
.blog-blocks .bk-bg-gray,
.blog-blocks .bk-bg-tint,
.blog-blocks .bk-bg-accent,
.blog-blocks .bk-bg-light {
    padding-inline: 44px;
    border-radius: 28px;
    max-width: calc(var(--bk-max) + 88px);
}
.blog-blocks .bk-w-full[class*="bk-bg-"]:not(.bk-bg-none) { border-radius: 0; padding-inline: max(20px, calc((100vw - 1080px) / 2)); }
.bk-bg-gray { background: var(--jh-card-bg); }
.bk-bg-tint { background: color-mix(in srgb, var(--blog-accent) 16%, var(--jh-surface-sunken)); }
.bk-bg-accent { background: var(--blog-accent); color: #fff; }
.bk-bg-accent :is(h2, h3, strong, a, blockquote) { color: #fff; }
.bk-bg-accent a { text-decoration-color: rgba(255, 255, 255, 0.6); }
.bk-bg-accent li::marker, .bk-bg-accent .ql-editor li > .ql-ui::before { color: #fff; }
.bk-bg-accent blockquote { border-left-color: #fff; }
.bk-bg-light { background: #f5f5f7; color: #1d1d1f; }
.bk-bg-light :is(h2, h3, strong, blockquote, .katex) { color: #1d1d1f; }
.bk-bg-light code { background: rgba(0, 0, 0, 0.06); color: #1d1d1f; }
.bk-bg-light .bk-cell + .bk-cell { border-color: #d2d2d7; }
.bk-bg-light .ql-editor.ql-blank::before { color: #86868b; }

/* コールアウト */
.blog-blocks .bk-callout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.blog-blocks .bk-callout.bk-bg-none { background: var(--jh-card-bg); border-radius: 20px; --bk-pad-y: 24px; padding-inline: 28px; max-width: calc(var(--bk-max) + 56px); }
.bk-callout-icon { font-size: 28px; line-height: 1.3; background: none; border: none; padding: 0; color: inherit; }
button.bk-callout-icon { cursor: pointer; border-radius: 8px; }
button.bk-callout-icon:hover { background: rgba(var(--jh-fg-rgb), 0.08); }

/* 引用 (プルクオート) */
.blog-blocks .bk-quote .bk-cell {
    font-family: var(--jh-font-display);
    font-size: clamp(26px, 3.2vw, 36px);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-align: center;
    color: var(--jh-text);
}
.blog-blocks .bk-quote.bk-bg-light .bk-cell { color: #1d1d1f; }
.blog-blocks .bk-quote .bk-cell::before {
    content: "“";
    display: block;
    font-size: 2.2em;
    line-height: 0.6;
    margin-bottom: 0.15em;
    color: var(--blog-accent);
}
.blog-blocks .bk-quote.bk-bg-accent .bk-cell::before { color: #fff; }

/* 区切り線・余白・ボタン */
.blog-blocks .bk-divider hr { margin: 1.2em 0; }
.blog-blocks .bk-divider--line hr { height: 1px; background: var(--jh-line); }
/* 「ドット」を選んだ区切りブロックだけ ··· で表示する */
.blog-blocks .bk-divider--dots hr { height: auto; background: none; text-align: center; }
.blog-blocks .bk-divider--dots hr::after {
    content: "···";
    letter-spacing: 0.8em;
    font-size: 24px;
    color: var(--jh-text-muted);
}
.bk-spacer--s { height: 24px; }
.bk-spacer--m { height: 56px; }
.bk-spacer--l { height: 112px; }
.bk-button { display: flex; }
.bk-align-left { justify-content: flex-start; }
.bk-align-center { justify-content: center; }
.bk-align-right { justify-content: flex-end; }

/* 最初の段落のドロップキャップ (ミニマル) */
.blog-blocks.blog-prose--dropcap > .bk:first-child .bk-cell:first-child > p:first-of-type::first-letter {
    float: left;
    font-family: var(--blog-serif);
    font-size: 4.2em;
    line-height: 0.85;
    font-weight: 600;
    padding: 0.08em 0.1em 0 0;
    color: var(--blog-accent-text);
}

@media (max-width: 734px) {
    .bk-cols-2 .bk-grid, .bk-cols-3 .bk-grid,
    .bk-cols-2.bk-ratio-wide-left .bk-grid, .bk-cols-2.bk-ratio-wide-right .bk-grid { grid-template-columns: minmax(0, 1fr); }
    .blog-blocks .bk.bk-custom-cols > .bk-grid { grid-template-columns: minmax(0, 1fr); }
    .bk-rule .bk-cell + .bk-cell { border-left: none; padding-left: 0; border-top: 1px solid var(--jh-line); padding-top: 24px; }
    .blog-blocks .bk-bg-gray, .blog-blocks .bk-bg-tint, .blog-blocks .bk-bg-accent, .blog-blocks .bk-bg-light { padding-inline: 24px; border-radius: 22px; }
    .bk-size-l { font-size: 20px; }
}

/* =========================================
   ブロックエディタ固有
   ========================================= */
.blog-blocks-editor { padding: 16px 0 8px; }
.blog-blocks-editor .bk-edit { position: relative; }
.blog-blocks-editor .bk-edit.is-dragging { opacity: 0.35; }
.bk-gutter {
    position: absolute;
    top: 0;
    left: -60px;
    display: flex;
    gap: 2px;
    padding-top: calc(var(--bk-gutter-top, 0px));
    opacity: 0;
    /* 見えていないときは押せないようにする (スマホで前のブロックの下端を触ったときに誤って開かないように) */
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s;
}
.blog-blocks-editor .bk-edit:hover > .bk-gutter,
.blog-blocks-editor .bk-edit:focus-within > .bk-gutter { opacity: 1; visibility: visible; }
.bk-gutter button {
    width: 26px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--jh-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.bk-gutter button:hover { background: rgba(var(--jh-fg-rgb), 0.1); color: var(--jh-text); }
.bk-gutter .bk-handle { cursor: grab; touch-action: none; }
.bk-gutter .material-symbols-outlined { font-size: 20px; }
/* エディタではブロックの境界と列を薄く示す */
.blog-blocks-editor .bk-edit:hover > .bk:not([class*="bk-bg-"]),
.blog-blocks-editor .bk-edit:hover > .bk.bk-bg-none { box-shadow: inset 0 0 0 1px rgba(var(--jh-fg-rgb), 0.06); border-radius: 12px; }
.blog-blocks-editor .bk-cols-2 .bk-cell, .blog-blocks-editor .bk-cols-3 .bk-cell {
    outline: 1px dashed rgba(var(--jh-fg-rgb), 0.14);
    outline-offset: 8px;
    border-radius: 4px;
    min-height: 3em;
}
.blog-blocks-editor .bk-bg-light .bk-cell { outline-color: rgba(0, 0, 0, 0.15); }
/* 区切り線ブロックは線の上下の余白も含めてつかめるようにする (余白が外へ抜けると 1px の高さになり、⋮⋮ が隣のブロックに隠れる) */
.blog-blocks-editor .bk-divider { display: flow-root; }
.blog-blocks-editor .bk-spacer { border: 1px dashed rgba(var(--jh-fg-rgb), 0.12); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.bk-spacer-label { font-size: 12px; color: var(--jh-text-muted); }
.blog-blocks-editor .bk-button button { pointer-events: auto; }
.bk-drop-line {
    position: absolute;
    z-index: 50;
    height: 3px;
    border-radius: 2px;
    background: var(--blog-accent, var(--jh-accent));
    pointer-events: none;
}
.blog-add-block {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px auto 0;
    max-width: calc(var(--blog-measure) + 40px);
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    background: none;
    color: var(--jh-text-muted);
    font-size: 15px;
    cursor: pointer;
    text-align: left;
}
.blog-add-block:hover { background: rgba(var(--jh-fg-rgb), 0.05); color: var(--jh-text); }

/* ポップオーバー (追加メニュー・ブロック設定) */
.bk-popover {
    position: fixed;
    z-index: 10050;
    width: 320px;
    max-width: calc(100vw - 24px);
    max-height: min(560px, calc(100vh - 24px));
    overflow-y: auto;
    overscroll-behavior: contain; /* 中をスクロールしきっても後ろのページを動かさない */
    padding: 10px;
    border-radius: 16px;
    background: var(--jh-card-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(var(--jh-fg-rgb), 0.06);
    color: var(--jh-text);
    font-size: 14px;
}
.bk-inserter-search {
    width: 100%;
    padding: 9px 12px;
    margin-bottom: 6px;
    border: none;
    border-radius: 10px;
    background: var(--jh-card-bg-2);
    color: var(--jh-text);
    font-size: 14px;
    outline: none;
}
.bk-inserter-list { list-style: none; margin: 0; padding: 0; }
.bk-inserter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
}
.bk-inserter-item.is-active { background: rgba(var(--jh-fg-rgb), 0.08); }
@media (hover: hover) {
    .bk-inserter-item:hover { background: rgba(var(--jh-fg-rgb), 0.08); }
}
.bk-inserter-item .material-symbols-outlined {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--jh-card-bg-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.bk-inserter-item strong { display: block; font-weight: 600; font-size: 14px; }
.bk-inserter-item small { display: block; color: var(--jh-text-muted); font-size: 12px; }
.bk-inserter-empty { padding: 12px; color: var(--jh-text-muted); }

.bk-menu-title { font-size: 13px; font-weight: 600; color: var(--jh-text-muted); margin: 4px 6px 10px; }
.bk-menu-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 6px;
}
.bk-menu-label { color: var(--jh-text-muted); font-size: 13px; }
.bk-seg { display: flex; width: 100%; }
.bk-seg label { flex: 1; }
.bk-seg span { text-align: center; padding: 5px 6px; font-size: 13px; }
.bk-menu-input {
    width: 100%;
    padding: 7px 10px;
    border: none;
    border-radius: 8px;
    background: var(--jh-card-bg-2);
    color: var(--jh-text);
    font-size: 14px;
    outline: none;
}
.bk-menu-input:focus { box-shadow: 0 0 0 2px var(--jh-accent); }
.bk-menu-input--icon { width: 64px; text-align: center; font-size: 18px; }
.bk-swatches { display: flex; gap: 8px; }
.bk-swatches label { position: relative; cursor: pointer; }
.bk-swatches input { position: absolute; opacity: 0; pointer-events: none; }
.bk-swatch {
    display: block;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(var(--jh-fg-rgb), 0.2);
}
.bk-swatch--none { background: linear-gradient(135deg, transparent 45%, #ff453a 45%, #ff453a 55%, transparent 55%), #000; }
.bk-swatch--gray { background: var(--jh-card-bg); }
.bk-swatch--tint { background: color-mix(in srgb, var(--blog-accent) 30%, var(--jh-card-bg)); }
.bk-swatch--accent { background: var(--blog-accent); }
.bk-swatch--light { background: #f5f5f7; }
.bk-swatches input:checked + .bk-swatch { box-shadow: 0 0 0 2px var(--jh-card-bg), 0 0 0 4px var(--jh-text); }
.bk-swatches input:focus-visible + .bk-swatch { outline: 2px solid var(--jh-accent); outline-offset: 3px; }
.bk-menu-toggles { display: flex; flex-direction: column; gap: 8px; padding: 8px 6px 4px; }
.bk-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.bk-switch input { position: absolute; opacity: 0; pointer-events: none; }
.bk-switch-track {
    position: relative;
    width: 36px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 11px;
    background: var(--jh-card-bg-3);
    transition: background-color 0.2s ease;
}
.bk-switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}
.bk-switch input:checked + .bk-switch-track { background: #30d158; }
.bk-switch input:checked + .bk-switch-track::after { transform: translateX(14px); }
.bk-switch input:focus-visible + .bk-switch-track { outline: 2px solid var(--jh-accent); outline-offset: 2px; }
.bk-menu-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(var(--jh-fg-rgb), 0.08);
}
.bk-menu-actions button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--jh-text);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}
.bk-menu-actions button:hover:not(:disabled) { background: rgba(var(--jh-fg-rgb), 0.08); }
.bk-menu-actions button:disabled { opacity: 0.35; cursor: default; }
.bk-menu-actions .is-danger { color: var(--jh-red); }
.bk-menu-actions .material-symbols-outlined { font-size: 18px; }

@media (max-width: 1180px) {
    /* ガター (＋ ⋮⋮) が画面外に出ないよう内側へ */
    .bk-gutter { left: -4px; top: -30px; }
}

/* =========================================
   スマホ・タッチ端末向けの調整 (エディタ)
   ========================================= */
/* シート (狭い画面ではメニューを画面下から出す) */
.bk-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: rgba(0, 0, 0, 0.5);
    -webkit-tap-highlight-color: transparent;
}
.bk-sheet-backdrop[hidden] { display: none; }
.bk-popover.is-sheet {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    max-width: none;
    max-height: min(75vh, 560px);
    padding: 22px 12px calc(12px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(var(--jh-fg-rgb), 0.06);
}
/* つまみ (シートであることを示す飾り) */
.bk-popover.is-sheet::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 5px;
    border-radius: 3px;
    background: rgba(var(--jh-fg-rgb), 0.2);
    transform: translateX(-50%);
}
.bk-popover.is-sheet .bk-inserter-item { padding: 10px; }
.bk-popover.is-sheet .bk-seg span { padding-block: 8px; }
.bk-popover.is-sheet .bk-swatches { gap: 10px; flex-wrap: wrap; }
.bk-popover.is-sheet .bk-menu-actions button { padding-block: 12px; }

@media (pointer: coarse) {
    /* 16px 未満の入力欄は iOS がフォーカス時に画面を拡大してしまい、レイアウトが崩れて見える */
    .bk-inserter-search, .bk-menu-input, .bk-demo-field textarea { font-size: 16px; }
    /* ＋ と ⋮⋮ を指で押しやすい大きさに */
    .bk-gutter button { width: 32px; height: 32px; }
    .bk-inserter-item, .bk-menu-actions button { -webkit-tap-highlight-color: transparent; }
}
@media (max-width: 1180px) and (pointer: coarse) {
    .bk-gutter { top: -34px; }
}

@media (max-width: 640px) {
    /* ツールバーは 1 行にして横スクロール (折り返すと画面の上部を大きく覆ってしまう) */
    .blog-toolbar {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        padding: 4px 6px;
        border-radius: 14px;
    }
    .blog-toolbar::-webkit-scrollbar { display: none; }
    .blog-toolbar .tb-group { flex-shrink: 0; }
    .blog-toolbar button { flex-shrink: 0; min-width: 36px; height: 36px; }
}
.blog-blocks .bk-button a { text-decoration: none; }
.blog-blocks .bk-button .jh-btn-primary { color: #fff; }
.bk-menu { width: 348px; }
.bk-seg span { white-space: nowrap; font-size: 12px; padding: 5px 4px; }


/* =========================================
   表示幅 (標準 = ページいっぱい / 狭幅 = 細い段組)
   記事ページは .blog-width-*、エディタはフォームの data-width で切り替える
   ========================================= */
.blog-width-standard,
#blog-post-form[data-width="standard"] { --blog-measure: 1200px; --blog-measure-wide: 1440px; --blog-canvas: 1240px; }
.blog-width-narrow,
#blog-post-form[data-width="narrow"] { --blog-measure: 720px; --blog-measure-wide: 1080px; --blog-canvas: 780px; }
#blog-post-form {
    transition:
        --blog-measure 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
        --blog-measure-wide 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
        --blog-canvas 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
    #blog-post-form { transition: none; }
}

/* 設定カード内の区切り線と表示幅オプション */
.blog-settings-divider {
    border: none;
    height: 1px;
    opacity: 1;
    background: rgba(var(--jh-fg-rgb), 0.1);
    margin: 20px 0 18px;
}
.blog-width-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.blog-width-option {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border-radius: 14px;
    border: 1.5px solid transparent;
    background: rgba(var(--jh-fg-rgb), 0.04);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.blog-width-option:hover { background: rgba(var(--jh-fg-rgb), 0.08); }
.blog-width-option:has(input:checked) {
    border-color: var(--blog-accent);
    background: color-mix(in srgb, var(--blog-accent) 10%, transparent);
}
.blog-width-option:has(input:focus-visible) { outline: 2px solid var(--blog-accent); outline-offset: 2px; }
.blog-width-option input { position: absolute; opacity: 0; pointer-events: none; }
.blog-width-name { font-size: 13px; font-weight: 600; margin-top: 6px; }
.blog-width-desc { font-size: 11px; color: var(--jh-text-muted); line-height: 1.3; }
/* ミニプレビュー: 画面 (枠) の中の本文 (線) の幅で違いを見せる */
.blog-width-thumb {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    aspect-ratio: 4 / 3;
    padding: 8px;
    border-radius: 8px;
    background: var(--jh-surface-sunken);
}
.blog-width-thumb b { display: block; height: 4px; border-radius: 2px; background: rgba(var(--jh-text-rgb), 0.55); transition: width 0.4s ease; }
.blog-width-thumb--standard b { width: 100%; }
.blog-width-thumb--standard b:last-child { width: 70%; align-self: flex-start; }
.blog-width-thumb--narrow b { width: 44%; }
.blog-width-thumb--narrow b:last-child { width: 30%; }
.blog-width-option:has(input:checked) .blog-width-thumb b { background: var(--blog-accent); }

/* 標準幅では編集エリアが画面の左端まで広がり、ブロック左側の「＋ ⋮⋮」(ガター) が
   画面外に出てしまう。ガターの幅だけ編集エリアの左に余白を取り、常に表示されるようにする。
   (1180px 以下ではガターはブロックの上に移るので不要) */
@media (min-width: 1181px) {
    .blog-editor-canvas { transition: padding-left 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
    #blog-post-form[data-width="standard"] .blog-editor-canvas { padding-left: 60px; }
}
@media (min-width: 1181px) and (prefers-reduced-motion: reduce) {
    .blog-editor-canvas { transition: none; }
}

/* =========================================
   HTML / CSS デモブロック (記事ページ・エディタ共通)
   ========================================= */
/* エディタではブロック自体にも種類名のクラス (.bk-demo) が付くので、カードの見た目は .bk 以外に限る */
.bk-demo:not(.bk) {
    margin-inline: auto;
    border-radius: 20px;
    overflow: hidden;
    background: var(--jh-card-bg);
    text-align: left;
}
/* ── 表示・コピーのメニュー ──────────────────────
   カードにホバーすると右上に丸いボタンがぼんやり現れ、押すと左へ滑らかに展開する。
   背景はヘッダー (縮小ナビ .jh-glass-navbar) と同じすりガラス。 */
.bk-demo:not(.bk) { position: relative; }
.bk-demo-menu {
    --bk-glass-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    position: absolute;
    z-index: 5;
    top: 14px;
    right: 14px;
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 8px;
    max-width: calc(100% - 28px);
}
.bk-demo-fab,
.bk-demo-menu-panel {
    background: var(--jh-glass);
    backdrop-filter: saturate(180%) blur(20px) brightness(0.85);
    -webkit-backdrop-filter: saturate(180%) blur(20px) brightness(0.85);
    border: 1px solid var(--jh-glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.bk-demo-fab {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    color: var(--jh-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* 普段は見えず、カードのホバーでぼんやり現れる */
    opacity: 0;
    filter: blur(6px);
    transform: scale(0.88);
    pointer-events: none;
    transition: opacity 0.45s var(--bk-glass-ease), filter 0.45s var(--bk-glass-ease), transform 0.45s var(--bk-glass-ease), background-color 0.2s ease;
}
.bk-demo:hover .bk-demo-fab,
.bk-demo:focus-within .bk-demo-fab,
.bk-demo-menu.is-open .bk-demo-fab {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
    pointer-events: auto;
}
.bk-demo-fab:hover { background: rgba(58, 58, 60, 0.7); }
.bk-demo-fab:focus-visible { outline: 2px solid var(--jh-accent); outline-offset: 3px; }

/* ハンバーガー → ✕ */
.bk-burger { position: relative; width: 16px; height: 12px; }
.bk-burger i {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1.6px;
    border-radius: 1px;
    background: currentColor;
    transition: transform 0.35s var(--bk-glass-ease), opacity 0.2s ease, top 0.35s var(--bk-glass-ease);
}
.bk-burger i:nth-child(1) { top: 0; }
.bk-burger i:nth-child(2) { top: 5.2px; }
.bk-burger i:nth-child(3) { top: 10.4px; }
.bk-demo-menu.is-open .bk-burger i:nth-child(1) { top: 5.2px; transform: rotate(45deg); }
.bk-demo-menu.is-open .bk-burger i:nth-child(2) { opacity: 0; transform: scaleX(0.2); }
.bk-demo-menu.is-open .bk-burger i:nth-child(3) { top: 5.2px; transform: rotate(-45deg); }

/* 展開するパネル: ボタンの位置から左へ伸びる */
.bk-demo-menu-panel {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
    min-height: 44px;
    padding: 5px 0;
    border-radius: 22px;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    filter: blur(6px);
    transform: translateX(12px) scale(0.96);
    transform-origin: right center;
    pointer-events: none;
    /* 閉じている間はボタンに Tab で移動できないようにする (閉じるアニメーションの後に隠す) */
    visibility: hidden;
    transition: max-width 0.5s var(--bk-glass-ease), opacity 0.35s var(--bk-glass-ease),
        filter 0.4s var(--bk-glass-ease), transform 0.5s var(--bk-glass-ease), padding 0.5s var(--bk-glass-ease),
        visibility 0s linear 0.5s;
}
.bk-demo-menu.is-open .bk-demo-menu-panel {
    visibility: visible;
    transition-delay: 0s;
    padding: 5px 6px;
    max-width: 640px;
    opacity: 1;
    filter: blur(0);
    transform: none;
    pointer-events: auto;
}
.bk-demo-menu-panel > * { flex-shrink: 0; }
.bk-demo-menu-panel > .bk-demo-seg::before,
.bk-demo-menu-panel > .bk-demo-copy::before {
    /* グループ間の細い区切り */
    content: "";
    width: 1px;
    height: 18px;
    margin-right: 4px;
    background: rgba(var(--jh-fg-rgb), 0.16);
}
.bk-demo-tabs { display: inline-flex; padding: 2px; border-radius: 16px; background: rgba(var(--jh-fg-rgb), 0.08); }
.bk-demo-tabs button {
    padding: 5px 12px;
    border: none;
    border-radius: 14px;
    background: none;
    color: rgba(var(--jh-text-rgb), 0.72);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.bk-demo-tabs button:hover { color: var(--jh-text); }
.bk-demo-tabs button[aria-selected="true"] { background: rgba(var(--jh-fg-rgb), 0.22); color: var(--jh-text); }
.bk-demo-seg { display: inline-flex; align-items: center; gap: 2px; }
.bk-demo-seg[hidden] { display: none; }
.bk-demo-seg button, .bk-demo-copy {
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    border: none;
    border-radius: 16px;
    background: none;
    color: rgba(var(--jh-text-rgb), 0.72);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.bk-demo-seg button:hover, .bk-demo-copy:hover { background: rgba(var(--jh-fg-rgb), 0.1); color: var(--jh-text); }
.bk-demo-seg button[aria-pressed="true"] { color: var(--jh-accent); }
.bk-demo-seg .material-symbols-outlined, .bk-demo-copy .material-symbols-outlined { font-size: 18px; }
.bk-demo-copy { color: var(--jh-text); padding: 0 12px 0 8px; }
.bk-demo-copy.is-done { color: var(--jh-green); }

/* ホバーできない端末 (スマホ等) ではボタンを常に薄く表示 */
@media (hover: none) {
    .bk-demo-fab { opacity: 0.85; filter: none; transform: none; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .bk-demo-fab, .bk-demo-menu-panel, .bk-burger i { transition: none; filter: none; }
}

/* プレビュー: 高さは下端をドラッグして変えられる */
.bk-demo-stage {
    position: relative;
    display: flex;
    justify-content: center;
    min-height: 160px;
    max-height: 1200px;
    resize: vertical;
    overflow: hidden;
    background: var(--jh-surface);
}
.bk-demo-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: transparent;
    transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bk-demo-panel[hidden] { display: none; }

/* コード表示 */
.blog-prose .bk-demo-code {
    margin: 0;
    padding: 72px 24px 24px;
    border: none;
    border-radius: 0;
    background: #0d1117;
    max-height: 520px;
    overflow: auto;
    white-space: pre;
    font-size: 14px;
    line-height: 1.6;
}
.blog-prose .bk-demo-code code { background: none; padding: 0; font-size: inherit; }
.blog-prose .bk-demo-code code.hljs { padding: 0; background: none; }

/* エディタ: カードの幅 (左右の端をドラッグ。中央寄せのまま広がる / 縮む) */
.bk-demo-sizer {
    position: relative;
    margin-inline: auto;
    transition: max-width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bk-demo-sizer.is-resizing { transition: none; user-select: none; }
.bk-demo-sizer.is-resizing iframe { pointer-events: none; }
.bk-demo-resize {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    z-index: 3;
    cursor: ew-resize;
    touch-action: none;
    outline: none;
}
.bk-demo-resize--left { left: -20px; }
.bk-demo-resize--right { right: -20px; }
/* つまみ: 縦長の丸いピル。ブロックにホバーすると現れる */
.bk-demo-resize::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 44px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.28);
    transform: translate(-50%, -50%) scaleY(0.8);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease;
}
.bk-edit:hover .bk-demo-resize::after { opacity: 1; transform: translate(-50%, -50%); }
.bk-demo-resize:hover::after,
.bk-demo-resize:focus-visible::after,
.is-resizing .bk-demo-resize::after { opacity: 1; background: #fff; transform: translate(-50%, -50%) scaleY(1.15); }
.bk-demo-resize:focus-visible::after { box-shadow: 0 0 0 3px var(--jh-accent); }
/* ドラッグ中の幅の表示 */
.bk-demo-size {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 4;
    padding: 5px 12px;
    border-radius: 980px;
    background: rgba(var(--jh-glass-rgb), 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: #fff;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 6px);
    transition: opacity 0.2s ease, transform 0.25s ease;
}
.bk-demo-sizer.is-resizing .bk-demo-size,
.bk-demo-sizer:has(.bk-demo-resize:focus-visible) .bk-demo-size { opacity: 1; transform: translate(-50%, 0); }
@media (hover: none) {
    .bk-demo-resize::after { opacity: 0.6; transform: translate(-50%, -50%); }
}

/* エディタ: HTML と CSS を並べて入力 */
.bk-demo--edit .bk-demo-editors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(255, 255, 255, 0.08);
}
.bk-demo-field { display: flex; flex-direction: column; margin: 0; background: #0d1117; }
.bk-demo-field > span {
    padding: 8px 14px 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--jh-text-muted);
}
.bk-demo-field textarea {
    min-height: 180px;
    padding: 8px 14px 14px;
    border: none;
    outline: none;
    resize: vertical;
    background: transparent;
    color: #e6edf3;
    font-family: var(--jh-font-mono);
    font-size: 13px;
    line-height: 1.6;
    tab-size: 2;
    white-space: pre;
}
.bk-demo-field:focus-within { box-shadow: inset 0 0 0 2px var(--jh-accent); }

@media (max-width: 734px) {
    .bk-demo--edit .bk-demo-editors { grid-template-columns: 1fr; }
    /* 狭い画面では幅の変更は使わない。左右の端のつまみが縦スクロールの邪魔になるので隠す */
    .bk-demo-resize { display: none; }
    .bk-demo-menu-panel > .bk-demo-seg { display: none; } /* 狭い画面では幅の切り替えを省く */
    /* コピーはアイコンだけにして 1 行に収める (文言は読み上げ用に残す) */
    .bk-demo-copy { padding: 0 10px; }
    .bk-demo-copy [data-copy-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* スマートフォン: 16px 未満の入力欄は iOS がフォーカス時に画面を拡大してしまう */
@media (max-width: 734px) {
    .blog-dialog-input--mono,
    .bk-inserter-search,
    .bk-menu-input,
    .bk-demo-field textarea { font-size: 16px; }
    .bk-popover { max-width: calc(100vw - 24px); }
}

/* =========================================
   アクセントカラー
   記事・カードなど --blog-accent を受け取る要素で派生色を定義し、
   光・ライン・面の色としてさりげなく全体に効かせる。
   アクセントなし (.blog-accent-none) では同じ変数を白とグレーにして、
   同じ装飾をモノトーンで見せる。
   ========================================= */
.blog-article,
.blog-progress,
.blog-card,
.blog-slide,
.blog-mine-item,
#blog-post-form {
    --blog-accent-ink: #fff; /* アクセント色の面に載せる文字色 */
    /* 文字に使うアクセント。ライトのスキームでは明るいアクセントに黒を混ぜて読める濃さにする (--jh-accent-shade) */
    --blog-accent-text: color-mix(in srgb, var(--blog-accent), #000 var(--jh-accent-shade));
    --blog-accent-soft: color-mix(in srgb, color-mix(in srgb, var(--blog-accent) 72%, #fff), #000 var(--jh-accent-shade));
    --blog-glow: color-mix(in srgb, var(--blog-accent) 38%, transparent);
    --blog-tint: color-mix(in srgb, var(--blog-accent) 16%, transparent);
    --blog-tint-faint: color-mix(in srgb, var(--blog-accent) 7%, transparent);
    --blog-line: color-mix(in srgb, var(--blog-accent) 45%, transparent);
}
/* エディタのフォームは ID で派生色を定義しているので、同じ強さで上書きする */
.blog-accent-none,
#blog-post-form.blog-accent-none {
    /* 中立の白 (Post.ACCENT_NEUTRAL) はライトの背景では見えないので、スキームの文字色に置き換える (ダークでは同じ色) */
    --blog-accent: var(--jh-text) !important;
    --blog-accent-ink: var(--jh-bg);
    --blog-accent-soft: var(--jh-text);
    --blog-glow: rgba(var(--jh-fg-rgb), 0.08);
    --blog-tint: rgba(var(--jh-fg-rgb), 0.07);
    --blog-tint-faint: rgba(var(--jh-fg-rgb), 0.03);
    --blog-line: rgba(var(--jh-fg-rgb), 0.28);
}

/* ── 読了プログレス (画面上端の細いライン) ── */
.blog-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    height: 3px;
    pointer-events: none;
}
.blog-progress span {
    display: block;
    height: 100%;
    transform: scaleX(var(--blog-read, 0));
    transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--blog-accent-soft), var(--blog-accent));
    box-shadow: 0 0 12px var(--blog-glow);
}

/* ── ヘッダーの後ろのやわらかな光 ── */
.blog-article { position: relative; }
.blog-article::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -48px;
    left: 50%;
    width: min(1440px, 150vw);
    height: 900px;
    transform: translateX(-50%);
    background:
        radial-gradient(38% 50% at 28% 22%, var(--blog-glow), transparent 72%),
        radial-gradient(34% 42% at 74% 8%, var(--blog-tint), transparent 70%);
    filter: blur(24px);
    pointer-events: none;
}
/* 光を黒い背景の上に描くため、記事を重なりの基準にする。横にはみ出た光は切り取って横スクロールを出さない */
.blog-article { isolation: isolate; overflow-x: clip; }

/* Feature: カバーの下端に色を差してから黒に落とす */
.blog-hero-scrim {
    background:
        radial-gradient(70% 55% at 22% 92%, var(--blog-glow), transparent 70%),
        linear-gradient(180deg, rgba(var(--jh-bg-rgb), 0) 30%, rgba(var(--jh-bg-rgb), 0.55) 65%, var(--jh-bg) 100%);
}
.blog-accent-none .blog-hero-scrim {
    background: linear-gradient(180deg, rgba(var(--jh-bg-rgb), 0) 30%, rgba(var(--jh-bg-rgb), 0.55) 65%, var(--jh-bg) 100%);
}

/* カバー画像のまわりに色の影 */
.blog-hero-figure img,
.blog-hero-media { box-shadow: 0 48px 120px -56px var(--blog-glow); }

/* 画像なしのカバー: アクセントのグラデーションの面にする */
.blog-cover-fallback {
    background:
        radial-gradient(90% 90% at 18% 8%, color-mix(in srgb, var(--blog-accent) 58%, var(--jh-card-bg)), transparent 62%),
        radial-gradient(80% 90% at 100% 100%, color-mix(in srgb, var(--blog-accent) 32%, var(--jh-surface-sunken)), transparent 70%),
        var(--jh-surface);
}
.blog-cover-fallback span { color: rgba(var(--jh-text-rgb), 0.92); text-shadow: 0 8px 40px rgba(var(--jh-bg-rgb), 0.35); }

.blog-rule { background: linear-gradient(90deg, var(--blog-accent), var(--blog-accent-soft)); border-radius: 2px; }

/* ── 本文 ── */
.blog-article ::selection { background: color-mix(in srgb, var(--blog-accent) 45%, transparent); color: #fff; }
.blog-accent-none ::selection { background: rgba(var(--jh-fg-rgb), 0.28); }

.blog-prose a {
    color: var(--blog-accent-soft);
    text-decoration-color: var(--blog-line);
    text-decoration-thickness: 2px;
    border-radius: 4px;
    transition: background-color 0.2s ease, text-decoration-color 0.2s ease;
}
.blog-prose a:hover { background: var(--blog-tint); text-decoration-color: var(--blog-accent); }

.blog-prose blockquote {
    padding: 18px 24px 18px 26px;
    border-radius: 0 18px 18px 0;
    background: linear-gradient(90deg, var(--blog-tint), var(--blog-tint-faint) 55%, transparent);
}
.blog-prose code { background: var(--blog-tint); color: var(--blog-accent-soft); }
.blog-prose pre code { color: inherit; }
.blog-prose hr { background: linear-gradient(90deg, transparent, var(--blog-line) 50%, transparent); }
.blog-prose ol > li::marker { color: var(--blog-accent-soft); font-weight: 600; }

/* ── 著者 ── */
.blog-avatar {
    background: color-mix(in srgb, var(--blog-accent) 28%, var(--jh-card-bg-2));
    box-shadow: 0 0 0 2px var(--blog-line);
}
.blog-author-card {
    background:
        radial-gradient(120% 160% at 0% 0%, var(--blog-tint), transparent 55%),
        var(--jh-card-bg);
    box-shadow: inset 0 0 0 1px var(--blog-tint);
}
.blog-author-card .blog-avatar--lg {
    background: linear-gradient(140deg, var(--blog-accent-text), color-mix(in srgb, var(--blog-accent-text) 40%, var(--jh-card-bg)));
    color: var(--blog-accent-ink);
    box-shadow: 0 12px 32px -12px var(--blog-glow);
}

/* ── カード (一覧・ホーム・プロフィール) ── */
.blog-card,
.blog-slide { transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.3s ease, box-shadow 0.3s ease; }
.blog-card-body,
.blog-slide-body { background: linear-gradient(180deg, var(--blog-tint-faint), transparent 70%); }
.blog-card::after,
.blog-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px transparent;
    pointer-events: none;
    transition: box-shadow 0.3s ease;
}
.blog-card:hover,
.blog-slide:hover { box-shadow: 0 28px 64px -28px var(--blog-glow); }
.blog-card:hover::after,
.blog-slide:hover::after { box-shadow: inset 0 0 0 1px var(--blog-line); }

/* ── エディタ ── */
.blog-actionbar-btn--primary,
.blog-actionbar-btn--primary:hover { color: var(--blog-accent-ink); }
.blog-accent-swatch-none {
    background:
        linear-gradient(135deg, transparent calc(50% - 1px), #ff453a calc(50% - 1px), #ff453a calc(50% + 1px), transparent calc(50% + 1px)),
        var(--jh-card-bg-3);
}

/* =========================================
   いじれるデモ: Before / After 比較とコントロール (記事ページ・エディタ共通)
   ========================================= */
@property --split {
    syntax: '<percentage>';
    inherits: true;
    initial-value: 50%;
}
/* 2 枚の iframe を同じマスに重ね、「変更後」を境界より右だけ見せる */
.bk-demo-stage--compare {
    display: grid;
    grid-template: 100% / 100%;
    justify-content: stretch;
}
.bk-demo-stage--compare > iframe,
.bk-cmp-after { grid-area: 1 / 1; justify-self: center; }
.bk-cmp-after {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    clip-path: inset(0 0 0 var(--split));
}
.bk-demo-stage--compare.is-dragging iframe { pointer-events: none; }
.bk-cmp-label {
    position: absolute;
    bottom: 12px; /* 右上はメニューのボタンが出るので下に置く */
    z-index: 2;
    padding: 4px 10px;
    border-radius: 980px;
    background: rgba(var(--jh-glass-rgb), 0.55);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(var(--jh-fg-rgb), 0.14);
    color: var(--jh-text);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.bk-cmp-label--before { left: 12px; }
.bk-cmp-label--after { right: 12px; }
/* 境界が端に寄ったら、隠れた側のラベルを消す */
.bk-demo-stage--compare[style*="--split: 0%"] .bk-cmp-label--before,
.bk-demo-stage--compare[style*="--split: 100%"] .bk-cmp-label--after { opacity: 0; }
.bk-cmp-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--split);
    z-index: 3;
    width: 44px;
    margin-left: -22px;
    cursor: ew-resize;
    touch-action: none;
    outline: none;
}
.bk-cmp-handle::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.45);
}
.bk-cmp-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.22);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    color: #fff;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bk-cmp-knob .material-symbols-outlined { font-size: 20px; }
.bk-cmp-handle:hover .bk-cmp-knob,
.is-dragging .bk-cmp-knob { transform: translate(-50%, -50%) scale(1.1); }
.bk-cmp-handle:focus-visible .bk-cmp-knob { box-shadow: 0 0 0 3px var(--jh-accent), 0 8px 24px rgba(0, 0, 0, 0.35); }
/* 初めて見えたときの「動かせます」の合図 */
.bk-demo-stage--compare.is-hinting { animation: bk-cmp-hint 1.6s cubic-bezier(0.45, 0, 0.2, 1) 1; }
@keyframes bk-cmp-hint {
    0% { --split: 50%; }
    35% { --split: 34%; }
    70% { --split: 64%; }
    100% { --split: 50%; }
}

/* コントロール: プレビューの下のすりガラスの帯 */
.bk-ctl-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
    padding: 14px 18px;
    border-top: 1px solid rgba(var(--jh-fg-rgb), 0.08);
    background: linear-gradient(180deg, rgba(var(--jh-fg-rgb), 0.05), rgba(var(--jh-fg-rgb), 0.02));
    font-size: 13px;
}
.bk-ctl-bar[hidden] { display: none; }
.bk-ctl-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--blog-accent-text, var(--jh-text));
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
}
.bk-ctl-badge .material-symbols-outlined { font-size: 18px; }
.bk-ctl {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: rgba(var(--jh-text-rgb), 0.72);
    cursor: pointer;
}
.bk-ctl-name { white-space: nowrap; }
.bk-ctl output {
    min-width: 4.5em;
    color: var(--jh-text);
    font-family: "SF Mono", ui-monospace, Menlo, monospace;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.bk-ctl input[type="range"] {
    --fill: 50%;
    width: 128px;
    height: 22px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.bk-ctl input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--blog-accent-text, var(--jh-text)) var(--fill), rgba(var(--jh-fg-rgb), 0.16) var(--fill));
}
.bk-ctl input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(var(--jh-fg-rgb), 0.16); }
.bk-ctl input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--blog-accent-text, var(--jh-text)); }
.bk-ctl input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -7px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease;
}
.bk-ctl input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.bk-ctl input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
.bk-ctl input[type="range"]:focus-visible { outline: 2px solid var(--jh-accent); outline-offset: 4px; border-radius: 4px; }
.bk-ctl input[type="color"] {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(var(--jh-fg-rgb), 0.3);
    border-radius: 50%;
    background: none;
    cursor: pointer;
    overflow: hidden;
}
.bk-ctl input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.bk-ctl input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }
.bk-ctl input[type="color"]::-moz-color-swatch { border: none; border-radius: 50%; }
.bk-ctl-reset {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    border: none;
    border-radius: 50%;
    background: rgba(var(--jh-fg-rgb), 0.08);
    color: var(--jh-text);
    cursor: pointer;
    opacity: 0;
    transform: rotate(-90deg) scale(0.8);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s ease;
}
.bk-ctl-bar.is-touched .bk-ctl-reset { opacity: 1; transform: none; pointer-events: auto; }
.bk-ctl-reset:hover { background: rgba(var(--jh-fg-rgb), 0.16); }
.bk-ctl-reset .material-symbols-outlined { font-size: 18px; }
@media (max-width: 640px) {
    .bk-ctl-bar { gap: 12px; padding: 12px 14px; }
    .bk-ctl { flex: 1 1 100%; }
    .bk-ctl input[type="range"] { flex: 1; width: auto; }
    .bk-ctl-reset { position: absolute; top: 8px; right: 12px; margin: 0; }
    .bk-ctl-bar { position: relative; }
}
@media (prefers-reduced-motion: reduce) {
    .bk-demo-stage--compare.is-hinting { animation: none; }
    .bk-cmp-knob, .bk-ctl-reset { transition: none; }
}

/* エディタ: コントロールの設定 */
.bk-ctl-setup {
    border-top: 1px solid rgba(var(--jh-fg-rgb), 0.08);
    font-size: 13px;
}
.bk-ctl-setup > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: rgba(var(--jh-text-rgb), 0.72);
    cursor: pointer;
    list-style: none;
}
.bk-ctl-setup > summary::-webkit-details-marker { display: none; }
.bk-ctl-setup > summary .material-symbols-outlined { font-size: 18px; }
.bk-ctl-setup[open] > summary { color: var(--jh-text); }
.bk-ctl-count { color: var(--jh-accent); }
.bk-ctl-setup-body { display: grid; gap: 8px; padding: 0 16px 14px; }
.bk-ctl-hint, .bk-ctl-empty { margin: 0 0 4px; color: rgba(var(--jh-text-rgb), 0.55); font-size: 12px; line-height: 1.6; }
.bk-ctl-empty code, .bk-ctl-row code { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 12px; }
.bk-ctl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-height: 34px; }
.bk-ctl-row .bk-switch { min-width: 150px; }
.bk-ctl-row .bk-menu-input { width: auto; }
.bk-ctl-label { flex: 1 1 140px; max-width: 220px; }
.bk-ctl-num { width: 76px !important; }
.bk-ctl-sample { display: inline-flex; align-items: center; gap: 6px; color: rgba(var(--jh-text-rgb), 0.5); font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 12px; }
.bk-ctl-sample i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(var(--jh-fg-rgb), 0.3); }

/* =========================================
   旅する記事: 地図のシーンと固定の地図 (blog-journey.js)
   ========================================= */
/* 地図の列の幅。閉じると 0 になり、本文がその分広がる (トランジションのため登録する) */
@property --journey-map-w { syntax: '<length>'; inherits: true; initial-value: 0px; }
.journey {
    --journey-map-w: 42svh;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow-anchor: none; /* 開閉時の位置合わせは blog-journey.js が行う */
}
.journey-map {
    position: sticky;
    top: 0;
    z-index: 5;
    grid-column: 1;
    grid-row: 1;
    height: calc(var(--journey-map-w) + 8px);
    padding: 8px 8px 0;
    box-sizing: border-box;
    overflow: hidden;
    background: var(--jh-bg, #000);
    transition: height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), padding 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.journey-map-canvas {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 22px;
    overflow: hidden;
    background: radial-gradient(120% 90% at 50% 40%, #1b2440 0%, #0b0b10 70%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.journey-map-canvas.is-unavailable {
    display: grid;
    place-items: center;
    padding: 24px;
    color: rgba(245, 245, 247, 0.6);
    font-size: 14px;
    text-align: center;
}
/* 本文の列: 中身は必ずこの列の中に収める (地図の下に潜り込ませない) */
.journey .blog-blocks {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    overflow-x: clip;
}
.journey .blog-blocks .bk { max-width: min(100%, calc(var(--bk-max) + 40px)); }
.journey .blog-blocks .bk-w-full,
.journey .blog-blocks .bk-w-wide { --bk-max: 100%; }
.journey .blog-blocks .bk-w-full[class*="bk-bg-"]:not(.bk-bg-none) { padding-inline: 20px; border-radius: 24px; }

/* 閉じた状態: 地図の列 (スマホでは上の帯) をたたむ */
.journey.is-map-closed { --journey-map-w: 0px; }
.journey.is-map-closed .journey-map { padding-top: 0; }
.journey.is-map-closed .journey-map-canvas { opacity: 0; transform: scale(0.97); pointer-events: none; }

/* スマホではヘッダー (48px) が固定なので、その下に地図を留める */
@media (max-width: 734px) {
    .journey-map { top: 48px; }
}
@media (max-width: 959px) {
    .journey.is-map-closed .journey-map { height: 0; padding: 0; }
}

@media (min-width: 960px) {
    .journey {
        --journey-map-w: clamp(360px, 44vw, 820px);
        grid-template-columns: minmax(0, 1fr) var(--journey-map-w);
        grid-template-rows: auto;
        transition: --journey-map-w 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .journey-map {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
        height: 100vh;
        height: 100svh;
        padding: 16px 16px 16px 0;
        background: none;
        transition: padding 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .journey.is-map-closed .journey-map { padding: 16px 0; }
    .journey-map-canvas { border-radius: 28px; }
    .journey .blog-blocks {
        grid-row: 1;
        --blog-measure: 680px;
        padding-inline: clamp(16px, 3vw, 56px);
        box-sizing: border-box;
    }
    .journey.is-map-closed .blog-blocks { --blog-measure: 760px; }
}

/* 地図の開閉 */
.journey-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 980px;
    background: rgba(var(--jh-glass-rgb), 0.55);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: #f5f5f7;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.journey-close:hover { background: rgba(58, 58, 60, 0.7); }
.journey-close:active { transform: scale(0.96); }
.journey-close:focus-visible, .journey-open:focus-visible { outline: 2px solid var(--jh-accent); outline-offset: 3px; }
.journey-close .material-symbols-outlined, .journey-open .material-symbols-outlined { font-size: 18px; }
@media (min-width: 960px) {
    /* デスクトップでは上中央にサイトのナビ (ガラス) が出るので、右上の少し下に置く */
    .journey-close { top: 20px; right: 20px; }
}
/* 閉じているあいだ、画面の右下に出る「地図を開く」 */
.journey-open {
    position: fixed;
    right: 20px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: min(340px, calc(100vw - 40px));
    height: 48px;
    padding: 0 18px 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 980px;
    background: rgba(var(--jh-glass-rgb), 0.6);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    color: #f5f5f7;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.4s;
}
.journey.is-map-closed.is-in-view .journey-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
}
.journey-open-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--blog-accent);
    color: #1d1d1f;
}
.journey-open-text { display: grid; min-width: 0; text-align: left; line-height: 1.2; }
.journey-open-text small { color: rgba(245, 245, 247, 0.6); font-size: 11px; }
.journey-open-text strong { overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) {
    .journey, .journey-map, .journey-map-canvas, .journey-open { transition: none; }
}

/* HUD: 地図の左下に今のシーン (上はサイトのナビが重なるので避ける。Mapbox のロゴの上) */
.journey-hud {
    position: absolute;
    bottom: 36px;
    left: 20px;
    z-index: 2;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 2px 10px;
    min-width: 180px;
    max-width: calc(100% - 96px);
    padding: 12px 16px 14px;
    border-radius: 18px;
    background: rgba(var(--jh-glass-rgb), 0.5);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: #f5f5f7;
    pointer-events: none;
}
@media (min-width: 960px) { .journey-hud { bottom: 48px; left: 28px; } }
@media (max-width: 734px) {
    .journey-hud { left: 12px; bottom: 30px; min-width: 0; padding: 10px 12px 12px; }
}
.journey-hud-num { font: 600 12px/1 "SF Mono", ui-monospace, Menlo, monospace; color: var(--blog-accent); letter-spacing: 0.04em; }
.journey-hud-label { overflow: hidden; font-size: 15px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.journey-hud-progress {
    grid-column: 1 / -1;
    height: 3px;
    margin-top: 8px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
}
.journey-hud-progress i {
    display: block;
    height: 100%;
    background: var(--blog-accent);
    transform: scaleX(0);
    transform-origin: left center;
}

/* マーカー: 写真の丸 + 番号 */
.journey-marker {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 50% 50% 50% 4px;
    transform: rotate(-45deg);
    background: var(--jh-card-bg-2);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    opacity: 0.75;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.journey-marker img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; transform: rotate(45deg) scale(1.3); }
.journey-marker-num {
    position: absolute;
    right: -6px;
    bottom: -6px;
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #f5f5f7;
    color: #1d1d1f;
    font: 700 11px/1 -apple-system, BlinkMacSystemFont, sans-serif;
    transform: rotate(45deg);
}
.journey-marker:not(:has(img)) .journey-marker-num { position: static; background: none; color: #f5f5f7; }
.journey-marker.is-past { opacity: 0.9; }
.journey-marker.is-active {
    opacity: 1;
    border-color: var(--blog-accent);
    transform: rotate(-45deg) scale(1.35);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--blog-accent) 30%, transparent), 0 10px 26px rgba(0, 0, 0, 0.55);
}
.journey-marker:focus-visible { outline: 2px solid var(--jh-accent); outline-offset: 4px; }

/* 本文の中のシーンのカード */
.blog-blocks .bk-scene { margin-block: 56px 28px; }
.bk-scene-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 18px;
    padding: 22px 24px;
    border-radius: 24px;
    background: var(--jh-card-bg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bk-scene.is-current .bk-scene-card {
    border-color: color-mix(in srgb, var(--blog-accent) 55%, transparent);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), 0 0 0 1px color-mix(in srgb, var(--blog-accent) 25%, transparent);
}
.bk-scene-num {
    font: 600 34px/1 var(--blog-serif, Georgia, serif);
    color: var(--blog-accent);
    font-variant-numeric: tabular-nums;
}
.bk-scene-text { min-width: 0; }
.bk-scene-kicker { margin: 0 0 4px; color: rgba(245, 245, 247, 0.55); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.blog-prose .bk-scene-title { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 22px; line-height: 1.3; }
.bk-scene-title .material-symbols-outlined { font-size: 20px; color: var(--blog-accent); }
.blog-prose .bk-scene-note { margin: 6px 0 0; color: rgba(245, 245, 247, 0.7); font-size: 15px; line-height: 1.6; }
.bk-scene-photos {
    grid-column: 1 / -1;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 6px;
    margin-top: 12px;
    border-radius: 14px;
    overflow: hidden;
}
.blog-prose .bk-scene-photos img {
    width: 100%;
    height: 96px;
    margin: 0;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s ease;
}
.bk-scene-photos:hover img { filter: brightness(1.08); transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) {
    .journey-marker, .bk-scene-card, .bk-scene-photos img { transition: none; }
}

/* エディタ: 地図のシーン */
.bk-mapedit {
    border-radius: 20px;
    overflow: hidden;
    background: var(--jh-card-bg);
    border: 1px solid rgba(var(--jh-fg-rgb), 0.08);
    text-align: left;
}
.bk-mapedit-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(var(--jh-fg-rgb), 0.08);
    font-size: 13px;
}
.bk-mapedit-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--blog-accent); font-weight: 600; }
.bk-mapedit-badge .material-symbols-outlined { font-size: 18px; }
.bk-mapedit-pin { flex: 1 1 220px; width: auto; max-width: 360px; }
.bk-mapedit-nopins { color: rgba(var(--jh-text-rgb), 0.55); }
.bk-mapedit-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.bk-mapedit-map { position: relative; min-height: 300px; background: radial-gradient(120% 90% at 50% 40%, #1b2440 0%, #0b0b10 70%); }
.bk-mapedit-fallback { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; color: rgba(var(--jh-text-rgb), 0.55); font-size: 13px; text-align: center; }
.bk-mapedit-fields { display: grid; align-content: start; gap: 10px; padding: 16px; font-size: 13px; }
.bk-mapedit-fields .bk-menu-input { box-sizing: border-box; min-width: 0; }
.bk-mapedit-coords { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bk-mapedit-slider { display: grid; grid-template-columns: 4.5em minmax(0, 1fr) 3.2em; align-items: center; gap: 8px; margin: 0; color: rgba(var(--jh-text-rgb), 0.7); }
.bk-mapedit-slider input { width: 100%; accent-color: var(--blog-accent); }
.bk-mapedit-slider output { color: var(--jh-text); font: 12px "SF Mono", ui-monospace, Menlo, monospace; text-align: right; }
.bk-mapedit-hint { margin: 2px 0 0; color: rgba(var(--jh-text-rgb), 0.5); font-size: 12px; line-height: 1.6; }
.bk-mapedit-marker {
    width: 26px;
    height: 26px;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--blog-accent, #2997ff);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
    cursor: grab;
}
@media (max-width: 720px) {
    .bk-mapedit-body { grid-template-columns: minmax(0, 1fr); }
    .bk-mapedit-map { min-height: 240px; }
}

/* =========================================
   いいね・コメント (記事フッター)
   ========================================= */
.blog-reactions { margin-bottom: 32px; }
.blog-like-row { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; }
.blog-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--jh-card-bg);
    box-shadow: inset 0 0 0 1px var(--jh-card-border);
    color: var(--jh-text);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.blog-like-btn:hover { color: var(--jh-text); background: var(--jh-card-bg-2); }
.blog-like-btn:active { transform: scale(0.96); }
.blog-like-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; transition: fill 0.2s ease, stroke 0.2s ease; }
.blog-like-btn.is-liked { box-shadow: inset 0 0 0 1px rgba(255, 55, 95, 0.5); }
.blog-like-btn.is-liked svg { fill: #ff375f; stroke: #ff375f; }
.blog-like-btn:disabled { opacity: 0.7; }
.blog-like-count { color: var(--jh-text-muted); font-size: 15px; }

.blog-comments-title { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 20px; }
.blog-comments-title span { color: var(--jh-text-muted); font-weight: 500; margin-left: 4px; }
.blog-comment, .blog-comment-form { display: flex; gap: 14px; align-items: flex-start; }
.blog-comment { padding: 18px 0; border-top: 1px solid var(--jh-card-border); }
.blog-comment .blog-avatar, .blog-comment-form .blog-avatar { overflow: hidden; }
.blog-comment-body { flex: 1; min-width: 0; }
.blog-comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 4px; font-size: 14px; }
.blog-comment-name { color: var(--jh-text); font-weight: 600; text-decoration: none; }
.blog-comment-head time { color: var(--jh-text-muted); font-size: 13px; }
.blog-comment-badge {
    padding: 1px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--blog-accent) 22%, transparent);
    color: var(--jh-text);
    font-size: 12px;
}
.blog-comment-text { margin: 0; font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.blog-comment-actions { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; }
.blog-comment-actions form { margin: 0; }
.blog-comment-actions button,
.blog-comment-actions a { padding: 0; border: 0; background: none; color: var(--jh-text-muted); font-size: 13px; text-decoration: none; cursor: pointer; }
.blog-comment-actions button:hover,
.blog-comment-actions a:hover { color: var(--jh-text); }
.blog-comment:target { animation: blog-comment-flash 2s ease; }
@keyframes blog-comment-flash { from { background: color-mix(in srgb, var(--blog-accent) 14%, transparent); } }
.blog-comments-empty, .blog-comments-login { color: var(--jh-text-muted); padding: 18px 0; border-top: 1px solid var(--jh-card-border); margin: 0; }
.blog-comments-login a { color: var(--blog-accent); }
.blog-comment-form { padding-top: 20px; border-top: 1px solid var(--jh-card-border); }
.blog-comment-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.blog-comment-field textarea { box-sizing: border-box; width: 100%; max-width: 100%; resize: vertical; min-height: 88px; }
.blog-comment-field button { align-self: flex-end; }
.blog-comment-replying { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: var(--jh-text-muted); }
.blog-comment-replying[hidden] { display: none; }
.blog-comment-replying button { padding: 0; border: 0; background: none; color: var(--blog-accent); font-size: 13px; cursor: pointer; }

/* =========================================
   エディタ: ドラッグ＆ドロップとサイズの自由な変更
   (blog-editor-dnd.js / blog-blocks-resize.js)
   ========================================= */
.blog-blocks-editor .bk {
    position: relative;
    transition: max-width 0.42s cubic-bezier(0.2, 0.8, 0.2, 1), padding 0.3s ease;
}
.blog-blocks-editor .bk-grid { position: relative; transition: grid-template-columns 0.42s cubic-bezier(0.2, 0.8, 0.2, 1); }
.blog-blocks-editor .bk.is-resizing,
.blog-blocks-editor .bk.is-resizing > .bk-grid { transition: none; }
.blog-blocks-editor .bk.is-resizing { user-select: none; }
.blog-blocks-editor .bk.is-resizing iframe { pointer-events: none; }
.bk-resizing-x, .bk-resizing-x * { cursor: ew-resize !important; }
.bk-resizing-y, .bk-resizing-y * { cursor: ns-resize !important; }
.blog-blocks-editor .bk-spacer { transition: height 0.42s cubic-bezier(0.2, 0.8, 0.2, 1); }
.blog-blocks-editor .bk-spacer.is-resizing { transition: none; }
.blog-blocks-editor .bk-demo-stage { resize: none; transition: height 0.42s cubic-bezier(0.2, 0.8, 0.2, 1); }
.blog-blocks-editor .is-height-resizing .bk-demo-stage { transition: none; }

/* つまみ共通: ブロックにホバー (タッチではブロックにフォーカス) したときだけ現れる */
.bk-rs { position: absolute; z-index: 6; touch-action: none; outline: none; }
.bk-rs-width, .bk-rs-col, .bk-rs-height { opacity: 0; transition: opacity 0.2s ease; }
.bk-edit:hover .bk-rs-width, .bk-edit:hover .bk-rs-col, .bk-edit:hover .bk-rs-height,
.bk-edit:focus-within .bk-rs-width, .bk-edit:focus-within .bk-rs-col, .bk-edit:focus-within .bk-rs-height,
.bk.is-resizing .bk-rs, .bk-rs:focus-visible { opacity: 1; }
.bk-block-dragging .bk-rs, .blog-img-dragging .bk-rs { opacity: 0 !important; }

/* 幅: 左右の端の縦長のピル */
.bk-rs-width { top: 0; bottom: 0; width: 18px; cursor: ew-resize; }
.bk-rs-width--left { left: -9px; }
.bk-rs-width--right { right: -9px; }
.bk-rs-width::after, .bk-rs-height > i, .bk-rs-col > i {
    content: "";
    position: absolute;
    border-radius: 3px;
    background: rgba(var(--jh-fg-rgb), 0.28);
    box-shadow: 0 0 0 1px rgba(var(--jh-bg-rgb, 0, 0, 0), 0.25);
    transition: background-color 0.2s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bk-rs-width::after { top: 50%; left: 50%; width: 5px; height: min(44px, 60%); min-height: 18px; transform: translate(-50%, -50%) scaleY(0.85); }
.bk-rs-width:hover::after, .bk-rs-width:focus-visible::after,
.is-resizing > .bk-rs-width::after { background: var(--blog-accent); transform: translate(-50%, -50%) scaleY(1.15); }

/* 列の境目: 列の間の縦線 */
.bk-rs-col { top: -6px; bottom: -6px; width: 20px; margin-left: -10px; cursor: col-resize; }
.bk-rs-col > i { top: 0; bottom: 0; left: 50%; width: 3px; transform: translateX(-50%) scaleY(0.6); opacity: 0.6; }
.bk-rs-col:hover > i, .bk-rs-col:focus-visible > i,
.is-col-resizing .bk-rs-col > i { background: var(--blog-accent); transform: translateX(-50%); opacity: 1; }
.is-col-resizing .bk-cell { outline-color: color-mix(in srgb, var(--blog-accent) 60%, transparent) !important; }

/* 高さ: 下端の横長のピル */
.bk-rs-height { left: 0; right: 0; bottom: 0; height: 16px; cursor: ns-resize; }
.bk-rs-height > i { left: 50%; top: 50%; width: 44px; height: 5px; transform: translate(-50%, -50%) scaleX(0.85); }
.bk-rs-height:hover > i, .bk-rs-height:focus-visible > i,
.is-height-resizing .bk-rs-height > i { background: var(--blog-accent); transform: translate(-50%, -50%) scaleX(1.15); }
.bk-demo-stage > .bk-rs-height > i { background: rgba(255, 255, 255, 0.4); }

/* 吸い付いたときの合図: つまみが少し脈打つ */
.bk.is-snapped .bk-rs > i, .bk.is-snapped > .bk-rs-width::after { animation: bk-rs-snap 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes bk-rs-snap { 50% { filter: brightness(1.6); } }

/* ドラッグ中のサイズ表示 */
.bk-rs-badge {
    top: 8px;
    left: 50%;
    padding: 4px 11px;
    border-radius: 980px;
    background: rgba(var(--jh-glass-rgb), 0.82);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: var(--jh-text);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.is-resizing > .bk-rs-badge, .is-height-resizing .bk-demo-stage > .bk-rs-badge { opacity: 1; transform: translate(-50%, 0); }
.is-snapped .bk-rs-badge { color: var(--blog-accent-text, var(--jh-accent)); }

/* ── 並べ替え: 指についてくる札 ─────────────── */
.bk-drag-ghost {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 280px;
    padding: 8px 14px 8px 10px;
    border-radius: 12px;
    background: rgba(var(--jh-glass-rgb), 0.9);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    color: var(--jh-text);
    font-size: 13px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(var(--jh-fg-rgb), 0.08);
    pointer-events: none;
    opacity: 0;
    scale: 0.9;
    transition: opacity 0.16s ease, scale 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
}
.bk-drag-ghost > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-drag-ghost .material-symbols-outlined { font-size: 18px; color: var(--blog-accent-text, var(--jh-accent)); }
.bk-drag-ghost.is-lifted { opacity: 1; scale: 1; }
.bk-drag-ghost.is-dropped { opacity: 0; scale: 0.92; }
.bk-block-dragging, .bk-block-dragging * { cursor: grabbing !important; user-select: none; }
.blog-blocks-editor .bk-edit.is-dragging { opacity: 0.3; transition: opacity 0.2s ease; }
/* 並べ替えの線は滑らかに次の位置へ (現れた瞬間だけは跳ぶ) */
.bk-drop-line { transition: top 0.14s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bk-drop-line.is-instant { transition: none; }

/* ── 画像の移動・ドロップの落とし先 ─────────── */
.bk-drop-caret {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10050;
    height: 3px;
    border-radius: 2px;
    background: var(--blog-accent, var(--jh-accent));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blog-accent, var(--jh-accent)) 22%, transparent);
    pointer-events: none;
    transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.12s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bk-drop-caret.is-instant { transition: none; }
.bk-drop-caret[hidden] { display: none; }
/* ブロックの間 (新しいブロックになる) は太めにして、左端に丸 */
.bk-drop-caret.is-block { height: 4px; }
.bk-drop-caret.is-block::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--blog-accent, var(--jh-accent));
    background: var(--jh-surface, #111);
    transform: translateY(-50%);
}
.blog-img-ghost {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10060;
    border-radius: 10px;
    background: center / cover no-repeat;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.12);
    pointer-events: none;
    opacity: 0;
    scale: 0.85;
    rotate: -2deg;
    transition: opacity 0.16s ease, scale 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), rotate 0.22s ease;
    will-change: transform;
}
.blog-img-ghost.is-lifted { opacity: 0.92; scale: 1; rotate: 2deg; }
.blog-img-ghost.is-dropped { opacity: 0; scale: 0.9; }
.blog-img-overlay.is-moving { opacity: 0.25; }
.blog-img-overlay.is-snapped { outline: 2px solid var(--blog-accent); outline-offset: 2px; }
.blog-img-overlay.is-snapped .blog-img-size { color: #fff; background: var(--blog-accent); }
/* 移動つまみ (タッチでは画像に触れてもスクロールできるよう、移動はここから) */
.blog-img-move {
    position: absolute;
    left: 50%;
    top: -16px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid var(--blog-accent);
    border-radius: 50%;
    background: #fff;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
    touch-action: none;
    cursor: grab;
}
.blog-img-move .material-symbols-outlined { font-size: 18px; }
.blog-img-overlay.is-resizing .blog-img-move { opacity: 0; }
@media (pointer: coarse) {
    /* 指で掴みやすいよう、四隅のハンドルの当たり判定を広げる */
    .blog-img-handle { width: 18px; height: 18px; }
    .blog-img-handle::before { content: ""; position: absolute; inset: -12px; }
    .blog-img-handle[data-corner="nw"] { left: -9px; top: -9px; }
    .blog-img-handle[data-corner="ne"] { right: -9px; top: -9px; }
    .blog-img-handle[data-corner="sw"] { left: -9px; bottom: -9px; }
    .blog-img-handle[data-corner="se"] { right: -9px; bottom: -9px; }
    .bk-rs-height { height: 28px; }
    .bk-rs-height > i { width: 56px; height: 6px; }
}

/* ── ファイルを持ってきたとき ───────────────── */
.blog-editor-canvas.is-file-dragging .blog-blocks-editor {
    border-radius: 18px;
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--blog-accent, var(--jh-accent)) 55%, transparent);
    background: color-mix(in srgb, var(--blog-accent, var(--jh-accent)) 5%, transparent);
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
.bk-drop-hint {
    position: fixed;
    top: 132px;
    left: 0;
    z-index: 10055;
    padding: 8px 16px;
    border-radius: 980px;
    background: var(--blog-accent, var(--jh-accent));
    color: var(--blog-accent-ink, #fff);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: translateX(-50%);
    animation: bk-toast-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bk-drop-hint[hidden] { display: none; }
.blog-editor-canvas.is-file-dragging .ql-editor { pointer-events: none; } /* ブラウザ自身の挿入カーソルを出さない */

/* アップロードの進み具合 */
.bk-upload-toast {
    position: fixed;
    left: 50%;
    bottom: calc(104px + env(safe-area-inset-bottom)); /* 保存バーの上 */
    z-index: 10070;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px 10px;
    min-width: 220px;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(var(--jh-glass-rgb), 0.9);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    color: var(--jh-text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(var(--jh-fg-rgb), 0.08);
    transform: translateX(-50%);
    animation: bk-toast-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bk-upload-toast[hidden] { display: none; }
@keyframes bk-toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.bk-upload-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(var(--jh-fg-rgb), 0.2);
    border-top-color: var(--blog-accent, var(--jh-accent));
    animation: bk-spin 0.8s linear infinite;
}
@keyframes bk-spin { to { transform: rotate(360deg); } }
.bk-upload-bar { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: rgba(var(--jh-fg-rgb), 0.12); overflow: hidden; }
.bk-upload-bar i { display: block; height: 100%; background: var(--blog-accent, var(--jh-accent)); transform-origin: left; transform: scaleX(0); transition: transform 0.2s ease; }

@media (max-width: 734px) {
    /* 狭い画面では列は縦に並び、ブロックも画面いっぱいなので、幅と列のつまみは出さない */
    .bk-rs-width, .bk-rs-col { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .blog-blocks-editor .bk, .blog-blocks-editor .bk-grid, .blog-blocks-editor .bk-spacer,
    .blog-blocks-editor .bk-demo-stage, .bk-drop-caret, .bk-drop-line { transition: none; }
}
