/* OnePalestine API Plugin Styles */
:root {
    --op-primary: #ce1126;
    --op-secondary: #007a3d;
    --op-black: #000000;
    --op-white: #ffffff;
    --op-text-dark: #1a1a1a;
    --op-text-medium: #4a4a4a;
    --op-text-light: #6b7280;
    --op-bg-primary: #ffffff;
    --op-bg-secondary: #f8fafc;
    --op-border-light: #e2e8f0;
    --op-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --op-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --op-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --op-border-radius: 12px;
}

/* Global Plugin Styles */
.onepalestine-articles-shortcode,
.onepalestine-single-article-shortcode {
    margin: 2rem 0;
}

.onepalestine-articles-shortcode .articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* API Article Cards */
.api-article-card {
    background: var(--op-bg-primary);
    border-radius: var(--op-border-radius);
    overflow: hidden;
    transition: var(--op-transition);
    border: 1px solid var(--op-border-light);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--op-secondary);
}

.api-article-card:hover {
    box-shadow: var(--op-shadow-lg);
    transform: translateY(-4px);
}

.api-article-card .article-content {
    padding: 1.5rem;
}

.api-article-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--op-secondary), var(--op-primary));
    color: var(--op-white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 1rem;
}

.api-article-card .article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--op-text-light);
    flex-wrap: wrap;
}

.api-article-card .article-date {
    font-weight: 500;
}

.api-article-card .article-id {
    background: rgba(0, 122, 61, 0.1);
    color: var(--op-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: monospace;
}

.api-article-card .article-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    font-weight: 700;
}

.api-article-card .article-title a {
    color: var(--op-text-dark);
    text-decoration: none;
    transition: var(--op-transition);
}

.api-article-card .article-title a:hover {
    color: var(--op-primary);
}

.api-article-card .article-secondary-title {
    color: var(--op-text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--op-bg-secondary);
    border-left: 3px solid var(--op-secondary);
    border-radius: 4px;
}

.api-article-card .article-secondary-title strong {
    color: var(--op-text-medium);
}

/* Widget secondary title styles */
.onepalestine-widget-original-title {
    font-size: 0.8rem;
    color: var(--op-text-light);
    font-style: italic;
    display: block;
    margin-top: 0.25rem;
}

/* Shortcode secondary title styles */
.onepalestine-article-secondary-title {
    color: var(--op-text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--op-bg-secondary);
    border-left: 3px solid var(--op-secondary);
    border-radius: 4px;
}

.onepalestine-article-secondary-title strong {
    color: var(--op-text-medium);
}

/* Recent articles list secondary titles */
.onepalestine-article-secondary {
    font-size: 0.8rem;
    color: var(--op-text-light);
    font-style: italic;
}

.api-article-card .article-excerpt {
    color: var(--op-text-medium);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.api-article-card .article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--op-border-light);
    gap: 1rem;
    flex-wrap: wrap;
}

.api-article-card .article-id-full {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--op-text-light);
    background: var(--op-bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--op-border-light);
    cursor: help;
    white-space: nowrap;
}

.api-article-card .read-more {
    color: var(--op-primary);
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--op-transition);
    font-size: 0.9rem;
}

.api-article-card .read-more:hover {
    color: var(--op-secondary);
    transform: translateX(4px);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--op-border-light);
    border-radius: 50%;
    border-top-color: var(--op-primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-placeholder {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--op-bg-secondary);
    border-radius: var(--op-border-radius);
    border: 1px solid var(--op-border-light);
    color: var(--op-text-light);
}

.loading-placeholder p {
    margin-top: 1rem;
    font-size: 1rem;
}

/* Error Messages */
.error-message {
    background: #fef2f2;
    color: #991b1b;
    padding: 1rem;
    border-radius: var(--op-border-radius);
    border: 1px solid #fecaca;
    text-align: center;
    margin: 1rem 0;
}

.api-notice {
    background: #f0f9ff;
    color: #0c4a6e;
    padding: 2rem;
    border-radius: var(--op-border-radius);
    border: 1px solid #bae6fd;
    text-align: center;
    margin: 1rem 0;
}

.api-notice h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: #0c4a6e;
}

/* No Articles Found */
.no-articles-found {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--op-bg-secondary);
    border-radius: var(--op-border-radius);
    border: 1px solid var(--op-border-light);
    color: var(--op-text-medium);
}

.no-articles-found h3 {
    margin-bottom: 1rem;
    color: var(--op-text-dark);
}

.no-articles-found p {
    margin-bottom: 2rem;
    color: var(--op-text-light);
}

.no-articles-found .search-again-btn {
    background: var(--op-primary);
    color: var(--op-white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--op-border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--op-transition);
    text-decoration: none;
    display: inline-block;
}

.no-articles-found .search-again-btn:hover {
    background: var(--op-secondary);
    transform: translateY(-2px);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .onepalestine-articles-shortcode .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .api-article-card .article-content {
        padding: 1rem;
    }
    
    .api-article-card .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .loading-placeholder {
        padding: 2rem 1rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .api-article-card {
        border: 2px solid var(--op-text-dark);
    }
    
    .api-article-badge {
        background: var(--op-text-dark);
        color: var(--op-white);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .api-article-card:hover {
        transform: none;
    }
    
    .read-more:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .loading-placeholder,
    .error-message,
    .api-notice,
    .load-more-wrapper {
        display: none;
    }
    
    .api-article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
    
    .read-more {
        display: none;
    }
}

/* Dark Mode Support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    :root {
        --op-bg-primary: #1f2937;
        --op-bg-secondary: #111827;
        --op-text-dark: #f9fafb;
        --op-text-medium: #d1d5db;
        --op-text-light: #9ca3af;
        --op-border-light: #374151;
    }
    
    .error-message {
        background: #7f1d1d;
        color: #fef2f2;
        border-color: #991b1b;
    }
    
    .api-notice {
        background: #1e3a8a;
        color: #dbeafe;
        border-color: #3b82f6;
    }
}

/* Focus Styles for Accessibility */
.api-article-card a:focus,
.read-more:focus,
button:focus {
    outline: 2px solid var(--op-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Skip to Content for Screen Readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:active,
.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--op-primary);
    color: var(--op-white);
    text-decoration: none;
    border-radius: 4px;
}
