:root {
  --bg: #1D2D3E;
  --bgSoft: #a2d2ff;
  --textItem: #000000;
  --text: #a2d2ff;
  --textSoft: #white;
  --navbar: #1d2d3e;
  --listItemBorder: rgba(255, 255, 255, 0.24);
  --tocHover: white;
  --buttonHover: white;
}
pre {
  border-radius: 10px;
  overflow-y: auto; 
  max-width: 100%;
  white-space: pre-wrap; 
  word-break: break-spaces;
  scrollbar-width: thin; 
  scrollbar-color: #a4a5a7 #1e293b;
}

/* Chrome, Safari scrollbar */
pre::-webkit-scrollbar {
  height: 15px; /* 👈 Bật lại thanh ngang */
}
pre::-webkit-scrollbar-thumb {
  background-color: #a4a5a7;
  border-radius: 10px;
}
pre::-webkit-scrollbar-track {
  background-color: #1e293b;
}






img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}
* {
  margin: 0;
  box-sizing: border-box;
  font-family: 'JetBrains Mono', monospace;
}
.cate{
  color: var(--text);
}
.message{
  flex-wrap: wrap;
}

body.light .icon-moon {
  display: none;
}

body:not(.light) .icon-sun {
  display: none;
}




body {
  background: var(--bg);
  color: var(--text);
}

body.light{
  --bg: #E0F2FE;
  --text: #0b1529;
  --bgSoft: #a2d2ff;
  --navbar:#E0F2FE;
  --listItemBorder: #1D2D3E;
  --tocHover: #a2d2ff;
  --buttonHover: #465a6c;
}
.listItemTitle__name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: bold;
  font-size: 26px;
}

a {
  color: inherit;
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
}
.listItemDesc {
  display: -webkit-box;
  -webkit-line-clamp: 2;              
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;

  word-break: break-word;             
  white-space: normal;                
}

.singleHeadDesc {
  max-width: 100%;           
  overflow-wrap: break-word;  
  word-break: break-word;     
  overflow: hidden;          
}

.toc-fixed {
  width: 20%;
  min-width: 200px;
  max-width: 400px;
  border: 1px solid var(--listItemBorder);
  position: fixed;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 1rem;
  background-color: var(--bg);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--text);
  backdrop-filter: blur(6px);
  transition: all 0.3s ease;
/* Ẩn scrollbar (Chrome, Edge, Safari) */
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* Internet Explorer 10+ */
}
.toc-fixed::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
} 

.toc-fixed ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.toc-fixed li {
  margin-bottom: 0.6rem;
  padding-left: 0.5rem;
  border-left: 2px solid transparent;
  transition: border-color 0.2s;
}

.toc-fixed li:hover {
  border-left-color: var(--tocHover);
  color: var(--tocHover);
}

.toc-fixed a {
  color: inherit;
  text-decoration: none;
}

.toc-fixed a:hover {
  text-decoration: underline;
}
/* Highlight TOC item đang active */
.toc-fixed a.active {
  color: var(--tocHover);
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: bold;
  transition: all 0.3s;
}




.hugo-encryptor-form {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0;
  align-items: center;
}

.hugo-encryptor-input {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  background-color: var(--bg);
  border: 1px solid #64748b;
  border-radius: 6px;
  color: var(--text);
  outline: none;
  width: 100%;
}

.hugo-encryptor-input::placeholder {
  color: #94a3b8;
}

.hugo-encryptor-button {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-family: 'JetBrains Mono', monospace;
  background-color: var(--bgSoft);
  color: #1D2D3E;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}
.hugo-encryptor-button:hover{
  background-color: var(--buttonHover);
  color: var(--text);
}

h2, h3, h4, h5, h6 {
  scroll-margin-top: 100px; /* Điều chỉnh theo chiều cao navbar cố định */
}


.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5); /* Nền tối */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-box {

    width: 30%;
    background: var(--bg);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    max-width: 80%;
}

.modal-box button {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    font-weight: bold;
    background: var(--bgSoft);
    color: var(--textItem);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.modal-box button:hover {
  background-color: var(--buttonHover);
  color: var(--text);
}

.hidden {
    display: none;
}
.main-wrapper {
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 10px;
}


.container {
  /* border: 1px solid white; */
  width: 70%;
  padding-left: 100px;
  padding-right: 100px;
  margin: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  
  /* justify-content: space-between; */
}

/* NAVBAR START */

.navbar {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  height: 105px;
  position: sticky;
  top: 0  ;
  z-index: 999;
  border: 1px solid var(--bg);
  background-color: var(--bg);
}

.logo {
  font-weight: bold;
  font-size: 24px;
}

.links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 15px;
}

.searchButton {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bgSoft);
  color: var(--textSoft);
  padding: 5px;
  border-radius: 10px;
}

.toggle {
  width: 30px;
  height: 20px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  background-color: var(--bgSoft);
  border: 0.5px solid var(--textSoft);
  padding: 5px;
  position: relative;
}

.ball {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  position: absolute;
  left: 0;
  background-color: var(--textSoft);
  border: 1px solid var(--bgSoft);
}

.light .ball {
  left: unset;
  right: 0;
}

/* NAVBAR END */

/* FOOTER START */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100px;
  font-size: 14px;
  margin-top: auto;
}

.social {
  border: none;
  display: flex;
  gap: 10px;
}

/* FOOTER END */

/* LIST START */

.listItem {
  border: 1px solid var(--listItemBorder);
  border-radius: 10px;
  padding: 5px;
  display: flex;
  align-items: center;
  gap: 30px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  flex-wrap: wrap;
}
/* .listItem:hover{
  transform: translateY(-10px);
} */
.listItemTitle {
  display: flex;
  flex-direction: column;
  font-size: 25px;
  word-break: break-word;
  gap: 5px;
}

.listItemImage {
  width: 300px;
  height: 200px;
  object-fit: cover;
  flex-shrink: 0; 
}

.listItemTexts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1; 
  min-width: 0; 
}

.listItemDetail {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  flex-wrap: wrap;
  min-width: 0;
}

.listItemAvatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.listItemCategories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.listItemCategory {
  padding: 5px;
  border-radius: 5px;
  background-color: var(--bgSoft);
  color: var(--textItem);
  font-size: 14px;
  white-space: nowrap;
}
.social{
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--listItemBorder);
  border-radius: 6px;
  background-color: var(--bgSoft);
}
.pagination{
  display: flex;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  margin-top: 80px;
  margin-bottom: 30px;
}

.page-item{
  border: 1px solid gray;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
}

.page-item.active{
  background-color: var(--text);
  color: var(--bg);
}
.page-item.disabled{
  background-color: var(--bg);
  /* color: var(--bg); */
  cursor: not-allowed;
}

/* LIST END */

/* SINGLE START */
.single{
  width: 100%;
}

.single > img{
  object-fit: cover;
  width: 100%;
}

.singleHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.singleHeadTexts {
  max-width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.singleHeadTitle {
  font-size: 48px;
}

.singleHeadDesc {
  font-size: 20px;
  font-weight: 300;
}

.singleHeadDetail {
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.singleAvatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.singleCategory {
  padding: 5px;
  border-radius: 5px;
  background-color: var(--bgSoft);
  color: var(--textItem);
  font-size: 14px;
}

.singleHeadImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.singleBottom {
  scroll-margin-top: 100px;
  padding: 8px;   
  border: 1px solid var(--listItemBorder);
  padding: 10px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  gap: 50px;
  margin-top: 50px;
}

.singleContent {
  width: 100%;          
  display: block;      
  font-size: 15px;
  line-height: 32px;
  box-sizing: border-box; 
}

.singleContent p,
.singleContent h1,
.singleContent h2,
.singleContent h3 {
  margin: 20px 0px;
}

.singleContent img {
  width: 100%;
  object-fit: cover;
}

.singleContent pre {
  width: 100%;
  padding: 20px;
}

.singleRightBar {
  flex: 1;
}

/* SINGLE END */

/* RIGHTBAR START */

.rightBar {
  position: sticky;
  top: 100px;
}

.rightBarImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rightBarImgHr {
  display: none;
}



/* RIGHTBAR END */

/* Profile start */
.profile-cover {
  position: relative;
  width: 100%;
  height: 250px; /* bạn có thể chỉnh chiều cao theo ý */
  overflow: hidden;
  background-color: #333; /* phòng khi ảnh chưa load */
}

.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar {
  position: absolute;
  bottom: 0px; /* để avatar tràn xuống dưới cover */
  left: 10px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid black; /* bo viền cho avatar */
  background-color: #000; /* phòng khi chưa load */
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Profile end */

/* categories start */
.categoryBlock {
  margin-bottom: 1rem;
  border: 1px solid #444;
  padding: 0.5rem;
  border-radius: 5px;
  color: #fff;
}
.categoryHeader {
  cursor: pointer;
  user-select: none;
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--text);
}
.postList {
  margin-left: 1rem;
  margin-top: 0.5rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

/* Khi mở */
.postList.open {
  max-height: 1000px; /* Đủ lớn để hiển thị nội dung */
  opacity: 1;
}

/* Từng dòng post */
.postList div {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Khi mở */
.postList.open div {
  opacity: 1;
  transform: translateY(0);
}


/* categories end */
@media (max-width: 1536px) {
  .container {
    max-width: 1366px;
  }
}
@media (max-width: 1366px) {
  .container {
    max-width: 1280px;
  }
}
@media (max-width: 1280px) {
  .container {
    max-width: 1024px;
  }
}
@media (max-width: 1024px) {
  .hugo-encryptor-form {
    flex-direction: column;
    align-items: stretch; 
  }

  .hugo-encryptor-input,
  .hugo-encryptor-button {
    width: 100%;
  }
  .container {
    max-width: 768px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .toc-fixed{
    display: none;
  }
  .singleHeadImg {
    display: none;
  }

  .singleBottom {
    flex-direction: column-reverse;
  }

  .rightBarImg {
    display: none;
  }

  .rightBarImgHr {
    display: block;
    width: 100%;
  }
  .logo{
    font-size: 15px;

  }
  .listItem{
    flex-direction: column;
  }
  .listItemImage{
    width: 100%;
    object-fit: cover;
  }
  .modal-box{
    width: 70%;
  }
}
@media (max-width: 768px) {
  .hugo-encryptor-form {
    flex-direction: column;
    align-items: stretch; 
  }
  .hugo-encryptor-input,
  .hugo-encryptor-button {
    width: 100%;
  }
  .container {
    max-width: 640px;
  }
  .singleHead {
    flex-direction: column;  
    align-items: flex-start; 
    gap: 10px; 
  }

  .singleHeadTitle {
    font-size: 32px; 
  }

  .toc-fixed{
    display: none;
  }

  .singleHeadDesc {
    font-size: 16px;
  }

  .singleHeadDetail {
    flex-wrap: wrap; 
    gap: 10px;
  }

  .singleBottom {
    flex-direction: column;
  }

  .singleContent {
    font-size: 14px;
    line-height: 26px;
  }

  .links {
    font-size: 14px;
  }

  .listItem{
    flex-direction: column;
  }
  .listItemImage{
    width: 100%;
    object-fit: cover;
  }
  .modal-box{
    width: 70%;
  }
}
@media (max-width: 640px) {
  .container{
    width: 100%;
  }
  .hugo-encryptor-form {
    flex-direction: column;
    align-items: stretch; 
  }

  .hugo-encryptor-input,
  .hugo-encryptor-button {
    width: 100%;
  }
  .container {
    max-width: 475px;
  }
  .toc-fixed{
    display: none;
  }
  .modal-box{
    width: 70%;
  }
}

.markdown-body img {
  width: auto;
  height: auto;
  object-fit: unset;
  border-radius: 0;
}

.markdown-body div[align="center"] {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.markdown-body div[align="center"] img {
  height: 30px;
}