.publications-container {
  margin: 40px auto;
}

.publications-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.publications-content {
  flex: 3;
}

.publications-sidebar {
  flex: 1;
  top: 2rem;
  min-width: 300px;
}

.publications-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.publication-card {
  display: flex;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 250px;
  height: auto;
  align-items: stretch;
}

.publication-pdf-preview {
  flex: 0 0 250px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  align-self: stretch;
  height: 310px;
  max-height: 310px;
  overflow: hidden;
}

.pdf-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.pdf-fallback {
  width: 100%;
  height: 310px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f0f4f8;
  color: #333;
}

.pdf-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.publication-content {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.keyword-search-container {
  width: 100%;
}

.search-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 1rem 0;
  text-align: left;
}

.keyword-search-input {
  width: 100%;
  padding: 10px 10px !important;
  border: 1px solid #666 !important;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #ffffff;
  color: #374151;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.keyword-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.keyword-search-input::placeholder {
  color: #9ca3af;
}

.publication-type-filter {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.city-department-filter {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.publication-date-filter {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.date-range-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.date-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.date-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
}

.date-input {
  width: 100%;
  padding: 10px 10px !important;
  border: 1px solid #666 !important;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #ffffff;
  color: #374151;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.date-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 1rem 0;
  text-align: left;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: #374151;
  transition: color 0.2s ease;
}

.checkbox-label:hover {
  color: #1f2937;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 0.75rem;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.checkbox-text {
  user-select: none;
}

.checkbox-label input[type="checkbox"]:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.publication-meta {
  margin-bottom: 0.5rem;
}

.publication-date-dept {
  font-size: 0.9rem;
  color: #333;
  font-weight: 400;
}

.publication-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: black;
  margin: 0 0 1rem 0;
  line-height: 1.3;
  text-decoration: none;
}

.publication-title a {
  text-decoration: none;
  color: var(--text-color);
}

.publication-title a:visited {
  color: var(--text-color);
}

.publication-title a:hover {
  text-decoration: underline;
  color: var(--text-color);
}

.publication-description {
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;

  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.publication-actions {
  margin-top: auto;
}

.open-pdf-btn {
  display: inline-flex;
  align-items: center;
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 500;
  font-size: 0.95rem;
}

.open-pdf-btn:hover {
  text-decoration: underline;
}

.open-pdf-btn:visited:hover {
  color: #800080;
}

.no-results {
  text-align: center;
  padding: 2rem;
  color: #333;
  background: #f9fafb;
  border-radius: 8px;
  margin-top: 1rem;
}

.no-results p {
  margin: 0;
  font-size: 1rem;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0 1rem 0;
}

.pagination button {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.pagination button:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.pagination button.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  text-align: center;
  color: #333;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.publication-badge {
  background: #e4002b;
}

.city-department-badge {
  background: #0075bb;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .publications-layout {
    flex-direction: column;
  }

  .publications-sidebar {
    order: -1;
    position: static;
    flex: none;
    min-width: auto;
    margin-bottom: 1.5rem;
    width: 100%;
  }

  .publications-content {
    flex: none;
  }
}

@media (max-width: 768px) {
  .publication-sidebar-info {
    margin-top: 30px;
  }
  .publications-layout {
    gap: 1.5rem;
  }

  .publications-sidebar {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .publication-card {
    flex-direction: column;
    min-height: auto;
  }

  .publication-pdf-preview {
    flex: 0 0 200px;
    width: 100%;
    min-height: 259px; /* Bond paper aspect ratio: 200px * 1.294 ≈ 259px */
    height: 259px;
    max-height: 259px;
  }

  .pdf-fallback {
    height: 259px; /* Match the container height */
  }

  .publication-content {
    padding: 1rem;
  }

  .publication-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .publications-container {
    margin: 20px auto;
  }

  .publications-layout {
    gap: 1rem;
  }

  .publications-list {
    gap: 1rem;
  }

  .publication-card {
    border-radius: 8px;
  }

  .publication-pdf-preview {
    flex: 0 0 150px;
    min-height: 194px; /* Bond paper aspect ratio: 150px * 1.294 ≈ 194px */
    height: 194px;
    max-height: 194px;
  }

  .pdf-fallback {
    height: 194px; /* Match the container height */
  }

  .publication-content {
    padding: 0.75rem;
  }

  .publications-sidebar {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .publication-title {
    font-size: 1.1rem;
  }

  .open-pdf-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .keyword-search-input {
    padding: 0.65rem;
    font-size: 0.85rem;
  }

  .search-title {
    font-size: 1rem;
  }
}
