/* ---------- 募集作成ページ ---------- */
[hidden] { display: none !important; }

.post { padding-bottom: 30px; }

.post-grid { display: grid; gap: 18px; }
.post-form { min-width: 0; }

.post-tools {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.post-step { margin-bottom: 12px; }
.post-step h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 6px;
}
.post-step__no {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
  background: var(--primary);
}
.post-step__hint {
  margin: 0 0 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}
.post-fields { display: grid; gap: 10px; }
.post-row { display: grid; gap: 10px; }
.post-row--2 { grid-template-columns: 1fr 1fr; }
.post-row--3 { grid-template-columns: 1fr 1fr; }
.post-row--3 > .field:last-child { grid-column: 1 / -1; }
.field--short { max-width: 160px; }

.req {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: 1px;
}

.field textarea,
.sns-row input,
.sns-row select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfcfc;
  border-radius: 9px;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}
.field textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.7;
}
.field textarea:focus,
.sns-row input:focus,
.sns-row select:focus { outline: 2px solid rgba(244, 87, 15, .35); outline-offset: 1px; background: #fff; }

.field input.is-error,
.field select.is-error,
.field textarea.is-error { border-color: #dc9b92; background: #fff7f6; }

.post-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
  font-size: 11px;
  color: var(--muted);
}
.post-counter__hint { margin-left: auto; }
.post-counter.is-over #body-count { color: var(--primary-dark); font-weight: 700; }

/* tags */
.tagpick { display: flex; flex-wrap: wrap; gap: 6px; }
.tagpick__item { position: relative; display: inline-flex; }
.tagpick__item input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.tagpick__item span {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f4f7f8;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--ink);
  transition: .15s ease;
}
.tagpick__item span:hover { border-color: var(--primary); background: var(--primary-soft); }
.tagpick__item input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}
.tagpick__item input:focus-visible + span { outline: 2px solid rgba(244, 87, 15, .5); outline-offset: 2px; }

/* sns rows */
.sns-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) minmax(0, 1.2fr) 30px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.sns-row input,
.sns-row select { padding: 8px 9px; font-size: 12.5px; }
.sns-remove {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.sns-remove:hover { color: var(--primary-dark); border-color: #e9c3b6; }
.post-add { margin-top: 2px; }

/* emoji + hue */
.emoji-bar { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-pick {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 17px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.emoji-pick:hover { border-color: var(--primary); background: var(--primary-soft); }
#p-hue {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(90deg, hsl(0 85% 80%), hsl(60 85% 80%), hsl(120 85% 80%), hsl(180 85% 80%), hsl(240 85% 80%), hsl(300 85% 80%), hsl(360 85% 80%));
}
#p-hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 26px;
  border-radius: 5px;
  background: #fff;
  border: 2px solid var(--ink);
}
#p-hue::-moz-range-thumb {
  width: 14px;
  height: 24px;
  border-radius: 5px;
  background: #fff;
  border: 2px solid var(--ink);
}

.post-save-note {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* ---------- preview ---------- */
.post-side { display: grid; gap: 12px; align-content: start; }
.post-side__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.post-side__head h2,
.post-side__title { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.post-side__live {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 1px 8px;
}
.post-side .card { box-shadow: none; }
.post-side .card:hover { transform: none; }
#pv-detail .detail-hero {
  height: 104px;
  font-size: 46px;
  margin-bottom: 10px;
}
#pv-detail .pv-title { font-size: 15px; font-weight: 800; line-height: 1.45; }
#pv-detail .pv-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
#pv-detail .pv-place { margin: 4px 0 10px; font-size: 11.5px; color: var(--muted); }
#pv-detail .spec { font-size: 12px; }
#pv-detail .spec th { width: 38%; padding: 7px 4px; }
#pv-detail .spec td { padding: 7px 4px; }
#pv-detail .pv-body {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: #34505d;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* progress */
.post-progress__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
}
.post-progress__top strong { font-size: 18px; color: var(--ink); }
.post-progress__bar {
  height: 7px;
  border-radius: 999px;
  background: #eef3f5;
  overflow: hidden;
}
.post-progress__bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #ff9a5c);
  transition: width .25s ease;
}
.post-progress__note { margin: 8px 0 0; font-size: 11px; color: var(--muted); }

/* ---------- output ---------- */
.post-out { margin-top: 18px; }
.post-out__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.post-out__head h2 { font-size: 16px; }
.post-note { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.post-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: #eef3f5;
  border-radius: 4px;
  padding: 1px 5px;
}
.post-status {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
}
.post-status[data-state="pending"] { background: #eef3f5; color: #45606d; }
.post-status[data-state="ok"] { background: #e7f6ec; color: #17703a; }
.post-status[data-state="ng"] { background: #fff1e9; color: var(--primary-dark); }

.post-out__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.post-missing {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.post-missing:empty { display: none; }
.post-missing li {
  font-size: 11px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 3px 10px;
}
.post-missing li::before { content: "未入力 "; font-weight: 700; }

#out-json {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  border-radius: 10px;
  background: #0e2a3b;
  color: #d9e6ec;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
}
#out-json:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
#out-hint { margin-top: 10px; }

/* copied state */
.btn.is-done { background: #17703a; }
.btn.is-done:hover { background: #17703a; }

@media (min-width: 560px) {
  .post-row--3 { grid-template-columns: repeat(3, 1fr); }
  .post-row--3 > .field:last-child { grid-column: auto; }
  .post-row--2 { gap: 10px; }
}

@media (min-width: 900px) {
  .post-grid { grid-template-columns: minmax(0, 1fr) 344px; gap: 24px; align-items: start; }
  .post-side { position: sticky; top: 74px; }
  .post-step { padding: 18px; }
}

@media (max-width: 559px) {
  .post-out__head { flex-direction: column; gap: 6px; }
  .post-out__actions .btn { flex: 1 1 auto; }
  .sns-row { grid-template-columns: 1fr 1fr 30px; }
  .sns-row .sns-url { grid-column: 1 / 3; grid-row: 2; }
  .sns-row .sns-remove { grid-column: 3; grid-row: 1 / 3; align-self: center; }
}

@media (max-width: 899px) {
  .post { padding-bottom: 96px; }
  .post-progress {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 24px rgba(16, 38, 50, .18);
    backdrop-filter: blur(6px);
    transition: opacity .2s ease, transform .2s ease;
  }
  .post-progress.is-hidden {
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
  }
  .post-progress__top {
    flex: none;
    gap: 6px;
    margin: 0;
    font-size: 10.5px;
    white-space: nowrap;
  }
  .post-progress__top strong { font-size: 14px; }
  .post-progress__bar { flex: 1; }
  .post-progress__note { display: none; }
  .post-tools { margin-top: 10px; }
  .site-footer { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* 印刷: プレビューを募集要項として1枚に */
@media print {
  .site-header,
  .drawer,
  .drawer-overlay,
  .site-footer,
  .post .crumbs,
  .post .page-title p,
  .post-form,
  .post-out__actions,
  .post-save-note,
  .post-progress,
  .post-side__live { display: none !important; }
  body { background: #fff; }
  .post-grid { display: block; }
  .post-side { position: static; display: block; }
  .post-side .box { border: 0; padding: 0; margin-bottom: 14px; break-inside: avoid; }
  #pv-detail .pv-body { -webkit-line-clamp: unset; display: block; }
  .post-out { border: 0; padding: 0; }
  #out-json { max-height: none; overflow: visible; background: #fff; color: #000; border: 1px solid #ccc; }
}

/* ---------- 掲載同意 ---------- */
.post-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-size: 12.5px;
  line-height: 1.7;
}
.post-consent input { margin-top: 3px; flex: none; }
.post-consent a { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 2px; }
.post-out__actions .is-disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 自動送信 ---------- */
.post-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.post-result {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f6f8f9;
  font-size: 12.5px;
  line-height: 1.7;
}
.post-result[data-state="ok"] { background: #e7f6ec; border-color: #b8e3c6; color: #17703a; }
.post-result[data-state="ng"] { background: #fff7f2; border-color: #f6c8ad; color: #8a3200; }
.post-result[data-state="info"] { background: #eef3f5; border-color: #d6e2e8; color: #334f5c; }
.post-result strong { display: block; font-size: 13px; margin-bottom: 2px; }
.post-result ul { margin: 6px 0 0; padding-left: 18px; }
.post-result li { margin: 2px 0; }
.post-result a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#submit-post[disabled] { opacity: .45; cursor: not-allowed; }
#submit-post.is-sent { background: #17703a; }

