/* =========================================================
   RedSoul — Modern Minimal Theme
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&display=swap');

:root {
    --accent: #e11d48;
    --accent-dark: #be123c;
    --accent-soft: #fff1f3;
    --ink: #18181b;
    --gray-700: #3f3f46;
    --gray-500: #71717a;
    --gray-400: #a1a1aa;
    --gray-200: #e4e4e7;
    --gray-100: #f4f4f5;
    --bg: #fafafa;
    --card: #ffffff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.10);
    --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* 헤더 / 네비 */
header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--gray-200);
}
.header-inner {
    max-width: var(--maxw); margin: 0 auto; padding: 12px 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.logo img { height: 46px; display: block; }
nav { display: flex; align-items: center; gap: 4px; }
nav a {
    text-decoration: none; color: var(--gray-700); font-weight: 500;
    font-size: .95rem; padding: 8px 12px; border-radius: 999px; transition: all .2s ease;
}
nav a:hover { color: var(--accent); background: var(--accent-soft); }
nav a.admin-link { color: var(--accent); font-weight: 700; }
.btn-login {
    border: 1px solid var(--ink) !important; color: var(--ink) !important;
    padding: 7px 18px !important; border-radius: 999px; font-weight: 500;
}
.btn-login:hover { background: var(--ink) !important; color: #fff !important; }
.nav-toggle {
    display: none; background: none; border: none; cursor: pointer;
    padding: 8px; flex-direction: column; gap: 5px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .3s; }

/* 버튼 */
button, .btn {
    font-family: inherit; padding: 11px 22px; background: var(--ink); color: #fff;
    border: none; cursor: pointer; border-radius: 999px; font-size: .95rem; font-weight: 500;
    transition: all .2s ease; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
button:hover, .btn:hover { background: #000; transform: translateY(-1px); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--gray-200); }
.btn-ghost:hover { background: var(--gray-100); color: var(--ink); }

/* 히어로 */
.hero {
    max-width: var(--maxw); margin: 28px auto 48px; padding: 80px 32px; border-radius: 24px;
    background-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)), url('main_bg.jpg');
    background-size: cover; background-position: center;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; color: #fff; box-shadow: var(--shadow-lg);
}
.hero h2 { font-size: 2.6rem; font-weight: 900; margin: 0 0 14px; letter-spacing: -.02em; text-shadow: 0 2px 16px rgba(0,0,0,.4); }
.hero p { font-size: 1.1rem; opacity: .95; margin: 0 0 28px; }
.hero .btn { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.7); backdrop-filter: blur(6px); padding: 13px 34px; font-size: 1rem; }
.hero .btn:hover { background: #fff; color: var(--ink); }

/* 메인 레이아웃 */
main.home { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 72px; display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
.section-right { background: var(--card); padding: 26px; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); height: fit-content; }
h3.title { font-size: 1.15rem; font-weight: 700; margin: 0 0 18px; padding-bottom: 12px; border-bottom: 2px solid var(--gray-100); display: flex; justify-content: space-between; align-items: baseline; letter-spacing: -.01em; }
.more-link { font-size: .8rem; font-weight: 500; color: var(--gray-400); text-decoration: none; }
.more-link:hover { color: var(--accent); }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery-item { aspect-ratio: 1 / 1; background-color: var(--gray-200); border-radius: var(--radius-sm); background-size: cover; background-position: center; box-shadow: var(--shadow-sm); transition: transform .25s ease; display: block; }
.gallery-item:hover { transform: translateY(-4px) scale(1.01); box-shadow: var(--shadow-md); }
.empty-box { padding: 28px; color: var(--gray-400); background: var(--gray-100); text-align: center; border-radius: var(--radius-sm); grid-column: 1 / -1; }

.news-item { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--gray-100); }
.news-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.news-item a { text-decoration: none; color: var(--ink); font-weight: 700; display: block; margin-bottom: 4px; }
.news-item a:hover { color: var(--accent); }
.news-item p { margin: 0; font-size: .85rem; color: var(--gray-500); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mini-board-list { background: var(--card); border-radius: var(--radius); border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); padding: 6px 22px; }
.mini-board-item { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--gray-100); font-size: .95rem; gap: 12px; }
.mini-board-item:last-child { border-bottom: none; }
.mini-board-item a { text-decoration: none; color: var(--gray-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-board-item a:hover { color: var(--accent); }
.mini-board-item .date { color: var(--gray-400); font-size: .82rem; flex-shrink: 0; }

/* 페이지 래퍼 */
.page { max-width: 1000px; margin: 44px auto; padding: 0 20px; }
.page-narrow { max-width: 760px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.9rem; font-weight: 900; margin: 0; letter-spacing: -.02em; }

.search-bar { display: flex; gap: 8px; }
.search-bar input { padding: 10px 16px; border: 1px solid var(--gray-200); border-radius: 999px; font-size: .9rem; min-width: 200px; outline: none; font-family: inherit; }
.search-bar input:focus { border-color: var(--accent); }

/* 게시판 테이블 */
.board-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.board-table th { background: var(--gray-100); padding: 14px 12px; font-size: .85rem; font-weight: 700; color: var(--gray-700); text-align: center; }
.board-table th.left { text-align: left; }
.board-table td { padding: 15px 12px; border-top: 1px solid var(--gray-100); text-align: center; font-size: .92rem; color: var(--gray-700); }
.board-table tr:hover td { background: var(--gray-100); }
.board-table .subject { text-align: left; }
.board-table .subject a { color: var(--ink); font-weight: 500; text-decoration: none; }
.board-table .subject a:hover { color: var(--accent); }
.meta-chip { color: var(--gray-400); font-size: .82rem; }
.del-link { color: var(--accent); font-size: .82rem; text-decoration: none; }
.del-link:hover { text-decoration: underline; }

.gallery-grid-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.gallery-card { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow-sm); transition: transform .25s ease, box-shadow .25s ease; }
.gallery-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.gallery-card a { text-decoration: none; color: var(--ink); }
.img-thumb { width: 100%; aspect-ratio: 4 / 3; background-size: cover; background-position: center; background-color: var(--gray-100); }
.img-thumb.placeholder { display: flex; align-items: center; justify-content: center; color: var(--gray-400); font-size: .9rem; }
.card-info { padding: 14px; text-align: center; }
.card-info strong { display: block; font-size: .98rem; }
.card-info .author { font-size: .8rem; color: var(--gray-400); margin-top: 4px; display:block; }

.pagination { display: flex; justify-content: center; gap: 6px; margin: 32px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; height: 38px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; text-decoration: none; font-size: .9rem; color: var(--gray-700); border: 1px solid var(--gray-200); background: #fff; transition: .15s; }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .disabled { color: var(--gray-400); pointer-events: none; opacity: .5; }

/* 카드 / 폼 */
.card { background: var(--card); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 36px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 8px; font-size: .92rem; }
input[type=text], input[type=password], textarea, .input { width: 100%; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); font-size: .98rem; font-family: inherit; outline: none; transition: border-color .2s; background: #fff; }
input[type=text]:focus, input[type=password]:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; line-height: 1.6; }
.file-box { background: var(--gray-100); padding: 16px; border-radius: var(--radius-sm); }
.file-box input[type=file] { width: 100%; }
.form-actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }

/* 인증 카드 */
.auth { max-width: 420px; margin: 72px auto; padding: 0 20px; }
.auth .card { padding: 40px; text-align: center; }
.auth h2 { margin: 0 0 6px; font-size: 1.6rem; font-weight: 900; }
.auth .sub { color: var(--gray-500); font-size: .92rem; margin: 0 0 24px; }
.auth input { margin-bottom: 12px; }
.auth .full { width: 100%; justify-content: center; }
.auth-divider { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--gray-100); }
.error-msg { color: var(--accent); font-size: .9rem; margin: 0 0 14px; }

/* 글 보기 */
.post-card { background: var(--card); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 40px; }
.post-header { border-bottom: 1px solid var(--gray-200); padding-bottom: 18px; margin-bottom: 24px; }
.post-header h1 { font-size: 1.8rem; font-weight: 900; margin: 0 0 12px; letter-spacing: -.02em; }
.post-info { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--gray-500); font-size: .88rem; }
.post-info .stats { display: flex; gap: 14px; }
.post-actions a { text-decoration: none; font-size: .85rem; margin-left: 12px; }
.post-actions .edit { color: var(--gray-500); }
.post-actions .del { color: var(--accent); }
.post-body { min-height: 160px; padding: 8px 0 24px; font-size: 1.05rem; line-height: 1.8; word-break: break-word; }
.content-link { color: var(--accent); text-decoration: underline; }
.post-image { margin-top: 28px; text-align: center; }
.post-image img { border-radius: var(--radius); cursor: zoom-in; box-shadow: var(--shadow-md); }

.like-bar { text-align: center; margin: 20px 0 4px; }
.like-btn { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); padding: 10px 26px; font-size: 1rem; }
.like-btn:hover { background: var(--accent-soft); transform: translateY(-1px); }
.like-btn.liked { background: var(--accent); color: #fff; }

.comment-section { margin-top: 36px; }
.comment-section h3 { font-size: 1.1rem; margin: 0 0 16px; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list li { padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
.comment-list li:last-child { border-bottom: none; }
.comment-top { display: flex; justify-content: space-between; align-items: center; }
.comment-top strong { font-size: .92rem; }
.comment-date { font-size: .78rem; color: var(--gray-400); margin-left: 8px; }
.comment-body { margin-top: 6px; color: var(--gray-700); }
.comment-del { color: var(--accent); font-size: .78rem; text-decoration: none; }
.comment-form { margin-top: 18px; display: flex; gap: 8px; }
.comment-form input { flex: 1; }
.comment-empty { text-align: center; color: var(--gray-400); padding: 16px; }
.back-row { text-align: center; margin-top: 28px; }

.success-card { max-width: 480px; margin: 80px auto; padding: 0 20px; text-align: center; }
.success-card .card { padding: 40px; }
.success-card .check { font-size: 3rem; }
.info-list { background: var(--gray-100); border-radius: var(--radius-sm); padding: 18px 22px; text-align: left; margin: 20px 0; }
.info-list p { margin: 6px 0; }

.admin-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; align-items: start; }
.alert { background: var(--accent-soft); color: var(--accent-dark); padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-weight: 500; border: 1px solid #fecdd3; }
.role-admin { color: var(--accent); font-weight: 700; }
.role-member { color: var(--gray-500); }
.tool-card { background: var(--card); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.tool-card h3 { margin: 0 0 14px; font-size: 1rem; }
.tool-card input { margin-bottom: 10px; }
.tool-card button { width: 100%; justify-content: center; }
.kick { background: var(--accent); color: #fff; padding: 5px 12px; border-radius: 999px; text-decoration: none; font-size: .78rem; }

.error-page { max-width: 520px; margin: 100px auto; text-align: center; padding: 0 20px; }
.error-page .code { font-size: 5rem; font-weight: 900; color: var(--accent); margin: 0; }
.error-page p { color: var(--gray-500); font-size: 1.1rem; margin: 8px 0 28px; }

.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; margin: 20px 0; border-radius: var(--radius); background: #000; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.lightbox { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.9); cursor: zoom-out; align-items: center; justify-content: center; padding: 30px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 95%; max-height: 92%; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox .close { position: absolute; top: 20px; right: 28px; color: #fff; font-size: 2.4rem; cursor: pointer; line-height: 1; }

footer { border-top: 1px solid var(--gray-200); background: var(--card); padding: 28px 20px; text-align: center; color: var(--gray-400); font-size: .85rem; margin-top: 40px; }

@media (max-width: 860px) {
    main.home { grid-template-columns: 1fr; }
    .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .nav-toggle { display: flex; }
    nav { position: fixed; top: 70px; right: 0; left: 0; background: #fff; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px; border-bottom: 1px solid var(--gray-200); box-shadow: var(--shadow-md); transform: translateY(-150%); transition: transform .3s ease; max-height: calc(100vh - 70px); overflow-y: auto; }
    nav.open { transform: translateY(0); }
    nav a { padding: 14px 10px; border-radius: 10px; }
    .hero { padding: 56px 22px; margin: 18px auto 32px; border-radius: 18px; }
    .hero h2 { font-size: 1.9rem; }
    .page-head { flex-direction: column; align-items: stretch; }
    .search-bar input { flex: 1; min-width: 0; }
    .post-card, .card { padding: 24px; }
    .board-table th.hide-m, .board-table td.hide-m { display: none; }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 홈 블록(보드별 미리보기) */
main.home-blocks { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 72px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.home-block { background: var(--card); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px 24px; }
@media (max-width: 760px){ main.home-blocks { grid-template-columns: 1fr; } }
select { font-family: inherit; padding: 8px 10px; border: 1px solid var(--gray-200); border-radius: 8px; background:#fff; font-size:.88rem; }

/* 회원 등급 뱃지 */
.my-grade{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;font-size:.82rem;font-weight:700;background:#f1f5f9;color:#475569;}
.my-grade.grade-excellent{background:#ecfdf5;color:#059669;}
.my-grade.grade-vip{background:#fef3c7;color:#b45309;}
.my-grade.grade-admin{background:#fee2e2;color:#dc2626;}
.role-admin{display:inline-block;padding:2px 8px;border-radius:6px;background:#fee2e2;color:#dc2626;font-weight:700;font-size:.8rem;}
.role-member{display:inline-block;padding:2px 8px;border-radius:6px;background:#f1f5f9;color:#475569;font-weight:600;font-size:.8rem;}

/* 관리자 게시판 표: 버튼 줄바꿈 방지 + 컴팩트 + 가로 스크롤 */
.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;}
.board-table .kick{white-space:nowrap;display:inline-block;padding:5px 10px;}
.board-table button{white-space:nowrap;}
.board-table select{padding:5px 6px;font-size:.82rem;max-width:128px;}
.board-table td{white-space:nowrap;}
.board-table .subject{white-space:normal;}

/* 관리자 표 버튼 한 줄 강제 (v4) */
.board-table td button,
.board-table td .kick,
.board-table td a.kick{
  white-space:nowrap !important;
  display:inline-block;
  min-width:42px;
  text-align:center;
  word-break:keep-all;
}
.board-table select{width:118px;min-width:118px;}

/* 첨부 미디어 4열 격자 (사진/영상) */
.media-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:18px 0 12px;}
.media-grid .media-cell{position:relative;aspect-ratio:1/1;border-radius:12px;overflow:hidden;background:#0f172a;border:1px solid var(--gray-200);}
.media-grid .media-cell img{width:100%;height:100%;object-fit:cover;cursor:zoom-in;display:block;}
.media-grid .video-cell video{width:100%;height:100%;object-fit:cover;background:#000;display:block;}
.media-grid .media-tag{position:absolute;left:6px;top:6px;background:rgba(0,0,0,.62);color:#fff;font-size:.72rem;padding:2px 8px;border-radius:999px;pointer-events:none;}
.media-grid .media-dl{position:absolute;right:6px;top:6px;width:28px;height:28px;border-radius:50%;background:rgba(0,0,0,.62);color:#fff;display:flex;align-items:center;justify-content:center;text-decoration:none;font-size:.9rem;}
.media-grid .media-dl:hover{background:var(--accent);}
.media-grid .file-cell{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;background:var(--gray-100);padding:10px;text-align:center;}
.media-grid .file-cell .file-ic{font-size:1.9rem;}
.media-grid .file-cell .file-nm{font-size:.72rem;color:var(--gray-700);word-break:break-all;line-height:1.2;max-height:2.4em;overflow:hidden;}
.media-grid .file-cell .file-sz{font-size:.68rem;color:var(--gray-400);}
.dl-all-row{margin:4px 0 6px;}
@media(max-width:760px){.media-grid{grid-template-columns:repeat(2,1fr);gap:8px;}}

/* 업로드 진행률 바 */
.upbox{margin:16px 0 4px;}
.upbar-wrap{height:14px;background:var(--gray-200);border-radius:999px;overflow:hidden;}
.upbar{height:100%;width:0;background:var(--accent);transition:width .25s ease;}
.uptext{margin:9px 0 2px;font-weight:700;color:var(--ink);}
.upnote{font-size:.8rem;color:var(--gray-400);margin:0;}

/* ===== 2026-10-12: 메뉴가 많아져 글자가 한두 자씩 줄바꿈되던 것 고침 =====
   - 메뉴·버튼 글자는 절대 중간에서 끊지 않는다
   - PC 화면에서 메뉴가 한 줄에 다 안 들어가면 오른쪽 정렬로 두 줄이 된다
   - 검색칸이 버튼 자리까지 먹지 않게 (input 전체 width:100% 규칙이 검색칸에도 걸리고 있었음) */
nav a, nav .my-grade, .btn-login, .search-bar button, .page-head .btn { white-space: nowrap; }
.search-bar button { flex-shrink: 0; }
@media (min-width: 681px) {
    .header-inner { gap: 16px; }
    .logo { flex-shrink: 0; }
    nav { flex-wrap: wrap; justify-content: flex-end; row-gap: 2px; }
    nav a { padding: 7px 10px; font-size: .92rem; }
    .search-bar input { width: auto; flex: 1 1 200px; }
}
