/* News and Admin Panel Styles */

.news-header-section {
  padding: 60px 0;
  background: linear-gradient(135deg, var(--surface) 0%, #fff 100%);
  text-align: center;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

.news-card {
  background: var(--bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.news-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.news-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-title {
  font-size: 20px;
  margin: 0 0 12px;
  line-height: 1.4;
  color: var(--text);
}

.news-title a {
  color: inherit;
}

.news-title a:hover {
  color: var(--primary);
}

.news-summary {
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* Home News Grid (2 columns, small cards) */
.home-news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.home-news-card {
  display: flex;
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  height: 140px;
}

.home-news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.home-news-cover {
  width: 140px;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

.home-news-content {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
}

.home-news-title {
  font-size: 16px;
  margin: 0 0 8px;
  line-height: 1.4;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-news-title a {
  color: inherit;
  text-decoration: none;
}

.home-news-title a:hover {
  color: var(--primary);
}

.home-news-summary {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.home-news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

@media (max-width: 960px) {
  .home-news-grid {
    grid-template-columns: 1fr;
  }
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface);
}

/* Admin Styles */
.admin-bg {
  background: var(--surface);
}

.admin-header {
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

#admin-nav-list {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

#admin-nav-list li {
  display: flex;
  align-items: center;
}

#admin-nav-list .btn {
  margin-top: 0; /* Remove any inherited top margin */
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
}

.admin-main .section {
  padding: 40px 0;
}

.admin-table-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  margin-top: 24px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th, .admin-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: #fcfcfc;
  font-weight: 600;
  color: var(--text);
}

.admin-table tbody tr:hover {
  background: var(--surface);
}

.admin-table .cover-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-published {
  background: #e6f7ef;
  color: #0b8e4e;
}

.status-hidden {
  background: #fff0f0;
  color: #d13a3a;
}

.status-draft {
  background: #f0f4ff;
  color: var(--primary-ink);
}

.action-btns {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: transparent;
  border: 1px solid #d13a3a;
  color: #d13a3a;
}

.btn-danger:hover {
  background: #d13a3a;
  color: #fff;
}

/* Editor Styles */
.editor-form {
  background: #fff;
  padding: 32px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
}

.form-control {
  width: 100%;
  font-size: 16px;
  font-family: inherit;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}

.cover-upload-group .upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--surface);
  position: relative;
}

.cover-upload-group .upload-area:hover {
  border-color: var(--primary);
  background: #f0f7ff;
}

.hidden-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.upload-area img {
  max-height: 200px;
  margin: 0 auto;
  border-radius: 8px;
}

.remove-cover {
  margin-top: 16px;
  position: relative;
  z-index: 20;
}

.form-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  justify-content: flex-end;
}