* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Noto Sans Myanmar', 'Padauk', 'Inter', system-ui, -apple-system, sans-serif;
  background: #f8f5f0;
  color: #2b2b2b;
  line-height: 1.65;
  font-size: 17px;
}
.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }

.site-header {
  background: #8B4513;
  color: #fff;
  padding: 14px 0;
  border-bottom: 3px solid #c7a233;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: 0.5px; }
.nav a { color: #ffeeb6; text-decoration: none; margin-left: 14px; }
.nav a:hover { color: #fff; text-decoration: underline; }

.main { padding: 28px 16px 60px; }

.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
.post-card {
  background: #fff;
  border: 1px solid #e9e4d8;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  transition: box-shadow 0.15s;
}
.post-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.07); }
.post-card .thumb {
  width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
  background: #ebe3d0; border-radius: 10px;
  font-size: 44px; color: #8B4513;
  text-decoration: none;
}
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.post-card h2 { margin: 0 0 6px; font-size: 1.15rem; }
.post-card h2 a { color: #2b2b2b; text-decoration: none; }
.post-card h2 a:hover { color: #8B4513; }
.post-card time { color: #777; font-size: 13px; }

.pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 28px 0 8px;
}
.pagination a {
  color: #8B4513; text-decoration: none; padding: 8px 14px;
  border: 1px solid #d7cbb3; border-radius: 999px; background: #fff;
}
.pagination a:hover { background: #8B4513; color: #fff; }

.post h1 { font-size: 1.75rem; margin: 0 0 6px; }
.post time { color: #777; font-size: 14px; }
.post-media { margin: 20px 0; display: grid; gap: 14px; }
.post-media img, .post-media video { width: 100%; height: auto; border-radius: 10px; }
.post-media audio { width: 100%; }
.post-media figcaption { color: #666; font-size: 14px; text-align: center; margin-top: 6px; }
.post-body { margin-top: 20px; }
.post-body img { max-width: 100%; height: auto; border-radius: 8px; }

.back { margin: 30px 0; }
.back a { color: #8B4513; text-decoration: none; }

.site-footer {
  padding: 20px 0; text-align: center; color: #999; font-size: 14px;
  border-top: 1px solid #e3dcc9; margin-top: 60px;
}

.notfound { text-align: center; padding: 60px 20px; }
.notfound h1 { font-size: 4rem; margin: 0; color: #8B4513; }
.notfound a { color: #8B4513; }

.muted { color: #777; text-align: center; padding: 40px 0; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .post-card { grid-template-columns: 90px 1fr; gap: 12px; padding: 10px; }
  .post-card .thumb { width: 90px; height: 90px; font-size: 32px; }
  .post h1 { font-size: 1.4rem; }
}

/* === GALLERY === */
.gallery {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.gallery[data-count="1"] {
  grid-template-columns: 1fr;
}
.gallery[data-count="1"] .gallery-item img { max-height: 70vh; object-fit: contain; }
.gallery-item {
  display: block;
  background: #ebe3d0;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  transition: transform 0.15s;
}
.gallery[data-count="1"] .gallery-item {
  aspect-ratio: auto;
  background: transparent;
}
.gallery-item:hover { transform: scale(1.02); }
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* === LIGHTBOX === */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
  touch-action: pan-y;
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
#lb-close, #lb-prev, #lb-next,
.lb-close, .lb-prev, .lb-next {
  position: fixed;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 0;
  width: 48px; height: 48px;
  border-radius: 999px;
  font-size: 28px;
  cursor: pointer;
  z-index: 1001;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.25); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
#lb-caption {
  position: fixed; left: 50%; bottom: 60px;
  transform: translateX(-50%);
  color: #eee; font-size: 15px;
  max-width: 80%; text-align: center;
  padding: 6px 14px;
  background: rgba(0,0,0,0.4);
  border-radius: 6px;
}
#lb-count {
  position: fixed; left: 50%; bottom: 20px;
  transform: translateX(-50%);
  color: #ccc; font-size: 13px;
}
@media (max-width: 600px) {
  .lb-close, .lb-prev, .lb-next { width: 42px; height: 42px; font-size: 24px; }
  .lb-close { top: 12px; right: 12px; }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
}
