/* ============================================================
   SOLETTE × ACCCOMMS — 월간 기획안 (plan.css)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --dark:     #1a1a1a;
  --mid:      #2d2d2d;
  --white:    #ffffff;
  --light:    #F7F4F0;
  --sand:     #C8B89A;
  --sage:     #8B9E8F;
  --rose:     #D4668A;
  --ivory:    #F5F0EB;
  --ff-serif: 'Playfair Display', Georgia, serif;
  --ff-sans:  'Noto Sans KR', sans-serif;
  --ff-en:    'Inter', sans-serif;
  --slide-w:  1080px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--ff-sans);
  background: #e8e4df;
  color: var(--dark);
  min-height: 100vh;
}

/* =========================================
   공통 레이아웃
   ========================================= */
.plan-wrap {
  max-width: var(--slide-w);
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* =========================================
   슬라이드 공통
   ========================================= */
.slide {
  width: 100%;
  background: var(--white);
  border-radius: 0;
  box-shadow: 0 2px 24px rgba(0,0,0,0.12);
  position: relative;
  overflow: hidden;
}
.slide__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--dark);
  color: var(--white);
}
.slide__header-brand {
  font-family: var(--ff-en);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--sand);
}
.slide__header-title {
  font-family: var(--ff-sans);
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
}
.slide__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  border-top: 1px solid rgba(0,0,0,0.07);
  background: var(--light);
}
.slide__footer-num { font-family: var(--ff-en); font-size: 11px; color: #aaa; letter-spacing: 1px; }
.slide__footer-tag { font-size: 10px; color: var(--sage); font-weight: 600; }

/* =========================================
   표지 슬라이드
   ========================================= */
.slide--cover { min-height: 540px; display: flex; flex-direction: column; }
.slide--cover .cover-body {
  flex: 1; display: flex; align-items: center;
  padding: 60px 64px; gap: 56px; background: var(--white);
}
.cover-left  { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.cover-label { font-family: var(--ff-en); font-size: 11px; letter-spacing: 4px; color: var(--sand); margin-bottom: 20px; }
.cover-title {
  font-family: var(--ff-serif);
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 400; line-height: 1.2; color: var(--dark); margin-bottom: 16px;
}
.cover-title--gothic { font-family: var(--ff-sans); font-weight: 700; letter-spacing: -0.5px; }
.cover-title em { color: var(--rose); font-style: italic; }
.cover-sub { font-size: 15px; color: #888; line-height: 1.7; margin-bottom: 32px; }
.cover-sub--gothic { font-family: var(--ff-sans); font-weight: 400; letter-spacing: 0.3px; }
.cover-meta { display: flex; gap: 24px; }
.cover-meta-item { display: flex; flex-direction: column; gap: 4px; }
.cover-meta-item span:first-child { font-family: var(--ff-en); font-size: 10px; letter-spacing: 2px; color: var(--sand); }
.cover-meta-item span:last-child  { font-size: 13px; font-weight: 600; color: var(--dark); }
.cover-right { width: 280px; flex-shrink: 0; }
.cover-img-slot {
  width: 100%; aspect-ratio: 4/5;
  border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, var(--sand) 0%, var(--sage) 100%);
}

/* =========================================
   콘텐츠 슬라이드
   ========================================= */
.slide--content { min-height: 500px; display: flex; flex-direction: column; }
.slide--content .content-body {
  flex: 1; display: grid;
  grid-template-columns: 360px 1fr; min-height: 440px;
}
.slide--content .content-img { min-height: 440px; }
.content-img {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--ivory) 0%, var(--sand) 100%);
}
.content-img .img-inner {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
  transition: transform .4s ease;
}
.content-img:hover .img-inner { transform: scale(1.03); }
.content-num-badge {
  position: absolute; top: 16px; left: 16px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--dark); color: var(--white);
  font-family: var(--ff-en); font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.content-num-badge.badge--polaroid { background: #f0e6d3; color: var(--dark); }
.category-bar { position: absolute; top: 0; left: 0; width: 4px; height: 100%; z-index: 3; }
.category-bar--daily   { background: var(--sand); }
.category-bar--product { background: var(--sage); }
.category-bar--studio  { background: var(--dark); }
.category-bar--review  { background: #e8ddd0; }
.category-bar--reels   { background: var(--rose); }
.content-text {
  padding: 32px 36px; display: flex;
  flex-direction: column; justify-content: space-between;
}
.content-category,
.content-category-display {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--ff-en); font-size: 10px; letter-spacing: 2px;
  font-weight: 700; color: var(--sand); margin-bottom: 16px; text-transform: uppercase;
}
.content-category::before,
.content-category-display::before { content: ''; display: block; width: 20px; height: 2px; background: var(--sand); }
.content-meta-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.content-meta-row__label {
  font-family: var(--ff-en); font-size: 9px; letter-spacing: 1.5px;
  color: #bbb; font-weight: 600; white-space: nowrap;
  margin-top: 8px; min-width: 72px; text-transform: uppercase;
}
.content-meta-row__field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cat-label-select {
  appearance: none; -webkit-appearance: none;
  background: var(--light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23C8B89A'/%3E%3C/svg%3E") no-repeat right 10px center;
  background-size: 8px; border: 1.5px solid var(--sand); border-radius: 8px;
  padding: 6px 28px 6px 12px; font-family: var(--ff-en); font-size: 11px;
  font-weight: 700; letter-spacing: 1.5px; color: var(--dark); cursor: pointer; transition: border-color .2s;
}
.cat-label-select:hover { border-color: var(--rose); }
.cat-label-select:focus { outline: none; box-shadow: 0 0 0 2px rgba(212,102,138,0.25); }
.cat-label-custom {
  border: 1.5px solid var(--sand); border-radius: 8px; padding: 6px 12px;
  font-family: var(--ff-en); font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; color: var(--dark); background: var(--light); width: 160px;
}
.cat-label-custom:focus { outline: none; border-color: var(--rose); }
.slide-num-input {
  width: 56px; border: 1.5px solid rgba(200,184,154,0.5); border-radius: 8px;
  padding: 6px 10px; font-family: var(--ff-en); font-size: 18px;
  font-weight: 700; color: var(--dark); background: var(--light);
  text-align: center; -moz-appearance: textfield;
}
.slide-num-input::-webkit-inner-spin-button,
.slide-num-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.slide-num-input:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(212,102,138,0.2); }
.slide-num-hint { font-size: 10px; color: #bbb; font-family: var(--ff-sans); white-space: nowrap; }
.slide-num-input--footer { width: 42px; font-size: 13px; padding: 3px 6px; border-radius: 5px; vertical-align: middle; }
.content-caption { font-size: 15px; line-height: 1.85; color: var(--dark); white-space: pre-line; margin-bottom: 24px; font-weight: 400; }
.hashtag-section { margin-bottom: 12px; }
.hashtag-label   { font-family: var(--ff-en); font-size: 10px; letter-spacing: 2px; color: #bbb; margin-bottom: 6px; }
.hashtag-text    { font-size: 12px; color: var(--sage); line-height: 1.8; font-weight: 500; }
.comment-tag-text{ font-size: 12px; color: #aaa; line-height: 1.8; }

/* =========================================
   릴스 슬라이드
   ========================================= */
.slide--reels .content-img { background: linear-gradient(135deg, var(--dark) 0%, var(--mid) 100%); }
.reels-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 4; pointer-events: none; }
.reels-play-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(212,102,138,0.85);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--white); box-shadow: 0 4px 20px rgba(212,102,138,0.5);
}

/* =========================================
   피드무드 슬라이드
   ========================================= */
.slide--mood .mood-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px 32px 28px;
  background: #f0ece8;
}
.feed-grid-wrap { display: flex; flex-direction: column; gap: 10px; }
.feed-grid-wrap__label {
  font-family: var(--ff-en); font-size: 10px;
  letter-spacing: 3px; color: #999; text-transform: uppercase;
}
.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: #ccc;
  border: 1px solid #ccc;
  align-items: start;
}

/* 셀 — 인스타그램 4:5 */
.fg-cell {
  background: var(--white);
  width: 100%;
  aspect-ratio: 4 / 5;
  position: relative;
  overflow: hidden;
  /* aspect-ratio 폴백: 패딩 트릭 */
  min-height: 80px;
}
.fg-cell__img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
  transition: transform .35s ease;
}
.fg-cell__img.editable { cursor: pointer; }
.fg-cell__img.editable:hover { transform: scale(1.04); }
.fg-cell__img.editable::after {
  content: '+';
  position: absolute; inset: 0;
  background: rgba(0,0,0,0); color: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 300; transition: all .25s;
}
.fg-cell__img.editable:hover::after { background: rgba(0,0,0,0.38); color: rgba(255,255,255,0.9); }

/* 릴스 아이콘 */
.fg-reels-icon {
  position: absolute; top: 6px; left: 6px; z-index: 4;
  background: rgba(212,102,138,0.88); color: var(--white);
  font-size: 9px; padding: 3px 7px; border-radius: 8px;
  font-family: var(--ff-en); pointer-events: none;
}
/* 카테고리 라벨 배지 */
.fg-label-badge {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 5;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
  color: rgba(255,255,255,0.9); font-family: var(--ff-en);
  font-size: 8px; font-weight: 600; letter-spacing: 1px;
  padding: 12px 6px 5px; text-align: center;
  pointer-events: none; text-transform: uppercase;
}
/* 번호 배지 */
.fg-num-badge {
  position: absolute; top: 0; right: 0; z-index: 5;
  background: rgba(30,30,30,0.82); color: var(--white);
  font-family: var(--ff-en); font-size: 11px; font-weight: 600;
  padding: 4px 8px; pointer-events: none; letter-spacing: 0.5px;
}
/* 날짜 배지 */
.fg-date-badge {
  position: absolute; bottom: 0; left: 0; z-index: 5;
  background: rgba(255,255,255,0.92); color: var(--dark);
  font-family: var(--ff-en); font-size: 10px; font-weight: 600;
  padding: 3px 8px; pointer-events: none; letter-spacing: 0.5px;
}
/* 날짜 배지 편집 모드 */
.fg-date-editable {
  pointer-events: auto; cursor: text;
  border-bottom: 1px dashed rgba(30,30,30,0.4);
  min-width: 30px; outline: none;
  transition: background .15s; user-select: text; -webkit-user-select: text;
}
.fg-date-editable:hover  { background: rgba(200,184,154,0.25); border-bottom-color: var(--sand); }
.fg-date-editable:focus  { background: rgba(200,184,154,0.45); border-bottom: 1.5px solid var(--sand); }
.feed-date-hint {
  font-size: 9px; color: rgba(153,153,153,0.85); margin-left: 6px;
  font-family: var(--ff-sans); font-weight: 400;
  letter-spacing: 0; text-transform: none; vertical-align: middle;
}

/* =========================================
   페이지 구분선
   ========================================= */
.slide-divider { height: 12px; background: transparent; }

/* =========================================
   상단 네비
   ========================================= */
.plan-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(26,26,26,0.95); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 40px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.plan-nav__brand { font-family: var(--ff-en); font-size: 13px; font-weight: 700; letter-spacing: 3px; color: var(--sand); }
.plan-nav__title { font-family: var(--ff-sans); font-size: 12px; color: rgba(255,255,255,0.5); }
.plan-nav__link  {
  font-family: var(--ff-en); font-size: 11px; letter-spacing: 1px;
  color: rgba(255,255,255,0.4); text-decoration: none;
  padding: 6px 14px; border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; transition: all .2s;
}
.plan-nav__link:hover { color: var(--white); border-color: rgba(255,255,255,0.3); }

/* =========================================
   어드민 전용 UI
   ========================================= */

/* 이미지 슬롯 */
.img-slot { position: relative; width: 100%; height: 100%; }
.img-slot.editable { cursor: pointer; }
.img-slot.editable::after {
  content: '클릭하여 이미지 변경';
  position: absolute; inset: 0;
  background: rgba(0,0,0,0); color: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; letter-spacing: 0.5px; transition: all .25s;
}
.img-slot.editable:hover::after { background: rgba(0,0,0,0.42); color: var(--white); }
.img-slot.is-saving::after { content: '저장 중…'; background: rgba(0,0,0,0.55); color: var(--white); }

/* 편집 텍스트 */
.editable-text { outline: none; border-radius: 4px; transition: background .2s; min-height: 1em; }
.is-admin .editable-text:hover  { background: rgba(200,184,154,0.12); }
.is-admin .editable-text:focus  { background: rgba(200,184,154,0.18); box-shadow: 0 0 0 2px var(--sand); }

/* 로딩바 */
#planLoadingBar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--sand), var(--rose), var(--sand));
  background-size: 200% 100%;
  animation: ldAnim 1.2s linear infinite;
  opacity: 0; transition: opacity .2s; z-index: 99999;
}
@keyframes ldAnim { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* 어드민 로딩바는 툴바 아래에 */
.is-admin #planLoadingBar { top: 48px; }

/* 토스트 */
.save-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1a1a1a; color: var(--sand);
  border: 1px solid var(--sand);
  padding: 10px 24px; border-radius: 24px;
  font-size: 13px; font-weight: 500;
  opacity: 0; transition: all .3s; z-index: 9999;
  pointer-events: none; white-space: nowrap;
}
.save-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.save-toast.error   { background: #c0392b; color: #fff; border-color: #c0392b; }

/* =========================================
   반응형
   ========================================= */
@media (max-width: 900px) {
  .slide--content .content-body { grid-template-columns: 280px 1fr; }
  .cover-right { width: 220px; }
  .slide--mood .mood-body { gap: 16px; padding: 20px 20px 24px; }
}
@media (max-width: 640px) {
  .plan-nav { padding: 12px 20px; }
  .plan-nav__title { display: none; }
  .slide--content .content-body { grid-template-columns: 1fr; grid-template-rows: 280px 1fr; }
  .content-img { height: 280px; }
  .content-text { padding: 24px 20px; }
  .slide--cover .cover-body { flex-direction: column; padding: 36px 28px; gap: 32px; }
  .cover-right { width: 100%; max-width: 240px; align-self: center; }
  .plan-wrap { padding: 0 0 60px; }
  .slide--mood .mood-body { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
}
