/* ===== 기본 ===== */
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.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid #1f232c;
  z-index: 100;
}

.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: 15px;
  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: none;
  border: none;
  color: #ccc;
  font-size: 20px;
  cursor: pointer;
}

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

/* ===== 사이드바 ===== */
.sidebar {
  width: 180px;
  flex-shrink: 0;
}

.sidebar a {
  display: block;
  text-decoration: none;
  color: #8b90a0;
  font-size: 14px;
  margin-bottom: 10px;
  transition: 0.2s;
}

.sidebar a:hover {
  color: #fff;
}

.sidebar a.active {
  color: #fff;
  font-weight: 500;
}

/* ===== 콘텐츠 ===== */
.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: 20px;
  }

  .sidebar {
    display: none;
    width: 100%;
  }

  .sidebar.open {
    display: block;
    background: #14171d;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #1f232c;
  }

  .menu-btn {
    display: block;
  }

  .top-links {
    display: none;
  }
}

@media (max-width: 500px) {
  .photo-grid { column-count: 1; }
}