/* articles-page.css */

.articles-controls {
 display: flex;
 flex-wrap: wrap;
 gap: 1rem;
 justify-content: space-between;
 align-items: center;
 padding-bottom: 1rem;
 padding-top: 4rem;
 border-bottom: 0.1px solid var(--text-color);
 margin: 0 4rem;
}

.search-container {
 flex: 1 1 300px;
 max-width: 400px;
 display: flex;
 align-items: center;
 gap: 0.5rem;
}

.search-btn {
  font-size: 1.5rem;
  color: var(--accent-hl-alt);
}

.search-container input{
 width: 100%;
 padding: 0.5rem 1rem;
 font-size: 1rem;
 border: 1px solid var(--input-border);
 border-radius: 25px;
 background-color: var(--input-field);
 transition: border 0.3s ease;
}

::placeholder {
 color: var(--placeholder-text);
}

.search-container input:focus {
 color: var(--text-color);
 border-color: var(--text-color);
 outline: none;
}

.filters {
 display: flex;
 flex-wrap: wrap;
 gap: 0.5rem;
}

.filter-btn {
 padding: 0.5rem 1rem;
 font-size: 0.9rem;
 background-color: var(--bg-color);
 color: var(--accent-hl-alt);
 border: 0.5px solid var(--accent-hl-alt);
 border-radius: 20px;
 cursor: pointer;
 transition: background-color 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
 background-color: var(--accent-hl-alt);
 color: var(--bg-color);
 border: none;
}

@media screen and (max-width: 1110px) {
  .filters {
      display: none;
  }
}

@media screen and (max-width: 1024px) {
 .articles-controls {
  flex-direction: column;
  align-items: flex-end;
  margin-left: 2rem;
  margin-right: 2rem;
  margin-bottom: 0;
  gap: 1.5rem;
 }

 .filters {
  display: none;
  justify-content: flex-start;
  width: 100%;
 }

 .search-container {
  width: 100%;
  flex: 1 1 20px;
 }
}

@media screen and (max-width: 768px) {
  .search-container {
      max-width: none;
    }

 .articles-controls {
  padding-top: 4rem;
  padding-bottom: 1rem;
 }

 .filters {
  gap: 0.4rem;
 }

 .filter-btn {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
 }

 .search-container input {
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
 }
}

@media screen and (max-width: 480px) {
 .articles-controls {
  gap: 1rem;
 }

 .filter-btn {
  flex: 1 1 auto;
  min-width: 100px;
 }

 .filters {
  justify-content: space-between;
 }

 .expand-arrow {
  width: 0.9rem;
  height: 0.9rem;
  font-size: 0.6rem;
 }
}

.search-overlay {
 overflow-y: auto;
 overflow-x: hidden;
 z-index: 110;
 position: fixed;
 top: 8rem;
 left: 0;
 right: 0;
 bottom: 0;
 background-color: var(--navbar-bg);
 backdrop-filter: blur(4px);
 -webkit-backdrop-filter: blur(4px);
  visibility: hidden;
   opacity: 0;
   transform: scale(1.09);
 transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
 box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.search-overlay-active {
 visibility: visible;
  opacity: 1;
  transform: scale(1);
}

html.no-scroll,
body.no-scroll {
  overflow: hidden;
  overscroll-behavior: contain;
}

.search-top {
  display: flex;
  justify-content: end;
  margin-left: 4rem;
  margin-right: 4rem;
}


.search-results {
 height: 400px;
 width: auto;
 margin-left: 4rem;
 margin-right: 4rem;
 margin-top: 1rem
}

.search-results-title {
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 110%;
  letter-spacing: -2%;
  padding-bottom: 1rem;
  border-bottom: solid 0.1px var(--accent-meta);
}

.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-results-item {
  padding-top: 2rem;
}

.search-results-item a {
  text-decoration: none;
  color: inherit;
}

.search-results-item a:hover {
  text-decoration: underline;
  color: var(--accent-hl-alt);
}

.no-results {
  padding-top: 1rem;
}

.spinner-loader {
 margin-top: 45px;
 border-radius: 50%;
 width: 24px;
 height: 24px;
 border: 0.25rem solid var(--loader);
 border-top-color: var(--text-color);
 -webkit-animation: spin 1s infinite linear;
 animation: spin 1s infinite linear;
}

@keyframes spin {
 to {
  transform: rotate(360deg);
 }
}

@-webkit-keyframes spin {
 to {
  -webkit-transform: rotate(360deg);
 }
}

.main-flex {
 display: flex;
 gap: 20px;
 padding: 0 4rem;
 padding-top: 2rem;
 padding-bottom: 50px;
 max-width: 1900px;
 margin-left: auto;
 margin-right: auto;
}

.featured {
 flex: 1;
}

.side-snippets {
 flex: 0 0 calc((100% - 60px) / 4);
 display: flex;
 flex-direction: column;
 gap: 50px;
}

.featured-wrapper {
 position: relative;
 width: 100%;
 height: 648px;
 overflow: hidden;
}

.featured-wrapper img {
 width: 100%;
 height: 100%;
 object-fit: cover;
 display: block;
}

.featured-wrapper h1 {
 position: absolute;
 bottom: 10px;
 left: 10px;
 right: 10px;
 margin: 0;
 font-size: 3.5rem;
 color: rgb(250, 252, 248);
 text-shadow: 0 2px 5px rgba(15, 15, 15, 0.9);
 padding: 10px 15px;
 border-radius: 5px;
}

.featured-wrapper .featured-title {
 display: inline-block;
 max-width: 100%;
 width: auto;
 line-height: 1.2;
 display: -webkit-box;
 -webkit-line-clamp: 3;
 -webkit-box-orient: vertical;
 overflow: hidden;
 text-overflow: ellipsis;
 background-color: rgba(15, 15, 15, 0.1);
 -webkit-backdrop-filter: blur(2px);
 backdrop-filter: blur(2px);

}

.highlight {
 color: var(--accent-highlight);
}

.snippet {
 border-top: 0.1px solid var(--text-color);
 padding-top: 10px;
}

.snippet .meta-data-box {
 display: flex;
 justify-content: space-between;
 font-size: 0.688rem;
 text-transform: uppercase;
}

.snippet h2 {
 font-size: 0.8rem;
 font-weight: 500;
 margin: 10px 0;
}

.image-thumbnail {
 width: 100%;
 height: 212px;
 overflow: hidden;
 position: relative;
}


.image-thumbnail img {
 width: 100%;
 height: 100%;
 object-fit: cover;
 display: block;
}

.bottom-row {
 display: flex;
 justify-content: flex-start;
 gap: 20px;
 margin-bottom: 50px;
 padding: 0 4rem;
 flex-wrap: nowrap;
}

.bottom-row .block {
 flex: 0 0 calc((100% - 60px) / 4);
 max-width: calc((100% - 60px) / 4);
}

.block {
 flex: 1;
 border-top: 0.1px solid var(--text-color);
 padding-top: 10px;
}

.block .meta-data-box {
 display: flex;
 justify-content: space-between;
 font-size: 0.688rem;
 text-transform: uppercase;
}

.meta-data-box {
 height: 0.7rem;
}

.post-dates {
 line-height: 0.7rem;
}

.post-cats {
 display: -webkit-box;
 -webkit-line-clamp: 1;
 -webkit-box-orient: vertical;
 overflow: hidden;
 text-overflow: ellipsis;
 line-height: 0.7rem;
 min-height: calc(0.7rem * 1);
 width: 65%;
 height: 0.7rem;
}

.block h3 {
 font-size: 0.8rem;
 font-weight: 500;
 margin: 10px 0;
}

.article-title {
 display: -webkit-box;
 -webkit-line-clamp: 2;
 -webkit-box-orient: vertical;
 overflow: hidden;
 text-overflow: ellipsis;
 line-height: 1.4rem;
 min-height: calc(1.4rem * 2);
}

.thumbnail-link,
.post-cats a {
 text-decoration: none;
}

.post-cats a,
.post-dates {
 color: var(--accent-meta);
}

.thumbnail-link:hover,
.post-cats a:hover {
 text-decoration: underline;
}

#infinite-scroll-trigger {
 height: 1px;
 width: 100%;
}

@media screen and (max-width: 1300px) {
  .image-thumbnail {
    height: 170px;
  }

  .featured-wrapper {
    height: 563px;
  }
}

@media screen and (max-width: 1024px) {
  .search-top {
    margin-left: 2rem;
    margin-right: 2rem;
  }

  .search-results {
    margin-left: 2rem;
    margin-right: 2rem;
    }

 .main-flex {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-left: 2rem;
  padding-right: 2rem;
  padding-top: 4rem;
  padding-bottom: 20px;
 }

 .featured-wrapper {
  max-height: 500px;
 }

 .featured-wrapper .featured-title {
  max-width: 100vw;
 }

 .featured {
  grid-column: 1 / -1;
 }

 .side-snippets {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
 }

 .snippet {
  border-top: 0.1px solid var(--text-color);
  padding-top: 1rem;
 }

 .bottom-row {
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  padding: 0 2rem;
 }

 .bottom-row .block {
  flex: 0 0 calc((100% - 20px) / 2);
  max-width: calc((100% - 20px) / 2);
 }

 .image-thumbnail {
  width: 100%;
  max-height: 320px;
  min-height: 250px;
 }
}

@media (max-width: 820px) {

  .search-container input,
  input[type="search"],
  input[type="text"],
  textarea,
  select {
    font-size: 16px !important;
    line-height: 1.3;
    min-height: 44px;
  }

  .search-btn {
  font-size: 2rem;
}

  .search-container input {
    font-size: clamp(16px, 1rem, 18px) !important;
  }
}

.featured-hero {
  display: block;
}

.featured-card {
  display: none;
}

@media screen and (max-width: 640px) {
 .main-flex {
  display: block;
  padding-top: 2rem;
 }

 .featured,
 .side-snippets,
 .bottom-row,
 .bottom-row .block {
  width: 100%;
  max-width: 100%;
 }

 .featured,
 .snippet,
 .block {
  margin-bottom: 2rem;
 }

 .side-snippets {
  display: flex;
  flex-direction: column;
 }

 .snippet {
  border-bottom: 0.1px solid var(--text-color);
  border-top: none;
 }

 .bottom-row {
  flex-direction: column;
 }

 .bottom-row,
 .side-snippets {
  margin-bottom: 0;
  gap: 0;
 }

 .bottom-row .block {
  flex: 1 1 100%;
  border-bottom: 0.1px solid var(--text-color);
  border-top: none;
 }

 .featured-wrapper {
  height: 200px;
 }

 .featured-wrapper .featured-title {
  font-size: 1.4rem;
  line-height: 1.3;
 }

 .image-thumbnail {
  max-height: 300px;
  min-height: auto;
 }

 .block,
 .snippet {
  display: flex;
  flex-direction: column;
 }

 .block .image-thumbnail,
 .snippet .image-thumbnail {
  order: 1;
 }

 .block .meta-data-box,
 .snippet .meta-data-box {
  order: 2;
  margin-top: 0.5rem;
 }

 .block h3,
 .snippet h2 {
  order: 3;
  margin-top: 0.5rem;
 }

  .featured-hero {
    display: none;
  }

  .featured-card {
    display: flex;
    flex-direction: column;
    border-bottom: 0.1px solid var(--text-color);
    border-top: none;
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
  }

  .featured-card .image-thumbnail {
    order: 1;
  }

  .featured-card .meta-data-box {
    order: 2;
    margin-top: 0.5rem;
  }

  .featured-card .article-title {
    order: 3;
    margin-top: 0.5rem;
  }

  .featured-card .article-title {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4rem;
    min-height: calc(1.4rem * 2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .snippet .article-title,
  .block .article-title {
    font-size: 1rem;
  }

  .featured-card .meta-data-box {
    display: flex;
    justify-content: space-between;
    font-size: 0.688rem;
    text-transform: uppercase;
  }

  .featured-card .post-cats,
  .featured-card .post-dates {
    line-height: 0.7rem;
  }

  .featured-card .post-cats {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(0.7rem * 1);
    width: 65%;
    height: 0.7rem;
  }

  .featured-wrapper {
    height: 320px;
  }

  .image-thumbnail {
    height: 320px;
  }
}

@media screen and (max-width: 450px) {
  .image-thumbnail {
    height: 220px;
  }

  .featured-wrapper {
    height: 220px;
  }
}

@media screen and (max-width: 400px) {
  .image-thumbnail {
    height: 200px;
  }

  .featured-wrapper {
    height: 200px;
  }
}

@media screen and (max-width: 300px) {
  .image-thumbnail {
    height: 170px;
  }

    .featured-wrapper {
    height: 200px;
  }
}
