/**
 * Post Components Styles
 *
 * @package AFEL
 */

/*--------------------------------------------------------------
# Post Meta
--------------------------------------------------------------*/
.afel-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.875rem;
  color: var(--afel-secondary-text-color);
}

.afel-single-post-category {
  font-weight: 600;
  display: flex;
  gap: 6px;
}

.afel-post-meta__item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.afel-post-meta svg {
  width: 16px;
  height: 16px;
  stroke-width: 2px;
  flex-shrink: 0;
}

.afel-post-meta__text a {
  color: var(--afel-secondary-text-color);
  text-decoration: none;
  transition: color var(--afel-transition-normal) ease;
}

.afel-post-meta__text a:hover {
  color: var(--afel-link-hover-color);
  text-decoration: underline;
}

/*--------------------------------------------------------------
# Author Box
--------------------------------------------------------------*/
.afel-author-box {
  /* margin: auto;
  max-width: 600px; */
  margin-top: 32px;
  margin-bottom: 32px;
  display: flex;
  gap: 16px;
  position: relative;
}

.afel-author-box--boxed {
  padding: 40px;
  border-radius: 6px;
  border: 1px solid var(--afel-border-color);
}

.afel-author-box--minimal {
  padding: 24px 0;
  border-top: 1px solid var(--afel-border-color);
  border-bottom: 1px solid var(--afel-border-color);
}

.afel-author-box__avatar {
  flex-shrink: 0;
}

.afel-author-box__avatar img {
  border-radius: 50%;
  width: 96px;
  height: 96px;
  object-fit: cover;
}

.afel-author-box__content {
  flex: 1;
}

.afel-author-box__name {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 20px;
}

.afel-author-box__name a {
  color: var(--afel-primary-text-color);
  text-decoration: none;
  transition: color var(--afel-transition-normal) ease;
}

.afel-author-box__name a:hover {
  color: var(--afel-link-hover-color);
}

.afel-author-box__bio {
  margin-bottom: 10px;
  line-height: 1.3;
}

.afel-author-box__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 0.875rem;
}

.afel-author-box__posts-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--afel-link-color);
  text-decoration: none;
  transition: color var(--afel-transition-normal) ease;
}

.afel-author-box__posts-link:hover {
  color: var(--afel-link-hover-color);
}

.afel-author-box__social {
  display: flex;
  gap: 10px;
}

.afel-author-box__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--afel-light-bg);
  color: var(--afel-secondary-text-color);
  transition: all var(--afel-transition-normal) ease;
}

.afel-author-box__social-link:hover {
  background-color: var(--afel-brand-color);
  color: #fff;
}

@media (max-width: 576px) {
  .afel-author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }

  .afel-author-box__meta {
    justify-content: center;
  }
}

/*--------------------------------------------------------------
# Post Navigation
--------------------------------------------------------------*/
.afel-post-navigation {
  display: flex;
  margin: 32px 0;
  gap: 16px;
}

.afel-post-navigation--both {
  justify-content: space-between;
}

.afel-post-navigation--prev-only {
  justify-content: flex-start;
}

.afel-post-navigation--next-only {
  justify-content: flex-end;
}

.afel-post-navigation__prev,
.afel-post-navigation__next {
  flex: 0 0 auto;
  max-width: 48%;
}

.afel-post-navigation__next {
  text-align: right;
}

.afel-post-navigation a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--afel-primary-text-color);
  transition: color var(--afel-transition-normal) ease;
}

.afel-post-navigation a:hover {
  color: var(--afel-link-hover-color);
}

.afel-post-navigation__arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--afel-light-bg);
  transition: background-color var(--afel-transition-normal) ease;
}

.afel-post-navigation a:hover .afel-post-navigation__arrow {
  background-color: var(--afel-brand-color);
  color: #fff;
}

.afel-post-navigation__content {
  flex: 1;
  overflow: hidden;
}

.afel-post-navigation__label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  color: var(--afel-secondary-text-color);
}

.afel-post-navigation__title {
  display: block;
  font-weight: 500;
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.afel-post-navigation__thumbnail {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.afel-post-navigation__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.afel-post-navigation--modern .afel-post-navigation__prev a {
  flex-direction: row;
}

.afel-post-navigation--modern .afel-post-navigation__next a {
  flex-direction: row;
}

.afel-post-navigation--simple .afel-post-navigation__thumbnail {
  display: none;
}

@media (max-width: 992px) {
  .afel-post-navigation {
    flex-direction: column;
    gap: 16px;
  }

  .afel-post-navigation__prev,
  .afel-post-navigation__next {
    max-width: 100%;
  }

  .afel-post-navigation__next {
    text-align: left;
  }

  .afel-post-navigation--modern .afel-post-navigation__next a {
    flex-direction: row;
  }
}

/*--------------------------------------------------------------
# Related Posts
--------------------------------------------------------------*/
.afel-related-posts {
  margin: 32px 0;
}

.afel-related-posts__title {
  margin-bottom: 24px;
  font-size: var(--afel-h4-size);
  position: relative;
  padding-bottom: 10px;
}

.afel-related-posts__title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background-color: var(--afel-brand-color);
}

.afel-related-posts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.afel-related-posts__item {
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
}

.afel-related-posts__thumbnail {
  display: block;
  position: relative;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
}

.afel-related-posts__thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--afel-transition-normal) ease;
}

.afel-related-posts__content {
  padding-top: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.afel-related-posts__item-title {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.afel-related-posts__item-title a {
  color: var(--afel-primary-text-color);
  text-decoration: none;
  transition: color var(--afel-transition-normal) ease;
}

.afel-related-posts__item-title a:hover {
  color: var(--afel-link-hover-color);
}

.afel-related-posts__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--afel-secondary-text-color);
  margin-top: auto;
}

.afel-related-posts__date {
  display: flex;
  align-items: center;
  gap: 4px;
}

.afel-related-posts__excerpt {
  margin-top: 10px;
  margin-bottom: 16px;
  font-size: 0.875rem;
  color: var(--afel-secondary-text-color);
  line-height: 1.6;
}

/* Related Posts List Style */
.afel-related-posts--list .afel-related-posts__grid {
  display: block;
}

.afel-related-posts--list .afel-related-posts__item {
  display: flex;
  flex-direction: row;
  margin-bottom: 16px;
  background-color: var(--afel-light-bg);
}

.afel-related-posts--list .afel-related-posts__thumbnail {
  width: 120px;
  height: 120px;
  padding-top: 0;
  flex-shrink: 0;
}

.afel-related-posts--list .afel-related-posts__content {
  padding: 10px;
}

/* Related Posts Carousel Style */
.afel-related-posts--carousel {
  position: relative;
}

.afel-related-posts--carousel .afel-related-posts__carousel-inner {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 16px;
}

.afel-related-posts--carousel
  .afel-related-posts__carousel-inner::-webkit-scrollbar {
  display: none;
}

.afel-related-posts--carousel .afel-related-posts__item {
  flex: 0 0 300px;
  scroll-snap-align: start;
}

.afel-related-posts--carousel .afel-related-posts__carousel-prev,
.afel-related-posts--carousel .afel-related-posts__carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--afel-body-bg);
  border: none;
  box-shadow: var(--afel-shadow-md);
  color: var(--afel-primary-text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background-color var(--afel-transition-normal) ease,
    color var(--afel-transition-normal) ease;
}

.afel-related-posts--carousel .afel-related-posts__carousel-prev:hover,
.afel-related-posts--carousel .afel-related-posts__carousel-next:hover {
  background-color: var(--afel-brand-color);
  color: #fff;
}

.afel-related-posts--carousel .afel-related-posts__carousel-prev {
  left: -20px;
}

.afel-related-posts--carousel .afel-related-posts__carousel-next {
  right: -20px;
}

@media (max-width: 768px) {
  .afel-related-posts--carousel .afel-related-posts__carousel-prev,
  .afel-related-posts--carousel .afel-related-posts__carousel-next {
    display: none;
  }

  .afel-related-posts--list .afel-related-posts__item {
    flex-direction: column;
  }

  .afel-related-posts--list .afel-related-posts__thumbnail {
    width: 100%;
    height: auto;
    padding-top: 56.25%;
  }
}

/*--------------------------------------------------------------
# Social Share
--------------------------------------------------------------*/
.afel-social-share {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.afel-social-share--top {
  margin-top: 0;
}

.afel-social-share__title {
  font-weight: 600;
  color: var(--afel-secondary-text-color);
}

.afel-social-share__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.afel-social-share__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 6px;
  border-radius: 999px;
  background-color: var(--afel-light-bg);
  color: var(--afel-secondary-text-color);
  text-decoration: none;
  transition: all var(--afel-transition-normal) ease;
}

.afel-social-share__button svg {
  width: 16px;
  height: 16px;
  align-self: center;
}

.afel-social-share__button:hover {
  background-color: var(--afel-brand-color);
  color: #fff;
  text-decoration: none;
}

.afel-social-share__button-text {
  font-size: 0.875rem;
}

/* Social network specific colors */
.afel-social-share__button--facebook:hover {
  background-color: #1877f2;
}

.afel-social-share__button--twitter:hover {
  background-color: black;
  color: white;
}

.afel-social-share__button--linkedin:hover {
  background-color: #0a66c2;
}

.afel-social-share__button--pinterest:hover {
  background-color: #e60023;
}

.afel-social-share__button--reddit:hover {
  background-color: #ff4500;
}

.afel-social-share__button--whatsapp:hover {
  background-color: #25d366;
}

.afel-social-share__button--telegram:hover {
  background-color: #0088cc;
}

.afel-social-share__button--email:hover {
  background-color: #ea4335;
}

.afel-social-share__button--link:hover {
  background-color: #6366f1;
}

@media (max-width: 576px) {
  .afel-social-share {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .afel-social-share__buttons {
    width: 100%;
  }
}

/* Related Tools Section */
.afel-related-tools {
  margin: 32px 0;
}

.afel-related-tools__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0;
}

.afel-related-tools__title {
  margin: 0;
  font-size: var(--afel-h3-size);
  font-weight: 600;
  color: var(--afel-primary-text-color);
  line-height: 1.3;
}

.afel-related-tools__see-all svg {
  transition: transform var(--afel-transition-normal) ease;
}

.afel-related-tools__see-all:hover svg {
  transform: translateX(2px);
}

.afel-related-tools__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

/* No related tools message */
.afel-no-related-tools {
  text-align: center;
  padding: 32px;
  color: var(--afel-secondary-text-color);
  font-style: italic;
  background: var(--afel-light-bg);
  border-radius: 6px;
  border: 1px dashed var(--afel-border-color);
  margin: 32px 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .afel-related-tools__title {
    font-size: var(--afel-h3-size);
  }
}

@media (max-width: 768px) {
  .afel-related-tools__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .afel-related-tools__title {
    font-size: var(--afel-h3-size);
  }

  .afel-related-tools__see-all {
    align-self: flex-end;
    font-size: 0.8rem;
    padding: 4px 10px;
  }

  .afel-related-tools__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .afel-related-tools__header {
    flex-direction: column;
    align-items: stretch;
  }

  .afel-related-tools__see-all {
    align-self: center;
    width: fit-content;
    margin: 0 auto;
  }
}

/**
 * Table of Content Styles
 *
 * @package AFEL
 */

#quick-navigation {
  padding: 20px;
  border: solid 1px var(--afel-border-color);
  border-radius: 6px;
  margin-bottom: 20px;
}

#quick-navigation .toc-header {
  font-size: 20px;
  font-weight: 600;
  display: flex;
  gap: 10px;
}

#quick-navigation .toc-header p {
  margin-bottom: 0;
}

#quick-navigation .toc-header button {
  font-size: 12px;
  text-decoration: underline;
  color: var(--mow-mc1);
  border: none;
  background-color: transparent;
  cursor: pointer;
  padding-top: 3px;
}

#quick-navigation .toc-content {
  font-size: 14px;
}

#quick-navigation .toc-content ul {
  margin: 8px 16px 4px 16px;
  list-style: numbers;
  padding-inline-start: 24px;
}

#quick-navigation .toc-content ul a {
  border-bottom: none;
}

/* .single-post .afel-single-content h2 {
  scroll-margin-top: 50px;
  padding-top: 60px;
  margin-top: -50px;
  margin-bottom: 20px !important;
} */

.afel-single-content h3,
.afel-single-content h4,
.afel-single-content h5,
.afel-single-content h6 {
  margin-bottom: 16px !important;
}
