/* /resource/www/css/board.css */

/* Board Tab Navigation */
.board-tabs-wrap {
    width: 100%;
    margin-bottom: 50px;
}

.board-tabs {
    display: flex;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 12px;
}

.board-tab-item {
    flex: initial;
    min-width: 110px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #a7a7a7;
    font-size: 17px;
    font-weight: 400;
    border: 1px solid #d5d5d5;
    background-color: #fff;
    border-radius: 25px;
    padding: 0 25px;
    transition: all 0.2s;
}

.board-tab-item.active {
    background-color: #000;
    color: #fff;
    font-weight: 700;
    border-color: #000;
    z-index: 1;
}

/* Reference Room List Style */
.ref-list-wrap {
    border-top: 1px solid #d3d3d3;
}

.ref-list-item {
    position: relative;
    padding: 30px 20px;
    border-bottom: 1px solid #d3d3d3;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s;
}

.ref-list-item:hover {
    background-color: #f9f9f9;
}

/* Notice Item Spec */
.ref-list-item.notice-item {
    background-color: #ecf0f5;
    border-bottom: 1px solid #fff; /* Design shows subtle distinction or white line on blue bg */
}

.ref-list-item.notice-item:hover {
    background-color: #e2e8f0;
}

.ref-list-item .item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.badge-notice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    height: 32px;
    padding: 0 15px;
    background-color: #fff;
    border: 2px solid #5832ae;
    color: #9185bc;
    font-size: 16px;
    font-weight: 700;
    border-radius: 18px;
    flex-shrink: 0;
}

.ref-list-item .inst-nm {
    color: #888;
    margin-right: 8px;
    font-weight: 500;
}

.ref-list-item .item-title {
    flex: 1;
    display: block;
    font-size: 22.5px;
    font-weight: 600;
    color: #010101;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.38;
}

.ref-list-item .item-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-left: 0; /* Align with content or badge? Figma shows it aligned with start of text usually */
}

/* Metadata alignment if badge exists */
.notice-item .item-meta {
    /* padding-left: 94px; */ /* 82px badge + 12px gap */
}

.ref-list-item .meta-txt {
    font-size: 15.5px;
    line-height: 1.81;
    color: #757575;
    font-weight: 400;
    position: relative;
}

.ref-list-item .meta-txt + .meta-txt {
    padding-left: 15px;
}

.ref-list-item .meta-txt + .meta-txt::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 14px;
    background-color: #d3d3d3;
}

.ref-list-item .btn-file-icon {
    width: 50px;
    height: 50px;
    border: none;
    background: url('/resource/www/images/common/icon-file.png') no-repeat center / contain;
    cursor: pointer;
    margin-left: 10px;
    vertical-align: middle;
}

/* FAQ Accordion Style */
.faq-list-wrap {
    border-top: 1px solid #D3D3D3;
}

.faq-item {
    border-bottom: 1px solid #D3D3D3;
}

.faq-q {
    padding: 20px 0;
    display: flex;
    align-items: center;
    cursor: pointer;
    background-color: #FFF;
}

.faq-q .q-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22.5px;
    font-weight: 700;
    margin-right: 20px;
}

.faq-q .q-title {
    flex: 1;
    font-size: 18.5px;
    font-weight: 600;
    color: #010101;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.faq-q .toggle-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #757575;
    background-image: url('/resource/www/images/common/qna-btn-open.png');
    background-repeat: no-repeat;
    background-position: center;
}

.faq-q .toggle-icon.active { background-image: url('/resource/www/images/common/qna-btn-close.png'); }

.faq-a {
    display: none;
    background-color: #F9F9F9;
    padding: 38px 78px;
    font-size: 15.5px;
    color: #010101;
    line-height: 1.6;
    font-weight: 500;
}

/* Accessibility Support */
.high-contrast .board-tab-item.active {
    background-color: #000;
    color: #FF0;
    border-color: #FF0;
}

.high-contrast .ref-list-item {
    background-color: #000;
    color: #FFF;
    border-color: #FFF;
}

.high-contrast .ref-list-item .item-title {
    color: #FF0;
}

.high-contrast .faq-q {
    background-color: #000;
    color: #FFF;
}

.high-contrast .faq-q .q-icon {
    background-color: #FF0;
    color: #000;
}

.high-contrast .faq-a {
    background-color: #222;
    color: #FFF;
}

/* Font Size Scaling */
.font-size-up .board-tab-item { font-size: 20px; }
.font-size-up .ref-list-item .item-title { font-size: 26px; }
.font-size-up .faq-q .q-title { font-size: 22px; }
.font-size-up .faq-a { font-size: 18px; }

/* Responsive Layout */
@media screen and (max-width: 1024px) {
    .board-tabs { padding: 0 10px; }
    .board-tab-item { font-size: 16px; height: 50px; }
    .faq-a { padding: 20px 40px; }
}

@media screen and (max-width: 480px) {
    .board-tabs { flex-wrap: wrap; }
    .board-tab-item { flex: 0 0 50%; height: 45px; font-size: 14px; }
    .ref-list-item .item-title { font-size: 18px; }
    .faq-q .q-title { font-size: 16px; }
}

/* Board Search Area (Utility) */
.board-search-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
}

.board-total-count {
    font-size: 17.5px;
    line-height: 1.77;
    color: #757575;
}

.board-total-count .count-num {
    color: #000; 
    margin-left: 5px;
}

.board-search-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.board-search-select {
    height: 50px;
    padding: 0 40px 0 20px;
    border: 1px solid #dbdbdb;
    border-radius: 25px;
    background: #fff url('/resource/www/images/common/arr_down.png') no-repeat right 20px center;
    background-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    font-size: 16px;
    color: #b0b0b0;
    min-width: 120px;
    cursor: pointer;
}

.board-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #eaeaea;
    border-radius: 29px;
    background: #fff;
    overflow: hidden;
    height: 51px;
    width: 362px;
}

.board-search-input {
    flex: 1;
    border: none;
    height: 100%;
    padding: 0 25px;
    font-size: 16px;
    outline: none;
    color: #555;
    background: transparent;
}

.board-search-input::placeholder {
    color: #b1b1b1;
}

.board-search-btn {
    width: 60px;
    height: 100%;
    border: none;
    background: transparent url('/resource/www/images/common/icon-search.png') no-repeat center;
    background-size: 24px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.board-search-btn:hover {
    opacity: 0.7;
}

/* Pagination Customization (if overrides needed) */
.paging_wrap {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

/* Ensure pagination links look like design (simple numbers) */
.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 2px;
    font-size: 15px;
    color: #666;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a.active,
.pagination a:hover {
    font-weight: 700;
    color: #fff;
    background-color: #000; 
}

/* No Results Area */
.search_no_result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 0;
    text-align: center;
    width: 100%;
}

.search_no_result .no-icon {
    width: 89px;
    height: 89px;
    background-color: transparent;
    background-image: url('/resource/www/images/common/search-ico.png'); /* Fallback to existing search icon */
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: grayscale(1);
    opacity: 0.4;
    margin-bottom: 25px;
}

.search_no_result p {
    font-size: 18px;
    color: #777878;
    font-weight: 400;
    margin: 0;
}

/* Board View Section */
.board-view-section {
    width: 100%;
}

.view-page-header {
    text-align: left;
    margin-bottom: 50px;
}

.view-page-header .category {
    font-size: 19px;
    color: #7969af;
    margin-bottom: 10px;
    display: block;
    font-weight: 400;
}

.view-page-header .title {
    font-size: 66px;
    font-weight: 700;
    color: #131313;
    margin-bottom: 30px;
}

.view-header {
    padding-top: 0px;
    padding-bottom: 30px;
    /*border-top: 2px solid #000;*/
    border-bottom: 1px solid #d3d3d3;
    margin-bottom: 30px;
}

.view-header .view-title {
    font-size: 26px;
    font-weight: 500;
    color: #444;
    margin-bottom: 15px;
    line-height: 1.4;
    text-align: left;
}

.view-header .view-meta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.view-meta span {
    font-size: 15px;
    color: #adadad;
    position: relative;
    font-weight: 300;
}

.view-meta span + span {
    padding-left: 20px;
}

.view-meta span + span::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background-color: #d3d3d3;
}

.view-content {
    min-height: 300px;
    margin-bottom: 60px;
    line-height: 1.8;
    color: #333;
    font-size: 17px;
    padding: 20px 0;
}

.view-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 30px 0;
}

/* File Attachment in View */
.view-files {
    padding: 30px 0;
    border-top: 1px solid #d3d3d3;
    border-bottom: 1px solid #d3d3d3;
    display: flex;
    align-items: center;
    gap: 30px;
}

.file-header {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    flex-shrink: 0;
}

.view-files .file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.view-files .file-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #a8a8a8;
    text-decoration: none;
    font-weight: 400;
}

.view-files .file-list li a::before {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    background: url('/resource/www/images/common/icon-file.png') no-repeat center / contain;
}

/* Navigation prev/next */
.view-nav {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    background-color: #ecf0f5;
    padding: 24px 30px;
    border-radius: 10px;
    gap: 30px;
}

.nav-label {
    font-size: 17px;
    font-weight: 600;
    color: #494a4b;
    min-width: 100px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item .nav-arrow {
    width: 13px;
    height: 9px;
    display: inline-block;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

.nav-item.prev .nav-arrow {
    background-image: url('/resource/www/images/common/prev-bt.png');
    transform: rotate(90deg);
}

.nav-item.next .nav-arrow {
    background-image: url('/resource/www/images/common/prev-bt.png');
    transform: rotate(-90deg);
}

.nav-item a {
    font-size: 16px;
    color: #696b6d;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.nav-item a:hover {
    text-decoration: underline;
}

.nav-item.no-link span {
    color: #a1a1a1;
    font-size: 16px;
}

/* List Button */
.view-btn-area {
    display: flex;
    justify-content: center;
    margin-top: 60px;
    margin-bottom: 60px;
}

.btn-list-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 221px;
    height: 62px;
    border: 2px solid #57429e;
    border-radius: 31px;
    background-color: #fff;
    color: #8376b5;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-list-view:hover {
    background-color: #57429e;
    color: #fff;
}

/* High Contrast for View */
.high-contrast .board-view-section { color: #fff; }
.high-contrast .view-header { border-top-color: #fff; border-bottom-color: #fff; }
.high-contrast .view-header .view-title { color: #fff; }
.high-contrast .view-meta span { color: #ccc; }
.high-contrast .view-meta span + span::before { background-color: #fff; }
.high-contrast .view-content { color: #fff; }
.high-contrast .nav-item { background-color: #222; border: 1px solid #fff; }
.high-contrast .nav-label { color: #fff; }
.high-contrast .nav-item a { color: #FF0; }
.high-contrast .btn-list-view { background-color: #000; border-color: #fff; color: #fff; }
.high-contrast .btn-list-view:hover { background-color: #FF0; color: #000; }

/* Responsive View */
@media screen and (max-width: 1024px) {
    .view-page-header .title { font-size: 40px; }
}

@media screen and (max-width: 768px) {
    .view-page-header .title { font-size: 30px; }
    .view-header .view-title { font-size: 20px; }
    .view-meta { flex-wrap: wrap; gap: 10px; }
    .view-meta span + span { padding-left: 10px; }
    .view-meta span + span::before { left: 0; }
    .view-files { flex-direction: column; align-items: flex-start; gap: 10px; }
    .nav-item { padding: 15px; flex-direction: column; align-items: flex-start; gap: 5px; }
    .nav-label { min-width: auto; }
}

/* High Contrast for new elements */
.high-contrast .board-search-select,
.high-contrast .board-search-input-wrap {
    background-color: #000;
    color: #fff;
    border-color: #fff;
}
.high-contrast .board-search-input {
    background-color: #000;
    color: #fff;
}
.high-contrast .board-search-btn {
    background-color: #FF0; /* Highlight button */
}

.high-contrast .search_no_result p {
    color: #fff;
}

.high-contrast .search_no_result .no-icon {
    filter: invert(1) brightness(2);
}
