/* Main Content Layout */
main {
  padding: 40px 0;
}

.main-content {
  display: grid;
  grid-template-columns: 2fr 8fr;
  gap: 20px;
}

/* Sidebar Styles */
.sidebar {
  height: fit-content;
  position: sticky;
  top: 70px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.sidebar-item-wrapper {
  position: relative;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s;
  position: relative;
  font-size: 15px;
  cursor: pointer;
}

.sidebar-item i:first-child {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-item span {
  flex: 1;
}

.sidebar-item.has-submenu .submenu-icon {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  transition: transform 0.3s;
}

.sidebar-item-wrapper.open .submenu-icon {
  transform: rotate(180deg);
}

.sidebar-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.sidebar-item.active {
  background-color: #1573e549;
  color: #ffffff;
  border-left: 3px solid #1572e5;
}

/* Submenu Styles */
.submenu {
  max-height: 0;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.3);
  transition: max-height 0.3s ease-out;
}

.sidebar-item-wrapper.open .submenu {
  max-height: 500px;
  transition: max-height 0.4s ease-in;
}

.submenu-item {
  display: block;
  padding: 12px 20px 12px 56px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s;
  border-left: 2px solid transparent;
}

.submenu-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border-left-color: #3b82f6;
  padding-left: 60px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s;
}

.sidebar-footer:hover {
  color: #3b82f6;
  background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-footer i {
  font-size: 14px;
}

/* Section Title */
.section-title {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 3px solid #3b82f6;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Featured Section */
.featured-section {
  margin-bottom: 50px;
}

.featured-content {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 25px;
}

/* Featured Main Article */
.featured-main {
  border: 1px solid #1a1a1a;
  border-radius: 5px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.featured-main:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.featured-main-image {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
}

.featured-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.featured-main:hover .featured-main-image img {
  transform: scale(1.05);
}

.category-badge {
  display: block;
  margin-bottom: 10px;
}

.category-badge a {
  text-decoration: none;
  color: #ffffffb3;
  text-transform: capitalize;
  font-size: 15px;
}

.category-badge a:hover {
  transition: all 0.3s ease;
  color: #fff;
}

.featured-main-content {
  padding: 20px;
}

.featured-main-title {
  text-decoration: none;
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 12px;
  line-height: 1.4;
}

.featured-main-title:hover {
  color: #3b82f6;
}

.featured-main-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.article-meta .author,
.article-meta .date {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-meta i {
  font-size: 12px;
}

/* Featured List */
.featured-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.featured-item {
  display: flex;
  gap: 15px;
  border: 1px solid #1a1a1a;
  border-radius: 5px;
  overflow: hidden;
  padding: 12px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.featured-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.featured-item-image {
  width: 140px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
}

.featured-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.featured-item:hover .featured-item-image img {
  transform: scale(1.1);
}

.featured-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.featured-item-title {
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-item-title:hover {
  color: #3b82f6;
}

.latest-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-bottom: 40px;
}

/* Post Card */
.post-card {
  border: 1px solid #1a1a1a;
  border-radius: 5px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.post-card-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
  position: relative;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card:hover .post-card-image img {
  transform: scale(1.05);
}

.post-card-content {
  padding: 20px;
}

.post-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.5;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 48px;
}

.post-card-title a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s;
}

.post-card-title a:hover {
  color: #3b82f6;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #2a2a2a;
  color: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0 12px;
}

.pagination-btn:hover:not(.dots):not(.active) {
  background-color: #3a3a3a;
  color: #ffffff;
}

.pagination-btn.active {
  background-color: #3b82f6;
  color: #ffffff;
}

.pagination-btn.dots {
  cursor: default;
  pointer-events: none;
}

.pagination-btn.dots:hover {
  background-color: #2a2a2a;
}

.pagination-btn.prev,
.pagination-btn.next {
  font-size: 12px;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Newsletter Section */
.newsletter-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 60px 40px;
  margin-bottom: 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.newsletter-section::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.1) 0%,
    transparent 70%
  );
  animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-10px, -10px) scale(1.05);
  }
}

.newsletter-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.newsletter-title {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 15px;
  line-height: 1.3;
}

.newsletter-title .highlight {
  color: #3b82f6;
}

.newsletter-description {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 30px;
}

.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 15px;
  max-width: 600px;
  margin: 0 auto;
}

.newsletter-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background-color: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 0 20px;
  transition: border-color 0.3s;
}

.newsletter-input-wrapper:focus-within {
  border-color: #3b82f6;
}

.newsletter-input-wrapper i {
  color: rgba(255, 255, 255, 0.4);
  font-size: 16px;
  margin-right: 12px;
}

.newsletter-input-wrapper input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 15px;
  padding: 16px 0;
}

.newsletter-input-wrapper input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.newsletter-btn {
  padding: 16px 40px;
  background-color: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.newsletter-btn:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Community Section */
.community-section {
  margin-bottom: 60px;
  text-align: center;
}

.community-title {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 35px;
}

.community-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  max-width: 900px;
  margin: 0 auto;
}

.community-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 50px 30px;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  text-decoration: none;
  color: #ffffff;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.community-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1) 0%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.community-card:hover::before {
  opacity: 1;
}

.community-card:hover {
  transform: translateY(-8px);
  border-color: #3b82f6;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.community-card i {
  font-size: 20px;
  color: #ffffff;
  transition: all 0.3s;
  position: relative;
  z-index: 1;
}

.community-card:hover i {
  color: #3b82f6;
  transform: scale(1.1);
}

.community-card span {
  font-size: 18px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* Responsive Design */

/* Tablet Large - 1200px */
@media (max-width: 1200px) {
  .featured-content {
    grid-template-columns: 1fr;
  }

  .featured-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .latest-posts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* Tablet - 1024px */
@media (max-width: 1024px) {
  .sidebar {
    position: static;
  }

  .sidebar-nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .sidebar-item-wrapper .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .sidebar-item-wrapper.open .submenu {
    max-height: none;
    z-index: 1;
  }

  .sidebar-item.has-submenu .submenu-icon {
    display: inline-block;
  }

  .sidebar-footer {
    margin-top: 0;
  }
}

/* Mobile - 768px */
@media (max-width: 768px) {
  main {
    padding: 20px 0;
  }

  /* Sidebar horizontal scroll */
  .main-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sidebar {
    position: static;
    background: none;
    padding: 0;
    border-radius: 0;
    order: -1;
    width: 100%;
    overflow: hidden;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 10px 0;
    width: 100%;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar-item-wrapper,
  .sidebar-item {
    flex-shrink: 0;
  }

  .sidebar-item {
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 5px;
    min-width: 80px;
    justify-content: center;
    text-align: center;
    border-left: none;
  }

  .sidebar-item i:first-child {
    width: auto;
    font-size: 24px;
  }

  .sidebar-item span {
    font-size: 12px;
    white-space: nowrap;
  }

  .sidebar-item.active {
    background-color: #1573e549;
    border-left: none;
    border-bottom: 3px solid #1572e5;
  }

  .sidebar-item.has-submenu .submenu-icon {
    display: none;
  }

  .sidebar-item-wrapper .submenu {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .featured-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .featured-main-title {
    font-size: 18px;
  }

  .featured-main-content {
    padding: 15px;
  }

  /* Featured list horizontal scroll */
  .featured-list {
    display: flex;
    flex-direction: row;
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 10px;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .featured-list::-webkit-scrollbar {
    display: none;
  }

  .featured-item {
    flex-shrink: 0;
    width: 300px;
    flex-direction: column;
    padding: 10px;
  }

  .featured-item-image {
    width: 100%;
    height: 180px;
  }

  .featured-item-title {
    font-size: 14px;
  }

  .post-card-image {
    height: 200px;
  }

  .post-card-content {
    padding: 15px;
  }

  .post-card-title {
    font-size: 15px;
    min-height: 45px;
  }

  /* Pagination */
  .pagination {
    gap: 6px;
  }

  .pagination-btn {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .section-title {
    font-size: 20px;
  }
}

/* Mobile Small - 390px */
@media (max-width: 430px) {
  .main-content {
    display: block;
  }

  /* Featured list */
  .featured-list {
    gap: 12px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .featured-item {
    width: 280px;
  }

  .featured-main-image {
    height: 180px;
  }

  .featured-item-image {
    width: 100%;
    height: 160px;
  }

  .latest-posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Latest posts */
  .post-card-image {
    height: 180px;
  }

  /* Pagination */
  .pagination {
    gap: 5px;
    flex-wrap: wrap;
  }

  .pagination-btn {
    min-width: 34px;
    height: 34px;
    font-size: 12px;
  }
}
