/* Custom styles for Free Printables for Kids */

/* CSS Variables */
:root {
    --blue-50: #f0f7ff;
    --blue-100: #e0efff;
    --blue-200: #baddff;
    --blue-300: #7cc2ff;
    --blue-400: #36a3ff;
    --blue-500: #0084f8;
    --blue-600: #0066cc;
    --blue-700: #0052a3;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
}

/* Base Typography */
body {
    font-family: 'Quicksand', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Nunito', sans-serif;
}

/* Utility Classes */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

/* Prose Styles */
.prose {
    line-height: 1.75;
}

.prose p {
    margin-bottom: 1rem;
}

.prose h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

/* Smooth Transitions */
a, button {
    transition: all 0.2s ease;
}

/* Focus States */
input:focus, button:focus, a:focus {
    outline: none;
}

input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(0, 132, 248, 0.1);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Lazy Load Images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([src=""]) {
    opacity: 1;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: max-height 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.open {
    max-height: 500px;
}

/* Button Hover Effects */
.btn-primary {
    background-color: var(--blue-500);
    color: white;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--blue-600);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 132, 248, 0.3);
}

/* Card Hover Effects */
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Download Button Animation */
.download-btn {
    position: relative;
    overflow: hidden;
}

.download-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.download-btn:hover::after {
    width: 300px;
    height: 300px;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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

/* Print Styles */
@media print {
    header, footer, nav, .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    a {
        text-decoration: none;
        color: inherit;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Blog Content Styles */
.blog-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--gray-700);
}

.blog-content h2 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--gray-800);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.blog-content h3 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.blog-content h4 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.blog-content p {
    margin-bottom: 1.25rem;
}

.blog-content a,
.blog-content a:link,
.blog-content a:visited {
    color: #0084f8 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

.blog-content a:hover,
.blog-content a:active {
    color: #0066cc !important;
}

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

.blog-content ul {
    list-style-type: disc;
}

.blog-content ol {
    list-style-type: decimal;
}

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

.blog-content li > ul,
.blog-content li > ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.blog-content blockquote {
    border-left: 4px solid var(--blue-500);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--gray-600);
    background: var(--gray-50);
    padding: 1rem 1.25rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.blog-content pre {
    background: var(--gray-800);
    color: var(--gray-100);
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.blog-content code {
    background: var(--gray-100);
    color: var(--gray-800);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

.blog-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 1rem;
}

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

.blog-content th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-800);
}

.blog-content tr:hover {
    background: var(--gray-50);
}

.blog-content hr {
    border: none;
    border-top: 2px solid var(--gray-200);
    margin: 2rem 0;
}

.blog-content strong {
    font-weight: 600;
    color: var(--gray-800);
}

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

.blog-content figure {
    margin: 1.5rem 0;
}

.blog-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
}
