/* ===========================================
   Calendar.css - 共通スタイル（プレビュー・PDF 両用）
   =========================================== */

body {
  font-family: 'M PLUS 1', sans-serif;
  margin: 0px;
}

/* カレンダーグリッド */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-cell {
  width: 26px;
  height: 24px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
}

.calendar-cell.header {
  font-weight: bold;
  text-align: center;
  font-size: 8px;
}

.calendar-cell img {
  max-width: 12px;
  max-height: 20px;
  object-fit: contain;
}

.full-date-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.calendar-wrapper {
  overflow-x: auto;
}

/* ===========================================
   プレビュー共通
   =========================================== */

.preview {
  border: 1px solid #eee;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 20px;
  border-radius: 8px;
  margin: 0 auto;
}

.flex.preview {
  display: flex;
  flex-shrink: 0;
  width: 300px;
  height: 202.7px;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* 月の画像（左側） */
.month-image {
  width: 45%;
  margin-right: 15px;
  position: relative;
  z-index: 1;
}

.pre-image {
  width: 100%;
}

/* カレンダー部分（右側） */
.pre-calendar {
  width: 50%;
}

.pre-right {
  font-size: 10px;
  position: relative;
  z-index: 1;
}

.pre-h2 {
  font-size: 24px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* 月表示の数字用（英語） */
.pre-month-num {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pre-month-num img {
  max-width: 20px;
  max-height: 24px;
}

/* 日本語の月表示用（数字と「月」をまとめる） */
.pre-month-jp {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pre-month-jp img {
  max-width: 20px;
  max-height: 24px;
}

/* ===========================================
   フレーム画像
   =========================================== */

.frame-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* フレームを依頼の場合のみ特別なスタイル */
.frame-11 {
  border: 2px dashed #ccc !important;
  background-image: none !important;
}

/* フレーム背景用のスタイル */
.frame-background {
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* data-background属性から背景画像を設定 */
.frame-background[data-background] {
  background-image: attr(data-background url);
}

/* ===========================================
   印刷・PDF 用
   =========================================== */

@media print {
  .flex.preview {
    page-break-after: always;
    height: 100vh;
  }

  /* 最後のカレンダーには改ページを入れない */
  .flex.preview:last-child {
    page-break-after: avoid;
    margin-bottom: 0;
  }
}