/* 2026-10-04 학생 숙제 화면 디자인 점검 수정 (휴대폰 320~414px, PC 768~1440px) */

/* 학생 이름 배지: 밝아진 머리글 위에서 읽히도록 대비 회복 */
body:is([data-homework-section="list"], [data-homework-section="detail"], [data-homework-section="records"]) .header-actions .student-badge {
  background: #f1e6d2;
  color: #3f2d14;
  border: 1px solid #d8c4a0;
}

/* 숙제 첨부 파일 링크: 누르기 쉬운 높이 */
.detail-attachments a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 0;
}

/* 기초 교육 긴 문항 지시: 입력칸 위에 계속 보이게 */
.structured-homework-hint {
  margin: 0;
  color: #5a4d3a;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* 글쓰기 보기 도구: 글자 버튼 */
.writing-tool-btn {
  padding: 0 10px;
  white-space: nowrap;
}

/* 원고 사진 빈 안내: 작은 썸네일 칸에 갇히지 않게 */
.submission-attachment-grid > .submission-attachment-empty {
  grid-column: 1 / -1;
}

/* 학습 허브: 짧은 카드가 옆 카드 높이로 늘어나지 않게 */
.learning-hub-grid {
  align-items: start;
}

/* 입시 D-day 표: 날짜·전형 이름이 단위 중간에서 끊기지 않게 */
.admission-dday-table td,
.admission-dday-table th {
  word-break: keep-all;
}
.admission-dday-table td small {
  white-space: nowrap;
}
/* 근거 열: 공통 overflow-wrap:anywhere 때문에 링크 칸이 26px까지 줄어 글자가 세로로 꺾이던 것 */
.admission-dday-table th:last-child,
.admission-dday-table td:last-child {
  min-width: 10em;
  overflow-wrap: normal;
}

/* 입시 D-day 대학별 설명: PC에서는 표가 같은 정보를 보여 주므로 접어 둔다 */
.admission-dday-more > summary {
  display: none;
}
@media (min-width: 821px) {
  .admission-dday-more > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin-top: 12px;
    color: #7a5420;
    font-weight: 800;
    cursor: pointer;
  }
}

/* 휴대폰 좁은 화면: 겹친 여백을 줄이고 버튼을 한 줄씩 */
@media (max-width: 400px) {
  body[data-homework-section="detail"] .homework-section {
    padding-left: 10px;
    padding-right: 10px;
  }
  .submission-preview-block {
    padding: 12px;
  }
  .submission-footer .stack-actions,
  .foundation-resource-block .stack-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .submission-footer .stack-actions > *,
  .foundation-resource-block .stack-actions > * {
    width: 100%;
    min-width: 0;
  }
}

/* PC: 읽고 쓰는 줄 길이 제한 */
@media (min-width: 1024px) {
  .detail-note,
  #detailDescription,
  #detailRules,
  .homework-section[data-state="detail"] .detail-body {
    max-width: 46em;
  }
  .homework-section[data-state="detail"] textarea.form-input {
    max-width: 46em;
  }
}

/* PC: 숙제 목록 두 열 */
@media (min-width: 1100px) {
  .student-homework-due-group-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* 성적 수정 요청 창: 휴대폰은 기존 폭, PC·태블릿은 넓게 */
#gradeRequestOverlay .grade-request-modal {
  max-width: 460px;
}
@media (min-width: 768px) {
  #gradeRequestOverlay .grade-request-modal {
    max-width: min(640px, calc(100vw - 48px));
  }
}

/* 2차: 자주 쓰지 않는 정보는 한 단계 안쪽으로 접는다 (Apple: 흔한 길을 먼저) */
.student-info-boards,
.foundation-resource-block,
.reading-application-card {
  border: 1px solid rgba(110, 82, 30, 0.22);
  border-radius: 12px;
  background: #fffdf8;
}
.student-info-boards {
  margin: 16px 0;
  padding: 0;
}
.student-info-boards[hidden] {
  display: none;
}
.student-info-boards > section {
  margin: 0 12px 12px;
}
.student-info-boards-summary,
.foundation-resource-summary,
.reading-application-summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 4px 10px;
  flex-wrap: wrap;
  padding: 10px 44px 10px 16px;
  position: relative;
  font-weight: 700;
  color: #3a2a12;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}
.student-info-boards-summary::-webkit-details-marker,
.foundation-resource-summary::-webkit-details-marker,
.reading-application-summary::-webkit-details-marker {
  display: none;
}
.student-info-boards-summary::after,
.foundation-resource-summary::after,
.reading-application-summary::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #8a6a2a;
  border-bottom: 2px solid #8a6a2a;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}
details[open] > .student-info-boards-summary::after,
details[open] > .foundation-resource-summary::after,
details[open] > .reading-application-summary::after {
  transform: translateY(-30%) rotate(-135deg);
}
.student-info-boards-summary:focus-visible,
.foundation-resource-summary:focus-visible,
.reading-application-summary:focus-visible {
  outline: 2px solid #8a6a2a;
  outline-offset: 2px;
}
.student-info-boards-title {
  font-size: 1rem;
}
.student-info-boards-sub {
  font-weight: 400;
  font-size: 0.86rem;
  color: #6b5a3e;
  word-break: keep-all;
}
.reading-application-summary small {
  font-weight: 400;
  color: #6b5a3e;
}
.foundation-resource-block[open],
.reading-application-card[open] {
  padding-bottom: 12px;
}
.foundation-resource-block > :not(summary),
.reading-application-card > :not(summary) {
  margin-left: 16px;
  margin-right: 16px;
}
@media (prefers-reduced-motion: reduce) {
  .student-info-boards-summary::after,
  .foundation-resource-summary::after,
  .reading-application-summary::after {
    transition: none;
  }
}

/* 카드 윗줄: 상태 문구가 길어도 제목을 세로로 찌그러뜨리지 않게 한다.
   제목은 최소 12em을 지키고, 넘치는 배지는 다음 줄로 내려가 안에서 줄을 바꾼다. */
.homework-card .card-top {
  flex-wrap: wrap;
}
.homework-card .card-top .card-title {
  flex: 1 1 12em;
  min-width: 0;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.homework-card .card-top .status-pill {
  max-width: 100%;
  white-space: normal;
  text-align: left;
  word-break: keep-all;
  line-height: 1.45;
}
/* 640px 이하에서는 윗줄이 세로로 쌓이므로 12em이 높이로 잡히지 않게 한다 */
@media (max-width: 640px) {
  .homework-card .card-top .card-title {
    flex: 0 0 auto;
  }
}

/* 숙제 완료율: 지난달과 이번 달 나란히 */
.student-completion-head strong,
.student-completion-head small {
  word-break: keep-all;
}
.student-completion-compare {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e2d4bc;
}
.student-completion-compare[hidden] {
  display: none;
}
.student-completion-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.student-completion-month {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.8);
  border: 1px solid #ece2d1;
  min-width: 0;
}
.student-completion-month.is-current {
  border-color: #c9a96a;
  background: #fffaf0;
}
.student-completion-month-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #7a6b55;
}
.student-completion-month-percent {
  font-size: 1.35rem;
  font-weight: 900;
  color: #3f2d14;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.student-completion-month.is-previous .student-completion-month-percent {
  color: #6b5a3e;
}
.student-completion-month-counts {
  font-size: 0.8125rem;
  color: #7a6b55;
  word-break: keep-all;
}
.student-completion-month-bar {
  display: block;
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: #ebe1d1;
  overflow: hidden;
}
.student-completion-month-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #b9a582;
  transition: width 220ms ease;
}
.student-completion-month.is-current .student-completion-month-bar > span {
  background: #8b6914;
}
.student-completion-compare-note {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #6b5a3e;
  word-break: keep-all;
}
@media (prefers-reduced-motion: reduce) {
  .student-completion-month-bar > span {
    transition: none;
  }
}
