/* ========================================
   BLOG PAGE — Clean Tile Layout (nenukc.in theme)
   Revised for full-width expansion and clean grid
   Includes overflow containment and content styling
======================================== */

body.blog-page {
  background-color: rgb(90, 90, 90);
  color: #eeeeee;
  font-family: monospace;
  margin: 0;
  padding: 20px 20px 80px 40px;
  overflow-y: auto;
}

/* Central container */
#blog-container.blog-center {
  max-width: 850px;
  margin: 40px auto;
  padding: 30px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

/* Title */
#blog-container.blog-center .blog-title {
  color: #ff9933;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  text-align: left;
}

/* Grid of tiles */
#blog-container.blog-center .blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  align-items: stretch;
}

/* Tile */
.blog-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 14px 16px;
  transition: all 0.3s ease;
  cursor: pointer;
  color: #ddd;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  min-height: 100px;
  overflow: hidden;
}

.blog-item:hover {
  border-color: #ff9933;
  background: rgba(255, 153, 51, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.blog-detail-date {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 16px;
}

/* Thumbnail visible on tile */
.blog-thumb {
  width: 100%;
  max-width: 95%;
  height: 160px;
  overflow: hidden;
  border-radius: 6px;
  margin: 0 auto 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.blog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  transition: transform 0.4s ease;
}

.blog-item:hover .blog-thumb img {
  transform: scale(1.05);
}

/* Header inside tile */
.blog-header {
  font-size: 15px;
  font-weight: bold;
  color: #ff9933;
  text-align: center;
  margin: 6px 0 8px 0;
}

/* Hidden blog content */
.blog-content {
  display: none;
}

/* Full blog detail container */
.blog-detail {
  display: none;
  padding: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #ff9933;
  border-radius: 8px;
  margin-top: 30px;
  color: #eee;
  line-height: 1.6;
  animation: fadeIn 0.3s ease;
}

/* Ensure content doesn't overflow */
.blog-detail,
.blog-detail * {
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Media & formatting inside blog detail */
.blog-detail img,
.blog-detail figure,
.blog-detail iframe,
.blog-detail pre,
.blog-detail table {
  max-width: 100%;
  width: 100%;
  display: block;
  margin: 10px auto;
  border-radius: 6px;
}

.blog-detail figure {
  text-align: center;
  margin: 16px 0;
}

.blog-detail figcaption {
  font-size: 12px;
  color: #ccc;
  margin-top: 4px;
}

.blog-detail a {
  color: #ff9933;
  text-decoration: underline;
  word-break: break-word;
}

.blog-detail ul,
.blog-detail ol {
  margin-left: 20px;
}

.blog-detail code,
.blog-detail pre {
  overflow-x: hidden;        /* or remove line */
  white-space: pre-wrap;     /* wraps long code lines */
  word-break: break-all;     /* breaks very long tokens if needed */
}

.blog-detail h2,
.blog-detail h3,
.blog-detail h4 {
  color: #ff9933;
  margin-top: 20px;
  margin-bottom: 10px;
}

/* Scrollbar styling */
.blog-detail::-webkit-scrollbar {
  width: 8px;
}
.blog-detail::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Blog detail title */
.blog-detail-title {
  color: #ff9933;
  margin-bottom: 16px;
  text-transform: uppercase;
  font-size: 18px;
}

/* Back button */
.back-button {
  display: inline-block;
  margin: 20px 0 10px 0;
  background: none;
  color: #ff9933;
  border: 1px solid #ff9933;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.back-button:hover {
  background: #ff9933;
  color: #000;
}

/* Fade animation for transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile layout */
@media (max-width: 768px) {
  body.blog-page {
    padding: 16px 12px 72px 18px;
  }

  #blog-container.blog-center {
    width: 100%;
    padding: 12px 0 0 0;
    margin: 12px 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #blog-container.blog-center .blog-title {
    font-size: 20px;
    margin: 0 0 22px 0;
  }

  #blog-container.blog-center .blog-list {
    grid-template-columns: 1fr;
  }

  .blog-item {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 16px 14px;
  }

  .blog-thumb {
    max-width: 100%;
    height: 180px;
    margin: 0 auto 10px auto;
  }

  .blog-header {
    font-size: 14px;
  }

  .blog-detail {
    padding: 0;
    margin-top: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 15px;
    line-height: 1.75;
  }

  .blog-detail-title {
    font-size: 18px;
    line-height: 1.45;
    margin: 0 0 10px 0;
  }

  .blog-detail-date {
    margin-bottom: 18px;
  }

  .blog-detail img,
  .blog-detail figure,
  .blog-detail iframe,
  .blog-detail pre,
  .blog-detail table {
    border-radius: 6px;
    margin: 14px 0;
  }

  .blog-detail blockquote {
    margin: 18px 0;
    padding: 0 0 0 14px;
    border-left: 2px solid rgba(255, 153, 51, 0.75);
  }

  .back-button {
    margin: 22px 0 8px 0;
  }
}
