/**
 * Blog Module - Frontend Styles
 * Complete CSS replacement for Tailwind CSS
 */

/* CSS Variables for dynamic styling */
:root {
    --blog-primary-color: #3B82F6;
    --blog-border-radius: 0.5rem;
    --blog-spacing-xs: 0.25rem;
    --blog-spacing-sm: 0.5rem;
    --blog-spacing-md: 1rem;
    --blog-spacing-lg: 1.5rem;
    --blog-spacing-xl: 2rem;
    --blog-spacing-2xl: 3rem;
}

/* Global link styling - no underlines */
.blog-module-container a {
    text-decoration: none;
}

.blog-module-container a:hover {
    text-decoration: none;
}

/* Reset and Base Styles */
.blog-module-container {
    box-sizing: border-box;
}

.blog-module-container *,
.blog-module-container *::before,
.blog-module-container *::after {
    box-sizing: border-box;
}

/* Global link styling - no underlines */
.blog-module-container a,
.blog-list-container a,
.widget a {
    text-decoration: none !important;
}

.blog-module-container a:hover,
.blog-list-container a:hover,
.widget a:hover {
    text-decoration: none !important;
}

/* Layout Utilities */
.blog-container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.blog-flex {
    display: flex;
}

.blog-flex-col {
    flex-direction: column;
}

.blog-flex-wrap {
    flex-wrap: wrap;
}

.blog-items-center {
    align-items: center;
}

.blog-justify-between {
    justify-content: space-between;
}

.blog-justify-center {
    justify-content: center;
}

.blog-gap-1 {
    gap: 0.25rem;
}

.blog-gap-2 {
    gap: 0.5rem;
}

.blog-gap-3 {
    gap: 0.75rem;
}

.blog-gap-4 {
    gap: 1rem;
}

.blog-gap-8 {
    gap: 2rem;
}

/* Grid System */
.blog-grid {
    display: grid;
}

/* Base: 1 column on mobile */
.blog-grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

/* Medium screens (tablet) - 2 columns */
@media (min-width: 768px) {
    .blog-grid-cols-md-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Large screens (desktop) */
@media (min-width: 1024px) {
    .blog-grid-cols-lg-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    
    .blog-grid-cols-lg-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    
    .blog-grid-cols-lg-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

/* Spacing */
.blog-p-6 {
    padding: 1.5rem;
}

.blog-p-8 {
    padding: 2rem;
}

.blog-px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.blog-px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.blog-px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.blog-py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.blog-py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.blog-py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.blog-mb-3 {
    margin-bottom: 0.75rem;
}

.blog-mb-4 {
    margin-bottom: 1rem;
}

.blog-mb-6 {
    margin-bottom: 1.5rem;
}

.blog-mb-8 {
    margin-bottom: 2rem;
}

.blog-mb-12 {
    margin-bottom: 3rem;
}

.blog-mt-12 {
    margin-top: 3rem;
}

.blog-ml-1 {
    margin-left: 0.25rem;
}

.blog-ml-2 {
    margin-left: 0.5rem;
}

.blog-mr-2 {
    margin-right: 0.5rem;
}

/* Typography */
.blog-text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.blog-text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.blog-text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.blog-text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.blog-text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.blog-font-semibold {
    font-weight: 600;
}

.blog-font-bold {
    font-weight: 700;
}

.blog-font-medium {
    font-weight: 500;
}

.blog-text-center {
    text-align: center;
}

/* Colors */
.blog-bg-white {
    background-color: #ffffff;
}

.blog-bg-gray-50 {
    background-color: #f9fafb;
}

.blog-bg-gray-100 {
    background-color: #f3f4f6;
}

.blog-bg-gray-200 {
    background-color: #e5e7eb;
}

.blog-text-gray-500 {
    color: #6b7280;
}

.blog-text-gray-600 {
    color: #4b5563;
}

.blog-text-gray-700 {
    color: #374151;
}

.blog-text-gray-900 {
    color: #111827;
}

.blog-text-white {
    color: #ffffff;
}

/* Border and Radius */
.blog-rounded {
    border-radius: var(--blog-border-radius);
}

.blog-rounded-full {
    border-radius: 9999px;
}

.blog-border {
    border-width: 1px;
}

.blog-border-b {
    border-bottom-width: 1px;
}

.blog-border-t {
    border-top-width: 1px;
}

.blog-border-gray-200 {
    border-color: #e5e7eb;
}

.blog-border-gray-300 {
    border-color: #d1d5db;
}

/* Shadow */
.blog-shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.blog-shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Overflow */
.blog-overflow-hidden {
    overflow: hidden;
}

/* Width and Height */
.blog-w-full {
    width: 100%;
}

.blog-w-16 {
    width: 4rem;
}

.blog-w-80 {
    width: 20rem;
}

.blog-h-48 {
    height: 12rem;
}

.blog-h-auto {
    height: auto;
}

.blog-max-w-4xl {
    max-width: 56rem;
}

.blog-max-w-2xl {
    max-width: 42rem;
}

/* Object Fit */
.blog-object-cover {
    object-fit: cover;
}

/* Flex Utilities */
.blog-flex-1 {
    flex: 1 1 0%;
}

.blog-flex-shrink-0 {
    flex-shrink: 0;
}

.blog-min-w-0 {
    min-width: 0;
}

/* Line Clamp */
.blog-line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Opacity */
.blog-opacity-75 {
    opacity: 0.75;
}

/* Min Height */
.blog-min-h-screen {
    min-height: 100vh;
}

/* Space Y */
.blog-space-y-1 > * + * {
    margin-top: 0.25rem;
}

.blog-space-y-2 > * + * {
    margin-top: 0.5rem;
}

.blog-space-y-4 > * + * {
    margin-top: 1rem;
}

/* Responsive */
@media (min-width: 768px) {
    .blog-md-text-5xl {
        font-size: 3rem;
        line-height: 1;
    }
    
    .blog-md-grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .blog-lg-flex-row {
        flex-direction: row;
    }
    
    .blog-lg-w-80 {
        width: 20rem;
    }
    
    .blog-lg-hidden {
        display: none;
    }
}

/* Dynamic primary color classes */
.blog-primary {
    color: var(--blog-primary-color) !important;
}

.blog-primary-bg {
    background-color: var(--blog-primary-color) !important;
}

.blog-primary-text {
    color: var(--blog-primary-color) !important;
}

.blog-primary-border {
    border-color: var(--blog-primary-color) !important;
}

.blog-primary-hover:hover {
    background-color: var(--blog-primary-color) !important;
    color: white !important;
}

.blog-primary-hover-text:hover {
    color: var(--blog-primary-color) !important;
}

/* Transitions */
.blog-transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.blog-transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.blog-transition-shadow {
    transition-property: box-shadow;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.blog-hover-shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Pagination styling */
.page-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
    align-items: center;
}

.page-numbers li {
    margin: 0;
}

.page-numbers a,
.page-numbers span {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border-radius: var(--blog-border-radius);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    min-width: 2.5rem;
    text-align: center;
}

.page-numbers a {
    background-color: white;
    color: #4B5563;
    border: 1px solid #E5E7EB;
}

.page-numbers a:hover {
    background-color: var(--blog-primary-color);
    color: white;
    border-color: var(--blog-primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.page-numbers .current {
    background-color: var(--blog-primary-color);
    color: white;
    border-color: var(--blog-primary-color);
    font-weight: 600;
}

.page-numbers .dots {
    padding: 0.625rem 0.5rem;
    color: #9CA3AF;
}

/* Prose styling for blog content */
.prose {
    color: #374151;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    color: #111827;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0;
}

.prose p {
    margin-bottom: 1.25em;
}

.prose a {
    color: var(--blog-primary-color);
    text-decoration: none;
}

.prose a:hover {
    color: var(--blog-primary-color);
    opacity: 0.8;
    text-decoration: none;
}

.prose img {
    border-radius: var(--blog-border-radius);
    margin: 1.5em 0;
}

.prose ul,
.prose ol {
    margin: 1.25em 0;
    padding-left: 1.625em;
}

.prose li {
    margin: 0.5em 0;
}

.prose blockquote {
    border-left: 4px solid var(--blog-primary-color);
    padding-left: 1em;
    margin: 1.5em 0;
    font-style: italic;
    color: #6B7280;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .prose {
        font-size: 0.875rem;
    }
}

/* Widget Styles */
.widget {
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Additional padding utilities */
.blog-pl-6 {
    padding-left: 1.5rem;
}

.blog-pl-8 {
    padding-left: 2rem;
}

.blog-pb-2 {
    padding-bottom: 0.5rem;
}

/* Recent Posts Widget Styling */
.blog-recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-recent-post-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.blog-recent-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.blog-recent-post-link {
    display: flex;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 0.5rem;
}

.blog-recent-post-link:hover {
    background-color: #f9fafb;
    transform: translateX(4px);
}

.blog-recent-post-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #f3f4f6;
    position: relative;
}

.blog-recent-post-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.blog-recent-post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-recent-post-link:hover .blog-recent-post-img {
    transform: scale(1.1);
}

.blog-recent-post-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.blog-recent-post-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.blog-recent-post-link:hover .blog-recent-post-title {
    color: var(--blog-primary-color);
}

.blog-recent-post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.blog-recent-post-date {
    display: flex;
    align-items: center;
    color: #6b7280;
}

.blog-recent-post-date svg {
    opacity: 0.6;
}

/* Responsive adjustments for recent posts */
@media (max-width: 768px) {
    .blog-recent-post-thumb {
        width: 70px;
        height: 70px;
    }
    
    .blog-recent-post-title {
        font-size: 0.875rem;
    }
}

/* Blog Card Styles */
.blog-card {
    background-color: white;
    border-radius: var(--blog-border-radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 300ms;
}

.blog-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Aspect Ratio */
.blog-aspect-16-9 {
    position: relative;
    padding-bottom: 56.25%;
    overflow: hidden;
}

.blog-aspect-16-9 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Additional utilities */
.blog-block {
    display: block;
}

.blog-hidden {
    display: none;
}

.blog-pt-8 {
    padding-top: 2rem;
}

.blog-prose-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.blog-max-w-none {
    max-width: none;
}

/* Space utilities */
.blog-space-y-1 > * + * {
    margin-top: 0.25rem;
}

/* SVG sizing */
.blog-w-16 {
    width: 1rem;
    height: 1rem;
}

.blog-w-5 {
    width: 1.25rem;
    height: 1.25rem;
}

.blog-w-3 {
    width: 0.75rem;
    height: 0.75rem;
}

/* Hover states */
.blog-hover-bg-gray-100:hover {
    background-color: #f3f4f6;
}

.blog-hover-bg-gray-300:hover {
    background-color: #d1d5db;
}
