/**
 * RSS Category Mapper - Frontend Styles
 * Styles for displaying imported RSS content on the frontend
 * 
 * @package RSS_Category_Mapper
 * @version 1.1.0
 */

/* ============================================
   AUTHOR BYLINE STYLES
   ============================================ */

.rss-author-byline {
    font-style: italic;
    color: #555555;
    margin-bottom: 1.5em;
    font-size: 0.95em;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 0.5em;
}

.rss-author-byline strong {
    font-weight: 600;
    font-style: normal;
}

.rss-author-byline .rss-publisher-name {
    display: block;
    font-size: 0.9em;
    color: #666;
    font-style: normal;
    font-weight: normal;
    margin-top: 0.2em;
}

/* Source Info Box (optional - if using source info filter) */
.rss-cat-mapper-source-info {
    background: #f9f9f9;
    border-left: 4px solid #ddd;
    margin: 20px 0;
    padding: 10px 15px;
    font-size: 0.9em;
    color: #666;
}

.rss-cat-mapper-source-info .rss-source {
    margin: 0;
}

/* ============================================
   CAPITOL NEWS ILLINOIS - SUMMARY BOX STYLES
   ============================================ */

/* Primary summary box - gray theme */
.summary-box-gray {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 1.5em 0;
    padding: 1em 1.25em;
}

.summary-box-gray h4 {
    margin: 0 0 0.75em 0;
    padding: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    border-bottom: none;
    line-height: 1.3;
}

.summary-box-gray h4 strong {
    font-weight: 600;
}

.summary-box-gray ul {
    margin: 0 0 0.75em 0;
    padding-left: 1.25em;
    list-style-type: disc;
}

.summary-box-gray ul li {
    margin-bottom: 0.5em;
    line-height: 1.5;
    color: #333;
}

.summary-box-gray ul li:last-child {
    margin-bottom: 0;
}

/* Attribution line at bottom of summary */
.summary-box-gray > p:last-child {
    margin-bottom: 0;
    margin-top: 0.75em;
    font-style: italic;
    font-size: 0.85em;
    color: #666;
    border-top: 1px dotted #ccc;
    padding-top: 0.75em;
}

.summary-box-gray > p:last-child em {
    font-style: italic;
}

/* Alternative summary box color themes */
.summary-box-blue {
    background: #e8f4fc;
    border-color: #1e73be;
}

.summary-box-blue h4 {
    color: #1e73be;
}

.summary-box-green {
    background: #e8f8e8;
    border-color: #2e7d32;
}

.summary-box-green h4 {
    color: #2e7d32;
}

.summary-box-yellow {
    background: #fff8e1;
    border-color: #f9a825;
}

.summary-box-red {
    background: #ffebee;
    border-color: #c62828;
}

/* ============================================
   ARTICLE CONTENT ENHANCEMENTS
   ============================================ */

/* Figure and caption styling */
.entry-content figure,
.post-content figure,
.rss-imported-content figure {
    margin: 1.5em 0;
    max-width: 100%;
}

.entry-content figure img,
.post-content figure img,
.rss-imported-content figure img {
    display: block;
    max-width: 100%;
    height: auto;
}

.entry-content figcaption,
.post-content figcaption,
.rss-imported-content figcaption {
    font-size: 0.875em;
    color: #666;
    font-style: italic;
    margin-top: 0.5em;
    line-height: 1.4;
}

/* Responsive images from RSS feeds */
.entry-content img.imported-image,
.post-content img.imported-image,
.rss-imported-content img {
    max-width: 100%;
    height: auto;
}

/* "Read more" style links */
.entry-content p > strong:first-child > a,
.post-content p > strong:first-child > a {
    color: inherit;
}

/* External link indicator (optional) */
.rss-imported-content a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.75em;
    vertical-align: super;
    opacity: 0.7;
}

/* Blockquote styling */
.entry-content blockquote,
.post-content blockquote,
.rss-imported-content blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    border-left: 4px solid #ccc;
    background: #f9f9f9;
    font-style: italic;
}

.entry-content blockquote p:last-child,
.post-content blockquote p:last-child,
.rss-imported-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ============================================
   DATA VISUALIZATION EMBEDS
   ============================================ */

/* Flourish chart embeds */
.flourish-embed {
    margin: 1.5em 0;
    max-width: 100%;
}

.flourish-embed img,
.flourish-embed noscript img {
    max-width: 100%;
    height: auto;
}

/* Link to open interactive chart */
.entry-content a[href*="flourish.studio"],
.post-content a[href*="flourish.studio"] {
    display: inline-block;
    margin-bottom: 0.5em;
    font-size: 0.85em;
    color: #666;
}

.entry-content a[href*="flourish.studio"]::before,
.post-content a[href*="flourish.studio"]::before {
    content: "📊 ";
}

/* ============================================
   AUDIO/VIDEO EMBEDS
   ============================================ */

/* BeyondWords audio player */
[data-beyondwords-player="true"] {
    margin: 1em 0;
}

/* Generic iframe embeds */
.entry-content iframe,
.post-content iframe,
.rss-imported-content iframe {
    max-width: 100%;
    margin: 1em 0;
}

/* ============================================
   HORIZONTAL RULES / DIVIDERS
   ============================================ */

.entry-content hr,
.post-content hr,
.rss-imported-content hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 2em 0;
}

/* ============================================
   TABLE STYLES (for data tables in articles)
   ============================================ */

.entry-content table,
.post-content table,
.rss-imported-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95em;
}

.entry-content table th,
.post-content table th,
.rss-imported-content table th {
    background: #f5f5f5;
    font-weight: 600;
    text-align: left;
    padding: 0.75em;
    border: 1px solid #ddd;
}

.entry-content table td,
.post-content table td,
.rss-imported-content table td {
    padding: 0.75em;
    border: 1px solid #ddd;
    vertical-align: top;
}

.entry-content table tr:nth-child(even),
.post-content table tr:nth-child(even),
.rss-imported-content table tr:nth-child(even) {
    background: #fafafa;
}

/* ============================================
   SUPERSCRIPT / SUBSCRIPT (for footnotes, etc)
   ============================================ */

.entry-content sup,
.post-content sup,
.rss-imported-content sup {
    font-size: 0.75em;
    vertical-align: super;
    line-height: 0;
}

.entry-content sub,
.post-content sub,
.rss-imported-content sub {
    font-size: 0.75em;
    vertical-align: sub;
    line-height: 0;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media screen and (max-width: 768px) {
    .summary-box-gray {
        padding: 0.875em 1em;
        margin: 1em 0;
    }
    
    .summary-box-gray h4 {
        font-size: 1em;
    }
    
    .summary-box-gray ul {
        padding-left: 1em;
    }
    
    .summary-box-gray ul li {
        font-size: 0.95em;
    }
    
    .rss-author-byline {
        font-size: 0.9em;
    }
    
    .entry-content table,
    .post-content table,
    .rss-imported-content table {
        font-size: 0.85em;
    }
    
    .entry-content table th,
    .entry-content table td,
    .post-content table th,
    .post-content table td {
        padding: 0.5em;
    }
}

@media screen and (max-width: 480px) {
    .summary-box-gray {
        padding: 0.75em;
        border-radius: 0;
        margin-left: -15px;
        margin-right: -15px;
        border-left: none;
        border-right: none;
    }
    
    /* Make tables horizontally scrollable on small screens */
    .entry-content table,
    .post-content table,
    .rss-imported-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .summary-box-gray {
        background: #f5f5f5 !important;
        border: 1px solid #ccc !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        page-break-inside: avoid;
    }
    
    .rss-author-byline {
        border-bottom: 1px solid #ccc;
    }
    
    .flourish-embed,
    [data-beyondwords-player="true"],
    iframe {
        display: none !important;
    }
    
    /* Show URL for external links when printing */
    .entry-content a[href^="http"]::after,
    .post-content a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ============================================
   DARK MODE SUPPORT (optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .summary-box-gray {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .summary-box-gray h4,
    .summary-box-gray ul li {
        color: #e0e0e0;
    }
    
    .summary-box-gray > p:last-child {
        color: #999;
        border-top-color: #444;
    }
    
    .rss-author-byline {
        color: #bbb;
        border-bottom-color: #444;
    }
    
    .rss-author-byline .rss-publisher-name {
        color: #999;
    }
}
