/**
 * 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;
}

/* Hero section (split layout) */
.apb-hero {
    background: #1c2e1c;
    color: #e8e8ec;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 32px calc(50vw - 50%) 0;
    margin-top: -30px;
    margin-bottom: 0;
}
@media (max-width: 768px) {
    .apb-hero {
        margin-top: -12px;
    }
}
.apb-hero-inner {
    max-width: 960px;
}
/* TOC inside hero - don't let the dark background affect its styling */
.apb-hero .wmc-toc-bar {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}
/* Hide original theme breadcrumbs and entry title when hero is active */
body.apb-has-hero #breadcrumbs:not(.apb-hero-breadcrumbs) {
    display: none;
}
body.apb-has-hero .entry-header .entry-title {
    display: none;
}

/* Let nav use full viewport width so menu items have more room */
body.apb-has-hero .site-header .inside-header.grid-container {
    max-width: none !important;
    padding-left: 20px;
    padding-right: 20px;
}
body.apb-has-hero .main-navigation .inside-navigation.grid-container {
    max-width: none !important;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
}

/* Hide original disclosure when hero renders its own below */
body.apb-has-hero .disclaimer-top {
    display: none;
}

/* Disclosure bar below hero */
.apb-hero-disclosure {
    background: #f5f6f8;
    border-bottom: 1px solid #e5e7eb;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 8px calc(50vw - 50%);
    margin-bottom: 0;
}
.apb-hero-disclosure p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}
.apb-hero-disclosure a {
    color: #2d6a2e;
}

/* Hide original jump link - hero renders its own */
body.apb-has-hero .inside-article > .jump {
    display: none;
}

/* Sticky jump to list link below hero */
.apb-jump-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    padding: 8px 0;
    margin: 0;
    text-align: center;
}
.apb-jump-sticky a {
    color: #2d6a2e;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}
.apb-jump-sticky a:hover {
    text-decoration: underline;
}

/* Featured sites - collapsible tab */
body.apb-has-hero .featured-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease;
    margin: 0;
    padding: 0 20px;
    border: none;
    border-radius: 0;
    background: linear-gradient(135deg, #2d6a2e, #4a9e4c);
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}
body.apb-has-hero .featured-container.featured-open {
    max-height: 300px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #2d6a2e, #4a9e4c);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    text-align: center;
}
body.apb-has-hero .featured-container .featured-carousel {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    justify-content: center;
    margin: 0 !important;
}
body.apb-has-hero .featured-container .featured-site {
    margin: 0;
    padding: 0 4px 10px 0;
    flex-shrink: 0;
    position: relative;
    overflow: visible;
}
body.apb-has-hero .featured-container .featured-offer {
    margin: 0;
    padding: 0;
}
/* Hide the original Featured Sites heading - the tab button replaces it */
body.apb-has-hero .featured-container .carousel-title {
    display: none;
}

/* Featured sites toggle tab */
.apb-featured-tab {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #2d6a2e, #4a9e4c);
    color: #fff;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: calc(100vw);
}
.apb-featured-tab:hover {
    background: linear-gradient(135deg, #245523, #3d8a3f);
}
.apb-featured-tab::after {
    content: " \25BC";
    font-size: 12px;
    transition: transform 0.3s;
}
.apb-featured-tab.featured-tab-open::after {
    transform: rotate(180deg);
}
/* Subtle glow animation */
.apb-featured-tab::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: apb-glow 3s ease-in-out infinite;
    pointer-events: none;
}
@keyframes apb-glow {
    0%, 100% { opacity: 0; transform: translateX(-30%); }
    50% { opacity: 1; transform: translateX(30%); }
}
@media (prefers-reduced-motion: reduce) {
    .apb-featured-tab::before {
        animation: none;
        display: none;
    }
}

.apb-hero-breadcrumbs {
    font-size: 13px;
    margin: 0 0 16px;
}
.apb-hero-breadcrumbs,
.apb-hero-breadcrumbs a {
    color: #8a9a8a;
}
.apb-hero-breadcrumbs a:hover {
    color: #b0c8b0;
}
.apb-hero-breadcrumbs .breadcrumb_last {
    color: #c0d0c0;
}
.apb-hero h1 {
    color: #fff;
    font-size: 2.6em;
    margin-bottom: 18px;
    line-height: 1.15;
    font-weight: 800;
}
.apb-hero p {
    color: #c8c8d0;
    font-size: 18px;
    line-height: 1.65;
    margin-bottom: 0;
}
.apb-hero p a {
    color: #8ecf6e;
}
.apb-hero p a:hover {
    color: #a8e08a;
}
.apb-hero .apb-byline {
    border-top-color: rgba(255,255,255,0.15);
    border-bottom: none;
    padding: 14px 0 20px;
    margin: 16px 0 0;
}
.apb-hero .apb-byline-author,
.apb-hero .apb-byline-author a {
    color: #e0e0e8;
}
.apb-hero .apb-byline-sep {
    color: rgba(255,255,255,0.25);
}
.apb-hero .apb-byline-date {
    color: #9999aa;
}
@media (max-width: 768px) {
    .apb-hero {
        padding-top: 20px;
    }
    .apb-hero h1 {
        font-size: 1.8em;
    }
    .apb-hero p {
        font-size: 16px;
    }
}

/* Compact byline (split layout) */
.apb-byline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 1em 0;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #555;
}
.apb-byline-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}
.apb-byline-author a {
    color: #333;
    font-weight: 600;
    text-decoration: none;
}
.apb-byline-author a:hover {
    text-decoration: underline;
}
.apb-byline-sep {
    color: #ccc;
}
.apb-byline-date {
    color: #777;
}
@media (max-width: 480px) {
    .apb-byline {
        flex-wrap: wrap;
        gap: 4px 8px;
        font-size: 13px;
    }
}
