/* ===== 기본 ===== */
body {
  margin: 0;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f1115;
  color: #e6e6e6;
  -webkit-font-smoothing: antialiased;
}

/* ===== 상단바 ===== */
.topbar {
  position: sticky;
  top: 0;
  background: rgba(15, 17, 21, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid #1f232c;
  z-index: 1000;
}

.top-inner {
  max-width: 1100px;
  margin: auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 600;
  font-size: 16px;
  opacity: 0.9;
}

.top-links a {
  margin-left: 24px;
  text-decoration: none;
  font-size: 14px;
  color: #8b90a0;
  transition: 0.2s;
}

.top-links a:hover {
  color: #fff;
}

.menu-btn {
  display: none;
  background: #1f232c;
  border: 1px solid #333;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1;
}

/* ===== 레이아웃 ===== */
.layout {
  display: flex;
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
  gap: 40px;
}

/* ===== 사이드바 (여백 확실히 수정) ===== */
.sidebar {
  width: 180px;
  flex-shrink: 0;
}

/* 상위 메뉴: 좌측 여백을 16px로 설정 */
.sidebar a, .menu-toggle {
  display: block;
  text-decoration: none;
  color: #8b90a0;
  font-size: 14px;
  padding: 10px 16px; 
  border-radius: 8px;
  transition: 0.2s;
  cursor: pointer;
}

.sidebar a:hover, .menu-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.sidebar a.active {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

/* 아코디언 서브 리스트: 이미지 86dd06에서 딱 붙어 보이던 부분 수정 */
.sub-list {
  margin-left: 10px;
  border-left: 1px solid #2a3040;
  padding-left: 0px; /* 여기서 여백을 주지 않고 a 태그 자체에서 패딩을 줌 */
  margin-bottom: 10px;
}

.sub-list a {
  font-size: 13px;
  padding: 8px 16px !important; /* 좌측 여백 16px 강제 적용 */
  margin-bottom: 2px;
  margin-left: 5px; /* 선에서 살짝 띄움 */
}

/* ===== 콘텐츠 ===== */
.content {
  flex: 1;
  min-width: 0;
}

/* ===== 카드 ===== */
.post-item {
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 14px;
  background: #171a21;
  border: 1px solid #1f232c;
  cursor: pointer;
  transition: 0.25s;
}

.post-item:hover {
  transform: translateY(-2px);
  background: #1c2028;
  border-color: #2a3040;
}

.post-item h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 500;
}

.post-item .date {
  font-size: 12px;
  color: #8b90a0;
}

.post-item p {
  margin-top: 8px;
  font-size: 14px;
  color: #b5bac7;
}

/* ===== 글 보기 ===== */
.post-view {
  max-width: 720px;
  margin: auto;
}

.post-title {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 6px;
}

.meta {
  font-size: 12px;
  color: #8b90a0;
}

.post-content {
  margin-top: 30px;
  line-height: 1.9;
  color: #d6d9e0;
  font-size: 15.5px;
}

/* ===== 이미지 ===== */
.img-wrap {
  margin: 34px 0;
  text-align: center;
}

.img-wrap img {
  max-width: 100%;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  cursor: zoom-in;
  transition: 0.25s;
}

.img-wrap img:hover {
  transform: scale(1.02);
}

/* ===== 이미지 확대 모달 ===== */
.img-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.2s ease;
}

.img-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== 뒤로가기 ===== */
.back-btn {
  display: inline-block;
  margin-top: 50px;
  font-size: 13px;
  text-decoration: none;
  color: #7a8090;
}

.back-btn:hover {
  color: #fff;
}

/* ===== Pinterest Photo Grid ===== */
.photo-grid {
  column-count: 4;
  column-gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.photo-card {
  break-inside: avoid;
  margin-bottom: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
}

.photo-card img {
  width: 100%;
  display: block;
  border-radius: 14px;
  transition: 0.3s;
}

.photo-card:hover img {
  transform: scale(1.05);
  opacity: 0.9;
}

/* ===== 반응형 ===== */
@media (max-width: 1200px) { .photo-grid { column-count: 3; } }
@media (max-width: 800px) { .photo-grid { column-count: 2; } }
@media (max-width: 768px) {
  .layout { flex-direction: column; gap: 10px; margin: 20px auto; }
  .sidebar { display: none; width: 100%; box-sizing: border-box; }
  .sidebar.open {
    display: block !important;
    background: #171a21;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid #2a3040;
    margin-bottom: 25px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    animation: slideDown 0.3s ease-out;
  }
  .menu-btn { display: block !important; }
  .top-links { display: none !important; }
}
@media (max-width: 500px) { .photo-grid { column-count: 1; } }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
