/* ========================================================
   Servona Blog CSS
   Uses CSS variables defined in the page <style> block
   ======================================================== */

/* ========== BLOG HERO ========== */
.blog-hero {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 60%, #1D4ED8 100%);
    padding: 4rem 2rem 3.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.blog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 120%, rgba(37,99,235,0.35) 0%, transparent 70%);
    pointer-events: none;
}
.blog-hero-inner {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
}
.blog-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.85rem;
}
.blog-hero p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
    margin: 0 auto;
    max-width: 520px;
}

/* ========== BLOG MAIN LAYOUT ========== */
.blog-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
}

/* ========== ARTICLE CARD GRID ========== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    margin-bottom: 3rem;
}

/* ========== ARTICLE CARD ========== */
.article-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--gray-border);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.article-card:hover {
    box-shadow: 0 8px 32px rgba(15,23,42,0.12);
    transform: translateY(-3px);
}
.article-card-image {
    aspect-ratio: 16 / 9;
    width: 100%;
    overflow: hidden;
    background: var(--gray-light);
    flex-shrink: 0;
}
.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.article-card:hover .article-card-image img {
    transform: scale(1.04);
}
.article-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
}
.article-card-image-placeholder svg {
    width: 48px;
    height: 48px;
    color: #93C5FD;
}
.article-card-body {
    padding: 1.25rem 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.article-card-footer {
    padding: 0.75rem 1.25rem 1.1rem;
    border-top: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Category badge */
.category-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--blue);
    background: var(--blue-light);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.65rem;
    white-space: nowrap;
}
.category-badge.green {
    color: var(--green);
    background: #ECFDF5;
}
.category-badge.orange {
    color: #C2410C;
    background: #FFF7ED;
}

/* Card title */
.article-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card:hover .article-card-title {
    color: var(--blue);
}

/* Card excerpt */
.article-card-excerpt {
    font-size: 0.875rem;
    color: var(--gray);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
}

/* Card meta footer */
.article-card-date {
    font-size: 0.78rem;
    color: var(--gray);
}
.article-card-read-more {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--blue);
    white-space: nowrap;
    transition: gap 0.15s;
}
.article-card:hover .article-card-read-more {
    text-decoration: underline;
}

/* ========== LOADING SKELETON ========== */
@keyframes skeleton-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}
.skeleton {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 600px 100%;
    animation: skeleton-shimmer 1.4s infinite linear;
    border-radius: 6px;
}
.skeleton-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--gray-border);
    overflow: hidden;
}
.skeleton-image {
    aspect-ratio: 16 / 9;
    width: 100%;
}
.skeleton-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.skeleton-badge {
    height: 20px;
    width: 80px;
}
.skeleton-title {
    height: 18px;
    width: 90%;
}
.skeleton-title-2 {
    height: 18px;
    width: 65%;
}
.skeleton-text {
    height: 14px;
    width: 100%;
}
.skeleton-text-short {
    height: 14px;
    width: 75%;
}
.skeleton-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--gray-border);
    display: flex;
    justify-content: space-between;
}
.skeleton-date {
    height: 12px;
    width: 80px;
}
.skeleton-link {
    height: 12px;
    width: 60px;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
}
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray);
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    padding: 0.55rem 1rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    font-family: inherit;
    text-decoration: none;
}
.pagination-btn:hover:not(:disabled) {
    color: var(--blue);
    border-color: var(--blue);
    background: var(--blue-light);
}
.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.pagination-info {
    font-size: 0.875rem;
    color: var(--gray);
    padding: 0 0.5rem;
    white-space: nowrap;
}
.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.pagination-page {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray);
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    font-family: inherit;
}
.pagination-page:hover {
    color: var(--blue);
    border-color: var(--blue);
    background: var(--blue-light);
}
.pagination-page.active {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    grid-column: 1 / -1;
}
.empty-state-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    color: #CBD5E1;
}
.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}
.empty-state p {
    font-size: 0.95rem;
    color: var(--gray);
    max-width: 360px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}
.empty-state-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--blue);
    border: 1.5px solid var(--blue);
    border-radius: 8px;
    padding: 0.55rem 1.25rem;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}
.empty-state-link:hover {
    background: var(--blue);
    color: #fff;
}

/* ========== ERROR STATE ========== */
.error-state {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}
.error-state h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}
.error-state p {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 1.25rem;
}
.error-state button {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--blue);
    background: var(--blue-light);
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.25rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.error-state button:hover {
    background: #DBEAFE;
}

/* ========================================================
   BLOG POST PAGE
   ======================================================== */

/* ========== POST BREADCRUMB ========== */
.post-breadcrumb {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 2rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.post-breadcrumb a {
    font-size: 0.82rem;
    color: var(--gray);
    text-decoration: none;
    transition: color 0.15s;
}
.post-breadcrumb a:hover {
    color: var(--blue);
}
.post-breadcrumb-sep {
    font-size: 0.82rem;
    color: #CBD5E1;
}
.post-breadcrumb-current {
    font-size: 0.82rem;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

/* ========== POST HEADER ========== */
.post-header {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 2rem 0;
}
.post-header-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.post-title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 1rem;
}
.post-byline {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--gray);
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-border);
    margin-bottom: 0;
}
.post-byline-author {
    font-weight: 600;
    color: var(--dark);
}
.post-byline-sep {
    width: 4px;
    height: 4px;
    background: #CBD5E1;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ========== POST FEATURED IMAGE ========== */
.post-featured-image {
    max-width: 720px;
    margin: 1.75rem auto 0;
    padding: 0 2rem;
}
.post-featured-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

/* ========== POST BODY ========== */
.post-body {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 2rem 2.5rem;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--dark);
}
.post-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.02em;
    margin: 2rem 0 0.75rem;
    line-height: 1.3;
}
.post-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    margin: 1.75rem 0 0.6rem;
    line-height: 1.35;
}
.post-body h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    margin: 1.5rem 0 0.5rem;
}
.post-body p {
    margin-bottom: 1.3rem;
}
.post-body p:last-child {
    margin-bottom: 0;
}
.post-body a {
    color: var(--blue);
    text-decoration: underline;
    text-decoration-color: rgba(37,99,235,0.35);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.15s;
}
.post-body a:hover {
    text-decoration-color: var(--blue);
}
.post-body ul,
.post-body ol {
    margin: 0 0 1.3rem 1.5rem;
}
.post-body li {
    margin-bottom: 0.4rem;
}
.post-body img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.5rem 0;
    display: block;
}
.post-body blockquote {
    border-left: 4px solid var(--blue);
    background: var(--blue-light);
    margin: 1.75rem 0;
    padding: 1rem 1.25rem 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #334155;
}
.post-body blockquote p {
    margin-bottom: 0;
}
.post-body pre {
    background: var(--dark-2);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}
.post-body pre code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    line-height: 1.65;
    color: #E2E8F0;
    background: none;
    padding: 0;
    border-radius: 0;
}
.post-body code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.875em;
    background: #F1F5F9;
    color: #BE185D;
    padding: 0.15em 0.4em;
    border-radius: 4px;
}
.post-body hr {
    border: none;
    border-top: 1px solid var(--gray-border);
    margin: 2rem 0;
}
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}
.post-body th,
.post-body td {
    text-align: left;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--gray-border);
}
.post-body th {
    background: var(--gray-light);
    font-weight: 700;
    color: var(--dark);
}
.post-body td {
    color: var(--gray);
}

/* ========== TAG PILLS ========== */
.post-tags {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.post-tags-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray);
    margin-right: 0.25rem;
}
.tag-pill {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--gray);
    background: var(--gray-light);
    border: 1px solid var(--gray-border);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    text-decoration: none;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.tag-pill:hover {
    color: var(--blue);
    background: var(--blue-light);
    border-color: #BFDBFE;
}

/* ========== RELATED ARTICLES ========== */
.related-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
    border-top: 1px solid var(--gray-border);
}
.related-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1.5rem;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* ========== POST 404 STATE ========== */
.post-not-found {
    max-width: 520px;
    margin: 0 auto;
    padding: 6rem 2rem;
    text-align: center;
}
.post-not-found h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.75rem;
}
.post-not-found p {
    font-size: 0.95rem;
    color: var(--gray);
    margin-bottom: 2rem;
    line-height: 1.6;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    transition: gap 0.15s;
}
.back-link:hover {
    gap: 0.6rem;
    text-decoration: underline;
}
.back-link-bottom {
    display: block;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
}
.back-link-bottom a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    transition: gap 0.15s;
}
.back-link-bottom a:hover {
    gap: 0.6rem;
    text-decoration: underline;
}

/* ========== POST LOADING SKELETON ========== */
.post-loading {
    max-width: 720px;
    margin: 4rem auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.post-loading-image {
    height: 340px;
    border-radius: 12px;
    margin: 0.5rem 0;
}

/* ========== NAV CTA BUTTONS ========== */
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.btn-cta-quote {
    display: none;
    background: var(--blue);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
}
.btn-cta-quote:hover {
    background: var(--blue-dark);
}
@media (min-width: 1024px) {
    .btn-cta-quote {
        display: inline-block;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 900px) {
    .blog-main {
        padding: 2.5rem 1.5rem 4rem;
    }
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}
@media (max-width: 640px) {
    .blog-hero {
        padding: 3rem 1.25rem 2.5rem;
    }
    .blog-main {
        padding: 2rem 1.25rem 3.5rem;
    }
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .related-grid {
        grid-template-columns: 1fr;
    }
    .pagination {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .pagination-pages {
        display: none;
    }
    .post-header,
    .post-featured-image,
    .post-body,
    .post-tags,
    .post-breadcrumb {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    .post-title {
        font-size: 1.6rem;
    }
    .related-section {
        padding: 2rem 1.25rem 3.5rem;
    }
    .back-link-bottom {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}
@media (max-width: 420px) {
    .articles-grid {
        gap: 0.875rem;
    }
    .blog-hero h1 {
        font-size: 1.75rem;
    }
    .blog-hero p {
        font-size: 0.95rem;
    }
}
