/* ================= 기본 설정 ================= */
@font-face {
    font-family: "psyfont";
    src: url("/fonts/font.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "psyfont_bold";
    src: url("/fonts/font_bold.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
}

* {
    font-family: "psyfont", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #ffffff;
    color: #333;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.cool-btn {
    padding: 12px 16px;
    width: auto;
    display: inline-block;
    font-size: 16px;
    font-weight: bold;
    color: white;

    background: linear-gradient(135deg, #000000);
    border: none;
    border-radius: 12px;

    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 0;

    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.cool-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.cool-btn:active {
    transform: scale(0.95);
}

.cool-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #000000);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: -1;
}

.cool-btn:hover::after {
    opacity: 1;
}

.cool-btn-blue {
    padding: 12px 16px;
    width: auto;
    display: inline-block;
    font-size: 16px;
    font-weight: bold;
    color: white;

    background: linear-gradient(135deg, #2f3b79);
    border: none;
    border-radius: 12px;

    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 0;

    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.cool-btn-blue:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.cool-btn-blue:active {
    transform: scale(0.95);
}

.cool-btn-blue::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #2f3b79);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: -1;
}

.cool-btn-blue:hover::after {
    opacity: 1;
}

.cool-btn-green {
    padding: 12px 16px;
    width: auto;
    display: inline-block;
    font-size: 16px;
    font-weight: bold;
    color: white;

    background: linear-gradient(135deg, #8ba074);
    border: none;
    border-radius: 12px;

    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 0;

    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.cool-btn-green:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.cool-btn-green:active {
    transform: scale(0.95);
}

.cool-btn-green::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #8ba074);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: -1;
}

.cool-btn-green:hover::after {
    opacity: 1;
}

.popup {
    position: fixed;
    top: 20px;
    right: 20px; /* 🔥 오른쪽 정렬 */
    width: 33vw;
    max-width: 500px;
    z-index: 9999;
}

/* 🔥 이미지 배경 흰색 처리 */
.popup-img-wrap {
    background: white;
}

.popup img {
    width: 100%;
    height: auto;
    display: block;
}

/* 🔥 하단 검은 바 */
.popup-links {
    background: black;
    color: white;
    font-size: 14px;
    padding: 8px 10px;
    text-align: right;
}

/* 텍스트 버튼 */
.popup-links span {
    margin-left: 10px;
    cursor: pointer;
    text-decoration: underline;
}

.popup-links span:hover {
    color: #ccc;
}

@media (max-width: 768px) {
    .popup {
        width: 80vw;
    }
}

/* ================= 공통 컨테이너 ================= */
.container {
    width: 90%;
    max-width: 1100px;
    color: #000000;
    margin: auto;
    text-align: center;
}

.container2 {
    width: 90%;
    max-width: 1100px;
    color: #000000;
    margin: auto;
    text-align: center;
}

.container2 h2 {
    color: #002970
}

.container1 {
    width: 90%;
    max-width: 1100px;
    margin: auto;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.container1 img {
    display: block;
    object-fit: contain;
}

/* ================= 뒤로가기 버튼 (핵심 수정) ================= */
.back-btn {
    position: fixed;
    top: 15px;
    left: 15px;

    z-index: 99999;

    background: #000;
    color: #fff;

    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 6px;

    cursor: pointer;

    width: auto !important; /* ⭐ 전역 button 영향 제거 */
}

.back-btn:hover {
    background: #333;
}

/* ================= 헤더 ================= */
header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #eee;
    padding: 20px 0;
}

header h1 {
    display: inline-block;
}

nav {
    text-align: right;
}

.nav-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

nav a {
    margin-left: 20px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
}

nav a:hover {
    color: #000;
}

.top {
    margin-bottom: 5px;
}

/* ================= 배너 ================= */
.hero {
    width: 100%;
    background: #f8f9fa;
    text-align: center;
    padding: 100px 20px;
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 10px;
}

.hero h1 {
    font-family: "psyfont_bold", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 64px;
    margin-bottom: 10px;
    color: #2f3b79;
}

.hero h4 {
    font-size: 18px;
    margin-bottom: 10px;
}

.hero p {
    color: #777;
    margin-bottom: 20px;
}

.btn {
    background: #000;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
}

.btn:hover {
    background: #333;
}

/* ================= 섹션 ================= */
section {
    width: 100%;
    padding: 80px 0;
}

section h2 {
    text-align: center;
    margin-bottom: 30px;
}

/* ================= 카드 ================= */
.cards {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.card {
    background: #fff;
    border: 1px solid #eee;
    padding: 20px;
    width: 30%;
    text-align: center;
    border-radius: 10px;
    transition: 0.2s;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* ================= 문의 ================= */
.contact {
    text-align: center;
}

/* ================= 뉴스 ================= */
#news-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* 더보기 버튼 */
#news-list button {
    grid-column: 1 / -1;
    justify-self: center;
}

/* 뉴스 카드 */
#news-list > div {
    background: #fff;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 10px;
    transition: 0.2s;
}

#news-list > div:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

#news-list img {
    width: 100%;
    margin-top: 10px;
    border-radius: 8px;
}

/* ================= 푸터 ================= */
footer {
    width: 100%;
    background: #EFEFEF;
    padding: 20px 0; /* 좌우 패딩 제거 (중요) */
    font-size: 14px;
    color: #161616;
}

/* ⭐ 글자만 1/4 지점부터 시작 */
footer .footer-inner {
    width: 82.5%;
    margin-left: 17.5%;
}

/* ================= 관리자 ================= */
h2 {
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 28px;
}

/* 로그인 박스 */
#login-box {
    background: #fff;
    border: 1px solid #eee;
    padding: 30px;
    width: 300px;
    border-radius: 10px;
    text-align: center;
}

/* 관리자 패널 */
#admin-panel {
    background: #fff;
    border: 1px solid #eee;
    padding: 30px;
    width: 500px;
    border-radius: 10px;
    margin-top: 20px;
}

/* 입력 */
input[type="text"],
input[type="username"],
input[type="password"],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

textarea {
    height: 120px;
    resize: none;
}

input:focus,
textarea:focus {
    border-color: #000;
}

/* 파일 */
input[type="file"] {
    width: 100%;
}

/* 버튼 (전역) */
button {
    width: 100%;
    padding: 10px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
}

button:hover {
    background: #333;
}

/* 관리자 추가 */
#admin-panel h3 {
    margin-top: 30px;
    margin-bottom: 10px;
}

/* 구분선 */
hr {
    margin: 30px 0;
    border: none;
    border-top: 1px solid #eee;
}

#left-panel { 
    width: 350px; 
    background: white; 
    padding: 20px; 
    border-radius: 10px; 
}

#right-panel {
    flex: 0 0 auto;
    width: fit-content;
    max-width: 700px;

    background: white;
    padding: 20px;
    border-radius: 10px;
}

#admin-wrap {
    display: flex;
    gap: 20px;
    width: fit-content;
    max-width: 1200px;
    margin: 30px auto;
}

/* ================= 반응형 ================= */

/* 태블릿 */
@media (max-width: 1024px) {
    #news-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .card {
        width: 45%;
    }
}

/* 모바일 */
@media (max-width: 768px) {
    #news-list {
        grid-template-columns: 1fr;
    }

    nav {
        float: none;
        text-align: center;
        margin-top: 10px;
    }

    .card {
        width: 100%;
    }

    #admin-panel {
        width: 90%;
    }

    #login-box {
        width: 90%;
    }
}

.bar-logo {
    cursor: pointer;
}

/* PC */
@media (min-width: 768px) {
    .bar-logo {
        width: 17.5vw;
        height: auto;
    }
}

/* 모바일 */
@media (max-width: 767px) {
    .bar-logo {
        width: 30vw;
        height: auto; /* 원하는 크기로 조절 */
    }
}

.container *:not(.text-box):not(.text-box *) {
    word-break: keep-all;
    overflow-wrap: normal;
}