/* ============================================================
   VOLUNTAS — 配布用ポスター（poster.css）
   1) .pm-poster … 印刷するポスター本体。794×1123px（A4 縦）。色は印刷用の固定値
   2) .pm-modal  … 管理画面のモーダル。色は admin のトークン（ダークにも追従）
   ============================================================ */

/* ------------------------------------------------------------
   1. ポスター本体（共通）
   html2canvas で描くため、object-fit・line-clamp・filter は使わない。
   はみ出し対策（行数・文字サイズ）は poster.js の fit() が受け持つ。
   ------------------------------------------------------------ */
.pm-poster {
  --p-paper: #faf7ef; --p-gold: #b49157; --p-deep: #8f7038; --p-blue: #3f8fb5;
  --p-ink: #2a2418; --p-sub: #5b5242; --p-line: #e3d6b8; --p-white: #ffffff;
  position: relative; width: 794px; height: 1123px; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--p-paper); color: var(--p-ink);
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-weight: 500; font-size: 18px; line-height: 1.6; letter-spacing: .02em; text-align: left;
  -webkit-font-smoothing: antialiased; font-kerning: normal; font-feature-settings: "palt" 0;
}
.pm-poster div, .pm-poster span, .pm-poster img, .pm-poster svg { margin: 0; padding: 0; border: 0; box-sizing: border-box; max-width: none; }
.pm-poster .pm-ph { display: inline-block; }   /* 見出しの文節（poster.js の fmt）。max-width を付けると html2canvas が固まる */
.pm-poster .pm-title, .pm-poster .pm-fv, .pm-poster .pm-desc, .pm-poster .pm-mv, .pm-poster .pm-org { overflow-wrap: anywhere; }
.pm-poster .pm-num { font-family: "Manrope", "Zen Kaku Gothic New", sans-serif; font-weight: 800; letter-spacing: 0; }
.pm-poster .pm-ic { display: block; flex: none; }

/* 区分のスタンプ（当日／定期／長期） */
.pm-poster .pm-stamp {
  position: absolute; width: 138px; height: 138px; border-radius: 50%;
  background: var(--p-blue);
  display: flex; align-items: center; justify-content: center;
}
.pm-poster .pm-stamp-in {
  width: 122px; height: 122px; border-radius: 50%; border: 2px solid rgba(255,255,255,.88);
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff;
}
/* html2canvas は行の高さが文字より小さいと字を下にずらすため、行の高さは 1.3 以上にする */
.pm-poster .pm-stamp-c { display: block; font-weight: 900; font-size: 44px; line-height: 1.3; letter-spacing: .06em; padding-left: .06em; }
.pm-poster .pm-stamp-s { display: block; font-weight: 700; font-size: 13.5px; line-height: 1.5; letter-spacing: .08em; margin-top: -4px; }

.pm-poster .pm-kicker { display: block; font-weight: 700; font-size: 18px; line-height: 1.4; letter-spacing: .14em; }
.pm-poster .pm-head { display: block; font-weight: 900; font-size: 58px; line-height: 1.16; letter-spacing: .07em; }

/* 本文の面：残りの高さを使い、あふれたら fit() が削る */
.pm-poster .pm-body { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 36px 56px 20px; }
.pm-poster .pm-title { font-weight: 900; font-size: 56px; line-height: 1.3; letter-spacing: .03em; color: var(--p-ink); }
.pm-poster .pm-title .pm-num { font-weight: 800; }
.pm-poster .pm-org { margin-top: 10px; font-weight: 700; font-size: 19px; line-height: 1.5; color: var(--p-deep); }
.pm-poster .pm-rule { width: 64px; height: 5px; background: var(--p-gold); margin: 20px 0 16px; }

.pm-poster .pm-facts { border-top: 1.5px solid var(--p-line); }
.pm-poster .pm-fact { display: flex; align-items: flex-start; gap: 18px; padding: 11px 0; border-bottom: 1.5px solid var(--p-line); }
/* ラベルの高さを値の 1 行目にそろえて、縦の中心を合わせる */
.pm-poster .pm-fl { flex: none; width: 92px; height: 36px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; line-height: 1.4; letter-spacing: .14em; color: var(--p-deep); }
.pm-poster .pm-fv { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 25px; line-height: 1.45; color: var(--p-ink); }

.pm-poster .pm-desc { margin-top: 18px; font-weight: 500; font-size: 18px; line-height: 1.8; color: var(--p-sub); overflow-wrap: anywhere; }

.pm-poster .pm-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 16px; }
.pm-poster .pm-m { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
/* 枠付きのラベルは html2canvas で枠と字が数 px ずれるため、色と太さだけで区別する */
.pm-poster .pm-ml { flex: none; display: block; font-weight: 700; font-size: 15px; line-height: 1.5; letter-spacing: .12em; color: var(--p-blue); }
.pm-poster .pm-mv { display: block; min-width: 0; font-weight: 700; font-size: 18px; line-height: 1.5; color: var(--p-ink); }

/* チケット：QR と案内。切り取り線とノッチで「参加券」の形 */
.pm-poster .pm-ticket { position: relative; flex: none; margin: 0 40px; background: var(--p-white); border-radius: 20px; overflow: hidden; border: 1.5px solid var(--p-line); }
.pm-poster .pm-tk-main { display: flex; align-items: center; gap: 30px; padding: 20px 30px 18px 20px; }
.pm-poster .pm-qrbox { flex: none; width: 228px; height: 228px; background: #fff; }
.pm-poster .pm-qr { display: block; width: 228px; height: 228px; }
.pm-poster .pm-cta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pm-poster .pm-cta-h { display: block; font-weight: 900; font-size: 29px; line-height: 1.45; letter-spacing: .03em; color: var(--p-ink); }
.pm-poster .pm-cta-s { display: block; margin-top: 14px; font-weight: 700; font-size: 16.5px; line-height: 1.5; color: var(--p-blue); }
.pm-poster .pm-cta-n { display: block; margin-top: 10px; font-weight: 500; font-size: 14px; line-height: 1.6; color: var(--p-sub); }
.pm-poster .pm-tk-url { position: relative; display: flex; align-items: baseline; gap: 14px; padding: 12px 34px 14px; border-top: 2px dashed var(--p-line); white-space: nowrap; }
.pm-poster .pm-notch { position: absolute; top: -14px; width: 26px; height: 26px; border-radius: 50%; background: var(--p-paper); border: 1.5px solid var(--p-line); }
.pm-poster .pm-notch-l { left: -14px; }
.pm-poster .pm-notch-r { right: -14px; }
.pm-poster .pm-url-l { flex: none; font-weight: 700; font-size: 14px; line-height: 1.4; color: var(--p-deep); letter-spacing: .06em; }
.pm-poster .pm-url { display: block; min-width: 0; font-family: "Manrope", sans-serif; font-weight: 700; font-size: 15px; line-height: 1.4; color: var(--p-ink); letter-spacing: .01em; }
.pm-poster .pm-url-short { justify-content: center; }
.pm-poster .pm-url-short .pm-url { font-size: 17px; font-weight: 800; order: -1; }
.pm-poster .pm-url-short .pm-url-l { font-size: 15px; color: var(--p-sub); }

/* フッター：ロゴと運営元 */
.pm-poster .pm-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 56px 26px; }
.pm-poster .pm-logo { display: block; width: 168px; height: 40px; }
.pm-poster .pm-logo-t { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 28px; letter-spacing: .2em; color: var(--p-deep); }
.pm-poster .pm-foot-t { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.pm-poster .pm-foot-a { display: block; font-weight: 700; font-size: 15px; line-height: 1.4; color: var(--p-ink); letter-spacing: .06em; }
.pm-poster .pm-foot-b { display: flex; align-items: center; gap: 16px; font-size: 14px; line-height: 1.4; color: var(--p-deep); }
.pm-poster .pm-foot-b .pm-num { font-weight: 700; }
.pm-poster .pm-ig { display: flex; align-items: center; gap: 5px; }
.pm-poster .pm-ig .pm-ic { margin-top: 2px; }   /* 小文字の英字に目で中心を合わせる */

/* ------------------------------------------------------------
   standard：クリーム地＋ゴールドの帯
   ------------------------------------------------------------ */
.pm-d-standard .pm-band { position: relative; flex: none; height: 172px; background: var(--p-gold); padding: 0 56px; display: flex; align-items: center; border-bottom: 6px solid var(--p-deep); }
.pm-d-standard .pm-band-txt { color: #fff; }
.pm-d-standard .pm-band .pm-kicker { color: #fbf1da; }
.pm-d-standard .pm-band .pm-head { margin-top: 6px; }
.pm-d-standard .pm-stamp { right: 52px; top: 17px; }

/* ------------------------------------------------------------
   photo：上に掲載画像、下は白い面
   ------------------------------------------------------------ */
.pm-d-photo { background: var(--p-white); }
.pm-d-photo .pm-hero { position: relative; flex: none; background: linear-gradient(160deg, #c4a46d 0%, #b49157 46%, #8f7038 100%); }
.pm-d-photo .pm-photo { position: absolute; left: 0; top: 0; display: block; width: 794px; height: 384px; }
.pm-d-photo .pm-stamp { right: 44px; top: 40px; }
.pm-d-photo .pm-tab { position: absolute; left: 0; bottom: 0; background: var(--p-white); padding: 18px 36px 0 56px; border-top-right-radius: 24px; color: var(--p-ink); }
.pm-d-photo .pm-tab .pm-kicker { color: var(--p-deep); font-size: 16px; }
.pm-d-photo .pm-tab .pm-head { font-size: 46px; margin-top: 2px; }
.pm-d-photo .pm-hero-empty .pm-stamp { top: 34px; }
.pm-d-photo .pm-body { padding-top: 22px; padding-bottom: 16px; }
.pm-d-photo .pm-tk-main { padding-top: 14px; padding-bottom: 12px; }
.pm-d-photo .pm-qrbox, .pm-d-photo .pm-qr { width: 220px; height: 220px; }
.pm-d-photo .pm-cta-h { font-size: 27px; }
.pm-d-photo .pm-foot { padding-top: 16px; padding-bottom: 22px; }
.pm-d-photo .pm-rule { background: var(--p-blue); margin: 16px 0 10px; }
.pm-d-photo .pm-fv { font-size: 23px; }
.pm-d-photo .pm-fl { height: 33px; }
.pm-d-photo .pm-fl { color: var(--p-blue); }
.pm-d-photo .pm-ticket { background: var(--p-paper); border-color: var(--p-paper); }
.pm-d-photo .pm-qrbox { padding: 0; border-radius: 6px; }
.pm-d-photo .pm-tk-url { border-top-color: #dccfae; }
.pm-d-photo .pm-notch { background: var(--p-white); border-color: var(--p-white); }

/* ------------------------------------------------------------
   mono：白地・墨一色・罫線のみ（白黒コピー向け）
   ------------------------------------------------------------ */
.pm-d-mono { --p-ink: #000; --p-sub: #1d1d1d; background: #fff; color: #000; }
.pm-d-mono .pm-band { position: relative; flex: none; margin: 34px 56px 0; padding: 28px 0 20px; border-top: 12px solid #000; border-bottom: 3px solid #000; display: flex; align-items: flex-end; }
.pm-d-mono .pm-band-txt { color: #000; padding-right: 150px; }
.pm-d-mono .pm-band .pm-head { margin-top: 6px; }
.pm-d-mono .pm-stamp { right: 0; top: 12px; background: #fff; border: 3px solid #000; }
.pm-d-mono .pm-stamp-in { border-color: #000; color: #000; width: 116px; height: 116px; border-width: 1.5px; }
.pm-d-mono .pm-body { padding-top: 34px; }
.pm-d-mono .pm-org { color: #000; }
.pm-d-mono .pm-rule { background: #000; height: 3px; width: 100%; margin: 22px 0 0; }
.pm-d-mono .pm-facts { border-top: none; }
.pm-d-mono .pm-fact { border-bottom: 1px solid #000; }
.pm-d-mono .pm-fl { color: #000; width: 104px; height: auto; min-height: 36px; border-right: 1px solid #000; align-self: stretch; align-items: flex-start; padding-top: 6px; }
.pm-d-mono .pm-fv { color: #000; }
.pm-d-mono .pm-desc { color: #1d1d1d; }
.pm-d-mono .pm-ml { color: #000; }
.pm-d-mono .pm-ticket { margin: 0 44px; border: 2px dashed #000; border-radius: 0; overflow: visible; background: #fff; }
.pm-d-mono .pm-cut { position: absolute; left: 22px; top: -13px; background: #fff; padding: 0 6px; display: block; }
.pm-d-mono .pm-cta-s { color: #000; }
.pm-d-mono .pm-cta-n { color: #1d1d1d; }
.pm-d-mono .pm-tk-url { border-top: 1px solid #000; }
.pm-d-mono .pm-notch { display: none; }
.pm-d-mono .pm-url-l { color: #000; }
.pm-d-mono .pm-foot-b { color: #000; }
.pm-d-mono .pm-foot { border-top: 0; }

/* ------------------------------------------------------------
   2. モーダル（管理画面のトークンを使う。単体でも読めるよう既定値つき）
   ------------------------------------------------------------ */
.adx-modal.pm-modal { z-index: 420; }
.pm-modal .adx-modal-box.pm-box { width: min(1060px, 96vw); max-height: 92vh; height: min(860px, 92vh); }
.pm-modal .pm-head-bar { gap: 16px; }
.pm-modal .pm-h-txt { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.pm-modal .pm-h-txt b { flex: none; }
.pm-modal .pm-h-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--tx-mid, #61594a); }
.pm-modal .pm-main { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 236px 1fr; }
.pm-modal .pm-rail { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-right: 1px solid var(--line, #e5dcc5); overflow-y: auto; }
.pm-modal .pm-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; text-align: left;
  background: transparent; border: 1.5px solid var(--line, #e5dcc5); border-radius: 12px; cursor: pointer;
  color: var(--tx, #26221a); font: inherit; transition: border-color .15s, background .15s;
}
.pm-modal .pm-opt:hover { border-color: var(--acc, #b49157); }
.pm-modal .pm-opt[aria-checked="true"] { border-color: var(--acc, #b49157); background: var(--acc-soft, #f5eedd); box-shadow: inset 0 0 0 1px var(--acc, #b49157); }
.pm-modal .pm-opt:focus-visible { outline: 2px solid var(--sec-deep, #2e7ba0); outline-offset: 2px; }
.pm-modal .pm-thumb { flex: none; position: relative; width: 64px; height: 91px; border-radius: 4px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--line, #e5dcc5), 0 4px 10px -6px rgba(0,0,0,.35); }
.pm-modal .pm-thumb-in { position: absolute; left: 0; top: 0; width: 794px; height: 1123px; transform: scale(.0806); transform-origin: 0 0; pointer-events: none; }
.pm-modal .pm-opt-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pm-modal .pm-opt-t b { font-family: var(--disp, inherit); font-weight: 700; font-size: 14px; }
.pm-modal .pm-opt-t small { font-size: 11.5px; line-height: 1.5; color: var(--tx-dim, #9b9280); }

.pm-modal .pm-view { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--field, #faf7ef); }
.pm-modal .pm-stage { position: relative; flex: 1 1 auto; min-height: 0; margin: 20px 24px 8px; }
.pm-modal .pm-scaler { position: absolute; left: 0; top: 0; width: 794px; height: 1123px; transform-origin: 0 0; }
.pm-modal .pm-scaler .pm-poster { position: absolute; left: 0; top: 0; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 24px 60px -24px rgba(24,20,12,.45); }
.pm-modal .pm-loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--tx-dim, #9b9280); }
.pm-modal .pm-qrnote { margin: 0; padding: 0 24px 14px; font-size: 12px; line-height: 1.7; color: var(--tx-mid, #61594a); text-align: center; overflow-wrap: anywhere; }
.pm-modal .pm-qrnote a { color: var(--acc-deep, #8f7038); }

.pm-modal .pm-foot-bar { display: flex; align-items: center; gap: 14px; padding: 13px 22px; border-top: 1px solid var(--line, #e5dcc5); }
.pm-modal .pm-msg { flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 700; line-height: 1.6; color: var(--tx-mid, #61594a); }
.pm-modal .pm-msg.is-err { color: var(--bad, #b3402f); background: var(--bad-soft, #f9e8e3); border-radius: var(--r-sm, 9px); padding: 8px 12px; }
.pm-modal .pm-msg.is-ok { color: var(--ok, #2b8557); }
.pm-modal .pm-acts { flex: none; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pm-modal .pm-btn {
  font-family: var(--disp, inherit); font-weight: 700; font-size: 13px; line-height: 1; padding: 11px 16px; border-radius: 10px; cursor: pointer;
  background: var(--panel, #fff); color: var(--tx, #26221a); border: 1px solid var(--line, #e5dcc5); transition: border-color .15s, background .15s, opacity .15s;
}
.pm-modal .pm-btn:hover:not(:disabled) { border-color: var(--acc, #b49157); color: var(--acc-deep, #8f7038); }
.pm-modal .pm-btn-pri { background: var(--acc, #b49157); border-color: var(--acc, #b49157); color: #fff; }
.pm-modal .pm-btn-pri:hover:not(:disabled) { background: var(--acc-deep, #8f7038); border-color: var(--acc-deep, #8f7038); color: #fff; }
body.adx[data-theme="dark"] .pm-modal .pm-btn-pri:hover:not(:disabled) { background: #a7854c; border-color: #a7854c; color: #fff; }
.pm-modal .pm-btn:disabled { opacity: .5; cursor: default; }
.pm-modal .pm-btn.is-busy { opacity: 1; cursor: progress; }
.pm-modal .pm-btn.is-busy::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 8px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: pmSpin .8s linear infinite; }
@keyframes pmSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pm-modal .pm-btn.is-busy::after { animation: none; } }

@media (max-width: 760px) {
  .adx-modal.pm-modal { padding: 10px; }
  .pm-modal .adx-modal-box.pm-box { height: 94vh; max-height: 94vh; }
  .pm-modal .pm-main { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .pm-modal .pm-rail { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line, #e5dcc5); padding: 10px; overflow-x: auto; }
  .pm-modal .pm-opt { width: auto; flex: 1 0 auto; padding: 6px 10px 6px 6px; }
  .pm-modal .pm-thumb { width: 34px; height: 48px; }
  .pm-modal .pm-thumb-in { transform: scale(.0428); }
  .pm-modal .pm-opt-t small { display: none; }
  .pm-modal .pm-stage { margin: 12px; }
  .pm-modal .pm-foot-bar { flex-direction: column; align-items: stretch; }
  .pm-modal .pm-acts { justify-content: stretch; }
  .pm-modal .pm-btn { flex: 1 1 auto; }
}

/* ------------------------------------------------------------
   3. 管理画面の募集フォーム：配布用ポスター欄
   ------------------------------------------------------------ */
.op-poster-prev { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.op-poster-prev:empty { display: none; }
.op-poster-prev img { height: 84px; width: auto; border-radius: 6px; border: 1px solid var(--line, #e5dcc5); background: #fff; }
.op-poster-prev .op-poster-file { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--acc-deep, #8f7038); text-decoration: none; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-poster-prev .op-poster-file:hover { text-decoration: underline; }
.op-poster-tools { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.op-poster-err { margin-top: 8px; }
