/*
 * 캠페인 상세 "일정" — 단계 목록 + 달력 (쥬드 12-06)
 * - 표시만 바꾼다. 날짜·기간 값은 JSP(fmt)와 FullCalendar 이벤트 그대로.
 * - 칸이 넓으면(컨테이너 460px 이상) 달력 | 단계 목록 2단, 좁으면 목록 위·달력 아래.
 * - 달력 칸은 정사각, 기간은 얇은 둥근 띠(글자는 화면에서 숨기고 목록 색 점으로 범례).
 * - 이 파일은 data-fb-dark-skip 으로 붙인다(밤 색 엔진이 다시 칠하지 않음) — 밤 모드 색은 아래 html.fb-dark 규칙.
 * - 오른쪽 사이드 달력(#calendar)은 숨기고 본문 "일정" 칸 하나로 모았다(사이드는 신청 버튼·날짜 요약만).
 */

.cal-sched-wrap {
    --cs-bg: #f7f5ff;
    --cs-card: #ffffff;
    --cs-ink: #17142a;
    --cs-ink2: #4a4760;
    --cs-mute: #8b88a0;
    --cs-faint: #c4c1d4;
    --cs-line: #ece9f6;
    --cs-accent: #5a63f0;
    --cs-sun: #e5486a;
    --cs-sat: #4f6bed;
    --cs-recruit: #8d9cff;
    --cs-select: #b77cff;
    --cs-review: #ff8cbd;
    --cs-end: #a9aec2;
    container-type: inline-size;
    container-name: calsched;
    width: 100%;
    margin: 8px 0 24px;
}

/* 본문 "일정" 칸은 모든 폭에서 보인다(원래 600px 이상에선 .status-mobile 을 숨겼다). 쿠폰형은 클래스가 없어 그대로 */
body.campaign-detail-page .status-mobile.status-mobile--sched { display: block !important; }
/* 사이드의 옛 달력은 숨긴다(초기화 스크립트는 그대로 돌게 엘리먼트는 남김) */
body.campaign-detail-page .status-container #calendar { display: none !important; }

html body.campaign-detail-page label.campaigninfo-label[data-sec="schedule"]::before { content: "🗓️"; background: #eef0ff; }
.cal-sched-wrap > label.campaigninfo-label { margin-top: 12px; }

.cal-sched {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    border-radius: 24px;
    background: var(--cs-bg);
    color: var(--cs-ink);
    box-sizing: border-box;
}

/* ── 단계 목록 ── */
.cal-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}
.cal-step {
    display: grid;
    grid-template-columns: 10px auto minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--cs-card);
    font-size: 14px;
    line-height: 1.35;
    min-width: 0;
}
.cal-step__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cs-step, var(--cs-end));
}
.cal-step--recruit { --cs-step: var(--cs-recruit); }
.cal-step--select  { --cs-step: var(--cs-select); }
.cal-step--review  { --cs-step: var(--cs-review); }
.cal-step--end     { --cs-step: var(--cs-end); }
.cal-step__name {
    font-weight: 800;
    color: var(--cs-ink);
    white-space: nowrap;
    letter-spacing: -.02em;
}
.cal-step__date {
    justify-self: end;
    text-align: right;
    font-weight: 700;
    color: var(--cs-ink2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.cal-step__now {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--cs-ink);
    color: #fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    vertical-align: 1px;
}
.cal-step.is-now { box-shadow: inset 0 0 0 2px var(--cs-step); }
.cal-sched__cancel {
    margin: 0;
    padding: 14px;
    border-radius: 14px;
    background: var(--cs-card);
    font-weight: 800;
    text-align: center;
}

/* ── 달력 ── */
.cal-sched__cal {
    min-width: 0;
    padding: 10px 10px 6px;
    border-radius: 18px;
    background: var(--cs-card);
}
.cal-sched .cal-width { width: 100% !important; max-width: 440px; margin: 0 auto; }

.cal-sched .fc { font-size: 13px; color: var(--cs-ink); }
.cal-sched .fc .fc-header-toolbar.fc-toolbar {
    padding: 2px 2px 8px !important;
    margin: 0 !important;
    align-items: center;
}
.cal-sched .fc .fc-toolbar-title {
    font-size: 16px !important;
    font-weight: 900;
    letter-spacing: -.03em;
    color: var(--cs-ink);
    padding-left: 6px;
}
.cal-sched .fc .btn-group { display: flex; gap: 6px; }
.cal-sched .fc .fc-prev-button,
.cal-sched .fc .fc-next-button {
    margin: 0 !important;
    padding: 0 !important;
    width: 32px;
    height: 32px;
    border: 0 !important;
    border-radius: 50% !important;
    background: var(--cs-bg) !important;
    color: var(--cs-ink2) !important;
    box-shadow: none !important;
    display: inline-grid;
    place-items: center;
    font-size: 12px;
}
.cal-sched .fc .fc-prev-button:hover,
.cal-sched .fc .fc-next-button:hover { background: var(--cs-line) !important; }

/* 칸 선·바탕 지우기 */
.cal-sched .fc .fc-scrollgrid,
.cal-sched .fc .fc-scrollgrid table,
.cal-sched .fc .fc-scrollgrid-section > td,
.cal-sched .fc th,
.cal-sched .fc td { border: 0 !important; }
.cal-sched .fc .fc-view-harness { padding: 0 !important; }
.cal-sched .fc .fc-daygrid-day.fc-day-today { background: transparent !important; box-shadow: none !important; }
.cal-sched .fc .fc-daygrid-day-bg .fc-highlight,
.cal-sched .fc .fc-daygrid-day-bg { display: none; }

/* 요일 머리 */
.cal-sched .fc .fc-col-header-cell { padding: 2px 0 4px; }
.cal-sched .fc .fc-col-header-cell-cushion {
    padding: 0 !important;
    font-size: 12px;
    font-weight: 700;
    color: var(--cs-mute) !important;
    text-decoration: none !important;
}
.cal-sched .fc .fc-col-header-cell.fc-day-sun .fc-col-header-cell-cushion { color: var(--cs-sun) !important; }
.cal-sched .fc .fc-col-header-cell.fc-day-sat .fc-col-header-cell-cushion { color: var(--cs-sat) !important; }

/* 정사각 칸 */
.cal-sched .fc .fc-daygrid-day-frame {
    aspect-ratio: 1 / 1;
    min-height: auto !important; /* FC 기본 min-height:100% 면 내용이 넘쳐도 칸이 안 늘어난다 */
    display: flex;
    flex-direction: column;
}
.cal-sched .fc .fc-daygrid-day-top { flex-direction: row; justify-content: center; padding-top: 3px; }
.cal-sched .fc .fc-daygrid-day-number {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 3px !important;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cs-ink2) !important;
    text-decoration: none !important;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
}
.cal-sched .fc .fc-day-sun .fc-daygrid-day-number { color: var(--cs-sun) !important; }
.cal-sched .fc .fc-day-sat .fc-daygrid-day-number { color: var(--cs-sat) !important; }
.cal-sched .fc .fc-day-other .fc-daygrid-day-top { opacity: .35; }
/* 오늘: 채운 동그라미 */
.cal-sched .fc .fc-day-today .fc-daygrid-day-number {
    background: var(--cs-accent);
    color: #fff !important;
    font-weight: 900;
}

/* 기간 띠: 얇고 둥근 끝, 글자는 화면에서만 숨김(읽기 도구엔 남음) */
.cal-sched .fc .fc-daygrid-day-events { min-height: 0 !important; margin: 3px 0 0 !important; }
.cal-sched .fc .fc-daygrid-day-bottom { padding: 0 !important; }
.cal-sched .fc .fc-daygrid-event-harness { margin-top: 0 !important; }
.cal-sched .fc .fc-daygrid-event.fc-event {
    height: 5px;
    min-height: 0;
    margin: 0 0 3px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-color: var(--cs-ev, var(--cs-end)) !important;
    box-shadow: none !important;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
    cursor: default;
}
.cal-sched .fc .fc-daygrid-event.fc-event-start { margin-left: 5px !important; border-top-left-radius: 999px !important; border-bottom-left-radius: 999px !important; }
.cal-sched .fc .fc-daygrid-event.fc-event-end { margin-right: 5px !important; border-top-right-radius: 999px !important; border-bottom-right-radius: 999px !important; }
.cal-sched .fc .fc-event-main {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
/* 하루짜리(선정·마감)는 작은 점 */
.cal-sched .fc .fc-daygrid-event.fc-event.ev-point {
    width: 8px;
    height: 8px;
    margin: 0 auto 2px !important;
    border-radius: 50% !important;
}
.cal-sched .fc .ev-recruit { --cs-ev: var(--cs-recruit); }
.cal-sched .fc .ev-select  { --cs-ev: var(--cs-select); }
.cal-sched .fc .ev-review  { --cs-ev: var(--cs-review); }
.cal-sched .fc .ev-end     { --cs-ev: var(--cs-end); }

/* ── 폭 단계 ── */
/* 중간 폭(태블릿 세로 등): 목록 2×2, 달력은 가운데 */
@container calsched (min-width: 400px) {
    .cal-sched { padding: 16px; gap: 16px; }
    .cal-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cal-step {
        grid-template-columns: 10px minmax(0, 1fr);
        grid-template-areas: "dot name" ". date";
        row-gap: 2px;
    }
    .cal-step__dot { grid-area: dot; }
    .cal-step__name { grid-area: name; }
    .cal-step__date { grid-area: date; justify-self: start; text-align: left; font-size: 15px; color: var(--cs-ink); }
    .cal-sched .fc .fc-toolbar-title { font-size: 17px !important; }
    .cal-sched .fc .fc-daygrid-day-number { font-size: 14px; min-width: 28px; height: 28px; }
    .cal-sched .fc .fc-daygrid-event.fc-event { height: 6px; }
}
/* 넓은 폭: 달력 | 목록 2단 (목록은 세로 한 줄씩) */
@container calsched (min-width: 460px) {
    .cal-sched {
        grid-template-columns: minmax(0, 1.8fr) minmax(150px, 1fr);
        align-items: start;
        gap: 14px;
        padding: 14px;
    }
    .cal-sched__cal { padding: 8px 8px 4px; }
    .cal-sched__cal { order: 1; }
    .cal-sched__list { order: 2; }
    .cal-steps { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .cal-step { padding: 12px 14px; }
    .cal-step__name { white-space: normal; }
    .cal-step__now { margin-left: 4px; }
    .cal-sched .fc .fc-daygrid-day-top { padding-top: 2px; }
    .cal-sched .fc .fc-daygrid-day-number { font-size: 13px; min-width: 24px; height: 24px; }
    .cal-sched .fc .fc-daygrid-day-events { margin-top: 2px !important; }
    .cal-sched .fc .fc-daygrid-event.fc-event { height: 4px; margin-bottom: 3px !important; }
}
@container calsched (min-width: 600px) {
    .cal-sched .fc .fc-daygrid-day-number { font-size: 14px; min-width: 28px; height: 28px; }
    .cal-sched .fc .fc-daygrid-event.fc-event { height: 5px; }
    .cal-step__date { font-size: 16px; }
}

/* ── 밤 모드 ── */
html.fb-dark .cal-sched-wrap {
    --cs-bg: #1B1E36;
    --cs-card: #242848;
    --cs-ink: #ECEEF8;
    --cs-ink2: #B4B9D0;
    --cs-mute: #7F85A3;
    --cs-faint: #4a4f75;
    --cs-line: #3A3F66;
    --cs-accent: #7B5CFA;
    --cs-sun: #ff7d98;
    --cs-sat: #8AB4FF;
    --cs-recruit: #8f9dff;
    --cs-select: #c39bff;
    --cs-review: #ff8fc0;
    --cs-end: #7f85a3;
}
html.fb-dark .cal-sched .cal-step__now { background: #ECEEF8; color: #14162A; }
html.fb-dark body.campaign-detail-page label.campaigninfo-label[data-sec="schedule"]::before { background: #242848; }
/* theme-dark-core.css 의 일반 달력 규칙(보라 막대·오늘 칸 테두리)보다 이 칸 규칙이 이기게 */
html.fb-dark .cal-sched .fc .fc-daygrid-event.fc-event { background-color: var(--cs-ev, var(--cs-end)) !important; border-color: transparent !important; }
html.fb-dark .cal-sched .fc .fc-daygrid-day.fc-day-today { background: transparent !important; box-shadow: none !important; }
html.fb-dark .cal-sched .fc .fc-day-today .fc-daygrid-day-number { color: #fff !important; }
