/* ============================================================
   insights.css
   Styles for /insights/ listing page, /insights/article.php,
   and the admin editor preview pane.
   All colors use CSS custom properties — dark-mode safe.
   ============================================================ */

/* ── Shared layout wrapper ── */
.insights-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg) var(--space-3xl);
}

/* ── Page heading ── */
.insights-page-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-xs);
    line-height: 1.2;
}
.insights-page-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2xl);
}

/* ── Article card (listing page) ── */
.insights-article-card {
    padding: var(--space-xl) 0;
    border-bottom: 1px solid var(--color-border);
}
.insights-article-card:last-of-type {
    border-bottom: none;
}

.insights-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}
.insights-article-date {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.insights-article-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text-primary);
    text-decoration: none;
    line-height: 1.35;
    display: block;
    margin-bottom: var(--space-sm);
    transition: color var(--transition-fast);
}
.insights-article-title:hover {
    color: var(--color-frog-green);
}
.insights-article-excerpt {
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: var(--space-md);
}
.insights-read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-frog-green);
    text-decoration: none;
}
.insights-read-more:hover {
    text-decoration: underline;
}
.insights-read-more-arrow {
    font-size: 15px;
    line-height: 1;
}

/* ── Admin guardrail badges (listing page) ── */
.insights-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    line-height: 1.6;
}
.insights-badge-draft {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}
.insights-badge-scheduled {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}
[data-theme="dark"] .insights-badge-draft {
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
    border-color: rgba(251,191,36,0.3);
}
[data-theme="dark"] .insights-badge-scheduled {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border-color: rgba(59,130,246,0.3);
}

.insights-draft-note {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
    font-style: italic;
}

/* ── Pagination ── */
.insights-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: var(--space-2xl);
    flex-wrap: wrap;
}
.insights-pagination a,
.insights-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.insights-pagination a {
    background: var(--color-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}
.insights-pagination a:hover {
    background: var(--color-surface-hover);
    color: var(--color-frog-green);
}
.insights-pagination .pg-current {
    background: var(--color-frog-green);
    color: #fff;
    border: 1px solid transparent;
    font-weight: 600;
}
.insights-pagination .pg-ellipsis {
    color: var(--color-text-muted);
    border: none;
    background: none;
    cursor: default;
}

/* ── Empty state ── */
.insights-empty {
    padding: var(--space-3xl) 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
}

/* ── Single article page ── */
.insights-back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--color-text-muted);
    text-decoration: none;
    margin-bottom: var(--space-xl);
    transition: color var(--transition-fast);
}
.insights-back-link:hover {
    color: var(--color-text-primary);
}

.insights-article-header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--color-border);
}
.insights-article-header h1 {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm);
}
.insights-article-byline {
    font-size: 13px;
    color: var(--color-text-muted);
}
.insights-article-thumbnail {
    margin-bottom: var(--space-xl);
}
.insights-article-thumbnail img {
    display: block;
    width: 100%;
    max-width: 650px;
    max-height: 400px;
    margin-left: auto;
    margin-right: auto;
    height: auto;
    border-radius: var(--radius-lg);
}

/* ── Admin banner (article page) ── */
.insights-admin-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
    font-size: 13px;
    font-weight: 500;
}
.insights-admin-banner-draft {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}
.insights-admin-banner-scheduled {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1e40af;
}
[data-theme="dark"] .insights-admin-banner-draft {
    background: rgba(251,191,36,0.1);
    border-color: rgba(251,191,36,0.25);
    color: #fbbf24;
}
[data-theme="dark"] .insights-admin-banner-scheduled {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.25);
    color: #60a5fa;
}
.insights-admin-banner a {
    font-weight: 600;
    text-decoration: underline;
    color: inherit;
    white-space: nowrap;
}

/* ── Article body typography ── */
.insights-body {
    font-size: 15px;
    line-height: 1.8;
    color: var(--color-text-primary);
}
.insights-body > * + * {
    margin-top: 1.1em;
}
.insights-body h2 {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text-primary);
    margin-top: 2em;
    margin-bottom: 0.4em;
}
.insights-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-primary);
    margin-top: 1.75em;
    margin-bottom: 0.35em;
}
.insights-body p {
    margin-bottom: 0;
}
.insights-body a {
    color: var(--color-frog-green);
    text-decoration: underline;
}
.insights-body a:hover {
    color: var(--color-frog-green-dark);
}
.insights-body ul,
.insights-body ol {
    padding-left: 1.5em;
    margin-bottom: 0;
}
.insights-body li {
    margin-bottom: 0.3em;
}
.insights-body blockquote {
    border-left: 3px solid var(--color-frog-green);
    padding: 0.4em 0 0.4em 1.2em;
    margin-left: 0;
    color: var(--color-text-secondary);
    font-style: italic;
}
.insights-body strong { font-weight: 700; }
.insights-body em     { font-style: italic; }
.insights-body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--color-surface-hover);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
}
.insights-body pre {
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    overflow-x: auto;
    font-size: 13px;
}
.insights-body pre code {
    background: none;
    padding: 0;
}

/* ── Images in article body ── */
.insights-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.75em auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}
.insights-body figure {
    margin: 1.75em 0;
    text-align: center;
}
.insights-body figure img {
    margin: 0 auto 0.6em;
}
.insights-body figcaption {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* ── CTA buttons inside article body ── */
/* Uses existing .btn .btn-primary etc. from global.css — no overrides needed */
.insights-body .btn {
    margin: var(--space-xs) 0;
}

/* ── Bottom nav (back link repeated) ── */
.insights-article-footer {
    margin-top: var(--space-3xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border);
}

/* ── Disclaimer ── */
.insights-disclaimer {
    max-width: 720px;
    margin: var(--space-2xl) auto var(--space-2xl);
    padding: var(--space-lg) var(--space-xl);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-text-muted);
    border-radius: var(--radius-lg);
    font-size: 12px;
    line-height: 1.65;
    color: var(--color-text-muted);
}
.insights-disclaimer strong {
    color: var(--color-text-secondary);
    font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .insights-wrap {
        padding: var(--space-lg) var(--space-md) var(--space-2xl);
    }
    .insights-article-header h1 {
        font-size: 1.4rem;
    }
    .insights-admin-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
}
