/* 
 * Board List 페이지 전용 스타일
 */

/* 전체 페이지 오버플로우 방지 - sticky 동작을 위해 body에만 적용 */
html {
    max-width: 100vw;
}
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Material Symbols 아이콘 스타일 */
.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 200,
        'GRAD' 0,
        'opsz' 24;
    font-size: 20px;
    line-height: 1;
    vertical-align: middle;
}

/* 게시판 목록 래퍼 */
.board-list-wrapper {
    padding: var(--spacing-xl) 0;
}

/* 검색 영역 */
.search-section {
    padding: 0 0 2rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.search-form {
    display: flex;
    max-width: 400px;
}

/* 버튼 스타일 - submit.html 스타일 적용 */
.btn-wrap {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
    padding: 20px 0;
}

/* 테두리 애니메이션 */
@-webkit-keyframes borderShow {
    0% { background-size: 0% 2px, 2px 0%, 0% 2px, 2px 0%; }
    50% { background-size: 100% 2px, 2px 0%, 100% 2px, 2px 0%; }
    100% { background-size: 100% 2px, 2px 100%, 100% 2px, 2px 100%; }
}

@keyframes borderShow {
    0% { background-size: 0% 2px, 2px 0%, 0% 2px, 2px 0%; }
    50% { background-size: 100% 2px, 2px 0%, 100% 2px, 2px 0%; }
    100% { background-size: 100% 2px, 2px 100%, 100% 2px, 2px 100%; }
}

@-webkit-keyframes borderHide {
    0% { background-size: 100% 2px, 2px 100%, 100% 2px, 2px 100%; }
    50% { background-size: 100% 2px, 2px 0%, 100% 2px, 2px 0%; }
    100% { background-size: 0% 2px, 2px 0%, 0% 2px, 2px 0%; }
}

@keyframes borderHide {
    0% { background-size: 100% 2px, 2px 100%, 100% 2px, 2px 100%; }
    50% { background-size: 100% 2px, 2px 0%, 100% 2px, 2px 0%; }
    100% { background-size: 0% 2px, 2px 0%, 0% 2px, 2px 0%; }
}

.btn {
    position: relative;
    padding: 12px 24px;
    border: 1px solid var(--color-text-light);
    border-radius: 0;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    color: var(--color-text);
    overflow: hidden;
    -webkit-transition: all var(--transition-base);
    -moz-transition: all var(--transition-base);
    -o-transition: all var(--transition-base);
    transition: all var(--transition-base);
}

.btn::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-theme);
    -webkit-transform: translateX(-100%);
    -ms-transform: translateX(-100%);
    transform: translateX(-100%);
    -webkit-transition: -webkit-transform var(--transition-base);
    -moz-transition: transform var(--transition-base);
    -o-transition: transform var(--transition-base);
    transition: transform var(--transition-base);
    z-index: 0;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background-image: 
        /* 상단 선 */
        linear-gradient(to right, var(--color-theme) 0%, var(--color-theme) 100%),
        /* 우측 선 */
        linear-gradient(to bottom, var(--color-theme) 0%, var(--color-theme) 100%),
        /* 하단 선 */
        linear-gradient(to left, var(--color-theme) 0%, var(--color-theme) 100%),
        /* 좌측 선 */
        linear-gradient(to top, var(--color-theme) 0%, var(--color-theme) 100%);
    background-size: 
        0% 2px,  /* 상단 */
        2px 0%,  /* 우측 */
        0% 2px,  /* 하단 */
        2px 0%;  /* 좌측 */
    background-position: 
        top left,    /* 상단 */
        top right,   /* 우측 */
        bottom right, /* 하단 */
        bottom left;  /* 좌측 */
    background-repeat: no-repeat;
    -webkit-animation: none;
    -moz-animation: none;
    -o-animation: none;
    animation: none;
}

.btn > * {
    position: relative;
    z-index: 1;
    -webkit-transition: color var(--transition-base);
    -moz-transition: color var(--transition-base);
    -o-transition: color var(--transition-base);
    transition: color var(--transition-base);
}

.btn-primary {
    border-color: var(--color-text-light);
    color: var(--color-text);
}

.btn-secondary {
    border-color: var(--color-text-light);
    color: var(--color-text);
}

.btn:hover::after {
    -webkit-animation: borderShow 0.3s ease forwards;
    -moz-animation: borderShow 0.3s ease forwards;
    -o-animation: borderShow 0.3s ease forwards;
    animation: borderShow 0.3s ease forwards;
}

.btn:not(:hover)::after {
    -webkit-animation: borderHide 0.3s ease forwards;
    -moz-animation: borderHide 0.3s ease forwards;
    -o-animation: borderHide 0.3s ease forwards;
    animation: borderHide 0.3s ease forwards;
}

.btn-primary:hover,
.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0);
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
    -webkit-transform: translateX(0);
    -ms-transform: translateX(0);
    transform: translateX(0);
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--color-primary);
    border-radius: 0;
    font-size: 14px;
    background: #fff;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-theme);
}

.search-btn {
    padding: 12px 16px;
    border: 1px solid var(--color-primary);
    border-radius: 0;
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--color-theme);
    border-color: var(--color-theme);
}

/* 게시판 목록 */
.board-list {
    margin-bottom: 3rem;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.board-item {
    position: relative;
    border: 1px solid var(--color-border);
    -webkit-transition: all var(--transition-base);
    -moz-transition: all var(--transition-base);
    -o-transition: all var(--transition-base);
    transition: all var(--transition-base);
}

.board-item-link {
    display: flex;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
}


.board-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.board-image .default-image {
    width: auto;
    height: 10vw;
    object-fit: contain;
    opacity: 1;
    transition: transform 0.3s ease;
}

.board-image, .board-content {
    border-bottom: 3px solid var(--color-primary);
}

.board-item-link:hover .board-image img {
    transform: scale(1.1);
}

.board-item-link:hover .board-image .default-image {
    transform: scale(1.1);
}

.board-item-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--color-theme);
    transition: width 0.3s ease;
    z-index: 2;
}

.board-item-link:hover::after {
    width: 100%;
}

.board-image {
    flex: 0 0 50%;
    height: 13vw;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.board-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.board-image .default-image {
    width: auto;
    height: 10vw;
    object-fit: contain;
    opacity: 1;
}

.board-content {
    flex: 1;
    padding: 1rem;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    justify-content: flex-end;
}

.board-date {
    display: block;
    color: var(--color-theme);
    margin: 0.5rem 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

h2.board-title {
    font-size: clamp(17px, 1.5vw, 20px);
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.4;
    margin: 0;
    word-break: keep-all;
    width: 100%;
}

/* 페이지 네비게이션 */

.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    padding: var(--spacing-lg) 0;
}

.pagination-btn {
    padding: 10px 12px;
    border: 1px solid var(--color-primary);
    border-radius: 0;
    background: #fff;
    color: var(--color-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--color-theme);
    border-color: var(--color-theme);
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 5px;
}

.pagination-number {
    padding: 10px 15px;
    border: 1px solid var(--color-primary);
    border-radius: 0;
    background: #fff;
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
}

.pagination-number:hover {
    background: var(--color-theme);
    border-color: var(--color-theme);
    color: #fff;
}

.pagination-number.active {
    background: var(--color-theme);
    border-color: var(--color-theme);
    color: #fff;
}

/* 배너 카드 스타일 호버 효과 적용 */
/* 두 지점에서 동시에 시작하는 테두리 효과 */
@-webkit-keyframes borderShow {
  0% { background-size: 0% 2px, 2px 0%, 0% 2px, 2px 0%; }
  50% { background-size: 100% 2px, 2px 0%, 100% 2px, 2px 0%; }
  100% { background-size: 100% 2px, 2px 100%, 100% 2px, 2px 100%; }
}

@keyframes borderShow {
  0% { background-size: 0% 2px, 2px 0%, 0% 2px, 2px 0%; }
  50% { background-size: 100% 2px, 2px 0%, 100% 2px, 2px 0%; }
  100% { background-size: 100% 2px, 2px 100%, 100% 2px, 2px 100%; }
}

@-webkit-keyframes borderHide {
  0% { background-size: 100% 2px, 2px 100%, 100% 2px, 2px 100%; }
  50% { background-size: 100% 2px, 2px 0%, 100% 2px, 2px 0%; }
  100% { background-size: 0% 2px, 2px 0%, 0% 2px, 2px 0%; }
}

@keyframes borderHide {
  0% { background-size: 100% 2px, 2px 100%, 100% 2px, 2px 100%; }
  50% { background-size: 100% 2px, 2px 0%, 100% 2px, 2px 0%; }
  100% { background-size: 0% 2px, 2px 0%, 0% 2px, 2px 0%; }
}

.board-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background-image: 
    /* 상단 선 */
    linear-gradient(to right, var(--color-theme) 0%, var(--color-theme) 100%),
    /* 우측 선 */
    linear-gradient(to bottom, var(--color-theme) 0%, var(--color-theme) 100%),
    /* 하단 선 */
    linear-gradient(to left, var(--color-theme) 0%, var(--color-theme) 100%),
    /* 좌측 선 */
    linear-gradient(to top, var(--color-theme) 0%, var(--color-theme) 100%);
  background-size: 
    0% 2px,  /* 상단 */
    2px 0%,  /* 우측 */
    0% 2px,  /* 하단 */
    2px 0%;  /* 좌측 */
  background-position: 
    top left,    /* 상단 */
    top right,   /* 우측 */
    bottom right, /* 하단 */
    bottom left;  /* 좌측 */
  background-repeat: no-repeat;
  -webkit-animation: none;
  -moz-animation: none;
  -o-animation: none;
  animation: none;
}

.board-item:hover::before {
  -webkit-animation: borderShow 0.3s ease forwards;
  -moz-animation: borderShow 0.3s ease forwards;
  -o-animation: borderShow 0.3s ease forwards;
  animation: borderShow 0.3s ease forwards;
}

.board-item:not(:hover)::before {
  -webkit-animation: borderHide 0.3s ease forwards;
  -moz-animation: borderHide 0.3s ease forwards;
  -o-animation: borderHide 0.3s ease forwards;
  animation: borderHide 0.3s ease forwards;
}

.board-item:hover {
  border-color: rgba(255, 255, 255, 0.0);
}

/* 반응형 스타일 */

/* PC 레이아웃 (1140px 이상) */
@media (min-width: 1140px) {
    h2.board-title {
        font-size: 20px;
    }

    .board-date {
        font-size: 17px;
    }
}

/* 태블릿 레이아웃 (768px ~ 1139px) */
@media (min-width: 768px) and (max-width: 1139px) {
    h2.board-title {
        font-size: clamp(18px, 1.6vw, 19px);
    }

    .board-date {
        font-size: 17px;
    }
}

/* 태블릿 레이아웃 (1023px 이하) */
@media (max-width: 1023px) {
    .board-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    h2.board-title {
        font-size: clamp(18px, 1.8vw, 19px);
    }

    .board-date {
        font-size: 14px;
    }
}

/* 모바일 레이아웃 (767px 이하) */
@media (max-width: 767px) {
    .board-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .board-item-link {
        flex-direction: column;
    }

    .board-image {
        flex: none;
        width: 100%;
        height: 80vw;
        border: 0;
    }

    .board-image .default-image {
        height: 40vw;
    }

    .board-content {
        padding: 0.5rem 0 3rem;
        align-items: flex-start;
    }

    h2.board-title {
        font-size: clamp(17px, 1.2vw, 18px);
        line-height: 1.5;
    }

    .board-date {
        font-size: 13px;
    }

    .search-section {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .search-form {
        max-width: 100%;
    }

    .btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 16px;
    }

    .pagination-numbers {
        flex-wrap: wrap;
        gap: 3px;
    }

    .pagination-number {
        min-width: 40px;
        padding: 8px 12px;
    }
}
