/* Articles Page Styles */

html {
  scroll-behavior: smooth;
}

.articles-page {
  background: white;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem 0;
  position: relative;
  overflow: hidden;
}

.articles-container {
  width: 100%;
  margin: 0 auto;
  padding: 4.75vw;
  flex: 1;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

/* Header Section - Title and Search side by side */
.header-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9rem;
  margin-bottom: 4rem;
  position: relative;
  padding-bottom: 20vh;
}

/* Rectangle-1 decorative element */
.rectangle-1{
  position: absolute;
  width: 484px;
  height: 250px;
  left: calc(-484px / 2); 
  top: calc(-250px / 10); 
  background: rgba(101, 29, 148, 0.2);
  border-radius: 50px;
  z-index: -1;
}

.rectangle-2 {
  position: absolute;
  width: 413px;
  height: 144px;
  background: rgba(15, 27, 75, 0.2);
  border-radius: 50px;
  left: calc(413px / 10);
  top: calc(144px);
  z-index: -1;
}

.title-section {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  text-align: right;
}

.articles-title {
  color: #0F1B4B;
  margin-bottom: 0.5rem;
  font-size: 36px;
  font-weight: 700;
}

.articles-subtitle {
  color: #0F1B4B;
  font-size: 24px;
  font-weight: 400;
  margin: 0;
}

/* Search Bar Container */
.search-container {
  flex: 0 0 auto;
  width: 100%;
  max-width: 20%;
  min-width: 320px;
  position: relative;
  top: 3rem;
  z-index: 2;
  align-self: flex-end;
}

.search-wrapper {
  background: #FFFFFF;
  border: 1px solid #888888;
  border-radius: 25px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-header {
  background: #651D94;
  padding: 10px 18px;
  border-radius: 25px 25px 0 0;
  text-align: left;
}

.search-header h2 {
  color: #FFFFFF;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.search-input-wrapper {
  padding: 2rem;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  background: white;
  position: relative;
}

.search-bar {
  width: 100%;
  padding: 10px 40px 10px 14px;
  border: 1px solid #888888;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 500;
  background: #FFFFFF;
  color: #4B4B4B;
  box-sizing: border-box;
}

.search-bar::placeholder {
  color: #4B4B4B;
  opacity: 0.7;
}

/* Search icon (magnifying glass) */
.search-input-wrapper::after {
  content: '\f002';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 3rem;
  top: 50%;
  transform: translateY(-50%);
  color: #888888;
  font-size: 18px;
  pointer-events: none;
}

/* Topic Filters */
.filter-section {
  background: #F9F9F9;
  border-radius: 30px;
  padding: 1.5rem;
  padding-bottom: 2rem;
  margin-top: 3.5rem;
  margin-bottom: 3.5rem;
}

/* Filter toggle button (hidden on desktop) */
.filter-toggle {
  display: none;
  width: 100%;
  padding: 0.75rem 0;
  background: transparent;
  color: #0F1B4B;
  border: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}


.filter-toggle:active {
  background: transparent;
  
}

.filter-toggle-text {
  text-align: center;
}

.filter-toggle-icon {
  transition: transform 0.3s ease, color 0.3s ease;
  font-size: 14px;
  color: #0F1B4B;
}

.filter-toggle[aria-expanded="true"] .filter-toggle-icon {
  transform: rotate(180deg);
}

.topic-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.topic-filters .filter-label {
  color: #0F1B4B;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 18px;
  width: 100%;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.topic-filter {
  padding: 8px 16px;
  border: 1px solid #0F1B4B;
  background: white;
  color: #0F1B4B;
  text-decoration: none;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 400;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-align: center;
}

.topic-filter:hover {
  background-color: rgba(101, 29, 148, 0.1);
  border-color: #651D94;
  color: #651D94;
}

.topic-filter.active {
  background-color: #651D94;
  color: white;
  border-color: #651D94;
  font-weight: 600;
}

.topic-filter.all {
  font-weight: 600;
}

/* Content wrapper - main layout container */
.content-wrapper {
  display: flex;
  gap: 2rem;
  width: 100%;
  position: relative;
  margin-top: 24rem;
  scroll-margin-top: 8rem;
}

/* Articles list section - 60% width */
.articles-list-section {
  flex: 0 0 60%;
  position: relative;
  padding: 1rem;
}

/* Decorative area - 40% width */
.decorative-area {
  flex: 0 0 calc(40% - 2rem);
  position: relative;
  min-height: 400px;
}

/* Decorative rectangles in the right area */
.rect-27 {
  position: absolute;
  width: 358px;
  height: 639px;
  right: 5rem;
  top: 4rem;
  background: rgba(101, 29, 148, 0.2);
  border-radius: 50px;
}

.rect-28 {
  position: absolute;
  width: 301px;
  height: 672px;
  left: 6rem;
  top: calc(4rem + 200px);
  background: rgba(15, 27, 75, 0.2);
  border-radius: 50px;
}

/* Articles List */
.articles-list {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem 0;
  position: relative;
}

.articles-list li {
  border-bottom: 1px solid rgba(15, 27, 75, 0.15);
}

.articles-list li:last-child {
  border-bottom: none;
}

.article-entry {
  padding: 1.5rem 0;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.article-entry h2 {
  text-align: left;
  margin: 0 0 1rem 0;
}

.article-entry h2 {
  text-align: left;
  margin: 0 0 0.5rem 0;
}

.article-entry h2 a {
  color: #0F1B4B;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.article-entry h2 a:hover {
  color: #651D94;
}

.article-info {
  display: flex;
  justify-content: flex-start;
  gap: 1.5rem;
  color: #666;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  margin: 0.3rem 0 0.8rem 0;
}

.article-description {
  text-align: left;
  color: #0F1B4B;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0.5rem 0 0 0;
}

/* Decorative lines at the bottom */
.decorative-lines {
  position: relative;
  width: 100%;
  height: 100px;
  padding-top: 2rem;
  background: #ffffff;
}

.line-7 {
  position: absolute;
  width: 48.54vw; 
  height: 6px;
  left: 0;
  top: 0;
  background: rgba(101, 29, 148, 0.6);
  border-radius: 3px;
  transform: rotate(-0.12deg);
  z-index: 10;
}

.line-8 {
  position: absolute;
  width: 48.54vw;
  height: 6px;
  left: 6.61vw;
  top: 40px;
  background: rgba(15, 27, 75, 0.6);
  border-radius: 3px;
  transform: rotate(-0.12deg);
  z-index: 10;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 2rem 0;
  color: #666;
}

.no-results h3 {
  color: #0F1B4B;
  margin-bottom: 0.8rem;
  font-size: 20px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

.no-results p {
  margin: 0.4rem 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
}

.no-results a {
  color: #651D94;
  text-decoration: underline;
  font-weight: 600;
}

.no-results a:hover {
  color: #0F1B4B;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  gap: 0.4rem;
}

.pagination a,
.pagination span {
  padding: 6px 12px;
  color: #0F1B4B;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid #0F1B4B;
  transition: all 0.2s ease;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  min-width: 36px;
  text-align: center;
  background: white;
}

.pagination a:hover {
  background-color: rgba(101, 29, 148, 0.1);
  border-color: #651D94;
  color: #651D94;
}


.pagination .current {
  background-color: #651D94;
  color: white;
  border-color: #651D94;
  font-weight: 600;
}

.pagination .disabled {
  color: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
}

.pagination .prev,
.pagination .next {
  font-size: 13px;
  padding: 6px 16px;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .content-wrapper {
    flex-direction: column;
    margin-top: 4rem;
  }
  
  .articles-list-section {
    flex: 1 1 100%;
    padding: 0;
  }
  
  .decorative-area {
    display: none; /* Hide decorative area on tablets */
  }
  
  .header-section {
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 5vh;
  }
  
  .search-container {
    max-width: 60%;
    min-width: 400px;
    top: 0;
    align-self: center;
  }
  
  .rectangle-1,
  .rectangle-2 {
    display: none;
  }
}

@media (max-width: 768px) {
  .articles-container {
    padding: 1.5rem;
  }
  
  .content-wrapper {
    margin-top: 2rem;
  }
  
  .header-section {
    margin-bottom: 2rem;
    gap: 1.5rem;
    padding-bottom: 2vh;
  }
  
  .articles-title {
    font-size: 24px;
  }
  
  .articles-subtitle {
    font-size: 14px;
  }
  
  .search-container {
    max-width: 70%;
    min-width: 350px;
    align-self: center;
  }
  
  .search-header h2 {
    font-size: 18px;
  }
  
  .search-bar {
    font-size: 14px;
    padding: 8px 36px 8px 12px;
  }
  
  .filter-section {
    padding: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
  
  .topic-filters {
    gap: 0.8rem;
  }
  
  .topic-filters .filter-label {
    font-size: 16px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  
  .topic-filter {
    font-size: 14px;
    padding: 7px 14px;
  }
  
  .article-entry {
    padding: 1.2rem 0;
  }
  
  .article-entry h2 a {
    font-size: 20px;
  }
  
  .article-info {
    font-size: 13px;
    gap: 1rem;
  }
  
  .article-description {
    font-size: 15px;
  }
  
  .decorative-lines {
    height: 80px;
  }
  
  .line-7,
  .line-8 {
    width: 70vw;
  }
  
  .line-8 {
    top: 35px;
    left: 10vw;
  }
  
  .pagination a,
  .pagination span {
    font-size: 13px;
    padding: 5px 10px;
    min-width: 32px;
  }
  
  .pagination .prev,
  .pagination .next {
    font-size: 12px;
    padding: 5px 12px;
  }
}

@media (max-width: 640px) {
  .articles-container {
    width: 100%;
    padding: 2rem;
  }
  
  .content-wrapper {
    margin-top: 1rem;
  }
  
  .articles-list-section {
    padding: 0;
  }
  
  .header-section {
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
  }

  .articles-title {
    font-size: 22px;
    text-align: center;
  }

  .articles-subtitle {
    font-size: 13px;
    text-align: center;
  }
  
  .title-section {
    text-align: center;
  }
  
  .search-container {
    max-width: 80%;
    min-width: 300px;
    align-self: center;
  }

  .search-header h2 {
    font-size: 16px;
    padding: 8px 16px;
  }
  
  .search-input-wrapper {
    padding: 1.5rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .search-bar {
    font-size: 14px;
  }
  
  .search-input-wrapper::after {
    right: 2rem;
    font-size: 16px;
  }

  .filter-section {
    padding: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  /* Show toggle button on mobile */
  .filter-toggle {
    display: flex;
  }

  /* Hide filters by default on mobile */
  .topic-filters {
    display: none;
    gap: 0.6rem;
  }
  
  /* Show filters when expanded */
  .topic-filters.expanded {
    display: flex;
    animation: slideDown 0.3s ease-out;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .topic-filters .filter-label {
    font-size: 15px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .topic-filter {
    font-size: 13px;
    padding: 6px 12px;
  }

  .article-entry {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(15, 27, 75, 0.2);
  }
  
  .article-entry:last-child {
    border-bottom: none;
  }
  
  .article-entry h2 {
    text-align: center;
  }

  .article-entry h2 a {
    font-size: 18px;
  }

  .article-info {
    flex-direction: column;
    gap: 0.4rem;
    font-size: 12px;
    justify-content: center;
  }

  .article-description {
    font-size: 14px;
    text-align: center;
  }
  
  .decorative-lines {
    height: 60px;
  }
  
  /* Hide decorative lines on very small screens */
  .line-7,
  .line-8 {
    width: 85vw;
    height: 4px;
  }
  
  .line-8 {
    top: 30px;
    left: 5vw;
  }
  
  .pagination {
    gap: 0.3rem;
    flex-wrap: wrap;
  }
  
  .pagination a,
  .pagination span {
    font-size: 12px;
    padding: 5px 8px;
    min-width: 28px;
  }
  
  .pagination .prev,
  .pagination .next {
    font-size: 11px;
    padding: 5px 10px;
  }
  
  /* Hide or minimize decorative rectangles */
  .rectangle-1,
  .rectangle-2,
  .rect-27,
  .rect-28 {
    display: none;
  }
}

/* Extra small devices - Full width search */
@media (max-width: 420px) {
  .search-container {
    max-width: 100%;
    min-width: 100%;
  }
  
  /* Hide search-header but keep search-input-wrapper visible */
  .search-header {
    display: none;
  }
  
  .search-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .title-section {
    
  }

  .articles-page {
    padding: 0;
  }
  
  .articles-container {
    padding: 2rem;
  }
  
  .filter-section {
    padding: 0.75rem;
  }
  
  .search-input-wrapper {
    padding: 1.25rem;
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
  }
  
  .search-input-wrapper::after {
    right: 1.5rem;
  }
}
