/* flockfinder/static/css/blog.css */

/* ----- Blog Index Page ----- */

.blog-wrapper {
  display: flex;
  gap: 40px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.blog-wrapper__left {
  border-left: 1px solid #f0f0f0;
  padding: 0 28px;
  width: 260px;
}

.blog-wrapper__right {
  width: 100%;
}

.blog__filter {
  padding: 32px 0;
  position: sticky;
  top: 20px;
}

.blog__filter ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.heading--blog-filter {
  font-family: var(--title-font);
  font-size: 0.95rem;
  color: rgba(13, 14, 20, 0.5);
  font-weight: 600;
  transition: color 0.2s ease;
}

.heading--blog-filter--selected {
  position: relative;
  color: var(--dark-base);
  transform: translateX(16px);
  transition: all ease 0.3s;
}

.heading--blog-filter--selected::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  height: 6px;
  width: 6px;
  border-radius: 100%;
  background-color: var(--accent-base);
  transform: translateY(-50%);
}

.blog-filter-button {
  all: unset;
  cursor: pointer;
}

.blog-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.blog-list__item {
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform 0.2s ease;
}

.blog-list__item:hover {
  transform: translateY(-5px);
}

.blog-list__item-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blog-date,
.blog-category {
  font-size: 0.85rem;
  color: rgba(13, 14, 20, 0.6);
  letter-spacing: 0.02em;
}

.blog-list__item-img {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.blog-list__item-img:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.blog-list__item-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-list__item:hover .blog-list__item-img img {
  transform: scale(1.05);
}

.heading--blog-preview {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark-base);
  line-height: 1.4;
}

/* ----- Blog Post Page ----- */

.blog-post-wrapper {
  display: flex;
  justify-content: center;
  padding: 0 0 60px;
}

.blog-post__content {
  padding: 0 60px 60px;
  max-width: 920px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.03);
  border-radius: 16px;
  background: #fff;
  position: relative;
}

.blog-post__back-link {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
}

.return-link {
  color: #666;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.return-link:hover {
  color: var(--accent-base);
}

.blog-post__author {
  color: rgba(13, 14, 20, 0.6);
  font-size: 0.9rem;
  margin-bottom: 0px;
}

.blog-post__content h1 {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
  color: var(--dark-base);
}

.blog-post__content iframe {
  aspect-ratio: 16/9;
  width: 100%;
  border-radius: 8px;
  margin: 30px 0;
}

.blog-post__content a {
  text-decoration: none;
  color: #008070;
  border-bottom: 1px solid rgba(0, 128, 112, 0.3);
  transition: border-color 0.2s;
}

.blog-post__content a:hover {
  border-color: rgba(0, 128, 112, 0.8);
}

.blog-post__content p {
  margin: 24px 0;
  line-height: 1.7;
  color: #333;
}

.blog-post__meta {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.blog-post__header {
  position: relative;
}

.blog-post__header h1 {
  margin-top: 10px;
  font-size: 2.6rem;
  line-height: 1.2;
  margin-bottom: 16px;
}

.blog-post__hero-img {
  position: relative;
  height: 400px;
  margin-bottom: 40px;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

.blog-post__hero-img img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
}

.blog-post__hero-img::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

.blog-post__introduction {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #444;
  margin-bottom: 30px;
  text-align: justify;
}

.blog-post__body {
  font-size: 1.05rem;
  padding-top: 20px;
}

.blog-post-wrapper ul {
  padding-left: 20px;
  margin: 24px 0;
}

.blog-post-wrapper ul li {
  padding: 8px 0;
  line-height: 1.6;
}

.blog-post-wrapper li {
  list-style-type: disc;
  margin-left: 10px;
}

/* Headers within blog posts */
.blog-post-wrapper h1 {
  font-size: 2.4rem;
  margin-top: 40px;
}
.blog-post-wrapper h2 {
  font-size: 1.8rem;
  margin-top: 36px;
  margin-bottom: 20px;
  font-weight: 700;
}
.blog-post-wrapper h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 16px;
}
.blog-post-wrapper h4 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 14px;
}
.blog-post-wrapper h5,
.blog-post-wrapper h6 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
}

/* Remove figcaption generated by image embeds */
.blog-post-wrapper figure {
  margin: 30px 0;
}

.blog-post-wrapper figure img {
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.blog-post-wrapper figure figcaption {
  display: none !important;
}

/* Tags styling */
.tags {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #f0f0f0;
}

.tags p {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
}

.tag-item {
  padding: 0 !important;
  margin: 0 !important;
}

.tag-link {
  display: inline-block;
  padding: 6px 12px;
  background-color: #f5f5f5;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #555;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tag-link:hover {
  background-color: #eaeaea;
  color: #333;
}

/* Related articles */
.related-articles {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid #f0f0f0;
}

.related-articles h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.related-articles-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-article-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: #f9f9f9;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: all 0.2s ease;
}

.related-article-item a:hover {
  background-color: #f0f0f0;
}

.related-article-arrow {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.related-article-item a:hover .related-article-arrow {
  transform: translateX(4px);
}

.mt-40 {
  margin-top: 40px;
}

/* ----- Home Page Blog Section ----- */

.home-page-blog {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.home-page-blog__wrapper {
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(3, 1fr);
}

/* ----- Media Queries ----- */

@media screen and (max-width: 1190px) {
  .blog-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }

  .blog-post__content {
    padding: 30px 40px 50px;
  }
}

@media screen and (max-width: 900px) {
  .blog-post__content h1,
  .blog-post__header h1 {
    font-size: 2rem;
  }

  .blog-post__hero-img {
    height: 350px;
  }

  .blog-post__introduction {
    max-width: 100%;
    font-size: 1.1rem;
  }
}

@media screen and (max-width: 768px) {
  .blog-wrapper {
    flex-direction: column;
  }

  .blog-wrapper__left {
    width: 100%;
    border-left: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 0 0 20px;
  }

  .blog__filter {
    position: static;
    padding: 20px 0;
  }

  .blog__filter ul {
    flex-direction: column;
  }

  .blog-post__content {
    padding: 0 30px 40px;
  }

  .return-link {
    font-size: 0.8rem;
    top: 0px;
  }

  .blog-post__hero-img {
    height: 280px;
  }
}

@media screen and (max-width: 680px) {
  .blog-list {
    grid-template-columns: repeat(1, 1fr);
  }
}

@media screen and (max-width: 650px) {
  .home-page-blog__wrapper {
    grid-template-columns: repeat(1, 1fr);
    gap: 30px;
  }

  .blog-post__content h1 {
    font-size: 1.8rem;
  }

  .blog-post-wrapper h2 {
    font-size: 1.5rem;
  }
}

@media screen and (max-width: 465px) {
  .blog-wrapper {
    gap: 24px;
  }

  .blog-post__content {
    padding: 0 24px 30px;
  }

  .blog-post__hero-img {
    height: 220px;
  }

  .blog-post__header h1 {
    font-size: 1.8rem;
    line-height: 1.3;
  }

  .blog-post__introduction {
    font-size: 1rem;
  }
}

.blog-post__categories {
  display: flex;
  gap: 8px;
}

.blog-category-tag {
  display: inline-block;
  padding: 4px 10px;
  background-color: rgba(0, 128, 112, 0.08);
  color: #008070;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.return-link svg {
  margin-right: 6px;
}

.return-link span {
  position: relative;
  top: -1px;
}

.blog-post__title {
  margin-top: 0px !important;
}
