/* ================================================================
   BLOG.CSS - COMPLETELY FIXED & FULLY RESPONSIVE
   Surgicrafts Blog Page - No text cutoff, proper spacing
================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --red: #c8102e;
    --red-dark: #9b0d23;
    --red-light: rgba(200, 16, 46, 0.1);
    --black: #0d0d0d;
    --white: #ffffff;
    --dark: #161616;
    --gray: #3a3a3a;
    --gray-light: #6c757d;
    --light: #f5f5f5;
    --mid: #777;
    --border: #e9ecef;
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

/* Container */
.container {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================================================================
   BLOG HERO SECTION - FIXED
================================================================ */
.blog-hero {
    position: relative;
    padding: 80px 0;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
    overflow: hidden;
}

.blog-hero-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1576091160550-2173dba999ef?w=800&q=80') no-repeat center center;
    background-size: cover;
    opacity: 0.1;
}

.blog-hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

.blog-hero-content .label {
    color: var(--red);
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.blog-hero-content .heading {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 16px;
    line-height: 1.2;
}

.blog-hero-content .heading em {
    color: var(--red);
    font-style: normal;
}

.blog-hero-content .divider {
    width: 52px;
    height: 3px;
    background: var(--red);
    margin-bottom: 20px;
}

.blog-hero-content .sub {
    color: rgba(255, 255, 255, 0.7);
    max-width: 500px;
    font-size: 1rem;
    line-height: 1.6;
}

/* ================================================================
   MAIN BLOG LAYOUT
================================================================ */
.blog-main-section {
    background: var(--light);
    padding: 60px 0;
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 50px;
}

/* ================================================================
   BLOG CONTENT - FIXED TEXT CUTOFF
================================================================ */
.blog-content {
    background: transparent;
    width: 100%;
    overflow-x: hidden;
}

/* Mobile Search */
.blog-search-mobile {
    display: none;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    background: var(--white);
    border-radius: 50px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.search-form input {
    flex: 1;
    padding: 14px 20px;
    border: none;
    outline: none;
    font-size: 0.9rem;
}

.search-form button {
    background: var(--red);
    border: none;
    padding: 0 25px;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

/* Filter Tabs */
.blog-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.filter-tab {
    padding: 8px 22px;
    background: var(--white);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--border);
    display: inline-block;
}

.filter-tab:hover {
    border-color: var(--red);
    color: var(--red);
}

.filter-tab.active {
    background: var(--red);
    border-color: var(--red);
    color: var(--white);
}

.filter-tab span {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 4px;
}

/* Results Info */
.blog-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 0.85rem;
    color: var(--gray);
    flex-wrap: wrap;
    gap: 10px;
}

.clear-filters {
    color: var(--red);
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition);
}

/* Blog Grid - FIXED */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

/* Blog Card - FIXED for proper text display */
.blog-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.blog-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    flex-shrink: 0;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--white);
    z-index: 2;
}

.blog-category-badge.surgical { background: #1e3a5f; }
.blog-category-badge.veterinary { background: #2d6a4f; }
.blog-category-badge.dental { background: #0077b6; }
.blog-category-badge.beauty { background: #9d4edd; }

.blog-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 0.7rem;
    color: var(--gray-light);
}

.blog-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.blog-meta i {
    color: var(--red);
    font-size: 0.7rem;
}

.blog-title {
    font-family: "Oswald", sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 12px;
}

.blog-title a {
    color: var(--black);
    text-decoration: none;
    transition: var(--transition);
    display: block;
}

.blog-title a:hover {
    color: var(--red);
}

.blog-excerpt {
    font-size: 0.85rem;
    color: var(--mid);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.blog-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 36px;
    height: 36px;
    background: var(--red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.author-info .author-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--black);
    display: block;
}

.author-info .author-title {
    font-size: 0.65rem;
    color: var(--gray-light);
}

.read-more {
    color: var(--red);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.read-more i {
    transition: transform 0.2s ease;
}

.read-more:hover {
    color: var(--red-dark);
}

.read-more:hover i {
    transform: translateX(4px);
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 8px;
    text-decoration: none;
    color: var(--black);
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.pagination-link:hover,
.pagination-link.active {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}

.pagination-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* No Results */
.blog-no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 16px;
}

.blog-no-results i {
    font-size: 4rem;
    color: var(--gray-light);
    margin-bottom: 20px;
}

.blog-no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.blog-no-results p {
    color: var(--gray-light);
    margin-bottom: 25px;
}

/* ================================================================
   SIDEBAR
================================================================ */
.blog-sidebar {
    position: sticky;
    top: 120px;
}

.sidebar-widget {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-family: "Oswald", sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--red);
    display: inline-block;
}

/* Search Widget */
.sidebar-search-form {
    display: flex;
    background: var(--light);
    border-radius: 50px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.sidebar-search-form input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.85rem;
}

.sidebar-search-form button {
    background: var(--red);
    border: none;
    padding: 0 20px;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-search-form button:hover {
    background: var(--red-dark);
}

/* Categories List */
.categories-list {
    list-style: none;
    padding: 0;
}

.categories-list li {
    margin-bottom: 12px;
}

.categories-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    text-decoration: none;
    color: var(--gray);
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.categories-list li a:hover,
.categories-list li a.active {
    color: var(--red);
    padding-left: 8px;
}

.categories-list li a span {
    background: var(--light);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--gray);
}

/* Recent Posts */
.recent-posts-list {
    list-style: none;
    padding: 0;
}

.recent-post-link {
    display: flex;
    gap: 15px;
    text-decoration: none;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.recent-post-link:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-post-link:hover .recent-post-info h4 {
    color: var(--red);
}

.recent-post-img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.recent-post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--black);
    transition: var(--transition);
    margin-bottom: 6px;
}

.recent-post-date {
    font-size: 0.7rem;
    color: var(--gray-light);
}

/* Tags Cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    padding: 6px 14px;
    background: var(--light);
    border-radius: 30px;
    font-size: 0.75rem;
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
}

.tag:hover {
    background: var(--red);
    color: var(--white);
}

/* Newsletter */
.newsletter-widget p {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 16px;
    line-height: 1.5;
}

.newsletter-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--red);
}

.newsletter-form .btn-sm {
    width: 100%;
    padding: 10px;
    font-size: 0.8rem;
}

/* Featured Products */
.featured-products-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.featured-product-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.featured-product-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.featured-product-item img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.featured-product-info h4 {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--black);
}

.featured-product-info .price {
    font-size: 0.75rem;
    color: var(--red);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.view-product {
    font-size: 0.7rem;
    color: var(--red);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.view-product:hover {
    text-decoration: underline;
}

/* ================================================================
   CTA SECTION
================================================================ */
.blog-cta-section {
    background: linear-gradient(135deg, var(--dark) 0%, var(--black) 100%);
    padding: 60px 0;
    text-align: center;
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.cta-content .heading {
    color: var(--white);
    margin-bottom: 16px;
    font-size: 2rem;
}

.cta-content .heading em {
    color: var(--red);
    font-style: normal;
}

.cta-content p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    line-height: 1.6;
}

.cta-newsletter-form {
    display: flex;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.cta-newsletter-form input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
}

.cta-newsletter-form input:focus {
    outline: none;
}

.cta-newsletter-form .btn-red {
    padding: 14px 28px;
    white-space: nowrap;
}

/* Button Styles */
.btn-red {
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-red:hover {
    background: var(--red-dark);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.8rem;
}

.btn-outline-white {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline-white:hover {
    background: var(--white);
    color: var(--black);
    transform: translateY(-2px);
}

/* ================================================================
   RESPONSIVE DESIGN - COMPLETE FIX
================================================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .blog-sidebar {
        position: static;
    }
}

/* Mobile Landscape (576px - 768px) */
@media (max-width: 768px) {
    .blog-hero {
        padding: 50px 0;
    }
    
    .blog-hero-content {
        text-align: center;
        margin: 0 auto;
    }
    
    .blog-hero-content .divider {
        margin-left: auto;
        margin-right: auto;
    }
    
    .blog-hero-content .sub {
        margin-left: auto;
        margin-right: auto;
    }
    
    .blog-main-section {
        padding: 40px 0;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .blog-search-mobile {
        display: block;
    }
    
    /* Hide desktop search in sidebar on mobile */
    .search-widget {
        display: none;
    }
    
    .blog-filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .blog-filter-tabs::-webkit-scrollbar {
        height: 3px;
    }
    
    .blog-filter-tabs::-webkit-scrollbar-track {
        background: var(--border);
        border-radius: 10px;
    }
    
    .blog-filter-tabs::-webkit-scrollbar-thumb {
        background: var(--red);
        border-radius: 10px;
    }
    
    .filter-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .blog-results-info {
        flex-direction: column;
        text-align: center;
    }
    
    .blog-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .cta-newsletter-form {
        flex-direction: column;
        padding: 0 20px;
    }
    
    .cta-newsletter-form .btn-red {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile Portrait (480px - 576px) */
@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    .blog-hero {
        padding: 40px 0;
    }
    
    .blog-hero-content .heading {
        font-size: 2rem;
    }
    
    .blog-hero-content .sub {
        font-size: 0.85rem;
    }
    
    .blog-main-section {
        padding: 30px 0;
    }
    
    .sidebar-widget {
        padding: 18px;
        margin-bottom: 20px;
    }
    
    .blog-card-image {
        height: 180px;
    }
    
    .blog-card-body {
        padding: 15px;
    }
    
    .blog-title {
        font-size: 1rem;
    }
    
    .blog-meta {
        gap: 10px;
        font-size: 0.6rem;
    }
    
    .blog-excerpt {
        font-size: 0.8rem;
    }
    
    .filter-tab {
        padding: 6px 16px;
        font-size: 0.75rem;
    }
    
    .pagination-link {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
    
    .cta-content .heading {
        font-size: 1.6rem;
    }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    .blog-hero-content .heading {
        font-size: 1.6rem;
    }
    
    .filter-tab {
        padding: 5px 12px;
        font-size: 0.7rem;
    }
    
    .blog-card-image {
        height: 160px;
    }
    
    .blog-card-body {
        padding: 12px;
    }
    
    .blog-title {
        font-size: 0.9rem;
    }
    
    .blog-excerpt {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }
    
    .author-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }
    
    .author-info .author-name {
        font-size: 0.7rem;
    }
    
    .author-info .author-title {
        font-size: 0.6rem;
    }
    
    .read-more {
        font-size: 0.7rem;
    }
    
    .sidebar-widget {
        padding: 15px;
    }
    
    .widget-title {
        font-size: 1rem;
    }
    
    .recent-post-img {
        width: 55px;
        height: 55px;
    }
    
    .recent-post-info h4 {
        font-size: 0.75rem;
    }
    
    .tag {
        padding: 4px 10px;
        font-size: 0.65rem;
    }
    
    .featured-product-item img {
        width: 45px;
        height: 45px;
    }
}

/* Extra Small (below 360px) */
@media (max-width: 360px) {
    .blog-hero-content .heading {
        font-size: 1.4rem;
    }
    
    .blog-card-image {
        height: 140px;
    }
    
    .blog-meta {
        gap: 8px;
        font-size: 0.55rem;
    }
    
    .filter-tab {
        padding: 4px 10px;
        font-size: 0.65rem;
    }
}

/* ================================================================
   TOUCH & INTERACTION FIXES FOR MOBILE
================================================================ */
@media (max-width: 768px) {
    .filter-tab,
    .tag,
    .read-more,
    .pagination-link,
    .search-form button,
    .sidebar-search-form button,
    .view-product {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    .filter-tab:active,
    .tag:active {
        transform: scale(0.96);
    }
    
    /* Prevent zoom on input focus for iOS */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Improve touch targets */
    .categories-list li a,
    .recent-post-link {
        padding: 10px 0;
    }
    
    button,
    .btn-red,
    .filter-tab,
    .tag {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}