/* =============================================
   Blog Styles — EnvioSMS
   ============================================= */

/* ---- Blog Index Page ---- */
.blog-hero {
    padding: 6rem 0 3rem;
    text-align: center;
}

.blog-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: hsl(var(--primary));
    background: hsla(var(--primary), 0.1);
    padding: 0.375rem 1rem;
    border-radius: 999px;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: hsl(var(--foreground));
    margin: 0 0 1rem;
    line-height: 1.15;
}

.blog-hero-subtitle {
    font-size: 1.125rem;
    color: hsl(var(--muted-foreground));
    max-width: 540px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* Search Bar */
.blog-search-wrap {
    max-width: 520px;
    margin: 0 auto;
    position: relative;
}

.blog-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: hsl(var(--muted-foreground));
    pointer-events: none;
    display: flex;
    align-items: center;
}

.blog-search-icon svg {
    width: 18px;
    height: 18px;
}

.blog-search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.875rem;
    font-size: 1rem;
    font-family: var(--font-sans);
    color: hsl(var(--foreground));
    background: hsl(var(--card));
    border: 1.5px solid hsl(var(--border));
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.blog-search-input::placeholder {
    color: hsl(var(--muted-foreground));
}

.blog-search-input:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsla(var(--primary), 0.15);
}

/* Blog Grid */
.blog-grid-section {
    padding: 2rem 0 5rem;
}

.blog-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.blog-grid-count {
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
}

.blog-grid-count strong {
    color: hsl(var(--foreground));
}

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

/* Blog Card */
.blog-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px hsla(var(--foreground), 0.1);
    border-color: hsl(var(--primary));
    text-decoration: none;
}

.blog-card-date {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.blog-card-date svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.blog-card-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.blog-card:hover .blog-card-title {
    color: hsl(var(--primary));
}

.blog-card-description {
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.6;
    margin: 0 0 1.25rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid hsl(var(--border));
    margin-top: auto;
}

.blog-card-read-more {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--primary));
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.blog-card-read-more svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

.blog-card:hover .blog-card-read-more svg {
    transform: translateX(3px);
}

/* No results */
.blog-no-results {
    text-align: center;
    padding: 4rem 1rem;
    color: hsl(var(--muted-foreground));
    display: none;
}

.blog-no-results svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.blog-no-results h3 {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
    color: hsl(var(--foreground));
}

/* Pagination */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: var(--font-sans);
    color: hsl(var(--foreground));
    background: hsl(var(--card));
    border: 1.5px solid hsl(var(--border));
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    text-decoration: none;
}

.page-btn:hover {
    border-color: hsl(var(--primary));
    color: hsl(var(--primary));
}

.page-btn.active {
    background: hsl(var(--primary));
    border-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    font-weight: 600;
}

.page-btn:disabled,
.page-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.page-btn svg {
    width: 16px;
    height: 16px;
}

/* ---- Blog Post Page ---- */
.blog-post-main {
    padding: 8rem 0 4rem;
}

.blog-post-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: color 0.2s;
}

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

.breadcrumb-sep {
    display: flex;
    align-items: center;
    color: hsl(var(--border));
}

.breadcrumb-sep svg {
    width: 14px;
    height: 14px;
}

/* Post Header */
.post-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid hsl(var(--border));
}

.post-title {
    font-family: var(--font-display);
    font-size: clamp(1.625rem, 3.5vw, 2.5rem);
    font-weight: 800;
    color: hsl(var(--foreground));
    margin: 0 0 1rem;
    line-height: 1.2;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

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

.post-meta svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.post-description {
    font-size: 1.0625rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.65;
    margin: 0;
}

/* Post Content */
.post-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: hsl(var(--foreground));
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: var(--font-display);
    font-weight: 700;
    color: hsl(var(--foreground));
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

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

.post-content h2 {
    font-size: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid hsl(var(--border));
}

.post-content h3 {
    font-size: 1.25rem;
    color: hsl(var(--primary));
}

.post-content h4 {
    font-size: 1.0625rem;
}

.post-content p {
    margin: 0 0 1.25rem;
}

.post-content a {
    color: hsl(var(--primary));
    text-decoration: underline;
    text-decoration-color: hsla(var(--primary), 0.4);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s;
}

.post-content a:hover {
    text-decoration-color: hsl(var(--primary));
}

.post-content ul,
.post-content ol {
    margin: 0 0 1.25rem 1.5rem;
    padding: 0;
}

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

.post-content strong {
    font-weight: 600;
    color: hsl(var(--foreground));
}

.post-content em {
    font-style: italic;
}

.post-content blockquote {
    border-left: 4px solid hsl(var(--primary));
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: hsla(var(--primary), 0.05);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: hsl(var(--muted-foreground));
}

.post-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
    background: hsl(var(--secondary));
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: hsl(var(--foreground));
}

.post-content pre {
    background: hsl(220, 26%, 10%);
    color: hsl(210, 20%, 88%);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.7;
}

.post-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
    overflow-x: auto;
    display: block;
}

.post-content th,
.post-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid hsl(var(--border));
}

.post-content th {
    background: hsl(var(--secondary));
    font-weight: 600;
    font-family: var(--font-display);
    color: hsl(var(--foreground));
}

.post-content tr:nth-child(even) td {
    background: hsla(var(--secondary), 0.5);
}

.post-content hr {
    border: none;
    border-top: 1px solid hsl(var(--border));
    margin: 2rem 0;
}

/* CTA Section at end of post */
.post-cta {
    margin: 3rem 0 2rem;
    background: linear-gradient(135deg, hsla(var(--primary), 0.08), hsla(var(--primary), 0.03));
    border: 1.5px solid hsla(var(--primary), 0.3);
    border-radius: calc(var(--radius) * 1.5);
    padding: 2rem;
}

.post-cta-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.post-cta-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: hsl(var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: hsl(var(--primary-foreground));
}

.post-cta-icon svg {
    width: 20px;
    height: 20px;
}

.post-cta-text {
    flex: 1;
    min-width: 200px;
}

.post-cta-text h3 {
    font-family: var(--font-display);
    font-size: 1.1875rem;
    font-weight: 700;
    margin: 0 0 0.375rem;
    color: hsl(var(--foreground));
}

.post-cta-text p {
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
    margin: 0;
    line-height: 1.5;
}

.post-cta-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.post-cta-btn svg {
    width: 16px;
    height: 16px;
}

/* Share buttons */
.post-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid hsl(var(--border));
    margin-top: 1.5rem;
}

.post-share-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
}

.share-btn {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--secondary));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    font-family: inherit;
}

.share-btn:hover {
    background: hsl(var(--primary));
    border-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.share-btn svg {
    width: 16px;
    height: 16px;
}

/* Sidebar */
.blog-sidebar {
    position: sticky;
    top: 5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.5rem;
}

.sidebar-widget-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin: 0 0 0.75rem;
}

.sidebar-widget-text {
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.55;
    margin: 0 0 1rem;
}

.sidebar-price {
    margin-bottom: 1rem;
}

.sidebar-price-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: hsl(var(--primary));
}

.sidebar-price-unit {
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
}

.sidebar-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.sidebar-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
    padding: 0.3rem 0;
}

.sidebar-features svg {
    width: 15px;
    height: 15px;
    color: hsl(var(--primary));
    flex-shrink: 0;
}

/* Button utilities */
.btn-block {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.btn-outline {
    background: transparent;
    color: hsl(var(--foreground));
    border: 1.5px solid hsl(var(--border));
}

.btn-outline:hover {
    border-color: hsl(var(--primary));
    color: hsl(var(--primary));
}

/* Nav active state */
.nav-link.active {
    color: hsl(var(--primary));
    font-weight: 600;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .blog-post-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .blog-hero {
        padding: 5rem 0 2rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        grid-template-columns: 1fr;
    }

    .post-cta-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .post-cta-btn {
        width: 100%;
        justify-content: center;
    }

    .blog-post-main {
        padding: 6rem 0 3rem;
    }

    .post-meta {
        gap: 0.75rem;
    }
}
