/* ---- 記事ページ（p.php）と共通の骨組み ---- */
.editor-shell,.article-shell{width:min(100% - 32px,760px);margin:0 auto;padding:48px 0 96px}
.article-shell h1{font-size:clamp(32px,6vw,56px);line-height:1.3}
.editor-error{padding:12px 16px;border:1px solid var(--red);color:var(--red);background:#fff4f1;font-weight:700}
.editor-moderation{display:grid;gap:10px;padding:14px 16px;border:1px solid var(--red);background:#fff4f1;font-size:14px;line-height:1.8}.editor-moderation p{margin:0}.editor-moderation b{display:block;color:var(--red)}.editor-review-message{display:grid;gap:6px;font-weight:700;font-size:13px}.editor-review-message textarea{width:100%;padding:10px 12px;border:1px solid var(--ink);border-radius:2px;background:#fff;font:inherit;font-size:14px;font-weight:400;resize:vertical}

/* ---- 編集画面 ---- */
.editor-page{padding-bottom:88px}
.editor-bar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:16px;padding:0 max(16px,calc((100% - 1200px) / 2));min-height:58px;border-bottom:1px solid var(--ink);background:var(--paper)}
.editor-bar-title{padding-left:16px;border-left:1px solid var(--line);font-size:14px;font-weight:700}
.editor-bar-close{margin-left:auto;display:grid;place-items:center;width:40px;height:40px;margin-right:-10px;color:var(--ink)}
.editor-bar-close:hover,.editor-bar-close:focus-visible{color:var(--red)}
.editor-shell form{display:grid;gap:40px}

.editor-section{display:grid;gap:20px}
.editor-section-head{display:flex;align-items:center;gap:12px;padding-bottom:12px;border-bottom:1px solid var(--ink)}
.editor-section-head h2{margin:0;font-size:22px;font-weight:900}

.field{display:grid;gap:6px;min-width:0}
.field-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:16px}
.field>label:not(.eyecatch-drop),.field-label{display:flex;align-items:baseline;gap:8px;font-size:14px;font-weight:700}
.field em{font:400 11px "Space Mono",monospace;font-style:normal;color:var(--red);letter-spacing:.08em}
.field-count{margin-left:auto;font:400 11px "Space Mono",monospace;color:var(--muted)}
.field-count.is-near{color:var(--red)}
.field-hint{margin:0;color:var(--muted);font-size:12px;line-height:1.7}
.field-hint.is-warn{color:var(--red)}
.field-narrow{max-width:280px}
/* 公式URL＋「サイトから読み込む」。入力欄と同じ高さにそろえる */
.url-fetch{display:flex;gap:8px}
.url-fetch input{flex:1;min-width:0}
.url-fetch .button{flex:none;white-space:nowrap}
.url-fetch .button[aria-busy=true]{opacity:.6;cursor:progress}
.is-autofilled{background-color:#fff6e8!important}
.editor-shell input:not([type=file]),.editor-shell select,.editor-shell textarea{width:100%;padding:12px;border:1px solid var(--ink);border-radius:2px;background:#fffdf9;color:var(--ink);font:16px "Zen Kaku Gothic New",sans-serif;line-height:1.7}
.editor-shell textarea{resize:vertical;overflow:hidden}
.editor-shell :is(input,select,textarea,button):focus-visible{outline:2px solid var(--bright-red);outline-offset:1px}

/* アイキャッチ：16:9 のプレビュー枠。一覧・記事と同じ比率で見せる */
/* max-height は付けない（付けると比率が崩れ、実際の表示と切り抜きがずれる） */
.eyecatch-drop{position:relative;display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:16/9;border:1px dashed var(--ink);border-radius:2px;background:#fffdf9 repeating-linear-gradient(135deg,transparent 0 11px,rgba(31,29,27,.035) 11px 12px);cursor:pointer;overflow:hidden;transition:border-color .15s,background-color .15s}
.eyecatch-drop:hover{border-color:var(--red)}
.eyecatch-drop:has(input:focus-visible){outline:2px solid var(--bright-red);outline-offset:2px}
.eyecatch-drop input{position:absolute;inset:0;z-index:3;width:100%;height:100%;opacity:0;cursor:pointer}
.eyecatch-drop img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none}
.eyecatch-drop>span{pointer-events:none}
.eyecatch-ratio{position:absolute;top:12px;left:14px;font:400 11px "Space Mono",monospace;letter-spacing:.1em;color:var(--muted)}
.eyecatch-empty{display:flex;flex-direction:column;align-items:center;gap:6px;padding:16px;text-align:center;color:var(--muted);font-size:13px;line-height:1.6}
.eyecatch-icon{margin-bottom:4px;color:var(--ink)}
.eyecatch-empty strong{color:var(--ink);font-size:16px}
.eyecatch-pick{color:var(--red);border-bottom:1px solid currentColor}
.eyecatch-empty small{margin-top:6px;font:400 11px "Space Mono","Zen Kaku Gothic New",monospace;letter-spacing:.06em}
.eyecatch-overlay{position:absolute;inset:0;z-index:2;display:none;align-items:center;justify-content:center;font-size:15px;font-weight:700}
.eyecatch-change{position:absolute;right:12px;bottom:12px;z-index:2;display:none;padding:7px 12px;border-radius:2px;background:var(--ink);color:var(--paper);font-size:12px;font-weight:700;transition:background-color .15s}
.eyecatch-drop.has-image{border-style:solid;background:#e4ddd0}
.eyecatch-drop.has-image :is(.eyecatch-empty,.eyecatch-ratio){display:none}
.eyecatch-drop.has-image .eyecatch-change{display:block}
.eyecatch-drop.has-image:hover .eyecatch-change{background:var(--red)}
.eyecatch-drop.is-over{border-style:solid;border-color:var(--bright-red)}
.eyecatch-drop.is-over .eyecatch-over-msg{display:flex;background:rgba(255,244,241,.92);color:var(--red)}
.eyecatch-drop.is-busy .eyecatch-busy-msg{display:flex;background:rgba(246,242,234,.88);color:var(--ink)}
.eyecatch-drop.is-busy{cursor:progress}
.eyecatch-status{display:flex;flex-wrap:wrap;gap:4px 12px;margin:2px 0 0;font:400 12px "Space Mono","Zen Kaku Gothic New",monospace;color:var(--muted)}
.eyecatch-status:empty{display:none}
.eyecatch-status .is-warn{color:var(--red);font-family:"Zen Kaku Gothic New",sans-serif;font-weight:700}

/* タブ（編集／プレビュー） */
.editor-tabs{display:flex;margin-left:auto}
.editor-tabs button,.segmented button{border:1px solid var(--ink);background:transparent;padding:5px 12px;font-size:13px;cursor:pointer}
.editor-tabs button+button,.segmented button+button{border-left:0}
.editor-tabs [aria-selected=true],.segmented [aria-pressed=true]{background:var(--ink);color:var(--paper)}
.editor-preview{padding:8px 0 24px;border-bottom:1px solid var(--line)}
.editor-preview-empty{color:var(--muted)}

/* 本文ブロック */
.blocks{display:grid}
.blocks.is-over{outline:2px dashed var(--bright-red);outline-offset:6px}
.block{padding:14px 16px 16px;border:1px solid var(--line);background:#fffdf9;transition:border-color .15s}
.block:hover,.block:focus-within{border-color:var(--ink)}
.block-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px}
.block-label{display:inline-flex;align-items:center;gap:6px;font:400 11px "Space Mono",monospace;letter-spacing:.1em;color:var(--muted)}
.type-mark{display:inline-grid;place-items:center;width:20px;height:20px;border:1px solid currentColor;font:700 11px "Space Mono",monospace}
.block-controls{display:flex;align-items:center;gap:4px}
.block-controls .segmented{margin-right:6px}
.segmented{display:flex}
.segmented button{padding:3px 9px;font:700 11px "Space Mono",monospace}
.icon-btn{width:28px;height:28px;border:1px solid transparent;background:transparent;cursor:pointer;font-size:14px;line-height:1}
.icon-btn:hover:not(:disabled){border-color:var(--ink)}
.icon-btn:disabled{opacity:.25;cursor:default}
.icon-btn.is-danger:hover{border-color:var(--red);color:var(--red)}

.editor-shell .block-input:is(input,textarea){padding:4px 0;border:0;border-radius:0;background:transparent;resize:none}
.editor-shell .block-input:is(input,textarea):focus-visible{outline:0}
.editor-shell .block-input.is-paragraph{min-height:3.4em;font-size:16px;line-height:2}
.editor-shell .block-input.is-heading{font-weight:900;line-height:1.5}
.editor-shell .block-input.is-h2{font-size:24px}
.editor-shell .block-input.is-h3{font-size:19px}
.editor-shell .block-input.is-quote{padding-left:16px;border-left:3px solid var(--bright-red);color:#3a3633}
.list-items{margin:0;padding:0;list-style:none}
/* 点は1行目の中央に揃える（上余白 4px ＋ 行の高さ 32px の半分 − 点の半径） */
.list-item{position:relative;padding-left:22px}
.list-item::before{content:"";position:absolute;left:6px;top:17px;width:6px;height:6px;border-radius:50%;background:var(--ink)}
.editor-shell .block-input.is-list-item{display:block;font-size:16px;line-height:2}
.editor-shell .block-input.is-url{font-family:"Space Mono",monospace;font-size:14px}
.block-divider{margin:12px 0 4px;border:0;border-top:1px solid var(--ink)}
.block-hint{margin:6px 0 0;font-size:12px;color:var(--muted)}
.block-hint[data-kind=bad]{color:var(--red)}
.button-sample-wrap{margin-top:12px;text-align:center}
.button-sample{pointer-events:none}
.block-hint[data-kind=youtube]::before,.block-hint[data-kind=link]::before{content:"✓ ";color:#2f7a4a}
/* 表ブロック：セルは枠付きの1行入力。列が多いときは横にスクロールする */
.table-edit-scroll{overflow-x:auto}
.table-edit table{width:100%;border-collapse:collapse}
.table-edit td{padding:0;border:1px solid var(--line)}
.table-edit td.table-edit-ctl,.table-edit tr.table-edit-ctl td{width:30px;border:0;text-align:center}
.table-edit tr.table-edit-ctl td{height:30px}
.editor-shell .table-edit .table-cell{min-width:110px;padding:7px 10px;border:0;border-radius:0;background:transparent;font-size:14px;line-height:1.6}
.editor-shell .table-edit .table-cell:focus-visible{outline:2px solid var(--bright-red);outline-offset:-2px}
.table-edit tr.is-header td:not(.table-edit-ctl){background:#efe9de}
.editor-shell .table-edit tr.is-header .table-cell{font-weight:700}
.table-edit-tools{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin-top:10px}
.table-edit-tools .type-btn{padding:4px 10px}
.table-edit-tools .type-btn:disabled{opacity:.35;cursor:default;background:transparent;color:inherit}
.table-edit-tools .block-hint{margin:0 0 0 4px}
.embed-thumb img{display:block;width:240px;max-width:100%;aspect-ratio:16/9;object-fit:cover;margin-top:10px;border:1px solid var(--line)}

/* 画像ブロック：編集中は高さを抑え、選んだ表示サイズの比率で見せる */
.block-figure{margin:0 auto;padding:10px;background:repeating-conic-gradient(#efe9de 0 25%,#f7f3ec 0 50%) 0 0/16px 16px;text-align:center}
.block-figure img{display:block;max-width:100%;max-height:280px;margin:0 auto;object-fit:contain}
.block-figure.figure-small{max-width:45%}
.block-figure.figure-medium{max-width:70%}
.block-figure.figure-full{max-width:100%}
.image-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
.image-fields label{display:grid;gap:4px;font-size:12px;font-weight:700;color:var(--muted)}
.editor-shell .image-fields input{padding:8px 10px;font-size:14px}
/* 空の画像ブロック：アイキャッチと同じ枠。比率は画像ごとに違うので固定しない */
.eyecatch-drop.image-drop{aspect-ratio:auto;min-height:200px}
.image-uploading{display:flex;align-items:center;justify-content:center;gap:10px;height:120px;background:#f3eee5;color:var(--muted);font-size:13px}
.spinner{width:16px;height:16px;border:2px solid var(--line);border-top-color:var(--bright-red);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ブロック間の挿入ボタン */
.inserter{position:relative;height:14px;display:grid;place-items:center}
.inserter-toggle{position:relative;z-index:2;width:22px;height:22px;border:1px solid var(--ink);border-radius:50%;background:var(--paper);font:700 14px/1 "Space Mono",monospace;cursor:pointer;opacity:0;transition:opacity .15s}
.inserter:hover .inserter-toggle,.inserter-toggle:focus-visible,.inserter:has(.inserter-menu:not([hidden])) .inserter-toggle{opacity:1}
.inserter:hover::before{content:"";position:absolute;left:0;right:0;top:50%;border-top:1px solid var(--bright-red)}
.inserter-menu{position:absolute;top:22px;z-index:5;display:flex;flex-wrap:wrap;gap:4px;padding:8px;border:1px solid var(--ink);background:var(--paper);width:max-content;max-width:min(92vw,560px)}
.inserter-menu[hidden]{display:none}
@media (hover:none){.inserter-toggle{opacity:.5}}

.block-tools{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:12px;border:1px dashed var(--ink)}
.block-tools-label{margin-right:4px;font:400 11px "Space Mono",monospace;letter-spacing:.1em;color:var(--muted)}
.type-btn{display:inline-flex;align-items:center;gap:6px;padding:5px 10px 5px 6px;border:1px solid var(--ink);border-radius:2px;background:transparent;font-size:13px;cursor:pointer}
.type-btn:hover{background:var(--ink);color:var(--paper)}
.type-btn .type-mark{width:18px;height:18px;border-color:var(--line)}

/* 下部に固定した保存バー */
.editor-actions{position:fixed;left:0;right:0;bottom:0;z-index:20;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px max(16px,calc((100% - 760px) / 2));border-top:1px solid var(--ink);background:var(--paper)}
.editor-actions .button{padding:10px 18px;font-size:14px;cursor:pointer}
.editor-status{margin-right:auto;font-size:12px;color:var(--red)}

@media (max-width:640px){
  .editor-bar-title{display:none}
  .field-row,.image-fields{grid-template-columns:1fr}
  .block{padding:12px}
  .block-figure.figure-small,.block-figure.figure-medium{max-width:100%}
  .editor-status{display:none}
  .editor-actions .button{flex:1;justify-content:center}
  .url-fetch{flex-direction:column}
  .url-fetch .button{justify-content:center}
  .field-narrow{max-width:none}
}

/* ---- 記事本文 ---- */
/* 詳細ページ: キャッチコピーを見出しの主役にし、製品名を添える（一覧カードと同じ順序） */
.article-title{margin:10px 0 22px}
.article-catchcopy{display:block;font-size:clamp(34px,7vw,64px);font-weight:900;line-height:1.3;letter-spacing:.01em;word-break:auto-phrase;overflow-wrap:anywhere}
.article-name{display:flex;align-items:center;gap:10px;margin-top:18px;font-size:clamp(16px,2.4vw,20px);font-weight:700;line-height:1.6}
.article-name::before{content:"";flex:none;width:10px;height:10px;background:var(--bright-red)}
.article-summary{font-size:18px;line-height:2}
.article-eyecatch{display:block;width:100%;height:auto;max-height:80vh;margin:32px 0;object-fit:contain}
.article-content{font-size:16px;line-height:2}
.article-content h2{margin-top:52px;font-size:28px}
.article-content h3{margin-top:36px;font-size:22px}
.article-content figure{margin:32px auto;text-align:center}
/* 縦長のスマホ画像などが画面を占有しないよう、サイズ指定の無い旧記事も含めて高さに上限を設ける */
.article-content img{display:block;max-width:100%;max-height:560px;height:auto;margin:0 auto}
.article-content .figure-small{max-width:min(100%,320px)}
.article-content .figure-medium{max-width:min(100%,520px)}
.article-content .figure-full{max-width:100%}
.article-content .figure-full img{max-height:none;width:100%}
.article-content figcaption{margin-top:8px;color:var(--muted);font-size:13px;line-height:1.7}
.article-content blockquote{margin:28px 0;padding:4px 0 4px 20px;border-left:3px solid var(--bright-red);color:#3a3633}
.article-content blockquote p{margin:0}
.article-content hr{margin:44px 0;border:0;border-top:1px solid var(--ink)}
.article-content .embed{position:relative;aspect-ratio:16/9;margin:28px 0}
.article-content iframe{width:100%;height:100%;border:0}
.article-content .article-table{margin:32px 0;overflow-x:auto}
.article-content table{width:100%;border-collapse:collapse;font-size:15px;line-height:1.7}
.article-content :is(th,td){padding:10px 14px;border:1px solid var(--line);text-align:left;vertical-align:top;overflow-wrap:anywhere}
.article-content th{background:#efe9de;font-weight:700}
.article-content .article-button{margin:32px 0;text-align:center}
.article-content .article-button .button{justify-content:center;max-width:100%}
.article-author{color:var(--muted);margin-top:44px}
.article-footer{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:12px 24px;margin-top:44px}
.article-footer .article-author{margin:0}
.owner-bar{background:var(--ink);color:var(--paper);font-size:14px}
.owner-bar-inner{display:flex;flex-wrap:wrap;align-items:center;gap:6px 24px;width:min(100% - 32px,760px);min-height:44px;margin:0 auto;padding:8px 0}
.owner-bar-label{margin-right:auto;color:#bdb5a8;font-size:12px}
.owner-bar a{padding-bottom:1px;border-bottom:1px solid transparent;font-weight:700}
.owner-bar a:hover{border-color:currentColor;color:var(--bright-red)}
.article-actions{display:flex;flex-wrap:wrap;gap:12px}
.article-actions-note{margin:10px 0 0;color:var(--muted);font-size:13px;line-height:1.7}
.save-button{background:transparent;color:var(--ink);font-family:inherit;line-height:inherit;cursor:pointer}
.save-button[aria-pressed="true"]{background:var(--ink);color:var(--paper)}
.save-button:disabled{opacity:.6;cursor:wait}
.follow-card{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:16px 24px;margin-top:48px;padding:24px;border:1px solid var(--ink)}
.follow-card p:not(.section-kicker){margin:0;font-weight:700}
.article-author{display:flex;align-items:center;gap:10px}.article-author .author-avatar{display:inline-grid;flex:none;width:32px;height:32px;place-items:center;border-radius:50%;background:#e4ddd0;color:var(--ink);object-fit:cover;font:400 13px "Space Mono",monospace}
a.article-author:hover{color:var(--red)}.more-products{margin-top:8px}

/* 紹介ページのコメント欄 */
.comments{margin-top:56px;padding-top:28px;border-top:1px solid var(--ink)}
.comments-head{display:flex;justify-content:space-between;align-items:end;gap:16px;margin-bottom:8px}.comments-head h2{margin:0;font-size:24px;line-height:1.4}
.comment-list,.comment-replies{margin:0;padding:0;list-style:none}
.comment{padding:20px 0;border-bottom:1px solid var(--line)}.comment.is-reply{margin-top:16px;padding:16px 0 0 20px;border-bottom:0;border-left:2px solid var(--line)}
.comment-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;font-size:14px}.comment-head time{margin-left:auto;color:var(--muted);font:400 12px "Space Mono",monospace}
.comment-author{display:inline-flex;align-items:center;gap:8px;min-width:0}.comment-author b{overflow-wrap:anywhere}a.comment-author:hover{color:var(--red)}
.comment-avatar{display:inline-grid;flex:none;width:28px;height:28px;place-items:center;border-radius:50%;background:#e4ddd0;color:var(--ink);object-fit:cover;font:400 12px "Space Mono",monospace}
.comment-badge{padding:1px 6px;border-radius:2px;background:var(--ink);color:var(--paper);font-size:11px;font-weight:700}
.comment-body{margin:10px 0 0;font-size:15px;line-height:1.9;overflow-wrap:anywhere}
.comment-actions{display:flex;gap:16px;margin-top:8px}
.comment-action{padding:2px 0;border:0;border-bottom:1px solid transparent;background:none;color:var(--muted);cursor:pointer;font:inherit;font-size:13px;font-weight:700}.comment-action:hover{border-color:currentColor;color:var(--red)}.comment-action:disabled{opacity:.6;cursor:wait}
.comments-note{margin:20px 0 0;color:var(--muted);font-size:14px}.comments-note a{border-bottom:1px solid currentColor;color:var(--ink);font-weight:700}.comments-note a:hover{color:var(--red)}
.comment-form{display:grid;gap:10px;margin-top:24px}.comment-form.is-reply{margin:16px 0 0 20px}
.comment-form textarea{width:100%;padding:12px 14px;border:1px solid var(--ink);border-radius:2px;background:#fffdf9;color:var(--ink);font:15px/1.8 "Zen Kaku Gothic New",sans-serif;resize:vertical}.comment-form textarea:focus{outline:3px solid #f2c7b8;outline-offset:1px}
.comment-form-foot{display:flex;justify-content:space-between;align-items:center;gap:12px}.comment-form-foot .button{padding:10px 18px;font-family:inherit;font-size:14px;cursor:pointer}.comment-form-foot .button:disabled{opacity:.6;cursor:wait}
.comment-form.is-reply .comment-form-foot{justify-content:flex-end;gap:20px}
.comment-count{color:var(--muted);font:400 12px "Space Mono",monospace}
.comment-status{min-height:1.5em;margin:0;color:var(--red);font-size:13px}.comment-status:empty{min-height:0}
.report-dialog{width:min(100% - 32px,480px);padding:28px;border:1px solid var(--ink);border-radius:2px;background:var(--paper);color:var(--ink)}.report-dialog::backdrop{background:rgba(31,29,27,.45)}
.report-dialog h3{margin:0 0 8px;font-size:20px}.report-dialog p:not(.comment-status){margin:0 0 16px;color:#3a3633;font-size:14px;line-height:1.8}
.report-dialog fieldset{display:grid;gap:8px;margin:0 0 14px;padding:0;border:0}.report-dialog legend{margin-bottom:6px;font-size:14px;font-weight:700}.report-dialog label{display:flex;align-items:center;gap:8px;font-size:15px;cursor:pointer}.report-dialog input[type="radio"]{accent-color:var(--bright-red)}
.report-dialog textarea{width:100%;padding:10px 12px;border:1px solid var(--ink);border-radius:2px;background:#fffdf9;color:var(--ink);font:14px/1.8 "Zen Kaku Gothic New",sans-serif;resize:vertical}
.report-dialog-foot{display:flex;justify-content:flex-end;align-items:center;gap:20px;margin-top:12px}.report-dialog-foot .button{padding:10px 18px;font-family:inherit;font-size:14px;cursor:pointer}
