/* =============================================
   AUTHOR PAGE
   ============================================= */

/* Cover */
.author-page {
  background: #fafafa;
}
.author-cover {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: #c9d6df;
}
.author-cover-img,
.author-cover .author-cover-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.author-cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Profile bar */
.author-profile-bar {
  background: #fafafa;
  padding-bottom: 24px;
}
.author-profile-inner {
  display: flex;
  gap: 28px;
  padding-top: 0;
  align-items: flex-start;
  position: relative;
}

/* Avatar */
.author-avatar-wrap {
  flex-shrink: 0;
  margin-top: -56px;
}
.author-avatar-wrap img.author-avatar,
.author-avatar-wrap img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #fafafa;
  /* box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15); */
  display: block;
}
.author-avatar-placeholder {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #764ba2;
  border: 4px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -56px;
}
.author-avatar-placeholder span {
  font-size: 40px;
  color: #fff;
  font-weight: 700;
}

/* Info */
.author-info {
  padding-top: 24px;
  flex: 1;
  min-width: 0;
}
.author-name {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 4px;
  color: #171717;
}
.author-job {
  font-size: 14px;
  color: #888;
  margin-bottom: 6px;
}
.author-location {
  font-size: 16px;
  color: #525252;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
  margin-top: 12px;
}
.icon-location {
  flex-shrink: 0;
}

/* Socials */
.author-socials {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  align-items: center;
}
.social-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  opacity: 1;
  transition: opacity 0.2s;
}
.social-link:hover {
  opacity: 0.7;
}

/* Bio */
.author-bio-wrap {
  margin-top: 4px;
}
.author-bio {
  font-size: 16px;
  color: #171717;
  line-height: 24px;
  max-height: 96px;
  overflow: hidden;
  transition: max-height 0.3s ease;
  max-width: 768px;
}
.author-bio.expanded {
  max-height: 600px;
}
.bio-toggle {
  background: none;
  border: none;
  color: #a24d24;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 0 0;
  font-weight: 500;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.3s ease;
  line-height: 1.4;
}
.bio-toggle:hover {
  background-size: 0% 1px;
}

/* Content area */
.author-content {
  padding-top: 32px;
  padding-bottom: 60px;
}
.author-articles-grid,
.latest-posts-section {
  margin-top: 40px;
}
.author-paging {
  margin-top: 40px;
}

/* Tabs row */
.author-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #eee;
  margin-bottom: 28px;
}
.author-tabs {
  display: flex;
  gap: 0;
}
.tab-btn {
  background: none;
  border: none;
  padding: 10px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #525252;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.tab-btn.active {
  color: #a24d24;
}
.tab-btn.active .tab-count {
  background: #f7eae1;
  color: #a24d24;
}
.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #a24d24;
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 35px;
  height: 20px;
  background: #f5f5f5;
  color: #525252;
  border-radius: 24px;
  font-size: 12px;
  padding: 0 6px;
  margin-left: 6px;
}
.tab-panel.hidden {
  display: none;
}

/* Sort bar */
.articles-toolbar {
  display: flex;
  align-items: center;
  padding-bottom: 4px;
}
.sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #404040;
}
.sort-label {
  white-space: nowrap;
}

.sort-custom {
  position: relative;
}
.sort-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-size: 14px;
  color: #404040;
  cursor: pointer;
  padding: 0;
  font-weight: 400;
}
.sort-trigger svg {
  transition: transform 0.2s;
  flex-shrink: 0;
}
.sort-trigger.open svg {
  transform: rotate(180deg);
}

.sort-options {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  padding: 8px 0;
  z-index: 100;
  list-style: none;
  margin: 0;
}
.sort-options.open {
  display: block;
}
.sort-option {
  padding: 12px 20px;
  font-size: 15px;
  color: #171717;
  cursor: pointer;
  transition: background 0.15s;
}
.sort-option:hover {
  background: #f5f5f5;
}
.sort-option.selected {
  font-weight: 600;
  color: #a24d24;
}

/* Articles grid — dùng class của blog category */
.latest-posts-section {
}
.post-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  row-gap: 40px;
}
.blog-post-card {
  flex: 0 0 calc((100% - 48px) / 3);
  width: calc((100% - 48px) / 3);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.blog-post-card img {
  aspect-ratio: 400/244;
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}
.blog-card_info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-meta {
  font-size: 14px;
  color: #737373;
  display: flex;
  gap: 8px;
  align-items: center;
}
.dots-blog {
  width: 4px;
  height: 4px;
  background: #737373;
  border-radius: 100%;
  display: inline-block;
}
.blog-post-card .title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 56px;
}
.blog-post-card .title:hover {
  color: #a24d24;
}
.blog-post-card .text-description {
  font-size: 14px;
  color: #525252;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
  height: 87px;
}

/* Photos grid */
.author-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.author-photo-item {
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 405/272;
}
.author-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.author-photo-item:hover img {
  transform: scale(1.05);
}

/* No result */
.no-result {
  padding: 40px 0;
  text-align: center;
  color: #aaa;
  font-size: 15px;
}

/* Responsive — Tablet */
@media (max-width: 1024px) {
  .author-avatar-wrap img.author-avatar,
  .author-avatar-wrap img {
    border: 4px solid #fafafa;
  }
  .post-grid {
    row-gap: 32px;
  }
  .blog-post-card {
    flex: 0 0 calc((100% - px) / 2);
    width: calc((100% - 24px) / 2);
  }
  .author-photos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .author-cover {
    height: 220px;
  }
  .author-avatar-wrap img {
    width: 150px;
    height: 150px;
  }
  .author-avatar-wrap {
    margin-top: -44px;
  }

  /* Font -2px */
  .author-name {
    font-size: 22px;
  }
  .author-job {
    font-size: 12px;
  }
  .author-location {
    font-size: 14px;
  }
  .author-bio {
    font-size: 14px;
  }
  .bio-toggle {
    font-size: 12px;
  }
  .tab-btn {
    font-size: 14px;
  }
  .sort-label,
  .sort-trigger,
  .sort-option {
    font-size: 12px;
  }
  .blog-post-card .title {
    font-size: 16px;
    height: 48px;
  }
  .blog-post-card .text-description {
    font-size: 12px;
  }
  .post-meta {
    font-size: 12px;
  }
}

/* Responsive — Mobile */
@media (max-width: 640px) {
  .blog-post-card .text-description {
    height: unset;
  }
  .author-cover {
    height: 160px;
  }

  /* Profile stacked */
  .author-profile-inner {
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
  }
  .author-avatar-wrap {
    margin-top: -44px;
  }
  .author-avatar-wrap img {
    width: 150px;
    height: 150px;
  }
  .author-info {
    padding-top: 12px;
    width: 100%;
  }
  .author-location {
    justify-content: center;
  }
  .author-socials {
    justify-content: center;
  }
  .author-bio-wrap {
    text-align: left;
  }

  /* Font -2px */
  .author-name {
    font-size: 22px;
  }
  .author-job {
    font-size: 12px;
  }
  .author-location {
    font-size: 14px;
  }
  .author-bio {
    font-size: 14px;
  }
  .bio-toggle {
    font-size: 12px;
  }
  .tab-btn {
    padding: 10px 16px;
    font-size: 14px;
  }
  .sort-label,
  .sort-trigger,
  .sort-option {
    font-size: 12px;
  }
  .blog-post-card .title {
    font-size: 16px;
    height: 48px;
  }
  .blog-post-card .text-description {
    font-size: 12px;
  }
  .post-meta {
    font-size: 12px;
  }

  /* Tabs row: wrap — border chỉ dưới tabs, sort bar nằm dưới border */
  .author-tabs-row {
    flex-wrap: wrap;
    gap: 0;
    border-bottom: none;
  }
  .author-tabs {
    width: 100%;
    border-bottom: 2px solid #eee;
  }
  .articles-toolbar {
    width: 100%;
    justify-content: flex-end;
    padding: 10px 0 8px;
    margin-bottom: 0;
  }

  /* Cards 1 col */
  .blog-post-card {
    flex: 0 0 100%;
    width: 100%;
  }

  /* Photos 1 col */
  .author-photos-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .author-content {
    padding-top: 24px;
  }
}
