/* =============================================
   Blog Public CSS — GoAccount Blog
   ============================================= */

/* Hero — no fixed background on mobile (iOS bug) */
.blog-hero {
    background-attachment: scroll;
}
@media (min-width: 1024px) {
    .blog-hero { background-attachment: fixed; }
}

/* Category Pills */
.cat-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
    transition: all 0.15s ease;
    text-decoration: none;
}
.cat-pill:hover,
.cat-pill.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

/* Blog Cards */
.blog-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.blog-card:hover {
    box-shadow: 0 10px 30px -8px rgba(30, 64, 175, 0.12);
    transform: translateY(-2px);
}
.blog-card.featured {
    border-color: #bfdbfe;
    background: linear-gradient(135deg, #eff6ff 0%, #fff 60%);
}
.blog-card-img img {
    width: 100%;
    height: 11rem;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.blog-card:hover .blog-card-img img {
    transform: scale(1.04);
}
.blog-card-img-placeholder {
    height: 8rem;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
}
.blog-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
}
.blog-card-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.15s;
}
.blog-card-title a:hover {
    color: #1d4ed8;
}

/* Pagination */
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.15s;
}
.page-btn:hover { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.page-btn.active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

/* Sidebar */
.sidebar-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem;
}
.sidebar-heading {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.875rem;
}
.sidebar-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #475569;
    text-decoration: none;
    transition: all 0.15s;
}
.sidebar-cat-link:hover,
.sidebar-cat-link.active {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

/* Share Buttons */
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.15s;
}
.share-btn:hover { opacity: 0.85; transform: scale(1.1); }
.share-btn.facebook  { background: #1877f2; }
.share-btn.twitter   { background: #000; }
.share-btn.linkedin  { background: #0077b5; }
.share-btn.whatsapp  { background: #25d366; }

/* Post Content Styles */
.post-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #334155;
}
.post-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 2rem 0 0.875rem;
    padding-bottom: 0.375rem;
    border-bottom: 2px solid #e2e8f0;
}
.post-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    margin: 1.5rem 0 0.625rem;
}
.post-content p   { margin: 0 0 1.25rem; }
.post-content ul,
.post-content ol  { margin: 0 0 1.25rem 1.5rem; }
.post-content li  { margin-bottom: 0.4rem; }
.post-content ul  { list-style-type: disc; }
.post-content ol  { list-style-type: decimal; }
.post-content a   { color: #1d4ed8; text-decoration: underline; }
.post-content strong { color: #1e293b; font-weight: 700; }
.post-content em  { font-style: italic; }
.post-content blockquote {
    border-left: 4px solid #3b82f6;
    background: #eff6ff;
    padding: 0.875rem 1.25rem;
    border-radius: 0 0.75rem 0.75rem 0;
    margin: 1.25rem 0;
    color: #1e293b;
    font-style: italic;
}
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.post-content table thead tr { background: #1d4ed8; color: #fff; }
.post-content table th,
.post-content table td { padding: 0.625rem 0.875rem; text-align: left; border-bottom: 1px solid #e2e8f0; }
.post-content table tbody tr:nth-child(even) { background: #f8fafc; }
.post-content table tbody tr:hover { background: #eff6ff; }
.post-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    font-size: 0.875rem;
    margin: 1.25rem 0;
}
.post-content code {
    background: #f1f5f9;
    color: #dc2626;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: monospace;
}

/* TOC Link */
.toc-link {
    display: block;
    font-size: 0.8125rem;
    padding: 0.25rem 0;
    text-decoration: none;
    border-left: 2px solid transparent;
    padding-left: 0.5rem;
    transition: all 0.15s;
}
.toc-link:hover {
    border-color: #3b82f6;
    color: #1d4ed8 !important;
    padding-left: 0.75rem;
}

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

/* Tablet */
@media (max-width: 1024px) {
    /* Blog listing: sidebar stacks below posts */
    .max-w-7xl .grid.lg\:grid-cols-3 { grid-template-columns: 1fr !important; }

    /* Sidebar goes below the posts */
    .max-w-7xl aside { order: 2; }
    .max-w-7xl main  { order: 1; }

    /* Blog post: same */
    article.lg\:col-span-2 { grid-column: span 1 !important; }
}

/* Mobile */
@media (max-width: 768px) {
    /* Blog hero */
    .blog-hero { padding-top: 5rem !important; padding-bottom: 2.5rem !important; }
    .blog-hero h1 { font-size: 1.85rem !important; }
    .blog-hero p  { font-size: 0.95rem !important; }
    .blog-hero form { max-width: 100% !important; }

    /* Category pills — hide overflow with scroll */
    .cat-pill { font-size: 0.75rem; padding: 0.3rem 0.75rem; }

    /* Blog cards: single column */
    .grid.sm\:grid-cols-2 { grid-template-columns: 1fr !important; }

    /* Post content */
    .post-content h2 { font-size: 1.25rem; }
    .post-content h3 { font-size: 1.05rem; }
    .post-content table { font-size: 0.8rem; }
    .post-content table th,
    .post-content table td { padding: 0.4rem 0.5rem; }

    /* Share buttons */
    .share-btn { width: 1.75rem; height: 1.75rem; font-size: 0.75rem; }

    /* Post meta row wraps */
    .flex.flex-wrap.items-center.gap-4 { gap: 0.5rem; }

    /* Sidebar card */
    .sidebar-card { padding: 1rem; }
}

@media (max-width: 480px) {
    .blog-hero h1 { font-size: 1.5rem !important; }
    .blog-card-img img { height: 9rem; }

    /* Post breadcrumb hides long text */
    nav .line-clamp-1 { max-width: 160px; }
}

/* Hide scrollbar on category pills strip */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
