/* ========================================
   Board Styles (공지사항/자료실 게시판)
   ======================================== */

/* Board Wrapper */
.sub-wrap .board {
    width: 100%;
    max-width: 1640px;
    margin: 0 auto;
    padding: 0 30px 8rem;
}

/* Board Toolbar */
.sub-wrap .board-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(20px, 2vw, 40px);
    gap: 24px;
}

.sub-wrap .board-toolbar__tabs {
    display: flex;
    gap: 0;
    align-items: center;
}

.sub-wrap .board-toolbar__tabs .tab {
    display: inline-block;
    padding: 8px 20px;
    font-size: clamp(14px, 1.5vw, 18px);
    font-weight: 500;
    color: #6B7280;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
}

.sub-wrap .board-toolbar__tabs .tab:hover {
    color: #111827;
}

.sub-wrap .board-toolbar__tabs .tab.is-active {
    color: #111827;
    font-weight: 700;
    border-bottom-color: #111827;
}

.sub-wrap .board-toolbar__right {
    display: flex;
    gap: 0;
    align-items: center;
    margin-left: auto;
}

.sub-wrap .board-search {
    display: flex;
    gap: 0;
    align-items: center;
    border-bottom: 2px solid #000;
}

.sub-wrap .board-search__select {
    padding: clamp(10px, 1.5vw, 16px) clamp(16px, 2vw, 24px);
    border: none;
    background: transparent;
    font-size: clamp(14px, 1.5vw, 16px);
    color: #111827;
    cursor: pointer;
    margin-right: 12px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    padding-right: 24px;
    min-width: clamp(100px, 10vw, 120px);
}

.sub-wrap .board-search__select:focus {
    outline: none;
}

.sub-wrap .board-search__input {
    padding: clamp(8px, 1.5vw, 12px) clamp(12px, 2vw, 16px);
    border: none;
    background: transparent;
    font-size: clamp(14px, 1.5vw, 16px);
    min-width: clamp(200px, 10vw, 280px);
    transition: var(--transition);
}

.sub-wrap .board-search__input::placeholder {
    color: #9CA3AF;
}

.sub-wrap .board-search__input:focus {
    outline: none;
}

.sub-wrap .board-search__btn {
    padding: 8px;
    border: none;
    background: transparent;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-left: 8px;
}

.sub-wrap .board-search__btn:hover {
    color: var(--c-primary);
}

.sub-wrap .board-search__btn svg {
    width: clamp(20px, 2vw, 24px);
    height: clamp(20px, 2vw, 24px);
}

/* Board List (Table Style for PC) */
.sub-wrap .board-list {
    border-top: 2px solid var(--c-text);
    border-bottom: 1px solid var(--c-border);
}

.sub-wrap .board-row {
    display: grid;
    grid-template-columns: 80px 1fr 120px 100px;
    border-bottom: 1px solid var(--c-border);
    transition: background 0.2s ease;
    align-items: center;
    grid-auto-flow: row;
}

.sub-wrap .board-row:hover {
    background: var(--c-gray-50);
}

.sub-wrap .board-row--header {
    background: var(--c-gray-50);
    font-weight: 600;
    color: var(--c-text);
}

.sub-wrap .board-row--header:hover {
    background: var(--c-gray-50);
}

.sub-wrap .board-row a {
    display: contents;
    text-decoration: none;
    color: inherit;
}

.sub-wrap .board-cell {
    padding: 16px 12px;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--c-border);
}

.sub-wrap .board-cell:last-child {
    border-right: none;
}

.sub-wrap .board-cell--no {
    justify-content: center;
    color: var(--c-muted);
    font-size: 14px;
}

.sub-wrap .board-cell--title {
    justify-content: flex-start;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.sub-wrap .board-cell--date,
.sub-wrap .board-cell--views {
    justify-content: center;
    color: var(--c-muted);
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sub-wrap .board-cell--file {
    justify-content: center;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sub-wrap .board-cell--file svg {
    width: 18px;
    height: 18px;
    color: var(--c-muted);
}

/* Archive List (with file column) */
.sub-wrap.sub-archive-list .board-row {
    grid-template-columns: 80px 1fr 72px 120px 100px;
}

.sub-wrap.sub-archive-list .board-cell--views,
.sub-wrap.sub-archive-view .board-view__meta-item {
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
}

.sub-wrap.sub-archive-list .board-cell--file {
    min-width: 72px;
}

.sub-wrap.sub-archive-list .board-cell--title {
    min-width: 200px;
}

/* Board View */
.sub-wrap .board-view {
    border-top: 2px solid var(--c-text);
}

.sub-wrap .board-view__header {
    padding: 24px;
    border-bottom: 1px solid var(--c-border);
}

.sub-wrap .board-view__title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.4;
}

.sub-wrap .board-view__meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--c-muted);
}

.sub-wrap .board-view__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sub-wrap .board-view__content {
    padding: 40px 24px;
    min-height: 300px;
    line-height: 1.8;
    color: var(--c-text);
    border-bottom: 1px solid var(--c-border);
}

.sub-wrap .board-view__content p {
    margin-bottom: 16px;
}

.sub-wrap .board-view__content .content-media {
    margin: 0 0 32px 0;
    text-align: center;
}

.sub-wrap .board-view__content .content-media img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.sub-wrap .board-view__attachment {
    padding: 20px 24px;
    background: var(--c-gray-50);
    border-bottom: 1px solid var(--c-border);
}

.sub-wrap .board-view__attachment-title {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

.sub-wrap .board-view__attachment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sub-wrap .board-view__attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--c-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sub-wrap .board-view__attachment-item:hover {
    color: var(--c-primary);
}

.sub-wrap .board-view__attachment-item svg {
    width: 16px;
    height: 16px;
}

.sub-wrap .board-view__actions {
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* Board Form */
.sub-wrap .board-form {
    border-top: 2px solid var(--c-text);
}

.sub-wrap .board-form__row {
    display: flex;
    border-bottom: 1px solid var(--c-border);
}

.sub-wrap .board-form__label {
    width: 150px;
    padding: 16px 20px;
    background: var(--c-gray-50);
    font-weight: 600;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--c-border);
}

.sub-wrap .board-form__field {
    flex: 1;
    padding: 16px 20px;
}

.sub-wrap .board-form__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.sub-wrap .board-form__input:focus {
    outline: none;
    border-color: var(--c-primary);
}

.sub-wrap .board-form__textarea {
    width: 100%;
    min-height: 400px;
    padding: 12px;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    line-height: 1.6;
    transition: var(--transition);
}

.sub-wrap .board-form__textarea:focus {
    outline: none;
    border-color: var(--c-primary);
}

.sub-wrap .board-form__file {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    cursor: pointer;
}

.sub-wrap .board-form__actions {
    padding: 24px 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Board Bottom (Pagination + Actions) */
.sub-wrap .board-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.sub-wrap .board-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    order: 1;
}

/* Pagination */
.sub-wrap .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    order: 2;
}

.sub-wrap .pagination__btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--c-border);
    background: #fff;
    color: var(--c-text);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 4px;
}

.sub-wrap .pagination__btn:hover {
    background: var(--c-gray-50);
    border-color: var(--c-primary);
}

.sub-wrap .pagination__btn--active {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
    font-weight: 600;
}

.sub-wrap .pagination__btn--active:hover {
    background: var(--c-primary);
}

/* ========================================
   Gallery Styles (공지사항 갤러리형)
   ======================================== */

/* Gallery List Container */
.sub-wrap .gallery-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-bottom: 20px;
}

/* Gallery Card */
.sub-wrap .gallery-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sub-wrap .gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--c-primary);
}

/* Gallery Card Image */
.sub-wrap .gallery-card__image {
    width: 100%;
    padding-top: 56.25%; /* 16:9 ratio */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Gallery Card Content */
.sub-wrap .gallery-card__content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* Gallery Card Label */
.sub-wrap .gallery-card__label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--c-primary);
    text-transform: uppercase;
}

/* Gallery Card Title */
.sub-wrap .gallery-card__title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--c-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Gallery Card Description */
.sub-wrap .gallery-card__desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--c-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    flex: 1;
}

/* Gallery Card Date */
.sub-wrap .gallery-card__date {
    font-size: 13px;
    color: var(--c-muted);
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--c-border);
}

/* Form Help Text */
.sub-wrap .board-form__help {
    margin-top: 8px;
    font-size: 13px;
    color: var(--c-muted);
    line-height: 1.5;
}

/* Thumbnail Preview */
.sub-wrap .board-form__thumbnail-preview {
    margin-bottom: 12px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    overflow: hidden;
    max-width: 400px;
}

.sub-wrap .board-form__thumbnail-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* Buttons */
.sub-wrap .btn {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sub-wrap .btn--primary {
    background: var(--c-primary);
    color: #fff;
}

.sub-wrap .btn--primary:hover {
    background: #C61940;
}

.sub-wrap .btn--secondary {
    background: #fff;
    color: var(--c-text);
    border: 1px solid var(--c-border);
}

.sub-wrap .btn--secondary:hover {
    background: var(--c-gray-50);
    border-color: var(--c-text);
}

.sub-wrap .btn--search {
    padding: 10px 20px;
}

.sub-wrap .btn svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 1280px) {
    .sub-wrap .gallery-list {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* Tablet Optimization */
@media (max-width: 1024px) and (min-width: 769px) {
    .sub-wrap .board {
        padding: 0 15px 4rem;
    }
    .sub-wrap.sub-archive-list .board-row {
        grid-template-columns: 60px 1fr 60px 100px 80px;
    }
    
    .sub-wrap .board-cell--title {
        min-width: 150px;
    }

    /* Gallery - 2 columns on tablet */
    .sub-wrap .gallery-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .sub-wrap .board {
        padding: 0 15px 4em;
    }

    /* Toolbar - Stack Vertically */
    .sub-wrap .board-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .sub-wrap .board-toolbar__tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        justify-content: center;
    }

    .sub-wrap .board-toolbar__tabs .tab {
        padding: 8px 16px;
        font-size: 14px;
        white-space: nowrap;
    }

    .sub-wrap .board-toolbar__right {
        width: 100%;
        margin-left: 0;
    }

    .sub-wrap .board-search {
        width: 100%;
        display: flex;
        gap: 0;
    }

    .sub-wrap .board-search__input {
        flex: 1;
        min-width: 0;
    }

    .sub-wrap .board-search__input {
        flex:1;
        min-width: auto;
        width: 100%;
    }

    .sub-wrap .btn--search,
    .sub-wrap .btn--primary {
        width: 100%;
        flex:1;
    }

    /* List - Card Style for Mobile */
    .sub-wrap .board-list {
        border-top: none;
        border-bottom: none;
    }

    .sub-wrap .board-row {
        display: block;
        padding: 16px;
        border: 1px solid var(--c-border);
        border-radius: 8px;
        margin-bottom: 5px;
    }

    .sub-wrap .board-row--header {
        display: none;
    }

    .sub-wrap .board-cell {
        padding: 0;
        border: none;
        display: block;
        margin-bottom: 0;
    }

    .sub-wrap .board-cell:last-child {
        margin-bottom: 0;
    }

    .sub-wrap .board-cell--no {
        display: none;
    }

    .sub-wrap .board-cell--title {
        font-size: 15px;
        font-weight: 600;
        margin-bottom: 5px;
        white-space: normal;
        line-height: 1.5;
    }

    .sub-wrap .board-cell--date,
    .sub-wrap .board-cell--views {
        display: inline-flex;
        font-size: 13px;
        margin-right: 12px;
    }

    .sub-wrap .board-cell--file {
        display: none;
    }

    .sub-wrap .board-cell--date::before {
        content: '등록일: ';
        font-weight: 500;
        color: var(--c-text);
    }

    .sub-wrap .board-cell--views::before {
        content: '조회: ';
        font-weight: 500;
        color: var(--c-text);
        white-space: nowrap;
    }

    /* View */
    .sub-wrap .board-view__header {
        padding: 20px 16px;
    }

    .sub-wrap .board-view__title {
        font-size: 20px;
    }

    .sub-wrap .board-view__meta {
        flex-direction: column;
        gap: 8px;
    }

    .sub-wrap .board-view__content {
        padding: 24px 16px;
    }

    .sub-wrap .board-view__attachment {
        padding: 16px;
    }

    .sub-wrap .board-view__actions {
        padding: 16px 0;
        flex-direction: column;
        gap:5px;
    }

    .sub-wrap .board-view__actions .btn {
        width: 100%;
    }

    /* Form */
    .sub-wrap .board-form__row {
        flex-direction: column;
    }

    .sub-wrap .board-form__label {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--c-border);
    }

    .sub-wrap .board-form__field {
        padding: 16px;
    }

    .sub-wrap .board-form__textarea {
        min-height: 300px;
    }

    .sub-wrap .board-form__actions {
        flex-direction: column;
        padding: 16px 0;
        gap:5px;
    }

    .sub-wrap .board-form__actions .btn {
        width: 100%;
    }

    /* Board Bottom - Mobile Order */
    .sub-wrap .board-bottom {
        margin-top: 32px;
        gap: 30px;
    }

    .sub-wrap .pagination {
        order: 1;
    }

    .sub-wrap .board-actions {
        order: 2;
        justify-content: stretch;
    }

    .sub-wrap .board-actions .btn--write {
        width: 100%;
        justify-content: center;
    }

    /* Pagination */
    .sub-wrap .pagination {
        gap: 6px;
    }

    .sub-wrap .pagination__btn {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }

    /* Gallery - 1 column on mobile */
    .sub-wrap .gallery-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .sub-wrap .gallery-card__content {
        padding: 20px;
    }

    .sub-wrap .gallery-card__title {
        font-size: 16px;
        min-height: auto;
    }

    .sub-wrap .gallery-card__desc {
        font-size: 13px;
    }

    /* Form Thumbnail Preview */
    .sub-wrap .board-form__thumbnail-preview {
        max-width: 100%;
    }
}

/* ========================================
   Certs & Awards Page Styles
   ======================================== */

/* 탭 UI */

/* 갤러리 */
.sub-wrap.sub-certs-awards .certs-gallery {
    margin-top: 20px;
}

.sub-wrap.sub-certs-awards .certs-gallery__list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.sub-wrap.sub-certs-awards .certs-gallery__list .board-empty-wrap {
    width: 100%;
    list-style: none;
}
.sub-wrap.sub-certs-awards .certs-gallery__list .board-empty {
    margin: 40px 0;
    text-align: center;
    color: #6B7280;
    font-size: 15px;
}

.sub-wrap.sub-certs-awards .certs-gallery__item {
    width: calc((100% - 20px * 5) / 6);
    display: flex;
    flex-direction: column;
}

.sub-wrap.sub-certs-awards .certs-gallery__card {
    width: 100%;
    aspect-ratio: 213 / 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #E5E7EB;
    transition: all 0.3s ease;
}

.sub-wrap.sub-certs-awards .certs-gallery__card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sub-wrap.sub-certs-awards .certs-gallery__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.sub-wrap.sub-certs-awards .certs-gallery__item:hover .certs-gallery__card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--c-primary);
}

.sub-wrap.sub-certs-awards .certs-gallery__info {
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sub-wrap.sub-certs-awards .certs-gallery__title {
    font-size: clamp(14px, 1.5vw, 16px);
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    word-break: keep-all;
}

.sub-wrap.sub-certs-awards .certs-gallery__org {
    font-size: clamp(12px, 1.3vw, 14px);
    color: #6B7280;
    line-height: 1.4;
    word-break: keep-all;
}

.sub-wrap.sub-certs-awards .certs-gallery__item--inno .certs-gallery__card img {
    max-height: 60%;
}

/* Tablet */
@media (max-width: 1024px) {
    .sub-wrap.sub-certs-awards .certs-gallery__item {
        width: calc((100% - 20px * 3) / 4);
    }

    .sub-wrap.sub-certs-awards .certs-gallery__info {
        padding: 12px 10px;
        gap: 4px;
    }
}

/* Mobile */
@media (max-width: 768px) {

    .sub-wrap.sub-certs-awards .certs-gallery__list {
        gap: 12px;
    }

    .sub-wrap.sub-certs-awards .certs-gallery__item {
        width: calc((100% - 12px * 2) / 3);
    }

    .sub-wrap.sub-certs-awards .certs-gallery__card {
        padding: 12px;
    }

    .sub-wrap.sub-certs-awards .certs-gallery__info {
        padding: 10px 8px;
        gap: 4px;
    }
}
@media screen and (max-width: 480px) {
    .sub-wrap.sub-certs-awards .certs-gallery__item {
        width: calc((100% - 12px) / 2);
    }
}

/* 인증 페이지 board-bottom border */
.sub-wrap.sub-certs-awards .board-bottom {
    padding-top: 40px;
}

/* Mobile */
@media (max-width: 768px) {
    .sub-wrap.sub-certs-awards .board-bottom {
        padding-top: 0;
    }
}
