/**
 * Author Box Plugin - Frontend Styles
 */

/* === ISTNIEJĄCE STYLE AUTHOR BOX (BEZ ZMIAN) === */
.abp-author-box { margin: 40px 0; clear: both; }
.abp-author-box * { box-sizing: border-box; }
.abp-author-box-inner { display: flex; gap: 24px; align-items: flex-start; }
.abp-author-photo { flex-shrink: 0; }
.abp-author-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; }
.abp-author-photo.abp-no-photo .abp-avatar-placeholder { display: block; width: 100px; height: 100px; border-radius: 50%; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.abp-author-info { flex: 1; min-width: 0; }
.abp-author-header { margin-bottom: 12px; }
.abp-author-name { margin: 0 0 4px 0; font-size: 1.25rem; font-weight: 600; line-height: 1.3; color: inherit; }
.abp-author-position { display: inline-block; font-size: 0.875rem; color: #666; }
.abp-author-bio { margin-bottom: 16px; font-size: 0.9375rem; line-height: 1.6; color: #444; }
.abp-author-bio p:last-child { margin-bottom: 0; }
.abp-author-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.abp-author-social { display: flex; gap: 8px; }
.abp-social-link { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #f0f0f0; color: #555; text-decoration: none; transition: all 0.2s ease; }
.abp-social-link:hover { background: #333; color: #fff; }
.abp-social-link svg { width: 18px; height: 18px; }
.abp-author-button { display: inline-block; padding: 10px 20px; background: #333; color: #fff; font-size: 0.875rem; font-weight: 500; text-decoration: none; border-radius: 6px; transition: all 0.2s ease; }
.abp-author-button:hover { background: #555; color: #fff; text-decoration: none; }

/* Style wariantów Author Box (Default, Modern, Minimal, Card) pozostają bez zmian */
.abp-style-default .abp-author-box-inner { padding: 24px; background: #f9f9f9; border: 1px solid #e0e0e0; border-radius: 8px; }
.abp-style-modern .abp-author-box-inner { padding: 32px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 16px; color: #fff; }
.abp-style-modern .abp-author-name { color: #fff; }
.abp-style-modern .abp-author-position { color: rgba(255, 255, 255, 0.8); }
.abp-style-modern .abp-author-bio { color: rgba(255, 255, 255, 0.9); }
.abp-style-modern .abp-social-link { background: rgba(255, 255, 255, 0.2); color: #fff; }
.abp-style-modern .abp-social-link:hover { background: #fff; color: #667eea; }
.abp-style-modern .abp-author-button { background: #fff; color: #667eea; }
.abp-style-modern .abp-author-button:hover { background: rgba(255, 255, 255, 0.9); color: #764ba2; }
.abp-style-minimal .abp-author-box-inner { padding: 24px 0; border-top: 2px solid #333; }
.abp-style-minimal .abp-author-avatar { width: 80px; height: 80px; }
.abp-style-minimal .abp-author-photo.abp-no-photo .abp-avatar-placeholder { width: 80px; height: 80px; }
.abp-style-minimal .abp-author-button { background: transparent; color: #333; border: 2px solid #333; padding: 8px 16px; }
.abp-style-minimal .abp-author-button:hover { background: #333; color: #fff; }
.abp-style-card .abp-author-box-inner { flex-direction: column; align-items: center; text-align: center; padding: 32px; background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); }
.abp-style-card .abp-author-avatar { width: 120px; height: 120px; }
.abp-style-card .abp-author-photo.abp-no-photo .abp-avatar-placeholder { width: 120px; height: 120px; }
.abp-style-card .abp-author-info { display: flex; flex-direction: column; align-items: center; }
.abp-style-card .abp-author-header { text-align: center; }
.abp-style-card .abp-author-footer { flex-direction: column; gap: 16px; }
.abp-style-card .abp-author-button { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 12px 32px; border-radius: 50px; }
.abp-style-card .abp-author-button:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4); }

@media (max-width: 600px) {
    .abp-author-box-inner { flex-direction: column; align-items: center; text-align: center; }
    .abp-author-footer { flex-direction: column; align-items: center; }
    .abp-author-info { display: flex; flex-direction: column; align-items: center; }
}

/* ============================
   NOWE STYLE: TL;DR (Key Takeaways)
   ============================ */
.abp-tldr-box {
    background-color: #f0f7ff;
    border-left: 5px solid #2271b1;
    padding: 20px 25px;
    margin: 30px 0;
    border-radius: 4px;
}

.abp-tldr-title {
    margin: 0 0 15px 0 !important;
    font-size: 1.2rem !important;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1d2327;
}

.abp-tldr-title .dashicons {
    color: #2271b1;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.abp-tldr-list {
    margin: 0 !important;
    padding-left: 20px !important;
    list-style-type: disc !important;
}

.abp-tldr-list li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #3c434a;
}

.abp-tldr-list li:last-child {
    margin-bottom: 0;
}

/* ============================
   NOWE STYLE: Spis Treści (ToC)
   ============================ */
.abp-toc-wrapper {
    margin: 30px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.abp-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer; /* Klikalne na mobile */
}

.abp-toc-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.abp-toc-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #555;
    transition: transform 0.3s ease;
}

.abp-toc-list {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    max-height: 2000px;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.abp-toc-list li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.abp-toc-link {
    text-decoration: none;
    color: #2271b1;
    font-size: 0.95rem;
    display: block;
    transition: color 0.2s;
}

.abp-toc-link:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Wcięcia dla h3, h4 */
.abp-toc-item-h3 { margin-left: 20px; }
.abp-toc-item-h4 { margin-left: 40px; }

/* === Desktop: Sticky Right === */
@media (min-width: 1200px) {
    /* UWAGA: Aby sticky działało, rodzic nie może mieć overflow:hidden.
       W typowych motywach WP "sticky" może wymagać dostosowania top.
       Stosujemy trick z pozycjonowaniem absolutnym/fixed względem contentu 
       lub prosty float/sticky wewnątrz kontenera.
       
       Dla uniwersalności: Robimy go sticky po prawej stronie, 
       ale wewnątrz kontenera treści (float right + sticky).
    */
    .abp-toc-wrapper {
        float: right;
        width: 300px;
        margin: 0 0 20px 30px;
        position: sticky;
        top: 40px; /* Odstęp od góry ekranu */
        z-index: 10;
    }
    
    .abp-toc-toggle {
        display: none; /* Na desktopie zawsze otwarte */
    }
}

/* === Mobile: Zwijanie === */
@media (max-width: 1199px) {
    .abp-toc-wrapper {
        width: 100%;
        margin: 20px 0;
    }
    
    .abp-toc-wrapper.collapsed .abp-toc-list {
        max-height: 0;
    }
    
    .abp-toc-wrapper.collapsed .abp-toc-toggle {
        transform: rotate(-90deg);
    }
}