/* ==========================================
   PROSTO24 NEWS WIDGET STYLES
   Supports automatic theme switching via parent `.dark-theme` class
   ========================================== */

/* 1. DEFAULT LIGHT THEME STYLES */
.p24-widget-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 18px;
    margin: 15px 0;
    color: #1e293b;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.06);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.p24-widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 12px;
    transition: border-color 0.3s ease;
}
.p24-widget-icon-svg {
    width: 22px;
    height: 22px;
    color: #3b82f6; /* Accent blue */
    flex-shrink: 0;
    transition: filter 0.3s ease;
}
.p24-widget-title {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.3px;
    color: #1e293b;
    transition: color 0.3s ease;
}
.p24-news-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.p24-news-item {
    display: flex;
    gap: 14px;
    text-decoration: none;
    color: #334155;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, color 0.2s ease;
    padding: 8px;
    border-radius: 8px;
}
.p24-news-item:hover {
    transform: translateX(6px);
    background: rgba(0, 0, 0, 0.03);
    color: #0f172a;
}
.p24-news-thumb {
    width: 88px;
    height: 54px;
    border-radius: 6px;
    object-fit: cover;
    background: #e2e8f0;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: background-color 0.3s ease;
}
.p24-news-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}
.p24-news-item-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.p24-news-meta {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 500;
    transition: color 0.2s ease;
}
.p24-news-item:hover .p24-news-meta {
    color: #1e293b;
}
.p24-loader {
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    padding: 15px 0;
}


/* 2. AUTOMATIC DARK THEME (TRIGGERS WHEN PARENT HTML/BODY HAS `.dark-theme`) */
.dark-theme .p24-widget-container {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}
.dark-theme .p24-widget-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.dark-theme .p24-widget-icon-svg {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}
.dark-theme .p24-widget-title {
    color: #ffffff;
}
.dark-theme .p24-news-item {
    color: #f1f5f9;
}
.dark-theme .p24-news-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}
.dark-theme .p24-news-thumb {
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.dark-theme .p24-news-meta {
    color: #cbd5e1;
}
.dark-theme .p24-news-item:hover .p24-news-meta {
    color: #ffffff;
}


/* 3. EXPLICIT OVERRIDES (IF THEME IS MANUALLY SPECIFIED VIA SCRIPT PARAMS) */

/* Explicit Light Theme */
.p24-widget-container.p24-theme-light {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    color: #1e293b !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.06) !important;
}
.p24-theme-light .p24-widget-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}
.p24-theme-light .p24-widget-icon-svg {
    filter: none !important;
}
.p24-theme-light .p24-widget-title {
    color: #1e293b !important;
}
.p24-theme-light .p24-news-item {
    color: #334155 !important;
}
.p24-theme-light .p24-news-item:hover {
    background: rgba(0, 0, 0, 0.03) !important;
    color: #0f172a !important;
}
.p24-theme-light .p24-news-meta {
    color: #64748b !important;
}
.p24-theme-light .p24-news-item:hover .p24-news-meta {
    color: #1e293b !important;
}

/* Explicit Dark Theme */
.p24-widget-container.p24-theme-dark {
    background: rgba(30, 41, 59, 0.7) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15) !important;
}
.p24-theme-dark .p24-widget-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.p24-theme-dark .p24-widget-icon-svg {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5)) !important;
}
.p24-theme-dark .p24-widget-title {
    color: #ffffff !important;
}
.p24-theme-dark .p24-news-item {
    color: #f1f5f9 !important;
}
.p24-theme-dark .p24-news-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}
.p24-theme-dark .p24-news-meta {
    color: #cbd5e1 !important;
}
.p24-theme-dark .p24-news-item:hover .p24-news-meta {
    color: #ffffff !important;
}
