body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  background: #121212;
  color: #fff;
  transition: background 0.3s, color 0.3s;
}
body.light {
  background: linear-gradient(to right, #04326e, #54f3dc);
  color: #000;
}
.container {
  max-width: 960px;
  margin: auto;
  padding: 1rem;
  text-align: center;
}
.profile {
  margin-bottom: 2rem;
}
.avatar {
  border-radius: 50%;
  width: 100px;
}
.social-icons img {
  width: 24px;
  margin: 0 5px;
  filter: invert(1);
}
body.light .social-icons img {
  filter: invert(0);
}
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(var(--columns, 3), 1fr);
}
.card {
  background: #1e1e1e;
  padding: 0.5rem;
  border-radius: 12px;
  transition: background 0.3s;
}
.card img {
  width: 100%;
  border-radius: 8px;
  cursor: pointer;
}
.card-content h3 {
  margin: 0.5rem 0 0.25rem;
}
.card-content p {
  height: 3.6em; /* tương đương 2 dòng */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* giới hạn 2 dòng */
  -webkit-box-orient: vertical;
}
.card-content a {
  color: #1e90ff;
  text-decoration: none;
}
body.light .card {
  background: #f0f0f0;
}
.controls {
  margin-bottom: 1rem;
}
.modal {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  z-index: 10;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.8);
}
.modal.hidden {
  display: none;
}
.modal-content {
  max-width: 90%;
  max-height: 90%;
}
.close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}


.card-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  transition: color 0.3s;
}
.card-link:hover h3,
.card-link:hover p {
  color: #1e90ff;
}
.button-link {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 6px 12px;
  background: #1e90ff;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.3s;
}
.button-link:hover {
  background: #0c70c2;
}
/* Hiệu ứng hover cho tiêu đề và mô tả khi rê chuột vào link */
.card-content a.card-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.card-content a.card-link:hover h3,
.card-content a.card-link:hover p {
  color: #1e90ff; /* màu xanh khi hover */
  transition: color 0.3s;
}
#toggle-theme {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  z-index: 999;
}

body.light #toggle-theme {
  color: black;
}
@media screen and (max-width: 480px) {
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

