/* ═══════════════════════════════════════════════════
   FDI Article Template — Dark Theme Stylesheet
   Version: 2.0.0
═══════════════════════════════════════════════════ */

:root {
    --fdi-bg-base:        #0a0c10;
    --fdi-bg-surface:     #10141c;
    --fdi-bg-card:        #141820;
    --fdi-bg-elevated:    #1a2030;
    --fdi-gold:           #E8B84B;
    --fdi-gold-dim:       #C8974A;
    --fdi-gold-glow:      rgba(232,184,75,0.12);
    --fdi-gold-border:    rgba(232,184,75,0.25);
    --fdi-green:          #22c887;
    --fdi-red:            #ef4444;
    --fdi-blue:           #4a9eff;
    --fdi-text-primary:   #f0f2f6;
    --fdi-text-secondary: #8a95a8;
    --fdi-text-muted:     #4a5568;
    --fdi-border:         rgba(255,255,255,0.07);
    --fdi-radius:         8px;
    --fdi-radius-lg:      10px;
    --fdi-font-display:   'Playfair Display', Georgia, serif;
    --fdi-font-body:      'DM Sans', -apple-system, sans-serif;
    --fdi-font-mono:      'JetBrains Mono', 'Courier New', monospace;
}

/* ── Base resets scoped to FDI ── */
.fdi-article-header,
.fdi-tags-section,
.fdi-recent-posts-sticky,
.fdi-author-bio {
    box-sizing: border-box;
    font-family: var(--fdi-font-body);
    color: var(--fdi-text-primary);
}

/* ══════════════════════════════════════
   1. ARTICLE HEADER
══════════════════════════════════════ */
.fdi-article-header {
    margin-bottom: 2rem;
}

.fdi-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--fdi-gold-glow);
    border: 1px solid var(--fdi-gold-border);
    color: var(--fdi-gold);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 4px;
    margin-bottom: 1rem;
}
.fdi-category-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fdi-gold);
    flex-shrink: 0;
}

.fdi-article-title {
    font-family: var(--fdi-font-display);
    font-size: clamp(26px, 3.5vw, 38px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--fdi-text-primary);
    letter-spacing: -0.03em;
    margin: 0 0 1.25rem;
}

/* Meta bar */
.fdi-article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid var(--fdi-border);
    border-bottom: 1px solid var(--fdi-border);
    margin-bottom: 1.75rem;
}

.fdi-meta-author {
    display: flex;
    align-items: center;
    gap: 9px;
}
.fdi-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fdi-gold), var(--fdi-gold-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #0a0c10;
    flex-shrink: 0;
}
.fdi-author-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--fdi-text-primary);
    line-height: 1.2;
}
.fdi-author-role {
    font-size: 11px;
    color: var(--fdi-text-muted);
    line-height: 1.2;
}
.fdi-meta-divider {
    width: 1px;
    height: 24px;
    background: var(--fdi-border);
    flex-shrink: 0;
}
.fdi-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--fdi-text-muted);
}
.fdi-meta-item svg { opacity: 0.6; }

.fdi-meta-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}
.fdi-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--fdi-border);
    background: var(--fdi-bg-elevated);
    color: var(--fdi-text-secondary);
    padding: 6px 14px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
    font-family: var(--fdi-font-body);
}
.fdi-action-btn:hover {
    border-color: var(--fdi-gold);
    color: var(--fdi-gold);
}

/* Lead paragraph */
.fdi-article-lead {
    font-size: 17px;
    line-height: 1.75;
    color: var(--fdi-text-secondary);
    border-left: 3px solid var(--fdi-gold);
    padding-left: 1.25rem;
    margin-bottom: 2rem;
}

/* Author Bio Card */
.fdi-author-bio {
    display: flex;
    gap: 16px;
    background: var(--fdi-bg-card);
    border: 1px solid var(--fdi-border);
    border-radius: var(--fdi-radius-lg);
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
}
.fdi-author-bio-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fdi-gold), var(--fdi-gold-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--fdi-font-display);
    font-size: 18px;
    font-weight: 700;
    color: #0a0c10;
    flex-shrink: 0;
}
.fdi-author-bio-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--fdi-text-primary);
    margin-bottom: 2px;
}
.fdi-author-bio-role {
    font-size: 12px;
    color: var(--fdi-gold);
    margin-bottom: 8px;
}
.fdi-author-bio-desc {
    font-size: 13px;
    color: var(--fdi-text-muted);
    line-height: 1.6;
}

/* ══════════════════════════════════════
   4. BLOG CONTENT (Award Cards + Pullquote)
══════════════════════════════════════ */

/* Award Cards Grid */
.fdi-award-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 2rem 0;
}
.fdi-award-card {
    background: var(--fdi-bg-card);
    border: 1px solid var(--fdi-border);
    border-radius: var(--fdi-radius);
    padding: 14px 12px;
    text-align: center;
    transition: border-color 0.2s;
}
.fdi-award-card:hover {
    border-color: var(--fdi-gold-border);
}
.fdi-award-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 10px;
    background: var(--fdi-gold-glow);
    border-radius: 50%;
    border: 1px solid var(--fdi-gold-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}
.fdi-award-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--fdi-text-primary);
    line-height: 1.4;
    margin-bottom: 5px;
}
.fdi-award-year {
    font-size: 10px;
    color: var(--fdi-gold);
    font-family: var(--fdi-font-mono);
}

/* Pullquote */
.fdi-pullquote {
    background: var(--fdi-bg-card);
    border: 1px solid var(--fdi-gold-border);
    border-left: 3px solid var(--fdi-gold);
    border-radius: 0 var(--fdi-radius) var(--fdi-radius) 0;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
}
.fdi-pullquote p {
    font-family: var(--fdi-font-display);
    font-size: 18px;
    font-style: italic;
    color: var(--fdi-text-primary);
    line-height: 1.55;
    margin: 0;
}
.fdi-pullquote cite {
    display: block;
    font-size: 12px;
    color: var(--fdi-gold);
    margin-top: 10px;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ══════════════════════════════════════
   5. TAGS SECTION
══════════════════════════════════════ */
.fdi-tags-section {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 1.5rem;
    margin: 2rem 0;
    border-top: 1px solid var(--fdi-border);
}
.fdi-tag {
    display: inline-block;
    background: var(--fdi-bg-elevated);
    border: 1px solid var(--fdi-border);
    color: var(--fdi-text-muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 5px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
a.fdi-tag:hover {
    border-color: var(--fdi-gold);
    color: var(--fdi-gold);
}

/* ══════════════════════════════════════
   7. RECENT POSTS — sticky sidebar widget
══════════════════════════════════════ */

/*
 * Sticky behaviour:
 *   The shortcode wraps everything in .fdi-recent-posts-sticky.
 *   Place [fdi_recent_posts] inside a sidebar/column that is taller
 *   than its content so position:sticky can engage.
 *   top offset (32px) = reasonable breathing room below the admin
 *   bar or a fixed site header — adjust the CSS variable if needed.
 */
:root { --fdi-sticky-top: 32px; }

.fdi-recent-posts-sticky {
    position: sticky;
    top: var(--fdi-sticky-top);
    /* Prevent the widget from overflowing a short viewport */
    max-height: calc(100vh - var(--fdi-sticky-top) - 16px);
    overflow-y: auto;
    /* Hide scrollbar visually but keep it functional */
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE 11 */
}
.fdi-recent-posts-sticky::-webkit-scrollbar { display: none; }

.fdi-recent-posts {
    background: var(--fdi-bg-card);
    border: 1px solid var(--fdi-border);
    border-radius: var(--fdi-radius-lg);
    padding: 1.25rem;
}

.fdi-sidebar-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fdi-gold);
    margin-bottom: 1rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--fdi-border);
}

.fdi-recent-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid var(--fdi-border);
    text-decoration: none;
    transition: all 0.2s;
}
.fdi-recent-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.fdi-recent-item:hover .fdi-recent-title {
    color: var(--fdi-gold);
}

.fdi-recent-cat {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fdi-gold);
}
.fdi-recent-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--fdi-text-secondary);
    line-height: 1.45;
    transition: color 0.2s;
}
.fdi-recent-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--fdi-text-muted);
}
.fdi-recent-dot {
    opacity: 0.4;
}

/* ══════════════════════════════════════
   READING PROGRESS BAR
══════════════════════════════════════ */
.fdi-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--fdi-gold);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ══════════════════════════════════════
   COPY LINK SUCCESS STATE
══════════════════════════════════════ */
.fdi-action-btn.fdi-copied {
    border-color: var(--fdi-green);
    color: var(--fdi-green);
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 768px) {
    .fdi-article-title {
        font-size: 24px;
    }
    .fdi-article-meta {
        gap: 10px;
    }
    .fdi-meta-actions {
        margin-left: 0;
        width: 100%;
    }
    .fdi-award-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    .fdi-author-bio {
        flex-direction: column;
    }
    .fdi-pullquote p {
        font-size: 16px;
    }
    /* On mobile the sidebar collapses below content — no sticky needed */
    .fdi-recent-posts-sticky {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}
