/*
 * AchieveAI — Dark Blog Post Design System
 * Matches the landing page glassmorphism / gradient aesthetic.
 * Colors: #05080d bg | #4D7CFE blue | #00ffa2 green | #e7ecff text
 */

/* ============================================
   BLOG BACKGROUND — HERO-STYLE ORBS
   ============================================ */

.blog-post-shell {
    background: transparent;
}

.blog-background-fixed {
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background:
        linear-gradient(180deg, #05080d 0%, #090d13 52%, #0b1017 100%);
}

/* Pulsing radial gradient overlay — matches .hero-vortex-pulse */
.blog-gradient-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 10% 10%, rgba(77, 124, 254, 0.07) 0%, transparent 36%),
        radial-gradient(ellipse at 92% 8%, rgba(0, 255, 162, 0.045) 0%, transparent 30%);
}

.blog-vortex-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    background:
        radial-gradient(ellipse at center, rgba(77, 124, 254, 0.045) 0%, transparent 55%),
        radial-gradient(ellipse at 15% 80%, rgba(0, 255, 162, 0.02) 0%, transparent 40%),
        radial-gradient(ellipse at 85% 20%, rgba(138, 171, 255, 0.018) 0%, transparent 40%);
    animation: blog-pulse 10s ease-in-out infinite;
    pointer-events: none;
}

.blog-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(77, 124, 254, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(77, 124, 254, 0.028) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: grid-drift 20s linear infinite;
    pointer-events: none;
    opacity: 0.4;
}

.blog-hero-scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 162, 0.18), transparent);
    animation: hero-scan 4s ease-in-out infinite;
    opacity: 0.24;
    pointer-events: none;
    z-index: 2;
}

@keyframes blog-pulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50%       { opacity: 0.85; transform: translate(-50%, -50%) scale(1.04); }
}

@keyframes grid-drift {
    0% { background-position: 0 0; }
    100% { background-position: 60px 60px; }
}

@keyframes hero-scan {
    0% {
        top: 0;
        opacity: 0;
    }
    10% {
        opacity: 0.24;
    }
    90% {
        opacity: 0.24;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Shared orb base */
.blog-orb {
    position: absolute;
    border-radius: 50%;
    will-change: opacity;
    pointer-events: none;
    animation: blog-orb-breathe 8s ease-in-out infinite;
}

/* Primary orb — top-left, blue/green */
.blog-orb--primary {
    top: -6rem;
    left: -4rem;
    width: min(52vw, 640px);
    aspect-ratio: 1;
    opacity: 0.18;
    filter: blur(64px);
    background: radial-gradient(
        circle at 50% 50%,
        rgba(77, 124, 254, 0.12) 0%,
        rgba(0, 255, 162, 0.05) 45%,
        transparent 70%
    );
    animation-duration: 7s;
}

/* Secondary orb — top-right, green/blue */
.blog-orb--secondary {
    top: -4rem;
    right: -6rem;
    width: min(38vw, 480px);
    aspect-ratio: 1;
    opacity: 0.12;
    filter: blur(72px);
    background: radial-gradient(
        circle at 50% 50%,
        rgba(0, 255, 162, 0.08) 0%,
        rgba(77, 124, 254, 0.045) 45%,
        transparent 70%
    );
    animation-duration: 9s;
    animation-delay: 3s;
}

/* Tertiary orb — lower-right, adds depth on long posts */
.blog-orb--tertiary {
    top: 55%;
    right: -8rem;
    width: min(30vw, 380px);
    aspect-ratio: 1;
    opacity: 0.08;
    filter: blur(80px);
    background: radial-gradient(
        circle at 50% 50%,
        rgba(77, 124, 254, 0.05) 0%,
        rgba(77, 124, 254, 0.035) 45%,
        transparent 70%
    );
    animation-duration: 11s;
    animation-delay: 5s;
}

@keyframes blog-orb-breathe {
    0%, 100% { opacity: var(--orb-opacity, 0.4); }
    50%       { opacity: calc(var(--orb-opacity, 0.4) + 0.15); }
}

/* Floating particles */
@keyframes blog-twinkle {
    0%, 100% { opacity: 0.06; }
    50%       { opacity: 0.45; }
}

@keyframes blog-drift {
    0%, 100% { transform: translate(0, 0); }
    25%       { transform: translate(14px, -28px); }
    50%       { transform: translate(-10px, -44px); }
    75%       { transform: translate(18px, -18px); }
}

/* ============================================
   BASE TYPOGRAPHY — Nexus Smart Assistant match
   Source: markdownComponents.tsx (assistant)
   ============================================ */

.post-content,
.post-content.prose {
    color: #f1f5ff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.75;
    max-width: none;
}

/* Kill Tailwind Typography prose overrides so Nexus styles win */
.post-content.prose :where(p, li, h1, h2, h3, h4, h5, h6, strong, b, em, a, blockquote, code) {
    color: inherit;
}

.post-content.prose :where(h1, h2, h3, h4, h5, h6) {
    color: #ffffff;
}

.post-content.prose :where(strong, b) {
    color: #04f9a6;
    font-weight: 400;
}

.post-content.prose :where(em) {
    color: #d8b4fe;
}

.post-content.prose :where(a) {
    color: #4D7CFE;
    text-decoration: underline;
    font-weight: inherit;
}

.post-content.prose :where(blockquote) {
    color: #d8b4fe;
    font-style: normal;
    font-weight: inherit;
    quotes: none;
}

.post-content.prose :where(ul > li)::marker,
.post-content.prose :where(ol > li)::marker {
    content: none;
    color: transparent;
}

.post-content p {
    margin-bottom: 1rem;
    color: #f1f5ff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.75;
}

.post-content p:last-child {
    margin-bottom: 0;
}

/* Nexus: strong is green emphasis at normal weight */
.post-content strong,
.post-content b {
    color: #04f9a6 !important;
    font-weight: 400 !important;
}

.post-content em,
.post-content i:not([class]) {
    color: #d8b4fe;
    font-style: italic;
    font-weight: 500;
}

.post-content > *:last-child {
    margin-bottom: 0;
}

/* ============================================
   LINKS — Nexus blue underline
   ============================================ */

.post-content a {
    color: #4D7CFE;
    text-decoration: underline;
    border-bottom: none;
    transition: color 0.2s ease;
}

.post-content a:hover {
    color: #6b93ff;
    text-decoration: underline;
}

/* ============================================
   HEADINGS — white hierarchy, no decorative rules
   ============================================ */

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
    line-height: 1.35;
    border: none;
    padding: 0;
    background: none;
}

.post-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1.25rem 0 0.75rem;
}

.post-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.25rem 0 0.625rem;
}

.post-content h2::after {
    display: none;
}

.post-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    border-left: none;
    padding-left: 0;
}

.post-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.9rem 0 0.45rem;
    color: #ffffff;
}

.post-content h5,
.post-content h6 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0.85rem 0 0.4rem;
    text-transform: none;
    letter-spacing: 0;
    color: #ffffff;
}

.post-content > h1:first-child,
.post-content > h2:first-child,
.post-content > h3:first-child {
    margin-top: 0;
}

/* ============================================
   UNORDERED LISTS — Nexus green checks
   ============================================ */

.post-content ul,
.post-content ul.wp-block-list {
    list-style: none;
    padding-left: 0;
    margin: 0 0 1.25rem;
}

.post-content ul > li,
.post-content ul.wp-block-list > li {
    position: relative;
    display: list-item;
    padding-left: 1.65rem;
    margin-bottom: 0.75rem;
    color: #f1f5ff;
    line-height: 1.5;
}

.post-content ul > li::before,
.post-content ul.wp-block-list > li::before {
    content: '';
    position: absolute;
    top: 0.2rem;
    left: 0;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m9 12 2 2 4-4' stroke='%2304f9a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 0;
}

.post-content ul ul {
    margin-top: 0.5rem;
    margin-bottom: 0;
    width: 100%;
}

.post-content ul ul > li::before {
    opacity: 0.7;
}

/* ============================================
   ORDERED LISTS — Nexus blue numbers
   ============================================ */

.post-content ol {
    list-style: none;
    padding-left: 0;
    margin: 0 0 1.25rem;
    counter-reset: post-ol;
}

.post-content ol > li {
    position: relative;
    display: list-item;
    padding-left: 1.9rem;
    margin-bottom: 0.75rem;
    color: #f1f5ff;
    line-height: 1.5;
    counter-increment: post-ol;
}

.post-content ol > li::before {
    content: counter(post-ol) '.';
    position: absolute;
    top: 0;
    left: 0;
    min-width: 1.25rem;
    width: auto;
    height: auto;
    border: none;
    border-radius: 0;
    background: none;
    color: #6f8dff;
    font-size: inherit;
    font-weight: 500;
    display: inline;
    line-height: inherit;
}

/* ============================================
   BLOCKQUOTES — Nexus purple edge
   ============================================ */

.post-content blockquote {
    position: relative;
    margin: 1.25rem 0;
    padding: 0 0 0 1rem;
    background: transparent;
    border: none;
    border-left: 2px solid #8b5cf6;
    border-image: none;
    border-radius: 0;
    backdrop-filter: none;
    font-style: normal;
    color: #d8b4fe;
}

.post-content blockquote p {
    margin-bottom: 0.75rem;
    color: #d8b4fe;
    font-size: inherit;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content blockquote cite {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    font-style: normal;
    font-weight: 600;
    color: #c4b5fd;
}

/* ============================================
   HORIZONTAL RULES / SEPARATORS
   ============================================ */

.post-content hr,
.post-content .wp-block-separator {
    border: none;
    height: 1px;
    margin: 1.5rem 0;
    max-width: none;
    background: linear-gradient(90deg, transparent, rgba(77, 124, 254, 0.25), transparent);
    opacity: 1;
}

/* ============================================
   INLINE CODE — Nexus blue chip
   ============================================ */

.post-content code {
    background: rgba(77, 124, 254, 0.15);
    color: #7aa2f7;
    padding: 0.15em 0.4em;
    border-radius: 0.35rem;
    font-size: 0.95em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    border: none;
    word-break: break-all;
}

/* ============================================
   CODE BLOCKS
   ============================================ */

.post-content pre {
    position: relative;
    background: rgba(15, 20, 30, 0.8);
    border: 1px solid rgba(77, 124, 254, 0.2);
    border-radius: 0.75rem;
    padding: 1rem;
    margin: 1.25rem 0;
    overflow-x: auto;
}

.post-content pre::before {
    display: none;
}

.post-content pre code {
    display: block;
    padding: 0;
    background: transparent;
    border: none;
    color: #7aa2f7;
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    word-break: normal;
}

/* ============================================
   TABLES — Nexus bordered dark surface
   ============================================ */

.post-content table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 1.25rem 0;
    background: transparent;
    border: 1px solid rgba(77, 124, 254, 0.2);
    border-radius: 0.75rem;
    overflow: hidden;
    font-size: 0.9375rem;
}

.post-content thead {
    background: rgba(77, 124, 254, 0.16);
}

.post-content thead th {
    background: transparent;
    color: #dbe6ff;
    font-weight: 600;
    font-size: inherit;
    text-transform: none;
    letter-spacing: 0;
    padding: 0.65rem 0.75rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(77, 124, 254, 0.14);
}

.post-content thead th:first-child {
    border-top-left-radius: 0;
}

.post-content thead th:last-child {
    border-top-right-radius: 0;
}

.post-content tbody td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(77, 124, 254, 0.12);
    color: #e7ecff;
    vertical-align: top;
    white-space: pre-wrap;
}

.post-content tbody tr:last-child td {
    border-bottom: none;
}

.post-content tbody tr:hover {
    background: rgba(77, 124, 254, 0.04);
}

.post-content tbody tr:nth-child(even) {
    background: transparent;
}

/* ============================================
   IMAGES & FIGURES
   ============================================ */

.post-content img {
    border-radius: 0.75rem;
    border: 1px solid rgba(77, 124, 254, 0.15) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.post-content img:hover {
    transform: translateY(-3px);
    border-color: rgba(77, 124, 254, 0.35) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(77, 124, 254, 0.08);
}

.post-content figure {
    margin: 2rem 0;
}

.post-content figcaption {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: #64748b;
    font-style: italic;
}

/* WP alignment classes */
.post-content .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.post-content .alignleft {
    float: left;
    margin: 0.5rem 1.5rem 1rem 0;
}

.post-content .alignright {
    float: right;
    margin: 0.5rem 0 1rem 1.5rem;
}

/* ============================================
   WP BLOCKS — SPECIAL OVERRIDES
   ============================================ */

/* WP Columns */
.post-content .wp-block-columns {
    gap: 1.5rem;
    margin: 2rem 0;
}

/* WP Buttons */
.post-content .wp-block-button__link {
    background: linear-gradient(135deg, #4D7CFE 0%, #00ffa2 100%);
    color: #fff;
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.75rem 1.75rem;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(77, 124, 254, 0.3);
}

.post-content .wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(77, 124, 254, 0.4), 0 0 40px rgba(0, 255, 162, 0.15);
    color: #fff;
    border-bottom: none;
}

/* WP Quote — large style */
.post-content .wp-block-quote.is-style-large {
    padding: 1.5rem 2rem;
    font-size: 1.25rem;
}

/* WP Cover block */
.post-content .wp-block-cover {
    border-radius: 0.75rem;
    overflow: hidden;
    margin: 2rem 0;
}

/* ============================================
   SELECTION
   ============================================ */

.post-content ::selection {
    background: rgba(77, 124, 254, 0.25);
    color: #e7ecff;
}

.post-content ::-moz-selection {
    background: rgba(77, 124, 254, 0.25);
    color: #e7ecff;
}

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

@media (max-width: 640px) {
    .blog-background-fixed {
        background:
            linear-gradient(180deg, #05080d 0%, #090d13 50%, #0b1017 100%);
    }

    .blog-gradient-overlay {
        background:
            radial-gradient(ellipse at 8% 8%, rgba(77, 124, 254, 0.085) 0%, transparent 38%),
            radial-gradient(ellipse at 94% 10%, rgba(0, 255, 162, 0.055) 0%, transparent 32%);
    }

    .blog-vortex-pulse {
        opacity: 0.72;
    }

    .blog-hero-grid {
        opacity: 0.42;
    }

    .blog-hero-scan-line {
        opacity: 0.22;
    }

    .blog-orb--primary {
        width: 74vw;
        left: -20vw;
        top: -4rem;
        opacity: 0.2;
    }

    .blog-orb--secondary {
        width: 58vw;
        right: -20vw;
        top: -2rem;
        opacity: 0.14;
    }

    .blog-orb--tertiary {
        width: 60vw;
        right: -24vw;
        top: 58%;
        opacity: 0.1;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
        margin-top: 2rem;
    }

    .post-content h3 {
        font-size: 1.25rem;
    }

    .post-content pre code {
        font-size: 0.8125rem;
    }

    .post-content table {
        font-size: 0.8125rem;
    }

    .post-content thead th,
    .post-content tbody td {
        padding: 0.625rem 0.75rem;
    }

    .post-content blockquote {
        padding: 1rem 1.25rem;
        margin: 1.5rem 0;
    }
}

/* ============================================
   SIDEBAR WIDGETS — GLASSMORPHISM UPGRADE
   ============================================ */

.dark-theme-sidebar .widget {
    background: rgba(15, 20, 27, 0.7) !important;
    border: 1px solid rgba(77, 124, 254, 0.15) !important;
    border-radius: 0.75rem !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}

.dark-theme-sidebar .widget:hover {
    border-color: rgba(77, 124, 254, 0.3) !important;
    box-shadow: 0 4px 20px rgba(77, 124, 254, 0.08) !important;
    background: rgba(15, 20, 27, 0.85) !important;
}

.dark-theme-sidebar .widget-title {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #4D7CFE !important;
    padding: 0.875rem 1.25rem !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(77, 124, 254, 0.12) !important;
    background: rgba(77, 124, 254, 0.04) !important;
}

.dark-theme-sidebar .widget p {
    padding: 0.75rem 1.25rem;
    color: #94a3b8 !important;
    font-size: 0.875rem;
    line-height: 1.65;
}

.dark-theme-sidebar .widget ul {
    padding: 0.25rem 0 !important;
}

.dark-theme-sidebar .widget ul li {
    padding: 0.625rem 1.25rem !important;
    border-bottom: 1px solid rgba(77, 124, 254, 0.06) !important;
    transition: background 0.2s ease;
}

.dark-theme-sidebar .widget ul li:last-child {
    border-bottom: none !important;
}

.dark-theme-sidebar .widget ul li:hover {
    background: rgba(77, 124, 254, 0.04);
}

.dark-theme-sidebar .widget a {
    color: #9fb8ff !important;
    text-decoration: none !important;
    font-size: 0.875rem;
    transition: color 0.2s ease !important;
}

.dark-theme-sidebar .widget a:hover {
    color: #00ffa2 !important;
    text-decoration: none !important;
}

/* Sidebar search */
.dark-theme-sidebar .search-form {
    padding: 1rem 1.25rem !important;
}

.dark-theme-sidebar .search-form input[type="search"] {
    background: rgba(12, 16, 24, 0.6) !important;
    border: 1px solid rgba(77, 124, 254, 0.2) !important;
    border-radius: 0.5rem !important;
    color: #e7ecff !important;
    padding: 0.625rem 1rem !important;
    font-size: 0.875rem !important;
    transition: border-color 0.2s ease !important;
}

.dark-theme-sidebar .search-form input[type="search"]:focus {
    border-color: rgba(77, 124, 254, 0.5) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(77, 124, 254, 0.1);
}

.dark-theme-sidebar .search-form button,
.dark-theme-sidebar .search-form input[type="submit"] {
    background: linear-gradient(135deg, #4D7CFE, #00ffa2) !important;
    border: none !important;
    border-radius: 0.5rem !important;
    color: #fff !important;
    font-weight: 600 !important;
    padding: 0.625rem 1rem !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.dark-theme-sidebar .search-form button:hover,
.dark-theme-sidebar .search-form input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(77, 124, 254, 0.3) !important;
    background: linear-gradient(135deg, #4D7CFE, #00ffa2) !important;
    color: #fff !important;
}

/* Sidebar tag cloud */
.dark-theme-sidebar .tagcloud {
    padding: 1rem 1.25rem !important;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.dark-theme-sidebar .tagcloud a {
    display: inline-block !important;
    padding: 0.25rem 0.75rem !important;
    background: rgba(77, 124, 254, 0.08) !important;
    border: 1px solid rgba(77, 124, 254, 0.15) !important;
    border-radius: 9999px !important;
    font-size: 0.75rem !important;
    color: #9fb8ff !important;
    transition: all 0.2s ease !important;
    margin: 0 !important;
}

.dark-theme-sidebar .tagcloud a:hover {
    background: rgba(77, 124, 254, 0.15) !important;
    border-color: rgba(77, 124, 254, 0.35) !important;
    color: #00ffa2 !important;
    transform: translateY(-1px);
}

/* Sidebar select dropdowns */
.dark-theme-sidebar .widget select {
    background: rgba(12, 16, 24, 0.6) !important;
    border: 1px solid rgba(77, 124, 254, 0.2) !important;
    border-radius: 0.5rem !important;
    color: #e7ecff !important;
    padding: 0.5rem 0.75rem !important;
    width: calc(100% - 2.5rem) !important;
    margin: 0.75rem 1.25rem !important;
}

/* Sidebar calendar */
.dark-theme-sidebar .widget_calendar caption {
    background: rgba(77, 124, 254, 0.04) !important;
    border-bottom: 1px solid rgba(77, 124, 254, 0.12) !important;
    color: #e7ecff !important;
    font-size: 0.8125rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark-theme-sidebar .widget_calendar td,
.dark-theme-sidebar .widget_calendar th {
    padding: 0.375rem !important;
    font-size: 0.8125rem;
}

.dark-theme-sidebar .widget_calendar th {
    color: #64748b !important;
    font-weight: 600;
}

.dark-theme-sidebar .widget_calendar td a {
    color: #4D7CFE !important;
    font-weight: 700;
}

/* Related articles styles live in css/related-articles.css (enqueued with cache-bust). */
