/* ===========================
   Single Author Page
   =========================== */

.single-author-page {
    padding: 2rem 0;
    background-color: var(--theme-bg);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    background-color: var(--theme-bg);
}

/* Author Header */
.author-archive-container {
    margin-bottom: 4rem;
}

.author-header {
    margin-bottom: 3rem;
}

.author-header > div {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    align-items: start;
}

/* Author Sidebar */
.author-sidebar {
    position: sticky;
    top: 200px;
}

.author-sidebar .author-image {
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius, 8px);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.author-sidebar .author-image img {
    width: 100%;
    height: auto;
    display: block;
}

.author-sidebar h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--theme-text, #333);
    line-height: 1.2;
}

/* Author Photo Placeholder */
.author-photo-placeholder {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-bg-alt, #f5f5f5);
    border-radius: var(--border-radius, 8px);
    margin-bottom: 1.5rem;
}

.author-photo-placeholder [class*="ph-"] {
    font-size: 5rem;
    color: var(--theme-text-muted, #999);
    line-height: 1;
}

/* Author Meta */
.author-meta {
    font-size: 0.9em;
    color: var(--theme-text-secondary, #666);
    line-height: 1.6;
}

.author-meta p {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--theme-border, #e0e0e0);
}

.author-meta p:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.author-meta strong {
    display: block;
    color: var(--theme-text, #333);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.author-meta a {
    color: var(--theme-link, #0073aa);
    text-decoration: none;
    transition: color 0.2s ease;
}

.author-meta a:hover {
    color: var(--theme-link-hover, #005a87);
    text-decoration: underline;
}

/* Author Content */
.author-content {
    background: var(--theme-bg);
}

/* Biography Styling */
.author-biography {
    line-height: 1.8;
    font-size: 1.05rem;
    color: var(--theme-text);
    margin-bottom: 2rem;
}

.author-biography .biography-excerpt {
    margin-bottom: 1rem;
}

.author-biography .biography-excerpt p {
    margin-bottom: 1.5rem;
}

.author-biography .biography-excerpt p:last-child {
    margin-bottom: 0;
}

.author-biography .read-more-wrapper {
    margin-top: 1rem;
    margin-bottom: 0;
}

.author-biography .read-more-btn {
    background: none;
    border: none;
    color: var(--theme-accent, #0073aa);
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
    padding: 0;
    font-weight: 600;
    transition: color 0.2s ease;
}

.author-biography .read-more-btn:hover {
    color: var(--theme-accent-dark, #005a87);
    text-decoration: underline;
}

/* Wikipedia Elements Styling */
.author-biography h2,
.author-biography h3,
.author-biography h4 {
    font-family: var(--font-heading);
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--theme-text, #333);
    line-height: 1.3;
}

.author-biography h2 {
    font-size: 1.75rem;
    border-bottom: 2px solid var(--theme-border, #e0e0e0);
    padding-bottom: 0.5rem;
}

.author-biography h3 {
    font-size: 1.5rem;
}

.author-biography h4 {
    font-size: 1.25rem;
}

/* Wikipedia Lists */
.author-biography ul,
.author-biography ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.author-biography li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* Wikipedia Blockquotes */
.author-biography blockquote {
    padding: 1.5rem;
    margin: 2rem 0;
    background: var(--theme-bg-alt, #f5f5f5);
    border-left: 4px solid var(--theme-accent, #0073aa);
    border-radius: var(--border-radius, 4px);
    font-style: italic;
    color: var(--theme-text-secondary, #666);
}

.author-biography blockquote p:last-child {
    margin-bottom: 0;
}

/* Wikipedia Captions and Small Text */
.author-biography .caption,
.author-biography .thumbcaption,
.author-biography .mw-caption-text,
.author-biography small {
    color: var(--theme-text-muted, #888);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    display: block;
    line-height: 1.5;
}

/* Wikipedia Tables */
.author-biography table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    border: 1px solid var(--theme-border, #e0e0e0);
    border-radius: var(--border-radius, 4px);
    overflow: hidden;
}

.author-biography th,
.author-biography td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--theme-border, #e0e0e0);
}

.author-biography th {
    background: var(--theme-bg-alt, #f5f5f5);
    font-weight: 600;
    color: var(--theme-text, #333);
}

.author-biography tr:last-child td {
    border-bottom: none;
}

/* Hide Wikipedia pollution elements */
.author-biography .mw-parser-output .avviso,
.author-biography .mw-parser-output .mbox,
.author-biography .avviso,
.author-biography .mbox,
.author-biography .mbox-text-div,
.author-biography .mbox-image,
.author-biography .hide-when-compact,
.author-biography .navbox,
.author-biography .hatnote {
    display: none !important;
}

/* Clean up any stray formatting from Wikipedia */
.author-biography p:first-child {
    font-size: inherit !important;
}

/* Author Topics */
.author-topics {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--theme-border, #e0e0e0);
}

.author-topics h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--theme-text, #333);
}

.author-topics p {
    color: var(--theme-text-secondary, #666);
    line-height: 1.7;
}

/* Author Works Section */
.author-works {
    margin-top: 4rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--theme-border, #e0e0e0);
    color: var(--theme-text, #333);
}

/* Works Sections */
.works-section {
    margin-bottom: 3rem;
}

.works-section h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--theme-text, #333);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--theme-bg-elevated, #fff);
    border: 1px solid var(--theme-border, #e0e0e0);
    border-radius: var(--border-radius, 8px);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-color: var(--theme-accent, #0073aa);
}

.product-card a {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1rem;
}

.product-card h4 {
    font-size: 1rem;
    margin: 0.75rem 0 0.5rem;
    line-height: 1.4;
    color: var(--theme-text, #333);
}

.product-price {
    font-weight: 600;
    color: var(--theme-accent, #0073aa);
    margin-top: 0.5rem;
}

.event-date,
.course-mode {
    font-size: 0.85em;
    color: var(--theme-text-muted, #666);
    margin-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .author-header > div {
        grid-template-columns: 250px 1fr;
        gap: 2rem;
    }
    
    .author-sidebar h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .author-header > div {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .author-sidebar {
        max-width: 400px;
        margin: 0 auto;
        position: static;
    }
    
    .author-sidebar h1 {
        font-size: 1.75rem;
        text-align: center;
    }
    
    .author-content {
        padding: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .single-author-page {
        padding: 1rem 0;
    }
    
    .author-biography {
        font-size: 1rem;
    }
    
    .author-biography ul,
    .author-biography ol {
        margin-left: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
}


/* wiki elements */

.itwiki-template-citazione {
    background: var(--theme-bg-alt);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;

}

figcaption{
    font-size: 0.875rem;
    color: var(--theme-text-muted);
    margin: 0.5rem 0 1rem 0;
    font-style: italic;
}

.itwiki-template-citazione {
    margin: 2rem 0;
}

.itwiki-template-citazione-doppia {
    display: flex;
    gap: 1rem;
}

.itwiki-template-citazione-doppia p {
    margin-bottom: 0;
}

.itwiki-template-citazione-doppia .itwiki-template-citazione {
    flex: 1;
}

.itwiki-template-citazione-doppia .itwiki-template-citazione:last-child {
    text-align: right;
}

.itwiki-template-citazione-footer {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
    margin-top: 1rem;
    font-style: italic;
}

/* Offcanvas Styling */
.biography-offcanvas {
    font-family: var(--font-body, inherit);
}

.biography-offcanvas .biography-full-content {
    line-height: 1.8;
    font-size: 1rem;
    color: var(--theme-text, #333);
}

.biography-offcanvas .biography-full-content p {
    margin-bottom: 1.5rem;
}

.biography-offcanvas .biography-full-content p:last-child {
    margin-bottom: 0;
}

.biography-offcanvas .biography-full-content h2,
.biography-offcanvas .biography-full-content h3,
.biography-offcanvas .biography-full-content h4 {
    font-family: var(--font-heading);
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--theme-text, #333);
}

.biography-offcanvas .biography-full-content ul,
.biography-offcanvas .biography-full-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.biography-offcanvas .biography-full-content li {
    margin-bottom: 0.5rem;
}

.biography-offcanvas .biography-full-content blockquote {
    padding: 1.5rem;
    margin: 2rem 0;
    background: var(--theme-bg-alt, #f5f5f5);
    border-left: 4px solid var(--theme-accent, #0073aa);
    border-radius: var(--border-radius, 4px);
    font-style: italic;
}

/* Related Authors Styling */
.author-meta p strong {
    display: block;
    color: var(--theme-text, #333);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.author-meta a {
    color: var(--theme-accent, #0073aa);
    text-decoration: none;
    transition: color 0.2s ease;
}

.author-meta a:hover {
    color: var(--theme-accent-dark, #005a87);
    text-decoration: underline;
}

/* Responsive Offcanvas */
@media (max-width: 768px) {
    .biography-offcanvas {
        width: 100% !important;
        right: -100% !important;
    }
    
    .biography-offcanvas[style*="right: 0"] {
        right: 0 !important;
    }
}



/* Additional CSS fixes for Single Author Biography */

/* Ensure biography section has proper heading */
.author-biography h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 0;
    color: var(--theme-text, #333);
}

/* Biography excerpt styling */
.author-biography .biography-excerpt {
    line-height: 1.8;
    font-size: 1.05rem;
    color: var(--theme-text);
    margin-bottom: 1rem;
}

.author-biography .biography-excerpt p {
    margin-bottom: 1.5rem;
}

.author-biography .biography-excerpt p:last-child {
    margin-bottom: 0;
}

/* Read more button wrapper */
.author-biography .read-more-wrapper {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.author-biography .read-more-btn {
    background: none;
    border: none;
    color: var(--theme-accent, #0073aa);
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
    padding: 0;
    font-weight: 600;
    transition: color 0.2s ease;
}

.author-biography .read-more-btn:hover {
    color: var(--theme-accent-dark, #005a87);
}

/* Section title styling */
.author-works .section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 2rem;
    margin-top: 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--theme-border, #e0e0e0);
    color: var(--theme-text, #333);
}

/* Works section h4 styling */
.works-section h4 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    margin-top: 0;
    color: var(--theme-text, #333);
}

/* Product card h5 styling */
.product-card h5 {
    font-size: 1rem;
    margin: 0.75rem 0 0.5rem;
    line-height: 1.4;
    color: var(--theme-text, #333);
    font-weight: 600;
}