/* ====================================================================
   管理画面の追加CSS。Tabler（/static/vendor/tabler/）の後に読む。
   瀬戸内市場の admin.css から、記事エディタの部分を除いて移植（2026-10-04）

   ==================================================================== */

:root {
  /* Tabler の既定は Inter。日本語の管理画面なのでシステムの和文に寄せる */
  --tblr-font-sans-serif: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Noto Sans JP", "Segoe UI", Roboto, sans-serif;
  /* 主色は公開側の「ポン」の濃い赤紫 rgb(85,25,55)。白文字が読める */
  --tblr-primary: #551937;
  --tblr-primary-rgb: 85, 25, 55;
  --tblr-primary-darken: #40122a;
  --tblr-primary-fg: #fff;
}

/* 押せるカードはホバーでわずかに浮く */
.card-link { transition: transform .12s ease, box-shadow .12s ease; }
.card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(16, 24, 40, .07), 0 12px 28px rgba(16, 24, 40, .12);
}

/* カードとアラートにごく薄い影。色の付いた背景の上で紙のように浮かせる */
.card, .page-body .alert {
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .08);
}
/* 角丸は公開側のカードと同じ 10px。card-table の行背景が
   角からはみ出して欠けて見えるので、中身ごと角で切り落とす */
.card {
  --tblr-card-border-radius: 10px;
  --tblr-card-inner-border-radius: 9px;
  overflow: hidden;
}
.page-body .alert { border-radius: 10px; }

/* Tabler の .alert は display:flex（アイコン併記用）。アイコンを使わない
   この管理画面では、<strong> や <br> 混じりの文が横に割れるので縦に戻す */
.alert { flex-direction: column; gap: .25rem; }

/* 背景に直接載る場所（見出し・注記）のリンクは下線＋濃色で立てる */
.page-header a:not(.btn), .page-body > .container-xl > p a,
.page-body > .container-xl > .text-secondary a {
  color: var(--tblr-body-color); text-decoration: underline;
}

/* 本体の背景は主色（濃い赤紫）をごく薄くした色。カードの白が浮くように */
.page { background: #f4eef1; }
[data-bs-theme=dark] .page { background: #1e1419; }

/* サイドバーの頭のロゴ */
.navbar-vertical .brand-logo { width: 150px; display: block; margin: 0 auto; }
/* ロゴ下の「管理画面」札。ロゴと間を空け、角丸の罫線で囲う */
.navbar-vertical .brand-tag { display: inline-block; margin-top: 14px;
  padding: 3px 14px; border: 1px solid #c6cdd5; border-radius: 999px;
  font-size: 12px; color: #667382; }
[data-bs-theme=dark] .navbar-vertical .brand-logo {
  /* 黒文字ロゴをダークで白抜きに */
  filter: invert(1) hue-rotate(180deg);
}
.navbar-vertical .letter-sp { letter-spacing: .35em; text-indent: .35em; }

/* 金額・数値の列。表の中で桁を揃える */
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }

/* サイドバーの下端に置く操作者の表示 */
.navbar-vertical .actor-box {
  margin-top: auto;
  padding: .75rem 1rem .5rem;
  border-top: 1px solid var(--tblr-border-color);
  font-size: .78rem;
  color: var(--tblr-secondary);
  overflow-wrap: anywhere;
}
.navbar-vertical .actor-box .caps { margin-top: .15rem; }

/* 一覧の小さな写真。Tabler の img 既定（max-width:100%; height:auto）に負けないよう幅と高さを固定 */
.table .thumb { width: 48px; height: 48px; max-width: none; object-fit: cover; }

/* ---------------------------------------------------------------- 見出しを押して並べ替える表（sortable.js。chateraise から写した 2026-10-22） */
.table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table th.sortable:hover { background: #ececec; }
[data-bs-theme=dark] .table th.sortable:hover { background: var(--tblr-gray-700); }
.table th.sortable .sort-mark { display: inline-block; width: 10px; height: 10px; margin-left: 3px; vertical-align: -1px; color: #9aa3ab; }
.table th.sortable:not(.on) .sort-mark { opacity: 0; }
.table th.sortable:not(.on):hover .sort-mark { opacity: .6; }

/* ---------------------------------------------------------------- 一覧の表: 行を開いてその場で直す（rowedit.js・fold.js。chateraise の admin.css から写した） */
.table-rows { table-layout: fixed; width: 100%; }
.table-rows th, .table-rows td { padding-left: 8px; padding-right: 8px; }
.table-rows td { padding-top: 3px; padding-bottom: 3px; height: 35px; font-size: 13px; }
.table-rows.with-photo td { height: 46px; }
.table-rows tr > .fold-cell:first-child, .table-rows tr > th:first-child { padding-left: 6px; padding-right: 0; }
.table-rows .fold-cell { padding-right: 0; }
.table-rows .photo-cell { padding-right: 4px; }
.table-rows .thumb { width: 40px; height: 40px; }
.table-rows .name-cell { white-space: nowrap; }
.table-rows .ellip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-rows .hint { font-size: 12px; color: var(--tblr-secondary); }
.table-rows a.rowedit-open { color: inherit; }
.table-rows a.rowedit-open:hover { color: var(--tblr-primary); }
button.fold {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 26px; height: 26px; padding: 0; margin: 0; box-sizing: border-box;
  border: none; border-radius: 50%; background: none; color: #9a9a9a;
  vertical-align: middle; line-height: 1; cursor: pointer;
  transition: color .15s, background-color .15s;
}
button.fold::before { content: ""; display: block; width: 8px; height: 9px; margin-left: 2px; background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%); }
button.fold:hover:not(:disabled) { color: var(--tblr-body-color); background: #ececec; }
[data-bs-theme=dark] button.fold:hover:not(:disabled) { background: var(--tblr-gray-700); }
button.fold.open { transform: rotate(90deg); }
button.fold.spin { animation: s-fold-open .4s cubic-bezier(.3, .9, .35, 1.3) both; }
button.fold.spin:not(.open) { animation-name: s-fold-close; }
@keyframes s-fold-open  { from { transform: rotate(0deg); }  to { transform: rotate(90deg); } }
@keyframes s-fold-close { from { transform: rotate(90deg); } to { transform: rotate(0deg); } }
tr.reveal > td { animation: s-row-grow .34s ease-out var(--d, 0ms) backwards; }
tr.reveal > td > .cell, tr.reveal > td > .inline-edit { overflow: hidden; animation: s-cell-grow .34s ease-out var(--d, 0ms) backwards; }
tr.reveal > td > .inline-edit { animation-name: s-box-grow; }
@keyframes s-row-grow  { from { padding-top: 0; padding-bottom: 0; opacity: 0; } to { opacity: 1; } }
@keyframes s-cell-grow { from { max-height: 0; } to { max-height: 48px; } }
@keyframes s-box-grow  { from { max-height: 0; } to { max-height: 320px; } }
tr.reveal > td > .inline-edit.tall { animation-name: s-box-grow-tall; }
@keyframes s-box-grow-tall { from { max-height: 0; } to { max-height: 900px; } }
@media (prefers-reduced-motion: reduce) {
  button.fold.spin, tr.reveal > td, tr.reveal > td > .cell, tr.reveal > td > .inline-edit { animation: none; }
}
.s-spacer { width: 100%; }
.table-rows tr.edit-row > td { height: auto; padding: 0 12px 0 32px; background: var(--tblr-bg-surface-secondary); font-size: inherit; }
.table-rows tr.edit-row .inline-edit { padding: 8px 0 10px; width: 0; min-width: 100%; }
.rowedit-grid { display: flex; gap: 16px; align-items: flex-start; }
.rowedit-photo { flex: none; width: 132px; }
.rowedit-photo .imgblk-preview { width: 132px; height: 132px; object-fit: cover; border-radius: 4px; display: block; }
.rowedit-photo .imgblk-empty { display: block; width: 132px; height: 132px; border-radius: 4px; background: var(--tblr-bg-surface-tertiary); }
.rowedit-fields { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rowedit-line { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.rowedit-line .fld { display: flex; flex-direction: column; }
.rowedit-line .fld .form-label { font-size: 12px; margin-bottom: 3px; white-space: nowrap; }
.rowedit-line .w-name { flex: 2 1 200px; min-width: 180px; }
.rowedit-line .w-maker { flex: 1 1 180px; min-width: 160px; }
.rowedit-line .w-num { width: 84px; }
.rowedit-line .w-style { width: 160px; }
.rowedit-line .grow { flex: 1 1 240px; min-width: 200px; }
.rowedit-line textarea.form-control-sm { line-height: 1.35; padding-top: 4px; padding-bottom: 4px; }
.rowedit-line .form-check { font-size: 13px; }
.rowedit-foot { position: relative; }
.unsaved-pill { position: absolute; right: 64px; bottom: 100%; margin-bottom: 6px;
  border: none; border-radius: 999px; padding: 3px 12px; font-size: 12px; color: #fff; background: #d63939; cursor: pointer; }
.zoom-overlay { position: fixed; inset: 0; z-index: 1080; background: rgba(0, 0, 0, .82); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.zoom-overlay img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 6px; background: #fff; box-shadow: 0 8px 32px rgba(0, 0, 0, .5); }
/* 作り手の説明からの香りと点数（行の中）: 系統ごとに 1 行、タイルは小さな札。付いている札は塗りつぶし */
.rowedit-taste { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; align-items: start; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--tblr-border-color); }
.rowedit-taste .cat { font-size: 12px; color: var(--tblr-secondary); white-space: nowrap; padding-top: 3px; }
.rowedit-taste .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.rowedit-taste .chip { display: inline-flex; align-items: center; padding: 1px 9px; border: 1px solid var(--tblr-border-color); border-radius: 999px; font-size: 12px; cursor: pointer; user-select: none; }
.rowedit-taste .chip input { position: absolute; opacity: 0; pointer-events: none; }
.rowedit-taste .chip:has(input:checked) { background: #F0047F; border-color: #F0047F; color: #fff; }
.rowedit-scores { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.rowedit-scores label { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.rowedit-scores select { width: 88px; }
