/* ---------------------------------------------------------------
   Base Styles
   --------------------------------------------------------------- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #020202;
  color: #bbb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #B4ADAD;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #E7D6D6;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------------------------------------------------------------
   Layout
   --------------------------------------------------------------- */

.g-doc {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.g-hd {
  padding: 40px 0 30px;
  text-align: center;
}

.g-hdc {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.g-mn {
  padding: 20px 0;
}

.g-ft {
  padding: 30px 0;
  text-align: center;
  border-top: 1px solid #333;
  margin-top: 40px;
}

/* ---------------------------------------------------------------
   Header & Navigation (next site-nav style)
   --------------------------------------------------------------- */

.m-ttl {
  margin-bottom: 20px;
}

.m-ttl a {
  color: #E7D6D6;
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 1px;
}

.site-nav {
  display: flex;
  justify-content: center;
}

.main-menu {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.menu-item a {
  color: #B4ADAD;
  padding: 4px 8px;
  transition: all 0.3s ease;
  font-size: 14px;
}

.menu-item a:hover {
  color: #E7D6D6;
  background: rgba(255, 255, 255, 0.05);
}

.menu-item a i {
  margin-right: 5px;
}

/* Separator style like home.html */
.main-menu .menu-item + .menu-item::before {
  content: "/";
  color: #666;
  margin-right: 8px;
}

.menu-item:last-child .menu-item::before {
  content: "";
}

/* First and last item brackets */
.main-menu::before {
  content: "{";
  color: #B4ADAD;
  margin-right: 10px;
}

.main-menu::after {
  content: "}";
  color: #B4ADAD;
  margin-left: 10px;
}

/* ---------------------------------------------------------------
   Waterfall Layout (Homepage)
   --------------------------------------------------------------- */

.m-postlst {
  column-count: 2;
  column-gap: 48px;
  max-width: 60%;
  margin: 0 auto;
}

.m-post {
  break-inside: avoid;
  margin-bottom: 48px;
  background: #000;
  border: 1px solid #eee;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.m-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.m-post .ct {
  padding: 0;
}

.m-post .ctc {
  position: relative;
}

.m-post .pic {
  overflow: hidden;
  padding: 12px;
}

.m-post .pic .img {
  display: block;
  line-height: 0;
}

.m-post .pic img {
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

.m-post:hover .pic img {
  transform: scale(1.02);
}

.m-post .text {
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #999;
  white-space: pre-line;
}

.m-post .info {
  padding: 10px 16px;
  border-top: 1px solid #222;
}

.m-post .lnks {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.m-post .date {
  color: #B4ADAD;
}

.m-post .tags {
  color: #666;
}

.m-post .tags a {
  color: #666;
  margin-left: 5px;
}

.m-post .tags a:hover {
  color: #B4ADAD;
}

/* ---------------------------------------------------------------
   Pagination
   --------------------------------------------------------------- */

.m-pager {
  text-align: center;
  padding: 30px 0;
}

.m-pager a,
.m-pager span {
  display: inline-block;
  padding: 8px 16px;
  margin: 0 4px;
  border: 1px solid #eee;
  border-radius: 4px;
  color: #B4ADAD;
  transition: all 0.3s ease;
}

.m-pager a:hover {
  background: #222;
  border-color: #B4ADAD;
}

.m-pager .current {
  background: #B4ADAD;
  color: #020202;
}

/* ---------------------------------------------------------------
   Post Detail Page
   --------------------------------------------------------------- */

.m-postdtl {
  max-width: 800px;
  margin: 0 auto;
}

.m-detail {
  background: #111;
  border: 1px solid #eee;
  border-radius: 4px;
  overflow: hidden;
}

.m-detail .m-cont {
  padding: 30px;
}

.m-detail .ctc {
  position: relative;
}

.m-detail .pic {
  margin-bottom: 20px;
}

.m-detail .pic .img {
  display: block;
  line-height: 0;
}

.m-detail .pic img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.m-detail .text {
  font-size: 15px;
  line-height: 1.8;
  color: #bbb;
}

.m-detail .text p {
  margin-bottom: 15px;
}

.m-detail .text img {
  border-radius: 4px;
  margin: 10px 0;
}

.m-detail .text blockquote {
  border-left: 3px solid #B4ADAD;
  padding-left: 15px;
  margin: 15px 0;
  color: #999;
}

.m-detail .text code {
  background: #222;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
}

.m-detail .text pre {
  background: #1a1a1a;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 15px 0;
}

.m-detail .text pre code {
  background: none;
  padding: 0;
}

.m-detail .m-info {
  padding: 20px 30px;
  border-top: 1px solid #222;
}

.m-detail .tags {
  margin-bottom: 10px;
}

.m-detail .tag {
  display: inline-block;
  padding: 4px 10px;
  margin: 0 5px 5px 0;
  background: #222;
  border-radius: 3px;
  font-size: 12px;
  color: #B4ADAD;
  transition: background 0.3s ease;
}

.m-detail .tag:hover {
  background: #333;
  color: #E7D6D6;
}

.m-detail .lnks {
  font-size: 13px;
  color: #666;
}

/* ---------------------------------------------------------------
   Post Navigation (Pager Detail)
   --------------------------------------------------------------- */

.m-pager-dtl {
  display: flex;
  justify-content: space-between;
  padding: 20px 0;
}

.m-pager-dtl a {
  color: #B4ADAD;
  font-size: 14px;
}

.m-pager-dtl a:hover {
  color: #E7D6D6;
}

.m-pager-dtl .prev {
  margin-right: auto;
}

.m-pager-dtl .next {
  margin-left: auto;
  text-align: right;
}

/* ---------------------------------------------------------------
   Archive & Tag Pages
   --------------------------------------------------------------- */

.m-detail .title {
  color: #E7D6D6;
  font-size: 24px;
  margin-bottom: 20px;
}

.m-detail .year {
  color: #E7D6D6;
  font-size: 20px;
  margin: 20px 0 10px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #333;
}

.archive-list,
.tag-list,
.category-list {
  margin-bottom: 30px;
}

.archive-item,
.tag-item,
.category-item {
  padding: 8px 0;
  border-bottom: 1px solid #222;
  display: flex;
  align-items: center;
}

.archive-item .date,
.tag-item .date,
.category-item .date {
  color: #666;
  font-size: 13px;
  min-width: 80px;
}

.archive-item a,
.tag-item a,
.category-item a {
  color: #B4ADAD;
  flex: 1;
}

.archive-item .tags,
.tag-item .tags,
.category-item .tags {
  color: #666;
  font-size: 12px;
  margin-left: 10px;
}

.archive-item .tags a,
.tag-item .tags a,
.category-item .tags a {
  color: #666;
  margin-left: 5px;
}

/* ---------------------------------------------------------------
   Tag Cloud & Category List
   --------------------------------------------------------------- */

.tag-cloud {
  padding: 20px 0;
  text-align: center;
}

.tag-link {
  display: inline-block;
  padding: 6px 14px;
  margin: 5px;
  background: #1a1a1a;
  border-radius: 4px;
  color: #B4ADAD;
  transition: all 0.3s ease;
}

.tag-link:hover {
  background: #333;
  color: #E7D6D6;
}

.tag-link .count {
  font-size: 12px;
  color: #666;
}

.category-list {
  padding: 20px 0;
}

.category-item {
  padding: 12px 0;
  border-bottom: 1px solid #222;
}

.category-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #B4ADAD;
  font-size: 16px;
  transition: color 0.3s ease;
}

.category-link:hover {
  color: #E7D6D6;
}

.category-link .count {
  font-size: 13px;
  color: #666;
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */

.m-cprt {
  font-size: 13px;
  color: #666;
}

.m-cprt a {
  color: #B4ADAD;
}

.m-cprt a:hover {
  color: #E7D6D6;
}

/* ---------------------------------------------------------------
   Responsive Design
   --------------------------------------------------------------- */

@media (max-width: 768px) {
  .g-hdc {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .m-nav {
    margin-top: 15px;
  }
  
  .m-postlst {
    column-count: 1;
  }
  
  .m-detail .m-cont {
    padding: 20px;
  }
  
  .m-detail .m-info {
    padding: 15px 20px;
  }
  
  .m-pager-dtl {
    flex-direction: column;
    gap: 10px;
  }
  
  .m-pager-dtl .prev,
  .m-pager-dtl .next {
    text-align: left;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .m-postlst {
    column-count: 2;
  }
}

@media (min-width: 1025px) {
  .m-postlst {
    column-count: 2;
  }
}

/* ---------------------------------------------------------------
   Animation
   --------------------------------------------------------------- */

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-down {
  animation: fadeInDown 0.5s ease forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

/* ---------------------------------------------------------------
   Lightbox
   --------------------------------------------------------------- */

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  overflow: auto;
}

.lightbox.active {
  display: flex;
}

.lightbox-img {
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 4px;
  transition: transform 0.3s ease;
  cursor: zoom-out;
}

.lightbox-img.fit {
  max-width: 90%;
  max-height: 90%;
  cursor: zoom-in;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 36px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2001;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: #B4ADAD;
}

.lightbox-hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #666;
  font-size: 13px;
  z-index: 2001;
  pointer-events: none;
}

.m-detail .text img {
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.m-detail .text img:hover {
  opacity: 0.8;
}
