/* 자동 생성 (scripts/build-bundle.mjs) — 크게 보기 창용 수학 학습지 모양 */
/* Addition & Subtraction Worksheet Styles */

.options .case-option label {
    text-align: center;
}

#bd-modal-body .problems-grid {
    display: grid;
    gap: 1.2rem 1.2rem;
    margin: 0.8rem 0 1.2rem 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#bd-modal-body .problems-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

#bd-modal-body .problems-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

#bd-modal-body .problem-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 90px;
}

#bd-modal-body .problem-number {
    position: absolute;
    top: 0.2rem;
    left: 0.3rem;
    font-size: 11pt;
    color: #888;
    font-weight: 500;
}

#bd-modal-body .problem-content {
    /* 문제 폭 = (연산자 1칸 + 최대 자리수) */
    width: calc(var(--cols) * 1.7rem);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 1.8rem;
    margin: 0 auto;
}

#bd-modal-body .problem-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 0.12rem;
    font-size: 21pt;
    line-height: 1.35;
    font-weight: 500;
    width: 100%;
}

#bd-modal-body .op-col {
    display: inline-block;
    width: 1.7rem; /* digit width와 동일 */
    text-align: left;
    padding-right: 0.3rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 21pt;
    line-height: 1.35;
    font-weight: 600;
}

#bd-modal-body .problem-row.operator {
    margin-bottom: 0.1rem;
}

#bd-modal-body .problem-row.line {
    border-top: 2pt solid #333;
    width: 100%;
    margin: 0.1rem 0;
    min-width: 0;
    max-width: none;
}

#bd-modal-body .problem-row.answer {
    margin-top: 0.15rem;
}

#bd-modal-body .digit {
    display: inline-block;
    width: 1.7rem;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 21pt;
    font-weight: 500;
    letter-spacing: 0.02em;
}

#bd-modal-body .digit.empty {
    min-height: 1.7rem;
}

#bd-modal-body .answer-digit {
    color: #cc0000;
    font-weight: 600;
}

/* Answers under each problem: reserve space always, show/hide without reflow */
#bd-modal-body .problem-row.answer {
    /* fixed row height so problems never move when answers toggle */
    height: 1.6em;
    margin-top: 0.15rem;
}

/* Reduce top vertical whitespace so everything fits within A4 preview */
#bd-modal-body .student-header {
    margin-bottom: 6mm;
}

#bd-modal-body .puzzle-title {
    margin: 5mm 0;
}

#bd-modal-body .title-slot {
    /* keep a fixed slot so problems never shift when title is hidden */
    min-height: 10mm;
}

#bd-modal-body.title-off .title-slot {
    visibility: hidden;
}

#bd-modal-body .problem-row.answer .answer-slot {
    opacity: 0;
    color: #cc0000;
    font-weight: 600;
}

#bd-modal-body.answers-on .problem-row.answer .answer-slot {
    opacity: 1;
}

/* Print (multi-page):
   We print via #print-pages so we can generate N pages while keeping preview as 1 page. */


/* Mobile: keep PC layout exactly, allow horizontal scrolling instead of reflow */


/* Mixed Operations Worksheet */

/* Operation checkboxes */
.mo-ops-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 1.2rem;
    margin: 0.2rem 0;
}

.mo-ops-grid label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.96rem;
    cursor: pointer;
    white-space: nowrap;
}

/* Operand count hint below radio label */
.mo-operand-hint {
    font-size: 0.72rem;
    color: #999;
    font-weight: 400;
    letter-spacing: 0.03em;
}


/* Override generator.css: make preview a flex column so grid can fill remaining height */


/* Body area below header: flex-grows to fill the page */
#bd-modal-body .mo-page-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Problems grid: fills all remaining space, rows distributed evenly via JS */
#bd-modal-body .mo-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2.5rem;
    row-gap: 0;
    align-items: center;
    min-height: 0;
}

#bd-modal-body .mo-grid.cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 1.5rem;
}

#bd-modal-body .mo-problem {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 17pt;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    white-space: nowrap;
}

#bd-modal-body .mo-num {
    font-size: 10pt;
    color: #888;
    font-weight: 500;
    min-width: 1.8rem;
    text-align: right;
    flex-shrink: 0;
}

#bd-modal-body .mo-expr {
    flex-shrink: 0;
}

/* Answer blank: no underline, just space */
#bd-modal-body .mo-blank {
    display: inline-block;
    min-width: 2.8rem;
    text-align: center;
}

#bd-modal-body .mo-blank .answer-slot {
    display: inline-block;
    opacity: 0;
    color: #cc0000;
    font-weight: 600;
}

#bd-modal-body.answers-on .mo-blank .answer-slot {
    opacity: 1;
}

#bd-modal-body .student-header {
    margin-bottom: 6mm;
}

#bd-modal-body .puzzle-title {
    margin: 5mm 0;
}

#bd-modal-body .title-slot {
    min-height: 10mm;
    flex-shrink: 0;
}

#bd-modal-body.title-off .title-slot {
    display: none;
}

/* Print */


/* Mobile */


/* Clock / Telling Time Styles */

/* Override generator.css first-child flex layout for clock options */
.clock-options .option-group:first-child {
    display: block;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

/* Center-align all option groups */
.clock-options .option-group h2 {
    text-align: center;
    margin-top: 0;
}

.clock-options .case-options {
    justify-content: center;
    padding: 0;
}

.clock-grid {
    display: grid;
    gap: 6mm;
    margin: 4mm auto;
    width: 100%;
}

.clock-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.clock-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.clock-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.clock-number {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 11pt;
    color: #888;
    font-weight: 500;
}

.clock-svg {
    width: 100%;
    max-width: 130px;
    height: auto;
    display: block;
}

/* 비활성화 스타일 */
.disabled-group {
    opacity: 0.35;
    pointer-events: none;
}

/* count별 시계 크기 */
.clock-grid.count-1 .clock-svg circle:first-child {
    stroke-width: 1.2;
}

.clock-grid.count-1 {
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: center;
    flex: 1;
    margin: auto;
}
.clock-grid.count-1 .clock-cell {
    width: 100%;
}
.clock-grid.count-1 .clock-svg {
    width: min(100%, 70vh);
    max-width: none;
    height: auto;
}
.clock-grid.count-6  { grid-template-columns: repeat(2, 1fr) !important; }
.clock-grid.count-9 .clock-svg  { max-width: 165px; }
.clock-grid.count-6 .clock-svg  { max-width: 180px; }
.clock-grid.count-6 { gap: 3mm; }

/* count별 답란 / 시간 표시 크기 */
.clock-grid.count-1 .time-answer  { font-size: 2.2rem; gap: 0.6rem; }
.clock-grid.count-1 .time-blank   { width: 5rem; border-bottom-width: 2.5px; }
.clock-grid.count-1 .time-label   { font-size: 2.2rem; }

.clock-grid.count-6 .time-answer  { font-size: 1.5rem; gap: 0.4rem; }
.clock-grid.count-6 .time-blank   { width: 3.5rem; border-bottom-width: 2px; }
.clock-grid.count-6 .time-label   { font-size: 1.5rem; }

.clock-grid.count-9 .time-answer  { font-size: 1.25rem; gap: 0.35rem; }
.clock-grid.count-9 .time-blank   { width: 2.5rem; }
.clock-grid.count-9 .time-label   { font-size: 1.25rem; }

.time-answer {
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 0.3rem;
    display: flex;
    align-items: flex-end;
    gap: 0.3rem;
}

.time-blank {
    display: inline-block;
    width: 2rem;
    border-bottom: 1.5px solid #333;
    text-align: center;
}

.time-label {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    letter-spacing: 0.05rem;
    margin-top: 0.2rem;
}

/* Print Styles */
#print-pages .print-page {
    width: 210mm;
    min-height: 297mm;
    padding: 20mm;
    box-sizing: border-box;
    page-break-after: always;
    position: relative;
    background: white;
}

#print-pages .print-page:last-child {
    page-break-after: auto;
}


