/**
 * PROPY BLOG STYLES - REMASTERED
 * Following existing Propy design system (static/chat-style.css)
 * Optimized for readability and PREMIUM aesthetic
 */

/* ===================================
   VARIABLES
   =================================== */
:root {
    --blog-max-width: 1400px;
    --blog-index-max-width: 1200px;
    --blog-font-family-sans: 'Inter', sans-serif;
    --blog-font-family-heading: 'Poppins', sans-serif;

    /* Colors derived from main site */
    --color-primary: #4F46E5;
    /* Example indigo */
    --color-primary-dark: #4338ca;
    --color-secondary: #EC4899;
    /* Example pink */
    --color-text-primary: #111827;
    --color-text-secondary: #4B5563;
    --color-text-muted: #9CA3AF;
    --color-bg-light: #F9FAFB;
    --color-border: #E5E7EB;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4F46E5 0%, #EC4899 100%);
    --gradient-surface: linear-gradient(145deg, #ffffff, #f8f9fa);
    --gradient-glass: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.5) 100%);

    /* AI/GEO Specific */
    /* Updated to match Form System Selection Gradient (Blue to Purple) */
    --ai-summary-bg: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(147, 51, 234, 0.1) 100%);
    --ai-summary-border: rgba(147, 51, 234, 0.3);
    --ai-summary-accent: linear-gradient(90deg, #3B82F6, #9333EA);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: var(--blog-font-family-sans);
    color: var(--color-text-primary);
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--blog-font-family-heading);
    color: var(--color-text-primary);
}

/* ===================================
   HERO SECTION (Matches Index)
   =================================== */
.blog-index-header {
    text-align: center;
    padding: 120px 20px 60px;
    /* Increased top padding */
    max-width: 900px;
    margin: 0 auto;
}

.blog-header-label {
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
    font-size: 1rem;
}

.badge-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.pill-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    background: rgba(79, 70, 229, 0.1);
    color: var(--color-primary);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.main-headline {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.main-headline span {
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    /* Make it wrap nicely */
}

.blog-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 1rem;
}

.blog-post-count {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===================================
   BENTO GRID LAYOUT
   =================================== */
.blog-index-container {
    max-width: var(--blog-index-max-width);
    margin: 0 auto;
    padding: 20px 20px 80px;
    /* Added small top padding */
}

.blog-posts-grid h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    font-weight: 700;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.blog-post-card {
    background: #ffffff;
    border-radius: 20px;
    /* Matching bento rounded corners */
    padding: 2rem;
    /* Initial padding */
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--color-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(79, 70, 229, 0.3);
}

.blog-post-card-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
}

.post-card-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #F3F4F6;
    color: var(--color-text-secondary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    align-self: flex-start;
}

.post-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    color: var(--color-text-primary);
}

.post-card-excerpt {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    /* Pushes meta to bottom */
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    padding-top: 1rem;
    border-top: 1px solid #F3F4F6;
}

/* ===================================
   BLOG POST CONTENT (Post Page)
   =================================== */
.blog-post-container {
    max-width: var(--blog-max-width);
    margin: 0 auto;
    padding: 100px 20px 80px;
    /* Increased to clear fixed header (70px) */
}

.blog-breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.blog-breadcrumb a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.blog-breadcrumb a:hover {
    color: var(--color-primary);
}

.blog-post-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.blog-post-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* AI Summary Box - Premium Look */
.ai-summary {
    background: #F8FAFC;
    /* Very light cool gray, cleaner look */
    border: 1px solid var(--form-border);
    border-radius: 16px;
    padding: 2.5rem;
    /* Increased padding */
    margin: 3rem 0;
    /* Increased margin */
    box-shadow: var(--shadow-sm);
    /* Subtler shadow */
    position: relative;
    overflow: hidden;
}

.ai-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    /* Thinner border */
    height: 100%;
    background: var(--form-gradient);
    opacity: 1;
}

.ai-summary h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    /* More space after title */
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--form-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.ai-summary h3::before {
    content: '✨';
}

.ai-summary ul {
    margin: 0;
    padding-left: 1.25rem;
}

.ai-summary li {
    margin-bottom: 1rem;
    /* Increased spacing between items */
    line-height: 1.7;
    color: var(--color-text-primary);
    font-size: 1.05rem;
}

/* Content Typography */
.blog-post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #374151;
    /* slightly lighter than pure black for reading */
}

.blog-post-content p {
    margin-bottom: 1.5rem;
}

.blog-post-content h2 {
    font-size: 1.875rem;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.blog-post-content h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.blog-post-content li {
    margin-bottom: 0.5rem;
}

.blog-post-content blockquote {
    border-left: 4px solid var(--color-secondary);
    background: #FFF1F2;
    /* very light pink tint */
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    font-size: 1.25rem;
    color: #831843;
}

/* Images in content */
.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: var(--shadow-lg);
}

/* FAQ Section */
.faq-section {
    margin-top: 4rem;
    background: #F9FAFB;
    border-radius: 16px;
    padding: 2.5rem;
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-question {
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.faq-answer {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Footer & Metadata */
.blog-post-footer {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--color-border);
}

.blog-post-info {
    background: var(--color-bg-light);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.disclaimer {
    color: var(--color-text-secondary);
    font-style: italic;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.post-metadata-bottom {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    color: var(--color-text-primary);
}

.post-metadata-bottom p {
    margin: 0;
}

.blog-post-share {
    text-align: center;
    padding: 2.5rem;
    background: #F0F9FF;
    /* Light blue background for emphasis */
    border-radius: 16px;
    margin-top: 2rem;
}

.share-cta {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.blog-post-share h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.blog-post-tags {
    margin-bottom: 2rem;
}

.blog-post-tags a {
    display: inline-block;
    background: #F3F4F6;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.blog-post-tags a:hover {
    background: var(--color-primary);
    color: white;
}

/* Social Sharing */
.share-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.share-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    color: var(--color-text-secondary);
    transition: all 0.2s;
}

.share-button:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

/* ===================================
   TABLES (Restored)
   =================================== */
.blog-post-content .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 4rem 0;
    /* Significant spacing added */
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    /* Slightly larger text */
    box-shadow: var(--shadow-sm);
    border-radius: 12px;
    overflow: hidden;
    margin: 3rem 0 4rem 0;
    /* Direct margin applied to table: Top 3rem, Bottom 4rem */
}

.blog-post-content th,
.blog-post-content td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.blog-post-content thead th {
    background-color: var(--color-bg-light);
    font-weight: 700;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-border);
}

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

.blog-post-content tbody tr:nth-child(even) {
    background-color: #F9FAFB;
}

.blog-post-content tbody tr:hover {
    background-color: #F0F9FF;
}