/* Blog Styles - Matches IP Tool Design */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #1f2937;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,.1);
    overflow: hidden;
    min-height: calc(100vh - 40px);
}

/* Header */
.hero {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: #fff;
    padding: 60px 40px;
    text-align: center;
}

.hero h1 {
    margin: 0 0 16px;
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: -0.5px;
}

.subtitle {
    opacity: 0.9;
    font-size: 1.2rem;
    margin-bottom: 32px;
}

.nav-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.2);
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: rgba(255,255,255,.3);
    transform: translateY(-1px);
}

/* Articles Grid */
.articles-grid {
    padding: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.article-card {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 16px rgba(0,0,0,.06);
    transition: all 0.3s ease;
    position: relative;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0,0,0,.12);
}

.article-card.featured {
    border: 2px solid #3498db;
    background: linear-gradient(135deg, #f8fbff, #fff);
}

.article-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #6b7280;
    flex-wrap: wrap;
}

.article-card h2 {
    margin: 0 0 16px;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.article-card h2 a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-card h2 a:hover {
    color: #3498db;
}

.article-card p {
    color: #4b5563;
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.tag {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.featured-tag {
    background: #3498db;
    color: #fff;
}

/* Article Content Styles */
.article-content {
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 2px solid #eef2f7;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 16px;
    color: #1f2937;
    line-height: 1.2;
}

.article-meta-full {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 1rem;
    color: #6b7280;
    flex-wrap: wrap;
}

/* SVG Icon helpers */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; }
.icon-lg { width: 1.25em; height: 1.25em; }
.icon-btn { width: 1.1em; height: 1.1em; }

.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151;
}

.article-body h1 {
    font-size: 2rem;
    margin: 40px 0 20px;
    color: #1f2937;
}

.article-body h2 {
    font-size: 1.6rem;
    margin: 32px 0 16px;
    color: #1f2937;
}

.article-body h3 {
    font-size: 1.3rem;
    margin: 24px 0 12px;
    color: #374151;
}

.article-body p {
    margin-bottom: 24px;
}

.article-body ul, .article-body ol {
    margin: 20px 0;
    padding-left: 24px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body code {
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: ui-monospace, Consolas, Monaco, monospace;
    font-size: 0.9em;
    color: #e11d48;
}

.article-body pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: #fafbfc;
    border-radius: 8px;
    overflow: hidden;
}

.article-body th,
.article-body td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.article-body th {
    background: #f1f5f9;
    font-weight: 600;
    color: #374151;
}

.article-body tr:last-child td {
    border-bottom: none;
}

.article-navigation {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 40px 0;
    flex-wrap: wrap;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #3498db;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* Footer */
.footer {
    background: #f8fafc;
    border-top: 1px solid #eef2f7;
    padding: 40px;
    text-align: center;
    color: #6b7280;
}

.footer-content p {
    margin: 8px 0;
}

.footer a {
    color: #3498db;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-note {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 12px;
    }
    
    .hero {
        padding: 40px 20px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .articles-grid {
        padding: 20px;
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .article-card {
        padding: 24px;
    }
    
    .article-content {
        padding: 20px;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .article-meta-full {
        flex-direction: column;
        gap: 8px;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: center;
    }
}

/* New UX Enhancement Styles */

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #2563eb;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Newsletter CTA in Hero */
.newsletter-cta {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    margin: 32px 0;
    backdrop-filter: blur(10px);
}

.newsletter-text {
    margin: 0 0 16px;
    font-size: 1.1rem;
    font-weight: 600;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 16px;
}

.newsletter-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.newsletter-btn {
    padding: 12px 24px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.newsletter-btn:hover {
    background: #1d4ed8;
}

/* Search and Filter Bar */
.search-filter-bar {
    padding: 32px 40px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.search-container {
    position: relative;
    max-width: 400px;
    margin: 0 auto 24px;
}

.search-input {
    width: 100%;
    padding: 12px 48px 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    font-size: 18px;
}

/* Ensure search icon renders at a predictable size across browsers */
.search-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

.filter-chips {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 8px;
}

.chip {
    padding: 8px 16px;
    background: #f3f4f6;
    border: 2px solid transparent;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.chip:hover {
    background: #e5e7eb;
}

.chip.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Enhanced Article Cards */
.articles-grid {
    padding: 32px 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.article-card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,.06);
    transition: all 0.3s ease;
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
}

.card-link {
    display: block;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.card-link:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
    border-radius: 12px;
}

.article-header .article-title {
    margin: 0 0 16px;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1f2937;
}

.article-excerpt {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-indicator {
    margin-top: 16px;
    color: #2563eb;
    font-weight: 600;
    font-size: 14px;
}

.article-meta {
    padding: 0 24px 24px;
    border-top: 1px solid #f3f4f6;
    margin-top: 16px;
    padding-top: 16px;
}

.article-meta time {
    color: #6b7280;
    font-size: 14px;
}

.reading-time {
    color: #6b7280;
    font-size: 14px;
    margin-left: 16px;
}

.article-tags {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.tag:hover {
    background: #e5e7eb;
}

.tag.featured-tag {
    background: #fef3c7;
    color: #92400e;
}

/* Newsletter Inline CTA */
.newsletter-inline {
    grid-column: 1 / -1;
    margin: 16px 0;
}

.newsletter-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 32px;
    border-radius: 16px;
    text-align: center;
}

.newsletter-card h3 {
    margin: 0 0 8px;
    font-size: 1.5rem;
}

.newsletter-card p {
    margin: 0 0 24px;
    opacity: 0.9;
}

/* --- New UX blocks (compact hero, list toolbar, grid cards, subscribe, tiny footer) --- */
/* Compact hero */
.hero { padding: clamp(20px,4vw,36px) 16px; background: linear-gradient(135deg,#2b5876,#4e4376); color:#fff; }
.hero__inner { max-width: 1000px; margin: 0 auto; text-align: center; }
.hero__title { font-size: clamp(22px,3.2vw,32px); margin: 0 0 4px; font-weight:800; }
.hero__sub { opacity:.9; margin: 0; }
.hero__util { margin-top: 12px; display:flex; gap: 12px; flex-wrap: wrap; justify-content:center; }
.util-link { padding:6px 10px; background: rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.2); border-radius:8px; color:#fff; text-decoration:none; }
.util-link:hover { background: rgba(255,255,255,.18); }

/* Ultra-compact variant */
.hero--mini { padding: 10px 16px 12px; }
.hero--mini .hero__sub { display:none; }
/* Ensure space between hero and toolbar */
.hero + .list-toolbar { margin-top: 8px; }

/* Split hero: title left, utility links right on wide screens */
@media (min-width: 900px) {
    .hero__inner { text-align: left; display:flex; align-items:flex-start; justify-content: space-between; gap: 16px; }
    .hero__title { margin: 0; }
    .hero__util { margin-top: 0; flex-shrink: 0; }
    .hero__left { flex: 1 1 auto; }
    .hero__side { flex: 0 0 auto; display:flex; flex-direction: column; align-items: flex-end; gap: 8px; }
}

/* Search in hero side */
.search--hero input { width: min(320px, 32vw); padding:10px 12px; border:1px solid rgba(255,255,255,.35); border-radius:10px; background: rgba(255,255,255,.9); color:#111; }
.search--hero input::placeholder { color:#4b5563; }

/* Sticky listing toolbar */
.list-toolbar { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); background: color-mix(in oklab, #ffffff 88%, transparent); padding: 10px 16px; display:flex; justify-content:flex-start; align-items:center; }
.chip[aria-current="true"] { background:#2563eb; color:#fff; border-color:#2563eb; }

/* Tighter grid cards */
.grid { gap: 14px; padding: 12px 16px; list-style: none; margin: 0; }
.card { position: relative; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.03); transition: box-shadow .15s ease, transform .15s ease; cursor: pointer; }
.card__link { position: absolute; inset: 0; z-index: 2; display: block; }
.card:hover { box-shadow: 0 8px 22px rgba(0,0,0,.07); transform: translateY(-1px); }
.card__meta { min-height: 20px; }
.card__link:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; border-radius: 12px; }
.card__title { -webkit-line-clamp: 2; line-clamp: 2; }
.card__excerpt { -webkit-line-clamp: 2; line-clamp: 2; }
.card__tags .tag { font-size: .73rem; }

/* Optional new-dot indicator */
.dot-new { width:8px; height:8px; border-radius:50%; background:#22c55e; display:inline-block; }

/* Rhythm and spacing */
section { margin-block: clamp(12px, 2.4vw, 20px); }
h2 { margin: 8px 0 6px; }

/* Subscribe light box */
.subscribe { margin: 18px auto 8px; max-width: 860px; text-align:center; background: linear-gradient(135deg, #f7faff, #f8fbff); border: 1px solid #e9eef7; border-radius: 14px; padding: clamp(14px,3vw,22px); }
.subscribe form { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }
.subscribe input { width: min(360px, 80vw); }
.subscribe.sub-hidden { display: none; }

/* Tiny footer */
.site-footer { padding: 12px; font-size: .9rem; }
.foot-links a { color:#4b5563; }

/* Responsive Design */
@media (max-width: 768px) {
    .search-filter-bar {
        padding: 24px 20px 16px;
    }
    
    .filter-chips {
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .filter-chips::-webkit-scrollbar {
        display: none;
    }
    
    .articles-grid {
        padding: 24px 20px;
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .newsletter-cta {
        padding: 20px;
        margin: 24px 0;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .hero {
        padding: 40px 20px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .article-card {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .article-header .article-title {
        color: #f9fafb;
    }
    
    .article-excerpt {
        color: #d1d5db;
    }
    
    .article-meta time,
    .reading-time {
        color: #9ca3af;
    }
    
    .tag {
        background: #374151;
        color: #d1d5db;
    }
    
    .tag:hover {
        background: #4b5563;
    }
}

/* Focus Management for Accessibility */
.card-link:focus-within .read-more-indicator {
    text-decoration: underline;
}

/* Animation for Filter Transitions */
.article-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.article-card.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}
