/*
 * 충남아이키움포털 — 정보마당 (ik_notice 스킨)
 * 공지사항 · 육아정보 목록 / 게시글 보기
 *
 * 게시글 본문에 쓰는 교육 부품(.edu-sec · .edu-btn · .edu-file)은
 * _layout/bootstrap/css/edu.css · ui.css 에 있습니다.
 * 공용 토큰(--color-*)은 style.css 에 있습니다.
 */

/* ============================================================
 * 자료실 — 목록 / 게시글 (04-7)
 * ============================================================ */
.archive { background: #fff; }

.archive-search {
    display: flex;
    gap: 12px;
    padding: 20px;
}

.archive-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.archive-item { border-top: 1px solid var(--color-border); }

.archive-item:last-child { border-bottom: 1px solid var(--color-border); }

.archive-item__link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 24px;
    color: inherit;
}

.archive-item__title {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    color: var(--color-text);
}

.archive-item__date {
    margin: 0;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-text);
    opacity: .4;
}

.archive-view { background: #fff; }

.archive-view__head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--color-border);
}

.archive-view__title {
    margin: 0;
    font-weight: 700;
    font-size: 20px;
    line-height: 30px;
    color: var(--color-text);
}

.archive-view__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-text);
    opacity: .5;
}

.archive-view__dot { opacity: .5; }

.archive-view__body { padding: 20px; }

.archive-view__placeholder {
    width: 100%;
    min-height: 480px;
    border-radius: 20px;
    background: #d9d9d9;
}

/* ===== 자료실 — API 연동 추가 스타일 ===== */

/* 공지 배지 */
.archive-item__notice {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 4px;
    border-radius: 8px;
    background: var(--color-primary, #2f7d68);
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    font-weight: 700;
    vertical-align: middle;
}

/* 게시글 본문 — 운영 DB 의 에디터 HTML 을 그대로 렌더링합니다. */
.archive-view__body {
    overflow-x: auto;
    font-size: 14px;
    line-height: 24px;
    word-break: break-word;
}

.archive-view__body img,
.archive-view__body video,
.archive-view__body iframe { max-width: 100%; height: auto; }

.archive-view__body table { max-width: 100%; border-collapse: collapse; }

/* 이전 · 다음 글 */
.archive-nav {
    display: flex;
    flex-direction: column;
    margin: 0 20px;
    border-top: 1px solid #e8e8e8;
}

.archive-nav__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #e8e8e8;
}

.archive-nav__label {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    color: #8b8b8b;
}

.archive-nav__title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    color: var(--color-text, #222);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ============================================================
 * 정보마당 게시판 3종 — 문의사항 · 양육퀴즈 · 이용후기
 *
 * 폼 부품(.edu-apply__*)과 버튼(.edu-btn)·첨부(.edu-file)는
 * _layout/bootstrap/css/edu.css · edu-apply.css 를 그대로 씁니다.
 * ============================================================ */

/* ===== 목록 머리 (건수 · 내 글만 보기) ===== */
.board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px 8px;
    background: #fff;
}

.board-total {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.board-mine {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text);
    opacity: .7;
    cursor: pointer;
}

.board-mine input { accent-color: var(--color-primary); }

/* ===== 상태 배지 ===== */
.board-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 12px;
    background: #f0f0f0;
    color: #6b6b6b;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    white-space: nowrap;
}

/* 답변 완료 · 승인 완료 · 참여 완료 */
.board-badge--done { background: rgba(0, 145, 132, .1); color: var(--color-primary); }

/* 양육퀴즈 상태 */
.board-badge--open   { background: rgba(0, 145, 132, .1); color: var(--color-primary); }
.board-badge--ready  { background: rgba(255, 160, 0, .12); color: #a56a00; }
.board-badge--closed { background: #f0f0f0; color: #8b8b8b; }

/* ============================================================
 * 자주하는 질문 — 아코디언 (레거시 board/faq)
 * ============================================================ */
.faq-list {
    margin: 0;
    padding: 0;
    list-style: none;
    background: #fff;
}

.faq-item { border-top: 1px solid var(--color-border); }

.faq-item:last-child { border-bottom: 1px solid var(--color-border); }

.faq-item__q {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 18px 24px;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
}

.faq-item__title {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: 15px;
    line-height: 24px;
    color: var(--color-text);
}

.faq-item__caret {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-right: 2px solid #9b9b9b;
    border-bottom: 2px solid #9b9b9b;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .2s;
}

.faq-item.is-open .faq-item__caret {
    transform: rotate(-135deg) translate(-2px, -2px);
    border-color: var(--color-primary);
}

.faq-item.is-open .faq-item__title { color: var(--color-primary); }

.faq-item__a {
    padding: 4px 24px 20px;
    background: #fafafa;
}

/* ============================================================
 * 글 목록 (1:1문의 · 이용후기)
 * ============================================================ */
.post-list {
    margin: 0;
    padding: 0;
    list-style: none;
    background: #fff;
}

.post-list > li > .ik-state { padding: 40px 20px; text-align: center; }

.post-item { border-top: 1px solid var(--color-border); }

.post-item:last-child { border-bottom: 1px solid var(--color-border); }

.post-item__link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 18px 24px;
    border: 0;
    background: none;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.post-item__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.post-item__title {
    font-weight: 600;
    font-size: 15px;
    line-height: 24px;
    color: var(--color-text);
    word-break: break-word;
}

.post-item__meta {
    font-weight: 500;
    font-size: 13px;
    line-height: 20px;
    color: var(--color-text);
    opacity: .45;
}

.post-item__link.is-locked { cursor: default; }

.post-item__link.is-locked .post-item__title { opacity: .55; }

.post-lock { font-size: 13px; }

/* ============================================================
 * 글 보기 (1:1문의 · 이용후기)
 * ============================================================ */
.post-view { background: #fff; }

.post-view__head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--color-border);
}

.post-view__title {
    margin: 0;
    font-weight: 700;
    font-size: 20px;
    line-height: 30px;
    color: var(--color-text);
    word-break: break-word;
}

.post-view__meta {
    margin: 0;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-text);
    opacity: .5;
}

.post-view__block {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
}

.post-view__block--answer { background: #fafafa; }

.post-view__answer-by {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary);
}

/* 일반 텍스트 본문 — 줄바꿈을 그대로 살립니다. */
.post-view__text {
    margin: 0;
    font-size: 15px;
    line-height: 26px;
    color: var(--color-text);
    white-space: pre-wrap;
    word-break: break-word;
}

/* 에디터 HTML 본문 */
.post-view__html {
    overflow-x: auto;
    font-size: 15px;
    line-height: 26px;
    color: var(--color-text);
    word-break: break-word;
}

.post-view__html img,
.post-view__html video,
.post-view__html iframe { max-width: 100%; height: auto; }

.post-view__html table { max-width: 100%; border-collapse: collapse; }

.post-view__html p,
.post-view__html div { margin: 0; }

.post-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

/* ============================================================
 * 글 등록 · 수정
 * ============================================================ */
.post-form { background: #fff; }

.post-form .edu-apply__file + .edu-apply__file { margin-top: 8px; }

.post-kept {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--color-border-strong);
    border-radius: 8px;
    background: #fafafa;
    font-size: 14px;
}

.post-kept__name {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-kept__del {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #8b8b8b;
}

.post-kept__del input { accent-color: var(--color-primary); }

/* ============================================================
 * 양육퀴즈
 * ============================================================ */
.quiz-page { background: #fff; }

.quiz-list {
    margin: 0;
    padding: 0 20px 8px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-list > li > .ik-state { padding: 40px 20px; text-align: center; }

.quiz-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border: 1px solid var(--color-border-strong);
    border-radius: 16px;
    background: #fff;
}

.quiz-item__head {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-item__title {
    margin: 0;
    font-weight: 700;
    font-size: 17px;
    line-height: 26px;
    color: var(--color-text);
    word-break: break-word;
}

.quiz-item__cta { display: flex; }

.quiz-item__cta .edu-btn { flex: 1 1 auto; }

/* ===== 내 결과 ===== */
.quiz-score {
    margin: 16px 24px 0;
    padding: 16px 20px;
    border-radius: 12px;
    background: rgba(0, 145, 132, .07);
    text-align: center;
}

.quiz-score__line {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--color-text);
    opacity: .6;
}

.quiz-score__big {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary);
}

/* ===== 문항 ===== */
.quiz-questions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
}

.quiz-questions > .ik-state { padding: 40px 0; text-align: center; }

.quiz-q {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--color-border-strong);
    border-radius: 12px;
}

.quiz-q__title {
    margin: 0;
    font-weight: 700;
    font-size: 15px;
    line-height: 24px;
    color: var(--color-text);
    word-break: break-word;
}

.quiz-q__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-q__explain {
    margin: 0;
    padding-top: 8px;
    border-top: 1px dashed var(--color-border-strong);
    font-size: 13px;
    line-height: 20px;
    color: var(--color-text);
    opacity: .65;
}

.quiz-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--color-border-strong);
    border-radius: 10px;
    font-size: 14px;
    line-height: 22px;
    color: var(--color-text);
    cursor: pointer;
}

.quiz-choice input { accent-color: var(--color-primary); }

.quiz-choice__label {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.quiz-choice__mark,
.quiz-choice__mine {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
}

.quiz-choice__mark { background: rgba(0, 145, 132, .12); color: var(--color-primary); }

.quiz-choice__mine { background: #f0f0f0; color: #6b6b6b; }

.quiz-choice.is-right { border-color: var(--color-primary); background: rgba(0, 145, 132, .05); }

.quiz-choice.is-wrong { border-color: #e2725b; background: rgba(226, 114, 91, .05); }

.quiz-choice.is-wrong .quiz-choice__mine { background: rgba(226, 114, 91, .12); color: #b8442c; }
