/* WPE Author Block - Simple Frontend Styles */

/* Base Block Styles */
.wp-block-wpe-author-block {
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    --wpe-vertical-gap: 8px;
}

/* Author Content */
.wpe-author-link,
.wpe-author-content {
    color: inherit;
    text-decoration: none;
    display: inline;
    transition: opacity 0.2s ease;
}

.wpe-author-link:hover {
    opacity: 0.8;
    text-decoration: none;
}

.wpe-author-link:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Author Photo */
.wpe-author-photo {
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
}

.wpe-author-photo-placeholder {
    display: inline-block;
    background: #f0f0f0;
    border-radius: 50%;
    text-align: center;
    color: #999;
    vertical-align: middle;
}

/* Image Size Classes */
.wpe-size-thumbnail {
    width: 24px;
    height: 24px;
    line-height: 24px;
    font-size: 12px;
}

.wpe-size-small {
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 14px;
}

.wpe-size-medium {
    width: 48px;
    height: 48px;
    line-height: 48px;
    font-size: 18px;
}

.wpe-size-large {
    width: 64px;
    height: 64px;
    line-height: 64px;
    font-size: 22px;
}

.wpe-size-extra-large {
    width: 96px;
    height: 96px;
    line-height: 96px;
    font-size: 32px;
}

.wpe-size-custom {
    /* Size will be set via inline styles */
}

/* Bio Content */
.wpe-type-bio .wpe-author-content,
.wpe-type-bio .wpe-author-link {
    display: block;
    margin-top: 0.5em;
}

.wpe-type-bio p {
    margin: 0 0 0.5em 0;
}

.wpe-type-bio p:last-child {
    margin-bottom: 0;
}

/* Multiple Authors */
.wpe-multiple-authors .wpe-author-link,
.wpe-multiple-authors .wpe-author-content {
    display: inline;
}

.wpe-multiple-authors.wpe-layout-vertical .wpe-author-link,
.wpe-multiple-authors.wpe-layout-vertical .wpe-author-content {
    display: block;
}

/* Text Alignment */
.wp-block-wpe-author-block[style*="text-align: center"] {
    text-align: center;
}

.wp-block-wpe-author-block[style*="text-align: right"] {
    text-align: right;
}

/* Typography Support Classes */
.wp-block-wpe-author-block.has-small-font-size {
    font-size: var(--wp--preset--font-size--small);
}

.wp-block-wpe-author-block.has-medium-font-size {
    font-size: var(--wp--preset--font-size--medium);
}

.wp-block-wpe-author-block.has-large-font-size {
    font-size: var(--wp--preset--font-size--large);
}

.wp-block-wpe-author-block.has-x-large-font-size {
    font-size: var(--wp--preset--font-size--x-large);
}

/* Font Family Support */
.wp-block-wpe-author-block[class*="has-"][class*="font-family"] {
    font-family: var(--wp--preset--font-family--system-font);
}

/* Display Mode Visual Indicators (Optional) */
.wpe-mode-current-post {
    position: relative;
}

.wpe-mode-archive-author {
    position: relative;
}

.wpe-mode-specific-author {
    position: relative;
}

/* No Author Message */
.wpe-no-author {
    color: #666;
    font-style: italic;
    padding: 0.5em;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    text-align: center;
    margin: 1em 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wpe-type-bio .wpe-author-content,
    .wpe-type-bio .wpe-author-link {
        font-size: 0.9em;
    }
    
    /* Responsive image sizing */
    .wpe-size-large,
    .wpe-size-extra-large {
        width: 48px !important;
        height: 48px !important;
        line-height: 48px !important;
        font-size: 18px !important;
    }
    
    .wpe-size-custom {
        max-width: 48px !important;
        max-height: 48px !important;
    }
    
    /* Convert horizontal to vertical on mobile if multiple authors */
    .wpe-multiple-authors.wpe-layout-horizontal .wpe-author-link,
    .wpe-multiple-authors.wpe-layout-horizontal .wpe-author-content {
        display: block;
        margin-bottom: 4px;
    }
    
    .wpe-multiple-authors.wpe-layout-horizontal .wpe-author-link:last-child,
    .wpe-multiple-authors.wpe-layout-horizontal .wpe-author-content:last-child {
        margin-bottom: 0;
    }
}

/* Print Styles */
@media print {
    .wp-block-wpe-author-block {
        break-inside: avoid;
    }
    
    .wpe-author-link {
        color: #000 !important;
        text-decoration: none !important;
    }
    
    .wpe-author-photo {
        filter: grayscale(100%);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .wpe-author-link:focus {
        outline: 3px solid;
        outline-offset: 2px;
    }
    
    .wpe-author-photo-placeholder {
        background: #000;
        color: #fff;
    }
    
    .wpe-no-author {
        border: 2px solid #000;
        background: #fff;
        color: #000;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wpe-author-photo-placeholder {
        background: #444;
        color: #ccc;
    }
    
    .wpe-no-author {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.7);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .wpe-author-link {
        transition: none;
    }
}

/* RTL Support */
[dir="rtl"] .wp-block-wpe-author-block {
    text-align: right;
}

[dir="rtl"] .wp-block-wpe-author-block[style*="text-align: left"] {
    text-align: left;
}

/* WordPress Global Styles Integration */
.wp-block-wpe-author-block {
    font-family: var(--wp--style--typography--font-family, inherit);
    font-size: var(--wp--style--typography--font-size, inherit);
    line-height: var(--wp--style--typography--line-height, inherit);
}

/* Block Gap Support */
.wp-block-wpe-author-block[style*="--wp--style--block-gap"] {
    gap: var(--wp--style--block-gap);
}

/* Ensure proper inheritance for nested elements */
.wp-block-wpe-author-block * {
    font-family: inherit;
    color: inherit;
}

/* Custom Properties for Theme Integration */
.wp-block-wpe-author-block {
    --wpe-author-link-hover-opacity: 0.8;
    --wpe-author-photo-border-radius: 50%;
}

/* Link styling with custom properties */
.wpe-author-link:hover {
    opacity: var(--wpe-author-link-hover-opacity);
}

/* Photo styling with custom properties */
.wpe-author-photo,
.wpe-author-photo-placeholder {
    border-radius: var(--wpe-author-photo-border-radius);
}