/* ============================================
   ENHANCED BLOG POST STYLES
   Single source of truth for all post styling.
   No !important needed — no conflicts with style.css.
   ============================================ */

/* ============================================
   1. POST HEADER
   ============================================ */

.post-header {
    margin: 10 0 3rem 0;
    padding: 4rem 2rem 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

/* Animated shimmer overlay */
.post-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.08),
            transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Decorative radial overlay */
.post-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.post-header>* {
    position: relative;
    z-index: 1;
}

/* Title */
.post-header h1 {
    font-size: 2.75rem;
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tags */
.post-header .tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
    animation: fadeIn 1s ease-out 0.4s both;
}

.post-header .tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    cursor: default;
}

.post-header .tag::before {
    content: "#";
    margin-right: 0.25rem;
    opacity: 0.8;
    font-weight: 700;
}

.post-header .tag:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Date */
.post-header .post-meta {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    font-weight: 500;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

/* ── Author block ── */
.author-block {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #f8f9fa;
    border-left: 4px solid #6366f1;
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0 1.75rem;
}

.author-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.author-info {
    flex: 1;
}

.author-name {
    font-weight: 700;
    color: #1a1a2e;
    font-size: 0.95rem;
    margin: 0 0 0.2rem;
}

.author-name a {
    color: inherit;
    text-decoration: none;
}

.author-name a:hover {
    color: #6366f1;
}

.author-bio {
    color: #555;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

/* ── Post meta row ── */
.post-header .post-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: #fff;
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
    justify-content: center;
    align-items: center;
}

.post-header .post-meta-row span::before {
    content: "·";
    margin-right: 0.75rem;
}

.post-header .post-meta-row span:first-child::before {
    content: "";
    margin-right: 0;
}

/* ── Related posts ── */
.related-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.related-posts h2 {
    font-size: 1.3rem;
    color: #1a1a2e;
    margin-bottom: 1.25rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.related-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: block;
}

.related-card:hover {
    border-color: #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.related-card h3 {
    font-size: 0.92rem;
    margin: 0 0 0.4rem;
    color: #1a1a2e;
    line-height: 1.4;
}

.related-card p {
    font-size: 0.8rem;
    color: #666;
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.related-card .related-meta {
    font-size: 0.75rem;
    color: #999;
}

/* ── Breadcrumb ── */
.container .breadcrumb {
    font-size: 0.82rem;
    color: #888;
    margin-bottom: 1rem;
}

.container .breadcrumb a {
    color: #6366f1;
    text-decoration: none;
}

.container .breadcrumb a:hover {
    text-decoration: underline;
}

.container .breadcrumb span {
    margin: 0 0.4rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.post-header .post-meta time {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.post-header .post-meta time::before {
    content: "📅";
    margin-right: 0.5rem;
}

/* ============================================
   2. BLOG POST WRAPPER
   ============================================ */

.blog-post {
    max-width: 900px;
    margin: 0 auto;
    animation: fadeInContent 0.8s ease-out;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   3. POST CONTENT TYPOGRAPHY
   ============================================ */

.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #2d3748;
    margin-top: 0;
}

.post-content>p:first-of-type {
    font-size: 1.25rem;
    line-height: 1.7;
    color: #4a5568;
    font-weight: 400;
}

.post-content p {
    margin-bottom: 1.75rem;
    line-height: 1.8;
}

/* Headings */
.post-content h2 {
    color: #1a202c;
    margin: 3rem 0 1.5rem 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    position: relative;
    padding-bottom: 0.75rem;
}

.post-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.post-content h3 {
    color: #2d3748;
    margin: 2.5rem 0 1.25rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
}

.post-content h4 {
    color: #4a5568;
    margin: 2rem 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* ============================================
   4. LISTS
   ============================================ */

.post-content ul,
.post-content ol {
    margin-bottom: 2rem;
    padding-left: 0;
}

.post-content ul {
    list-style: none;
}

.post-content ul li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.post-content ul li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: 700;
    font-size: 1.2rem;
}

.post-content ol {
    counter-reset: item;
    list-style: none;
}

.post-content ol li {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1rem;
    counter-increment: item;
    line-height: 1.7;
}

.post-content ol li::before {
    content: counter(item);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ============================================
   5. BLOCKQUOTES
   ============================================ */

.post-content blockquote {
    border-left: 4px solid #667eea;
    padding: 1.5rem 1.5rem 1.5rem 2rem;
    margin: 2.5rem 0;
    font-style: italic;
    color: #4a5568;
    background: linear-gradient(to right, #f7fafc, #edf2f7);
    border-radius: 0 12px 12px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
}

.post-content blockquote::before {
    content: "\201C";
    position: absolute;
    top: 0.5rem;
    left: 1.5rem;
    font-size: 3rem;
    color: #667eea;
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.post-content blockquote p {
    margin: 0;
    position: relative;
    z-index: 1;
}

/* ============================================
   6. CODE
   ============================================ */

.post-content code {
    background: #f7fafc;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-family: 'Fira Code', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
    border: 1px solid #e2e8f0;
}

.post-content pre {
    background: #1a202c;
    padding: 1.75rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid #2d3748;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

.post-content pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
}

.post-content pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    border: none;
    font-size: 0.95em;
    line-height: 1.6;
}

/* ============================================
   7. LINKS & EMPHASIS
   ============================================ */

.post-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.post-content a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

.post-content strong {
    color: #1a202c;
    font-weight: 700;
}

/* ============================================
   8. IMAGES
   ============================================ */

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

/* ============================================
   9. TABLES
   ============================================ */

.post-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.post-content table thead {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.post-content table th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.post-content table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.post-content table tbody tr:hover {
    background: #f7fafc;
}

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

/* ============================================
   10. HR
   ============================================ */

.post-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
    margin: 3rem 0;
}

/* ============================================
   11. AFFILIATE DISCLAIMER
   ============================================ */

.affiliate-disclaimer {
    background: linear-gradient(135deg, #fff9e6, #fff3cd);
    border-left: 4px solid #ffc107;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 3rem 0;
    font-size: 0.95rem;
    color: #856404;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.15);
    position: relative;
    overflow: hidden;
}

.affiliate-disclaimer::before {
    content: "ℹ️";
    position: absolute;
    top: 1.5rem;
    left: -0.5rem;
    font-size: 3rem;
    opacity: 0.1;
}

.affiliate-disclaimer p {
    margin: 0;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* ============================================
   12. RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .post-header {
        margin: 0 0 2rem 0;
        padding: 3rem 1.5rem 2rem 1.5rem;
    }

    .post-header h1 {
        font-size: 2rem;
    }

    .post-header .tags {
        gap: 0.5rem;
    }

    .post-header .tag {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

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

    .post-content>p:first-of-type {
        font-size: 1.15rem;
    }

    .post-content h2 {
        font-size: 1.75rem;
        margin: 2.5rem 0 1.25rem 0;
    }

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

    .post-content ul li,
    .post-content ol li {
        padding-left: 1.75rem;
    }

    .post-content blockquote {
        padding: 1.25rem 1.25rem 1.25rem 1.75rem;
    }

    .post-content pre {
        padding: 1.25rem;
        border-radius: 8px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .post-header {
        margin: 0 0 1.5rem 0;
        padding: 2.5rem 1rem 1.5rem 1rem;
    }

    .post-header h1 {
        font-size: 1.75rem;
    }

    .post-header .tag {
        padding: 0.4rem 0.9rem;
        font-size: 0.8rem;
    }

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

/* ============================================
   13. PRINT
   ============================================ */

@media print {
    .post-header {
        background: #667eea !important;
        color: white !important;
        page-break-after: avoid;
    }

    .post-content {
        font-size: 12pt;
        line-height: 1.6;
    }

    .post-content h2 {
        page-break-after: avoid;
    }

    .post-content a {
        color: #667eea;
        text-decoration: underline;
    }

    .post-content pre {
        page-break-inside: avoid;
    }
}

/* ============================================
   14. DARK MODE
   ============================================ */

@media (prefers-color-scheme: dark) {
    .post-content {
        color: #e2e8f0;
    }

    .post-content h2,
    .post-content h3 {
        color: #f7fafc;
    }

    .post-content code {
        background: #2d3748;
        color: #f093fb;
        border-color: #4a5568;
    }
}

/* ============================================
   ABOUT PAGE — MOBILE AUTHOR CARD
   ============================================ */

@media (max-width: 600px) {

    /* Stack photo above text instead of side-by-side */
    .author-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.25rem;
        gap: 1rem;
    }

    .author-avatar-lg {
        width: 90px;
        height: 90px;
        flex-shrink: 0;
    }

    .author-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }

    .author-card .credentials {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .author-card p {
        font-size: 0.9rem;
        line-height: 1.6;
        text-align: left;
    }

    .linkedin-link {
        font-size: 0.95rem;
    }
}