#wiki-wrapper {
    display: grid;
    /* 왼쪽 사이드바 고정, 본문 유동적, 오른쪽 사이드바 고정 */
    grid-template-columns: 240px 1fr 350px;
    width: 100%;       /* 가로 너비를 100%로 설정 */
    max-width: none;   /* 기존의 1400px 제한을 해제합니다 */
    margin: 0;         /* 중앙 정렬을 위한 여백 제거 */
    min-height: 100vh; /* 화면 전체 높이를 채우도록 설정 */
    background-color: #f7f7f7; /* 사이드바 배경색과 동일하게 설정 */
}
.side-left {
    display: flex;
    justify-content: center; /* 가로 중앙 정렬 */
    padding: 60px 10px;
    border-right: 1px solid #eee;
    background-color: #f7f7f7; /* 왼쪽 사이드바 색상 */
}

/* 본문 영역이 너무 퍼져 보이지 않게 안쪽 여백을 넉넉히 줍니다 */
#main-content {
    padding: 60px 80px; /* 양옆 패딩을 조금 더 늘리면 가독성이 좋아집니다 */
    background-color: #ffffff;
    min-height: 100vh;
}

.side-right {
    padding: 60px 15px;
    border-left: 1px solid #eee;
    background-color: #f7f7f7; /* 오른쪽 사이드바 색상 */
}

/* 오른쪽 사이드바 고정(Sticky) 설정 */
.sticky-container {
    position: sticky;
    top: 20px; /* 스크롤 시 상단 여백 */
    display: flex;
    flex-direction: column;
}

footer {
    display: flex;
    flex-direction: column;
    padding-top: var(--page-padding-top);
    align-items: center;
    margin: 24px;
}

/* 로고 및 타이틀 */
.logo-area {
    display: flex;
    flex-direction: column;
    align-items: center; /* 로고와 글자를 세로로 나열하며 중앙 정렬 */
    text-align: center;
}

.wiki-logo {
    width: 210px;
    height: auto;
    margin-bottom: 15px;
}

.wiki-title {
    font-size: 1.8rem;
    font-family: "Jua";
}

/* 메인 닉네임 */
.main-nickname { font-size: 2.3rem; font-family: "Jua"; margin-bottom: 10px; }
.main-divider { border: 0; border-top: 1px solid #eee; margin-bottom: 40px; }

/* 본문 섹션 */
.content-section { margin-bottom: 60px; }
.content-section h2 { font-size: 1.8rem; font-family: "Jua"; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 20px; }

.content-section .subtitle {
    font-size: 1rem;
    color: #666; /* 본문보다 약간 연한 회색 */
    margin-top: -10px; /* 제목(h2)과의 간격을 좁히고 싶을 때 조절 */
    margin-bottom: 25px; /* 아래 그리드와의 간격 */
    font-weight: 400;
}

/* 갤러리 그리드 전체 너비 제한 및 중앙 정렬 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  width: 600px; /* 기존보다 더 넓게 */
  margin: 20px auto;
}

/* 갤러리 이미지: 잘리지 않게 조정 */
.gallery-grid img {
    width: 100%;
    aspect-ratio: 1/1; /* 정사각형 셀 유지 */
    object-fit: cover; /* 중요: 잘리지 않고 원본 비율을 유지하며 셀 내에 중앙 배치됩니다. */
    border-radius: 8px; /* 부드러운 테두리 유지 */
    background: #f0f0f0; /* contain으로 인해 생기는 여백을 채웁니다. */
}

/* 사이드바 프로필 */
.profile-box img { width: 100%; border-radius: 12px; border: 1px solid #eee; }
.profile-caption { text-align: center; font-size: 0.9rem; color: #666; margin-top: 10px; }

/* Contents 네비게이션 간격 및 번호 설정 */
.contents-nav {
    margin-top: 40px; /* 프로필 사진과의 간격 확보 */
}

.contents-top-link {
    text-decoration: none; /* 밑줄 제거 */
    color: inherit;       /* 기존 h3 색상 유지 */
    cursor: pointer;      /* 마우스 커서를 손가락 모양으로 */
}

.contents-top-link:hover {
    color: #2ac1bc;       /* 마우스를 올렸을 때만 포인트 컬러로 변경 (선택 사항) */
}

.contents-nav h3 {
    font-family: "Jua";
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.auto-numbered-list {
    padding-left: 20px;
    list-style-type: decimal; /* 자동으로 1, 2, 3... 번호 부여 */
}

.auto-numbered-list li {
    margin-bottom: 10px;
}

.auto-numbered-list a {
    text-decoration: none;
    color: #555;
    transition: color 0.2s;
}

.auto-numbered-list a:hover {
    color: #2ac1bc;
    text-decoration: underline;
}

/* TIL */
/* TIL 섹션 전체 컨테이너 */
.til-input-container {
    background-color: #f8f9fa; /* 연한 회색 배경 */
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 40px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #444;
}

/* main.css */

/* 날짜와 제목을 한 줄에 배치하는 컨테이너 */
.form-row {
    display: flex;
    gap: 15px; /* 입력창 사이의 확실한 간격 */
    margin-bottom: 15px;
    width: 100%;
}

/* 각각의 입력 그룹(라벨+인풋)이 차지하는 비율 */
.date-group {
    flex: 3; /* 날짜창은 적당한 크기로 */
    min-width: 150px;
}
.title-group {
    flex: 3; /* 제목창은 길게 */
}

/* 모든 입력 요소가 부모 너비를 넘지 않도록 설정 */
.form-group input,
.form-group textarea {
    width: 100%;
    box-sizing: border-box; /* 패딩이 너비에 영향을 주지 않게 함 */
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    font-size: 0.9rem;
}

/* 반응형: 화면이 아주 좁아지면 세로로 나열 */
@media (max-width: 500px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* 버튼 그룹 정렬 */
.button-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-submit {
    background-color: #2ac1bc; /* 워넬 위키 민트색 */
    color: white;
    padding: 10px 30px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-submit:hover {
    background-color: #25a8a4;
}

.btn-reset {
    background-color: white;
    color: #666;
    padding: 10px 25px;
    border: 1px solid #ddd;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background-color: #f1f1f1;
}

/* TIL 섹션: 가로는 꽉 차게, 높이는 슬림하게 */
.til-input-container, .til-card {
    width: 100%; /* 본문 너비에 맞춤 */
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.til-input-container {
    background-color: #f8f9fa;
    padding: 15px 20px; /* 위아래 패딩 축소 */
    border-radius: 12px;
    margin-bottom: 25px;
}

/* 날짜와 제목을 한 줄에 배치하여 높이 절약 */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}
.date-group { flex: 1; }
.title-group { flex: 3; }

.form-group { margin-bottom: 8px; }
.form-group label { font-size: 0.85rem; margin-bottom: 3px; }

.form-group input,
.form-group textarea {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.button-group { margin-top: 10px; }

/* TIL 카드 디자인 축소 */
.til-card {
    padding: 15px 20px; /* 내부 여백 축소 */
    margin-bottom: 12px; /* 카드 사이 간격 축소 */
    border-left: 4px solid #2ac1bc;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.card-date { font-size: 0.8rem; margin-bottom: 4px; }
.card-title { font-size: 1.05rem; margin-bottom: 5px; }
.card-content { font-size: 0.9rem; line-height: 1.5; }

/* 목록 스타일 초기화 및 간격 조정 */
.works-list {
    list-style: none; /* 불렛 제거 */
    padding: 0;
}

.works-list > li {
    margin-bottom: 50px; /* 작품 사이 간격 */
    border-bottom: 1px dashed #eee;
    padding-bottom: 30px;
}

.works-list > li:last-child {
    border-bottom: none;
}

/* 이미지 크기 조정 */
.thumbnail img {
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

/* 유튜브 iframe 반응형 설정 */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 비율 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin-top: 15px;
    margin-bottom: 15px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 12px;
}

/* 기본 정보 섹션 전체 컨테이너 */
.info-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* 중앙이 아닌 상단 정렬로 변경 */
    gap: 50px; /* 테이블과 링크 사이의 충분한 간격 */
    width: 100%;
}

/* 테이블 교정 */
.info-table {
    flex: 1.2; /* 테이블이 차지하는 비율 */
    border-collapse: collapse;
    width: 100%; /* 부모 너비를 꽉 채우도록 설정 */
}

.info-table th {
    text-align: left;
    width: 150px; /* 항목 이름 너비를 고정하여 정렬 유지 */
    padding: 15px 0;
    color: #a39c91; /* 아이보리 테마에 맞춘 연한 갈색 */
    border-bottom: 1px solid #f1ede2;
    font-weight: bold;
}

.info-table td {
    padding: 15px 0;
    color: var(--font-color);
    border-bottom: 1px solid #f1ede2;
}

/* 링크 영역 교정 */
.external-links {
    flex: 0.8; /* 링크 버튼 영역 비율 */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background-color: #ffffff; /* 본문과 동일한 순백색 */
    border: 1px solid var(--wiki-border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--font-color);
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.link-item:hover {
    background-color: var(--wiki-bg-side); /* 마우스 올리면 베이지색으로 변경 */
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px); /* 살짝 떠오르는 효과 */
}

/* 모바일 대응: 화면이 좁아지면 세로 1열로 */
@media (max-width: 1050px) {
    #wiki-wrapper {
        grid-template-columns: 1fr;
    }
    .side-left, .side-right {
        border: none;
        padding: 20px;
    }
}