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

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

/* Pulsing radial gradient overlay — matches .hero-vortex-pulse */
.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.055) 0%, transparent 55%),
        radial-gradient(ellipse at 15% 80%, rgba(0, 255, 162, 0.03) 0%, transparent 40%),
        radial-gradient(ellipse at 85% 20%, rgba(138, 171, 255, 0.025) 0%, transparent 40%);
    animation: blog-pulse 10s ease-in-out infinite;
    pointer-events: none;
}

@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); }
}

/* 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.28;
    filter: blur(64px);
    background: radial-gradient(
        circle at 50% 50%,
        rgba(77, 124, 254, 0.2) 0%,
        rgba(0, 255, 162, 0.1) 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.2;
    filter: blur(72px);
    background: radial-gradient(
        circle at 50% 50%,
        rgba(0, 255, 162, 0.13) 0%,
        rgba(77, 124, 254, 0.08) 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.13;
    filter: blur(80px);
    background: radial-gradient(
        circle at 50% 50%,
        rgba(167, 139, 250, 0.12) 0%,
        rgba(77, 124, 254, 0.07) 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
   ============================================ */

.post-content {
    color: #cbd5e1;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.85;
}

.post-content p {
    margin-bottom: 1.5rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1.0625rem;
}

.post-content strong,
.post-content b {
    color: #e7ecff !important;
    font-weight: 600 !important;
}

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

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

/* ============================================
   LINKS
   ============================================ */

.post-content a {
    color: #4D7CFE;
    text-decoration: none;
    border-bottom: 1px solid rgba(77, 124, 254, 0.3);
    transition: color 0.25s ease, border-color 0.25s ease;
}

.post-content a:hover {
    color: #00ffa2;
    border-bottom-color: rgba(0, 255, 162, 0.5);
    text-decoration: none;
}

/* ============================================
   HEADINGS
   ============================================ */

.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: #e7ecff;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.post-content h2 {
    font-size: 1.75rem;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(77, 124, 254, 0.15);
    position: relative;
}

.post-content h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 4rem;
    height: 2px;
    background: linear-gradient(90deg, #4D7CFE, #00ffa2);
    border-radius: 1px;
}

.post-content h3 {
    font-size: 1.375rem;
    margin: 2rem 0 0.75rem;
    padding-left: 0.875rem;
    border-left: 3px solid #4D7CFE;
}

.post-content h4 {
    font-size: 1.125rem;
    margin: 1.5rem 0 0.625rem;
    color: #4D7CFE;
}

.post-content h5 {
    font-size: 1rem;
    margin: 1.25rem 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8AABFF;
}

.post-content h6 {
    font-size: 0.875rem;
    margin: 1rem 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

/* First heading after start — no top margin */
.post-content > h2:first-child,
.post-content > h3:first-child {
    margin-top: 0;
}

/* ============================================
   UNORDERED LISTS
   ============================================ */

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

.post-content ul li,
.post-content .wp-block-list li {
    position: relative;
    padding-left: 1.875rem;
    margin-bottom: 0.625rem;
    line-height: 1.75;
}

.post-content ul li::before,
.post-content .wp-block-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.2em;
    width: 1.1em;
    height: 1.1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z' fill='%234D7CFE' opacity='.35'/%3E%3Cpath d='M369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z' fill='%2300ffa2'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    border-radius: 0;
}

/* Nested lists — smaller, dimmed */
.post-content ul ul {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.post-content ul ul li::before {
    opacity: 0.5;
    width: 0.95em;
    height: 0.95em;
    top: 0.25em;
}

/* ============================================
   ORDERED LISTS
   ============================================ */

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

.post-content ol li {
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 0.625rem;
    line-height: 1.75;
    counter-increment: post-ol;
}

.post-content ol li::before {
    content: counter(post-ol);
    position: absolute;
    left: 0;
    top: 0.15em;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
    background: linear-gradient(135deg, rgba(77, 124, 254, 0.2), rgba(0, 255, 162, 0.1));
    border: 1px solid rgba(77, 124, 254, 0.3);
    color: #4D7CFE;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ============================================
   BLOCKQUOTES
   ============================================ */

.post-content blockquote {
    position: relative;
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    background: rgba(15, 20, 27, 0.6);
    border: 1px solid rgba(77, 124, 254, 0.15);
    border-left: 3px solid;
    border-image: linear-gradient(180deg, #4D7CFE, #00ffa2) 1;
    border-radius: 0 0.75rem 0.75rem 0;
    backdrop-filter: blur(8px);
    font-style: italic;
    color: #94a3b8;
}

.post-content blockquote p {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.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: #4D7CFE;
}

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

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

/* ============================================
   INLINE CODE
   ============================================ */

.post-content code {
    background: rgba(30, 41, 59, 0.8);
    color: #00ffa2;
    padding: 0.2em 0.5em;
    border-radius: 0.375rem;
    font-size: 0.875em;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    border: 1px solid rgba(77, 124, 254, 0.15);
}

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

.post-content pre {
    position: relative;
    background: rgba(12, 16, 24, 0.9);
    border: 1px solid rgba(77, 124, 254, 0.2);
    border-radius: 0.75rem;
    padding: 0;
    margin: 2rem 0;
    overflow: hidden;
}

.post-content pre::before {
    content: '';
    display: block;
    height: 2.25rem;
    background-color: rgba(18, 23, 34, 0.8);
    border-bottom: 1px solid rgba(77, 124, 254, 0.15);
    background-image:
        radial-gradient(circle 4px at 1rem 50%, #ef4444 3.5px, transparent 4px),
        radial-gradient(circle 4px at 2.25rem 50%, #f59e0b 3.5px, transparent 4px),
        radial-gradient(circle 4px at 3.5rem 50%, #22c55e 3.5px, transparent 4px);
    background-repeat: no-repeat;
}

.post-content pre code {
    display: block;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.7;
    overflow-x: auto;
}

/* ============================================
   TABLES
   ============================================ */

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

.post-content thead th {
    background: rgba(18, 23, 34, 0.8);
    color: #e7ecff;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 2px solid rgba(77, 124, 254, 0.2);
}

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

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

.post-content tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(77, 124, 254, 0.08);
    color: #cbd5e1;
    vertical-align: top;
}

.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: rgba(255, 255, 255, 0.015);
}

/* ============================================
   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) {
    .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: #8AABFF !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: #8AABFF !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;
}
