/**
 * AutoFeatured Pro - Frontend Attribution Styles
 * File: assets/css/frontend.css
 * 
 * CRITICAL: Required for Unsplash API compliance
 */

/* Attribution wrapper */
.autofeatured-attribution {
    margin: 0 0 2em 0;
}

.autofeatured-attribution img {
    margin-bottom: 0;
}

/* Attribution caption styling */
.autofeatured-caption {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #666;
    margin-top: 0.75em;
    padding: 0.5em 0;
    font-style: italic;
    text-align: left;
    display: flex;    
    column-gap: 0.4rem;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Prevent awkward line breaks */
.autofeatured-caption a {
    white-space: nowrap;
}

/* Attribution links */
.autofeatured-caption a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.autofeatured-caption a:hover {
    text-decoration: underline;
    color: #135e96;
}

/* Twenty Twenty-Five theme specific adjustments */
.wp-block-post-featured-image.autofeatured-attribution {
    margin-bottom: 2em;
}

.wp-block-post-featured-image .autofeatured-caption {
    margin-top: 0.5em;
}

/* Ensure proper spacing in block editor contexts */
.entry-content .autofeatured-attribution {
    margin-bottom: var(--wp--preset--spacing--50, 2em);
}

/* Handle different image alignment scenarios */
.alignwide.autofeatured-attribution,
.alignfull.autofeatured-attribution {
    margin-bottom: 2em;
}

.alignwide .autofeatured-caption,
.alignfull .autofeatured-caption {
    max-width: var(--wp--style--global--content-size, 650px);
    margin-left: auto;
    margin-right: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .autofeatured-caption {
        font-size: 0.8125rem;
        padding: 0.4em 0;
        margin-top: 0.5em;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .autofeatured-caption {
        color: #a0a0a0;
    }
    
    .autofeatured-caption a {
        color: #6ba3e8;
    }
    
    .autofeatured-caption a:hover {
        color: #8bb8ed;
    }
}

/* Accessibility improvements */
.autofeatured-caption:focus-within {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .autofeatured-caption {
        color: #000;
        font-size: 10pt;
    }
    
    .autofeatured-caption a {
        color: #000;
        text-decoration: underline;
    }
    
    /* Show URLs in print */
    .autofeatured-caption a::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        font-style: normal;
    }
}