/* Author Widget v2 — frontend stylesheet */

/* ========================================================================
   Widget on product/category/info/blog pages
======================================================================== */
.author-widget {
    margin: 20px 0;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fafafa;
    font-size: 14px;
    line-height: 1.5;
}
.author-widget__title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-bottom: 12px;
    font-weight: 600;
}
.author-widget__list { display: flex; flex-direction: column; gap: 16px; }
.author-widget__item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}
.author-widget__item:last-child { border-bottom: none; padding-bottom: 0; }

.author-widget__photo {
    flex: 0 0 80px;
    display: block;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
}
.author-widget__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.author-widget__body { flex: 1 1 auto; min-width: 0; }
.author-widget__name { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.author-widget__name a { color: #111827; text-decoration: none; }
.author-widget__name a:hover { color: #1d4ed8; }
.author-widget__degree { color: #6b7280; font-weight: 400; font-size: 14px; }

.author-widget__position { color: #4b5563; font-size: 13px; margin-bottom: 4px; }

.author-widget__role {
    font-size: 12px;
    margin-bottom: 8px;
    color: #6b7280;
}
.author-widget__role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 11px;
}
.author-widget__role-badge--author          { background: #dbeafe; color: #1e40af; }
.author-widget__role-badge--reviewer        { background: #dcfce7; color: #166534; }
.author-widget__role-badge--medical_advisor { background: #fef3c7; color: #92400e; }

.author-widget__reviewed-date { white-space: nowrap; }

.author-widget__bio {
    color: #374151;
    font-size: 13px;
    margin: 6px 0 8px;
}
.author-widget__link {
    display: inline-block;
    font-size: 13px;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 500;
}
.author-widget__link:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .author-widget__item { flex-direction: column; }
    .author-widget__photo { width: 60px; height: 60px; flex-basis: 60px; }
}

/* ========================================================================
   Single author profile page (/author/<slug>)
======================================================================== */
.author-profile { font-size: 15px; line-height: 1.6; color: #1f2937; }

.author-profile__header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}
.author-profile__photo {
    flex: 0 0 200px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e5e7eb;
}
.author-profile__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.author-profile__intro { flex: 1 1 auto; }
.author-profile__name { margin: 0 0 8px; font-size: 28px; font-weight: 700; color: #111827; }
.author-profile__name small { font-weight: 400; color: #6b7280; font-size: 18px; }
.author-profile__position { font-size: 17px; color: #374151; margin-bottom: 4px; }
.author-profile__category { font-size: 14px; color: #6b7280; font-style: italic; margin-bottom: 12px; }
.author-profile__license { font-size: 13px; color: #6b7280; margin-bottom: 12px; }
.author-profile__license span { margin-right: 8px; }

.author-profile__social { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.author-profile__social li a {
    display: inline-block;
    padding: 6px 12px;
    background: #f3f4f6;
    color: #1f2937;
    font-size: 13px;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}
.author-profile__social li a:hover { background: #e5e7eb; color: #111827; }

.author-profile__section { margin-bottom: 28px; }
.author-profile__section-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #f3f4f6;
}

.author-profile__bio { color: #374151; }
.author-profile__bio p { margin: 0 0 12px; }

.author-profile__tags {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-wrap: wrap; gap: 6px;
}
.author-profile__tags li {
    display: inline-block;
    padding: 4px 12px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 14px;
    font-size: 13px;
}

.author-profile__education { list-style: none; padding: 0; margin: 0; }
.author-profile__education li {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}
.author-profile__education li:last-child { border-bottom: none; }
.author-profile__education .edu-org { font-weight: 600; color: #111827; }
.author-profile__education .edu-deg { color: #374151; font-size: 14px; }
.author-profile__education .edu-years { color: #6b7280; font-size: 13px; margin-top: 2px; }

.author-profile__certificates {
    list-style: none; padding: 0; margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.author-profile__certificates li {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    padding: 10px;
}
.author-profile__certificates .cert-link { display: block; margin-bottom: 8px; }
.author-profile__certificates .cert-link img { width: 100%; height: auto; display: block; border-radius: 3px; }
.author-profile__certificates .cert-name { font-weight: 600; font-size: 13px; color: #111827; margin-bottom: 2px; }
.author-profile__certificates .cert-issuer { font-size: 12px; color: #6b7280; }
.author-profile__certificates .cert-date { font-size: 11px; color: #9ca3af; margin-top: 4px; }

@media (max-width: 640px) {
    .author-profile__header { flex-direction: column; align-items: center; text-align: center; }
    .author-profile__photo { flex-basis: 150px; width: 150px; height: 150px; }
    .author-profile__name { font-size: 22px; }
    .author-profile__social { justify-content: center; }
}

/* ========================================================================
   Authors list page (/authors)
======================================================================== */
.authors-list__title { margin: 0 0 12px; font-size: 28px; font-weight: 700; color: #111827; }
.authors-list__description { font-size: 15px; color: #4b5563; margin-bottom: 24px; max-width: 700px; }

.authors-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.authors-list__card {
    display: block;
    padding: 20px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
}
.authors-list__card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    text-decoration: none;
}
.authors-list__photo {
    width: 120px; height: 120px;
    margin: 0 auto 12px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #f3f4f6;
}
.authors-list__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.authors-list__name { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: #111827; }
.authors-list__position { font-size: 13px; color: #4b5563; margin-bottom: 4px; }
.authors-list__category { font-size: 12px; color: #6b7280; font-style: italic; margin-bottom: 10px; }
.authors-list__link { display: inline-block; font-size: 13px; color: #1d4ed8; font-weight: 500; }

/* ========================================================================
   Lightbox (for certificate images) — vanilla, minimal
======================================================================== */
.author-lightbox {
    position: fixed; inset: 0;
    background: rgba(17,24,39,0.9);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.author-lightbox.is-open { opacity: 1; visibility: visible; }
.author-lightbox__inner {
    position: relative;
    max-width: 90vw; max-height: 90vh;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.author-lightbox__img {
    max-width: 100%; max-height: calc(90vh - 60px);
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
}
.author-lightbox__caption {
    color: #fff; font-size: 14px; text-align: center;
    max-width: 600px;
}
.author-lightbox__close {
    position: absolute; top: -36px; right: 0;
    background: none; border: none; color: #fff;
    font-size: 28px; cursor: pointer; line-height: 1; padding: 4px 10px;
}
.author-lightbox__close:hover { color: #fca5a5; }
.author-lightbox__nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1); border: none;
    color: #fff; font-size: 32px; padding: 8px 16px; cursor: pointer;
    border-radius: 4px;
}
.author-lightbox__nav:hover { background: rgba(255,255,255,0.2); }
.author-lightbox__nav--prev { left: -60px; }
.author-lightbox__nav--next { right: -60px; }

@media (max-width: 768px) {
    .author-lightbox__nav--prev { left: 10px; }
    .author-lightbox__nav--next { right: 10px; }
}
