/* ============================================================
   NEWS PAGE - 2 COLUMN LAYOUT WITH SIDEBAR
   Bootstrap + Custom CSS - Redesigned
============================================================ */

:root {
  --primary: #2563eb;
  --secondary: #64748b;
  --dark: #1e293b;
  --light: #f8fafc;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.12);
}

/* ===== PAGE CONTAINER ===== */
.news-page-container {
  background: #ffffff;
  min-height: 100vh;
}

/* ===== PAGE HEADER ===== */
.news-page-header {
  background: linear-gradient(135deg, #1e40af 0%, var(--primary) 100%);
  padding: 50px 0 35px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.news-page-header::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.header-content {
  position: relative;
  z-index: 1;
}

.page-title {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title i {
  font-size: 32px;
}

.page-description {
  font-size: 16px;
  margin: 0;
  opacity: 0.95;
  max-width: 600px;
}

/* ===== MAIN CONTAINER ===== */
.news-main-container {
  padding: 40px 15px 60px;
  max-width: 1320px;
}

/* ===== ARTICLES LIST ===== */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-item {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

.article-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.article-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.article-image {
  height: 220px;
  position: relative;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease;
}

.article-item:hover .article-image img {
  transform: scale(1.1);
}

.article-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  color: #94a3b8;
}

.article-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary);
  color: #fff;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.article-content {
  padding: 20px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.meta-date,
.meta-read {
  font-size: 12px;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 10px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-summary {
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.6;
  margin: 0 0 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.read-more-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.3s;
}

.article-item:hover .read-more-link {
  gap: 10px;
}

/* ===== PAGINATION ===== */
.news-pagination {
  margin-top: 40px;
}

.pagination-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.pagination-item {
  display: inline-block;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid var(--border);
  transition: all 0.3s;
  gap: 5px;
}

.pagination-link:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

.pagination-item.active .pagination-link {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination-item.disabled .pagination-link {
  opacity: 0.4;
  pointer-events: none;
}

/* ===== SIDEBAR ===== */
.news-sidebar {
  position: sticky;
  top: 20px;
}

.sidebar-widget {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.widget-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 15px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-title i {
  color: var(--primary);
  font-size: 18px;
}

.widget-content {
  margin: 0;
}

/* ===== CATEGORY LIST ===== */
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-item {
  margin-bottom: 6px;
}

.category-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--light);
  color: var(--dark);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s;
  border: 1px solid transparent;
}

.category-link:hover {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(4px);
}

.category-item.active .category-link {
  background: var(--primary);
  color: #fff;
}

.category-link i {
  font-size: 16px;
  flex-shrink: 0;
}

.category-link span:first-of-type {
  flex: 1;
}

.category-count {
  background: rgba(0, 0, 0, 0.1);
  color: inherit;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.category-item.active .category-count {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== RECENT POSTS ===== */
.recent-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-post-item {
  margin-bottom: 12px;
}

.recent-post-item:last-child {
  margin-bottom: 0;
}

.recent-post-link {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  background: var(--light);
}

.recent-post-link:hover {
  background: #fff;
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.recent-post-image {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--border);
}

.recent-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-post-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #94a3b8;
}

.recent-post-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.recent-post-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin: 0 0 5px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-post-date {
  font-size: 11px;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== NEWSLETTER WIDGET ===== */
.newsletter-widget {
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color: #fff;
}

.newsletter-widget .widget-title {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.newsletter-widget .widget-title i {
  color: #fff;
}

.newsletter-text {
  font-size: 13px;
  margin: 0 0 12px 0;
  opacity: 0.95;
  line-height: 1.5;
}

.newsletter-form .form-control {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px 0 0 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.newsletter-form .form-control::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.newsletter-form .form-control:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: none;
  color: #fff;
}

.newsletter-form .btn-primary {
  background: #fff;
  border: none;
  color: var(--primary);
  padding: 10px 16px;
  border-radius: 0 8px 8px 0;
  font-weight: 600;
  transition: all 0.3s;
}

.newsletter-form .btn-primary:hover {
  background: var(--light);
  transform: scale(1.05);
}

/* ===== NO ARTICLES ===== */
.no-articles {
  text-align: center;
  padding: 80px 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.no-articles i {
  font-size: 80px;
  color: #cbd5e1;
  margin-bottom: 20px;
}

.no-articles h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 10px 0;
}

.no-articles p {
  font-size: 16px;
  color: var(--secondary);
  margin: 0;
}

/* ===== RESPONSIVE ===== */

/* ===== Tablet (768px - 991px) ===== */
@media (max-width: 991.98px) {
  .page-title {
    font-size: 32px;
  }

  .page-title i {
    font-size: 28px;
  }

  .page-description {
    font-size: 15px;
  }

  .news-main-container {
    padding: 35px 15px 50px;
  }

  .news-sidebar {
    position: static;
    margin-top: 30px;
  }

  .article-image {
    height: 200px;
  }

  .article-content {
    padding: 18px;
  }

  .article-title {
    font-size: 17px;
  }

  .sidebar-widget {
    padding: 18px;
  }
}

/* ===== Mobile Landscape / Small Tablet (576px - 767px) ===== */
@media (max-width: 767.98px) {
  .news-page-header {
    padding: 35px 0 25px;
  }

  .page-title {
    font-size: 26px;
    gap: 10px;
  }

  .page-title i {
    font-size: 24px;
  }

  .page-description {
    font-size: 14px;
  }

  .news-main-container {
    padding: 25px 12px 40px;
  }

  .articles-list {
    gap: 16px;
  }

  .article-item {
    border-radius: 10px;
  }

  .article-image {
    height: 180px;
  }

  .article-content {
    padding: 16px;
  }

  .article-meta {
    gap: 12px;
    margin-bottom: 8px;
  }

  .article-title {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .article-summary {
    font-size: 13px;
    margin-bottom: 10px;
    -webkit-line-clamp: 2;
  }

  .article-footer {
    padding-top: 10px;
  }

  .read-more-link {
    font-size: 12px;
  }

  .sidebar-widget {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 10px;
  }

  .widget-title {
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .category-link {
    padding: 9px 10px;
    font-size: 12px;
  }

  .recent-post-image {
    width: 55px;
    height: 55px;
  }

  .recent-post-title {
    font-size: 12px;
  }

  .newsletter-text {
    font-size: 12px;
  }

  .news-pagination {
    margin-top: 30px;
  }

  .pagination-link {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }
}

/* ===== Mobile Portrait (< 576px) ===== */
@media (max-width: 575.98px) {
  .news-page-header {
    padding: 30px 0 20px;
  }

  .page-title {
    font-size: 22px;
    gap: 8px;
  }

  .page-title i {
    font-size: 20px;
  }

  .page-description {
    font-size: 13px;
  }

  .news-main-container {
    padding: 20px 10px 35px;
  }

  .articles-list {
    gap: 14px;
  }

  /* Stack article layout on mobile */
  .article-item .row {
    flex-direction: column;
  }

  .article-item .col-md-4,
  .article-item .col-md-8 {
    width: 100%;
    max-width: 100%;
  }

  .article-image {
    height: 200px;
  }

  .article-content {
    padding: 14px;
  }

  .article-meta {
    gap: 10px;
    margin-bottom: 7px;
  }

  .meta-date,
  .meta-read {
    font-size: 11px;
  }

  .article-title {
    font-size: 15px;
    margin-bottom: 7px;
  }

  .article-summary {
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.5;
  }

  .article-footer {
    padding-top: 8px;
  }

  .article-badge {
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .sidebar-widget {
    padding: 14px;
    margin-bottom: 14px;
  }

  .widget-title {
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    gap: 6px;
  }

  .widget-title i {
    font-size: 16px;
  }

  .category-item {
    margin-bottom: 5px;
  }

  .category-link {
    padding: 8px 10px;
    font-size: 12px;
    gap: 8px;
  }

  .category-link i {
    font-size: 14px;
  }

  .category-count {
    padding: 2px 6px;
    font-size: 10px;
  }

  .recent-post-item {
    margin-bottom: 10px;
  }

  .recent-post-link {
    padding: 6px;
    gap: 8px;
  }

  .recent-post-image {
    width: 50px;
    height: 50px;
  }

  .recent-post-title {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .recent-post-date {
    font-size: 10px;
  }

  .newsletter-text {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .newsletter-form .form-control {
    padding: 9px 10px;
    font-size: 12px;
  }

  .newsletter-form .btn-primary {
    padding: 9px 12px;
  }

  .newsletter-form .btn-primary i {
    font-size: 14px;
  }

  .news-pagination {
    margin-top: 25px;
  }

  .pagination-link {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    font-size: 12px;
    gap: 4px;
  }

  /* Hide some pagination items on very small screens */
  .pagination-item:not(.active):not(:first-child):not(:last-child):not(
      :nth-last-child(2)
    ):not(:nth-child(2)) {
    display: none;
  }
}

/* ===== Extra Small Mobile (< 375px) ===== */
@media (max-width: 374.98px) {
  .page-title {
    font-size: 20px;
  }

  .page-title i {
    font-size: 18px;
  }

  .article-title {
    font-size: 14px;
  }

  .article-summary {
    font-size: 11px;
  }

  .pagination-link {
    min-width: 32px;
    height: 32px;
    font-size: 11px;
  }
}
