/* ═══════════════════════════════════════════════════════════════════════════
   RSS Content Aggregator — Frontend Styles
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Feed display shortcode ──────────────────────────────────────────────── */
.rca-feed-display { margin: 0; padding: 0; }
.rca-feed-display * { box-sizing: border-box; }
.rca-empty { color: #9ca3af; font-style: italic; }

/* ── Item shared ─────────────────────────────────────────────────────────── */
.rca-item {
    display: flex;
    gap: 18px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}
.rca-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.rca-item-thumbnail { flex: 0 0 130px; }
.rca-item-thumbnail a { display: block; overflow: hidden; border-radius: 8px; }
.rca-item-thumbnail img {
    width: 100%; height: 88px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    transition: transform .2s;
}
.rca-item-thumbnail a:hover img { transform: scale(1.04); }
.rca-item-body { flex: 1; min-width: 0; }

.rca-item-title {
    margin: 0 0 7px;
    font-size: 1em;
    font-weight: 700;
    line-height: 1.35;
}
.rca-item-title a { text-decoration: none; color: inherit; }
.rca-item-title a:hover { color: #2563eb; }

.rca-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    font-size: .75em;
    color: #9ca3af;
    align-items: center;
}
.rca-meta-date   { }
.rca-meta-author { }
.rca-meta-source {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    color: #4b5563;
    font-size: .9em;
}
.rca-item-excerpt {
    margin: 0;
    font-size: .875em;
    color: #6b7280;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Layout: grid ─────────────────────────────────────────────────────────── */
.rca-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.rca-layout-grid .rca-item {
    flex-direction: column;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0;
    padding-bottom: 0;
    background: #fff;
    transition: box-shadow .2s, transform .15s;
}
.rca-layout-grid .rca-item:hover { box-shadow: 0 8px 24px rgba(0,0,0,.10); transform: translateY(-3px); }
.rca-layout-grid .rca-item-thumbnail { flex: none; }
.rca-layout-grid .rca-item-thumbnail a { border-radius: 0; }
.rca-layout-grid .rca-item-thumbnail img { width: 100%; height: 170px; border-radius: 0; }
.rca-layout-grid .rca-item-body { padding: 14px 16px 18px; }

/* ── Layout: cards ────────────────────────────────────────────────────────── */
.rca-layout-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 22px;
}
.rca-layout-cards .rca-item {
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    overflow: hidden;
    margin-bottom: 0;
    padding-bottom: 0;
    transition: box-shadow .2s, transform .15s;
}
.rca-layout-cards .rca-item:hover { box-shadow: 0 10px 30px rgba(0,0,0,.13); transform: translateY(-4px); }
.rca-layout-cards .rca-item-thumbnail { flex: none; }
.rca-layout-cards .rca-item-thumbnail a { border-radius: 0; }
.rca-layout-cards .rca-item-thumbnail img { width: 100%; height: 195px; border-radius: 0; }
.rca-layout-cards .rca-item-body { padding: 16px 18px 20px; }
.rca-layout-cards .rca-item-title { font-size: 1.05em; }

/* ── Layout: magazine ─────────────────────────────────────────────────────── */
.rca-layout-magazine {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
}
.rca-layout-magazine .rca-item:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 28px;
    padding-bottom: 28px;
    border-bottom: 2px solid #e5e7eb;
}
.rca-layout-magazine .rca-item:first-child .rca-item-thumbnail { flex: 0 0 44%; }
.rca-layout-magazine .rca-item:first-child .rca-item-thumbnail img { height: 280px; width: 100%; }
.rca-layout-magazine .rca-item:first-child .rca-item-title { font-size: 1.4em; line-height: 1.25; margin-bottom: 10px; }
.rca-layout-magazine .rca-item:first-child .rca-item-excerpt { -webkit-line-clamp: 5; font-size: .9em; }
.rca-layout-magazine .rca-item:not(:first-child) { flex-direction: column; gap: 8px; padding-bottom: 18px; border-bottom: 1px solid #f0f0f0; }
.rca-layout-magazine .rca-item:not(:first-child) .rca-item-thumbnail img { height: 120px; width: 100%; }

/* ═══════════════════════════════════════════════════════════════════════════
   Imported Post Styles (Feed to Post content rendered in single posts)
   ══════════════════════════════════════════════════════════════════════════ */

/* Wrapper for all imported content */
.rca-imported-content {
    line-height: 1.72;
    font-size: 1.02em;
    color: inherit;
}

/* Clean up any inline styles that interfere with theme */
.rca-imported-content * { max-width: 100%; }

/* Images inside imported content */
.rca-imported-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1.2em auto;
}

/* Figures */
.rca-imported-content figure { margin: 1.5em 0; text-align: center; }
.rca-imported-content figcaption {
    font-size: .82em;
    color: #9ca3af;
    margin-top: 6px;
    font-style: italic;
}

/* Headings inside imported body */
.rca-imported-content h2,
.rca-imported-content h3,
.rca-imported-content h4 { margin: 1.4em 0 .5em; line-height: 1.3; }

/* Links */
.rca-imported-content a { color: #2563eb; }
.rca-imported-content a:hover { text-decoration: underline; }

/* Blockquotes */
.rca-imported-content blockquote {
    border-left: 4px solid #bfdbfe;
    margin: 1.5em 0;
    padding: .8em 1.2em;
    background: #f8faff;
    border-radius: 0 6px 6px 0;
    color: #374151;
    font-style: italic;
}

/* Code blocks */
.rca-imported-content pre,
.rca-imported-content code {
    background: #f3f4f6;
    border-radius: 4px;
    font-size: .88em;
}
.rca-imported-content pre  { padding: 1em 1.2em; overflow-x: auto; }
.rca-imported-content code { padding: 2px 5px; }

/* ── Attribution footer ──────────────────────────────────────────────────── */
.rca-source-attribution {
    margin-top: 2em;
    padding: 14px 18px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: .82em;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rca-source-attribution::before {
    content: '🔗';
    font-style: normal;
    flex-shrink: 0;
}
.rca-source-attribution a { color: #2563eb; font-weight: 600; text-decoration: none; }
.rca-source-attribution a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .rca-item { flex-direction: column; gap: 12px; }
    .rca-item-thumbnail { flex: none; }
    .rca-item-thumbnail img { height: 200px; }
    .rca-layout-magazine { grid-template-columns: 1fr; }
    .rca-layout-magazine .rca-item:first-child { flex-direction: column; }
    .rca-layout-magazine .rca-item:first-child .rca-item-thumbnail { flex: none; }
}
