/* =============================================
   営業日カレンダー画像生成ツール
   ============================================= */

.ln-cal {
  --ln-cal-green: #06c755;
  --ln-cal-green-hover: #05a847;
  --ln-cal-panel: #ffffff;
  --ln-cal-line: #e5e7eb;
  --ln-cal-text: #1e2430;
  --ln-cal-muted: #6b7380;
  --ln-cal-section-bg: #f9fafb;
  width: 100%;
  max-width: 100% !important;
  padding: 20px 0;
  font-family: -apple-system, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.post_content .ln-cal {
  max-width: 100% !important;
}

/* --- レイアウト --- */
.ln-cal__layout {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}

.ln-cal__panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ln-cal__preview {
  flex: 0 0 auto;
  width: 480px;
  position: sticky;
  top: 60px;
}

/* --- セクション --- */
.ln-cal__section {
  border: 1px solid var(--ln-cal-line);
  border-radius: 12px;
  background: var(--ln-cal-section-bg);
  padding: 18px 20px 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ln-cal__section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ln-cal-text);
  padding: 0 2px;
  margin: 0;
  letter-spacing: 0.02em;
}

/* --- 行（横並び） --- */
.ln-cal__row {
  display: flex;
  gap: 12px;
}

.ln-cal__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.ln-cal__field--grow {
  flex: 1;
  min-width: 0;
}

.ln-cal__field--fixed {
  flex: 0 0 160px;
}

.ln-cal__label {
  font-size: 11px;
  font-weight: 600;
  color: #888;
}

.ln-cal__input,
.ln-cal__textarea {
  width: 100%;
  border: 1px solid var(--ln-cal-line);
  border-radius: 8px;
  background: #fff;
  color: var(--ln-cal-text);
  font-size: 14px;
  padding: 9px 12px;
  box-sizing: border-box;
  transition: all .2s;
  font-family: inherit;
}

.ln-cal__textarea {
  resize: vertical;
}

.ln-cal__input:focus,
.ln-cal__textarea:focus {
  outline: none;
  border-color: var(--ln-cal-green);
  box-shadow: 0 0 0 2px rgba(6, 199, 85, 0.1);
}

/* --- カラーピッカー --- */
.ln-cal__color-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ln-cal__input--color {
  width: 48px;
  height: 36px;
  min-height: 36px;
  padding: 2px;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--ln-cal-line);
  background: #fff;
  flex-shrink: 0;
}

.ln-cal__color-desc {
  font-size: 11px;
  color: #999;
}

/* --- 定休日チェックボックス --- */
.ln-cal__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ln-cal__checks label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1.5px solid var(--ln-cal-line);
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--ln-cal-text);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}

.ln-cal__checks label:hover {
  border-color: #bbb;
}

.ln-cal__checks label:has(input:checked) {
  border-color: var(--ln-cal-green);
  background: #f0faf4;
  color: var(--ln-cal-green);
  box-shadow: 0 0 0 2px rgba(6, 199, 85, 0.1);
}

/* --- ボタン --- */
.ln-cal__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ln-cal__button {
  appearance: none;
  border: 1.5px solid var(--ln-cal-line);
  background: #fff;
  color: var(--ln-cal-text);
  border-radius: 8px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.ln-cal__button:hover {
  border-color: #bbb;
  background: #f8f8f8;
}

.ln-cal__button--primary {
  border-color: transparent;
  background: var(--ln-cal-green);
  color: #fff;
}

.ln-cal__button--primary:hover {
  background: var(--ln-cal-green-hover);
}

/* --- プレビュー --- */
.ln-cal__preview-frame {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  padding: 12px;
  overflow: hidden;
}

.ln-cal__preview-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px 2px;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  letter-spacing: 0.04em;
}

.ln-cal__preview-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ln-cal-green);
  animation: ln-cal-pulse 2s ease-in-out infinite;
}

@keyframes ln-cal-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.ln-cal__canvas-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #f5f5f5;
}

#ln-cal-canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
}

/* --- レスポンシブ --- */
@media (max-width: 960px) {
  .ln-cal__layout {
    flex-direction: column;
  }

  .ln-cal__preview {
    width: 100%;
    position: static;
  }
}

@media (max-width: 640px) {
  .ln-cal__row {
    flex-direction: column;
  }

  .ln-cal__field--fixed {
    flex: 1;
  }

  .ln-cal__actions {
    flex-direction: column;
  }

  .ln-cal__button {
    width: 100%;
    text-align: center;
  }

  .ln-cal__section {
    padding: 14px 14px 16px;
  }
}
