/* ============================================
   SOMAKO — Author Profile Page
   homepage sh-* 컴포넌트 재사용 + ap-* 최소 고유 스타일
   ============================================ */

/* ── Profile Header ── */
.ap-profile {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 0;
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.ap-profile-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--sh-gray-100, #f4f4f5);
  border: 1px solid var(--sh-gray-200, #e4e4e7);
}
.ap-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ap-profile-body {
  flex: 1;
  min-width: 0;
}

.ap-profile-label {
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--sh-red, #d32f2f);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.ap-profile-name {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--sh-dark, #09090b);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.ap-profile-bio {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--sh-gray-600, #52525b);
  margin-bottom: 1.25rem;
  max-width: 480px;
}

/* Stats — 히어로 내부 인라인 */
.ap-profile-stats {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
}
.ap-profile-stat {
  padding-right: 1.5rem;
  margin-right: 1.5rem;
  border-right: 1px solid var(--sh-gray-200, #e4e4e7);
}
.ap-profile-stat:last-child {
  border-right: none;
  padding-right: 0;
  margin-right: 0;
}
.ap-profile-stat-num {
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--sh-dark, #09090b);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.ap-profile-stat-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--sh-gray-400, #a1a1aa);
}

/* Expertise tags — 히어로 내부 */
.ap-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.ap-profile-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--sh-gray-200, #e4e4e7);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sh-gray-800, #27272a);
  background: var(--sh-gray-50, #fafafa);
}
.ap-profile-tag em {
  font-style: normal;
  font-weight: 500;
  color: var(--sh-gray-400, #a1a1aa);
}
.ap-profile-tag-primary {
  background: #fff5f5;
  border-color: var(--sh-red, #d32f2f);
  color: #b71c1c;
}
.ap-profile-tag-primary em {
  color: var(--sh-red, #d32f2f);
}

/* Profile divider */
.ap-divider {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding: 0 2rem;
}
.ap-divider-line {
  border: none;
  border-top: 1px solid var(--sh-gray-200, #e4e4e7);
  margin: 0;
}

/* ── Content Sections ── */
.ap-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem 0;
}

/* ── Featured Articles ── */
.ap-featured {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}
.ap-featured-card {
  position: relative;
  border: 1px solid var(--sh-gray-200, #e4e4e7);
  border-radius: 0.875rem;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.ap-featured-card:hover {
  border-color: var(--sh-gray-300, #d4d4d8);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}
.ap-featured-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sh-gray-100, #f4f4f5);
}
.ap-featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.ap-featured-card:hover .ap-featured-thumb img {
  transform: scale(1.05);
}
.ap-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  z-index: 2;
}
.ap-badge-best { background: var(--sh-red, #d32f2f); color: #fff; }
.ap-badge-new  { background: var(--sh-dark, #09090b); color: #fff; }

.ap-featured-body {
  padding: 1.25rem 1.5rem 1.5rem;
}
.ap-featured-title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--sh-dark, #09090b);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  transition: color 0.2s;
}
.ap-stretched-link { color: inherit; text-decoration: none; }
.ap-stretched-link::after { content: ''; position: absolute; inset: 0; }
.ap-featured-card:hover .ap-featured-title { color: var(--sh-red, #d32f2f); }

.ap-featured-excerpt {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--sh-gray-600, #52525b);
  margin-bottom: 0.625rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ap-featured-meta {
  font-size: 0.75rem;
  color: var(--sh-gray-400, #a1a1aa);
}

/* ── All Articles Grid (sh-latest-card 패턴 미러링) ── */
.ap-total-count {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--sh-gray-400, #a1a1aa);
}

.ap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.ap-card {
  position: relative;
  transition: transform 0.2s;
}
.ap-card:hover {
  transform: translateY(-2px);
}

.ap-card-img {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 0.875rem;
  overflow: hidden;
  margin-bottom: 0.75rem;
  background: var(--sh-gray-100, #f4f4f5);
}
.ap-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.ap-card:hover .ap-card-img img {
  transform: scale(1.05);
}
.ap-card-img .sh-category-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
}

.ap-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--sh-dark, #09090b);
  word-break: keep-all;
  margin: 0 0 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}
.ap-card:hover .ap-card-title {
  color: var(--sh-red, #d32f2f);
}

.ap-card-date {
  font-size: 0.75rem;
  color: var(--sh-gray-400, #a1a1aa);
}

/* ── Load More ── */
.ap-loadmore-wrap {
  text-align: center;
  margin-top: 2.5rem;
}
.ap-loadmore-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sh-dark, #09090b);
  background: none;
  border: 1px solid var(--sh-gray-200, #e4e4e7);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.ap-loadmore-btn:hover {
  border-color: var(--sh-gray-300, #d4d4d8);
  background: var(--sh-gray-50, #fafafa);
}
.ap-loadmore-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.ap-loadmore-wrap {
  margin-bottom: 4rem;
}

/* ── Bottom Padding ── */
.ap-bottom-pad {
  height: 3rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .ap-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    padding: 2rem 1.25rem 0;
  }
  .ap-profile-avatar {
    width: 100px;
    height: 100px;
  }
  .ap-profile-name {
    font-size: 1.375rem;
  }
  .ap-profile-bio {
    max-width: none;
  }
  .ap-profile-stats {
    justify-content: center;
  }
  .ap-profile-tags {
    justify-content: center;
  }

  .ap-divider {
    padding: 0 1.25rem;
    margin-top: 2rem;
  }

  .ap-section {
    padding: 2rem 1.25rem 0;
  }
  .ap-featured {
    grid-template-columns: 1fr;
  }
  .ap-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
