/* ==========================================================================
   BLOG STYLES — DOT Driver Certification
   Matches site design system: Navy (#0A2463), Red (#D83121), Poppins/Roboto
   ========================================================================== */

/* ---------- Blog Listing Page ---------- */

.blog-hero {
    background: linear-gradient(135deg, #0A2463 0%, #1a3a7a 50%, #0A2463 100%);
    padding: 7rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.03) 0%, transparent 70%);
    animation: blogHeroPulse 8s ease-in-out infinite;
}

@keyframes blogHeroPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
}

.blog-hero h1 {
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.blog-hero p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 1;
}

/* Search Bar */
.blog-search-wrapper {
    max-width: 560px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.blog-search-wrapper input {
    width: 100%;
    padding: 16px 24px 16px 52px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.blog-search-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.blog-search-wrapper input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.blog-search-wrapper .search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    pointer-events: none;
}

/* Blog Grid */
.blog-listing-section {
    padding: 4rem 0 5rem;
    background: #f8f9fa;
    min-height: 60vh;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 1rem;
}

.blog-results-info {
    margin-bottom: 1.5rem;
    color: #6b7280;
    font-size: 0.95rem;
}

.blog-results-info span {
    font-weight: 600;
    color: #0A2463;
}

/* Blog Card */
.blog-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(10, 36, 99, 0.06);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(10, 36, 99, 0.06);
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(10, 36, 99, 0.12);
}

.blog-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image {
    transform: scale(1.05);
}

.blog-card-image-wrapper {
    overflow: hidden;
    position: relative;
}

.blog-card-image-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(0,0,0,0.05), transparent);
}

.blog-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
    color: #6b7280;
}

.blog-card-meta i {
    margin-right: 4px;
    font-size: 0.75rem;
}

.blog-card-meta .blog-read-time {
    color: #D83121;
    font-weight: 500;
}

.blog-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #0A2463;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-card h3 a:hover {
    color: #D83121;
}

.blog-card-excerpt {
    color: #4b5563;
    font-size: 0.92rem;
    line-height: 1.65;
    margin-bottom: 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 #f0f0f0;
}

.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #D83121;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.blog-read-more:hover {
    gap: 10px;
}

.blog-read-more i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.blog-read-more:hover i {
    transform: translateX(4px);
}

/* Loading State */
.blog-loading {
    text-align: center;
    padding: 4rem 0;
    color: #6b7280;
}

.blog-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #0A2463;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.blog-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.blog-empty i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.blog-empty h3 {
    color: #374151;
    margin-bottom: 0.5rem;
}

.blog-empty p {
    color: #6b7280;
    font-size: 1rem;
}

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

.blog-pagination button {
    padding: 10px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.blog-pagination button:hover:not(:disabled) {
    border-color: #0A2463;
    color: #0A2463;
    background: rgba(10, 36, 99, 0.04);
}

.blog-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.blog-pagination .page-info {
    padding: 10px 16px;
    color: #6b7280;
    font-size: 0.9rem;
}

/* ---------- Blog Detail Page ---------- */

.blog-detail-hero {
    background: linear-gradient(135deg, #0A2463 0%, #1a3a7a 100%);
    padding: 7rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.blog-detail-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('') center/cover;
    opacity: 0.15;
    z-index: 0;
}

.blog-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.blog-breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.blog-breadcrumb a:hover {
    color: #fff;
}

.blog-breadcrumb span {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

.blog-breadcrumb .current {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-detail-hero h1 {
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1.25rem;
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.blog-detail-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.blog-detail-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
}

.blog-detail-meta i {
    font-size: 0.85rem;
}

/* Blog Content Area */
.blog-detail-section {
    padding: 0 0 5rem;
    background: #f8f9fa;
}

.blog-detail-layout {
    max-width: 860px;
    margin: -2rem auto 0;
    position: relative;
    z-index: 2;
}

.blog-featured-image-wrapper {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    margin-bottom: 2.5rem;
}

.blog-featured-image-wrapper img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.blog-content-body {
    background: #fff;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(10, 36, 99, 0.06);
    border: 1px solid rgba(10, 36, 99, 0.04);
}

/* Blog Typography */
.blog-content-body h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.65rem;
    font-weight: 600;
    color: #0A2463;
    margin: 2rem 0 1rem;
    line-height: 1.3;
}

.blog-content-body h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #0A2463;
    margin: 1.75rem 0 0.75rem;
    line-height: 1.35;
}

.blog-content-body p {
    font-family: 'Roboto', sans-serif;
    font-size: 1.05rem;
    color: #374151;
    line-height: 1.85;
    margin-bottom: 1.25rem;
}

.blog-content-body ul,
.blog-content-body ol {
    padding-left: 1.75rem;
    margin-bottom: 1.25rem;
}

.blog-content-body li {
    font-family: 'Roboto', sans-serif;
    font-size: 1.02rem;
    color: #374151;
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.blog-content-body strong {
    color: #1f2937;
    font-weight: 600;
}

.blog-content-body a {
    color: #D83121;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.blog-content-body a:hover {
    border-bottom-color: #D83121;
}

.blog-content-body blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #D83121;
    background: #fdf2f2;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #4b5563;
}

/* Related Posts */
.blog-related-section {
    padding: 4rem 0 5rem;
    background: #fff;
}

.blog-related-section .section-title {
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    color: #0A2463;
    margin-bottom: 2.5rem;
}

.blog-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* ---------- Homepage Blog Section ---------- */

.latest-blogs-section {
    padding: 5rem 0;
    background: #fff;
}

.latest-blogs-section .section-title {
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    color: #0A2463;
    margin-bottom: 0.5rem;
}

.latest-blogs-section .section-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 1.05rem;
    margin-bottom: 3rem;
}

.latest-blogs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.latest-blogs-cta {
    text-align: center;
    margin-top: 2rem;
}

.latest-blogs-cta a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0A2463;
    color: #fff;
    padding: 14px 32px;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(10, 36, 99, 0.25);
}

.latest-blogs-cta a:hover {
    background: #0d2f7a;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(10, 36, 99, 0.35);
}

.latest-blogs-cta a .arrow {
    transition: transform 0.3s ease;
}

.latest-blogs-cta a:hover .arrow {
    transform: translateX(4px);
}

/* ---------- Skeleton Loading ---------- */

.blog-skeleton-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(10, 36, 99, 0.06);
}

.blog-skeleton-image {
    height: 220px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.blog-skeleton-body {
    padding: 1.5rem;
}

.blog-skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.blog-skeleton-line.short { width: 60%; }
.blog-skeleton-line.medium { width: 80%; }
.blog-skeleton-line.title { height: 20px; width: 90%; margin-bottom: 14px; }

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Card appear animation */
.blog-card {
    opacity: 0;
    transform: translateY(20px);
    animation: blogCardAppear 0.5s ease forwards;
}

.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-card:nth-child(5) { animation-delay: 0.5s; }
.blog-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes blogCardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .blog-grid,
    .latest-blogs-grid,
    .blog-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-hero h1 {
        font-size: 2.4rem;
    }

    .blog-detail-hero h1 {
        font-size: 2rem;
    }

    .blog-content-body {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 6rem 0 3rem;
    }

    .blog-hero h1 {
        font-size: 2rem;
    }

    .blog-hero p {
        font-size: 1rem;
    }

    .blog-grid,
    .latest-blogs-grid,
    .blog-related-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .blog-detail-hero {
        padding: 6rem 0 2rem;
    }

    .blog-detail-hero h1 {
        font-size: 1.7rem;
    }

    .blog-detail-meta {
        gap: 1rem;
    }

    .blog-content-body {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .blog-content-body h2 {
        font-size: 1.4rem;
    }

    .blog-content-body h3 {
        font-size: 1.15rem;
    }

    .blog-content-body p {
        font-size: 1rem;
    }

    .blog-featured-image-wrapper img {
        height: 250px;
    }

    .blog-card-image {
        height: 200px;
    }

    .latest-blogs-section {
        padding: 3rem 0;
    }

    .latest-blogs-section .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .blog-hero h1 {
        font-size: 1.6rem;
    }

    .blog-search-wrapper input {
        padding: 14px 18px 14px 44px;
        font-size: 0.9rem;
    }

    .blog-detail-hero h1 {
        font-size: 1.45rem;
    }

    .blog-content-body {
        padding: 1.25rem;
    }

    .blog-featured-image-wrapper img {
        height: 200px;
    }
}
