/**
 * Author Profile Box - Frontend Styles
 */

/* Main container */
.apb.author-profile {
    margin: 2em 0;
    padding: 1.5em;
    background-color: #f9f9f9;
    border-left: 4px solid #0073aa;
    font-size: 0.95em;
    border-radius: 4px;
}

/* Meta container - flexbox layout */
.apb .author-meta {
    display: flex;
    align-items: flex-start;
    gap: 1.5em;
    flex-wrap: wrap;
}

/* Author image */
.apb .author-image img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

/* Author info section */
.apb .author-info {
    flex: 1;
    min-width: 200px;
}

/* Author title */
.apb .author-title {
    margin: 0 0 0.5em 0;
    font-size: 1.1em;
}

.apb .author-title a {
    color: #0073aa;
    text-decoration: none;
}

.apb .author-title a:hover {
    text-decoration: underline;
}

/* Author subtitle (job title / organization) */
.apb .author-subtitle {
    font-weight: normal;
    font-size: 0.9em;
    color: #666;
}

/* Read more container */
.apb .read-more-container {
    position: relative;
    max-height: 100px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.apb .read-more-container.expanded {
    max-height: none;
}

/* Author description */
.apb .author-description {
    margin: 0;
    line-height: 1.6;
    color: #444;
}

/* Fade gradient for collapsed text */
.apb .read-more-container:not(.expanded)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2em;
    background: linear-gradient(to bottom, rgba(249, 249, 249, 0), #f9f9f9 75%);
    pointer-events: none;
}

/* Read more toggle */
.apb .read-more-toggle {
    display: inline-block;
    margin-top: 0.5em;
    color: #0073aa;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
}

.apb .read-more-toggle:hover {
    text-decoration: underline;
}

/* Social links */
.apb .author-social {
    margin-top: 1em;
    display: flex;
    gap: 0.75em;
    flex-wrap: wrap;
}

.apb .social-link {
    display: inline-block;
    padding: 0.3em 0.8em;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.85em;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.apb .social-link:hover {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.apb .social-link.twitter:hover {
    background: #1da1f2;
    border-color: #1da1f2;
}

.apb .social-link.linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
}

/* Desktop: expanded by default, hide toggle */
@media (min-width: 768px) {
    .apb .read-more-container {
        max-height: none !important;
    }

    .apb .read-more-container::after {
        display: none;
    }

    .apb .read-more-toggle {
        display: none;
    }

    .apb .author-image img {
        width: 100px;
        height: 100px;
    }
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .apb .author-meta {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .apb .author-social {
        justify-content: center;
    }
}

/* Fact-checked date */
.apb-fact-checked {
    margin: 1em 0;
    padding: 0.5em 1em;
    background-color: #f0f7fb;
    border-left: 3px solid #0073aa;
    font-size: 0.9em;
    color: #444;
}
