/* ============================================= */
/*  ACGS - Frontend Styles for Source Block
/* ============================================= */

/* --- Main Block --- */
.acgs-sources-block {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb; /* light gray */
}

.acgs-sources-block h2 {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1f2937; /* darker gray */
  display: flex;
  align-items: center;
}

.acgs-sources-block h2 svg {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
  color: #6366f1; /* indigo */
}

/* --- Grid Layout --- */
.acgs-sources-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .acgs-sources-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --- Individual Source Item --- */
.acgs-source-item {
  padding: 1rem;
  background-color: #f9fafb; /* very light gray */
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  transition: box-shadow 0.2s ease-in-out;
}

.acgs-source-item:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.acgs-source-item a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.acgs-source-item-title {
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 0.5rem;
  word-break: break-word;
  flex-grow: 1; /* Pushes the meta info to the bottom */
  transition: color 0.2s ease-in-out;
}

.acgs-source-item a:hover .acgs-source-item-title {
  color: #4f46e5; /* indigo hover */
}

.acgs-source-item-meta {
  display: flex;
  align-items: center;
  margin-top: auto; /* Aligns to the bottom */
}

/* **** PHẦN QUAN TRỌNG NHẤT: ĐỊNH NGHĨA CHO FAVICON **** */
.acgs-source-favicon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  flex-shrink: 0; /* Prevents the icon from shrinking */
  display: inline-block; /* Ensures it's visible */
  vertical-align: middle; /* Aligns nicely with text */
}

.acgs-source-item-domain {
  font-size: 0.75rem;
  line-height: 1rem;
  color: #6b7280; /* medium gray */
}

/* --- Citation Link in Content --- */
.acgs-citation a {
  text-decoration: none;
  color: #4f46e5; /* indigo */
}

/* --- "View All" Logic --- */
.acgs-sources-grid .acgs-source-item:nth-child(n + 4) {
  display: none;
}

#acgs-view-all-sources-btn {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
  transition: color 0.2s ease-in-out;
}

#acgs-view-all-sources-btn:hover {
  color: #4f46e5;
}
