/* Custom styles for Latkin QA Solutions */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Reveal on scroll animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-on-scroll.delay-100 {
    transition-delay: 0.1s;
}

.reveal-on-scroll.delay-200 {
    transition-delay: 0.2s;
}

.reveal-on-scroll.delay-300 {
    transition-delay: 0.3s;
}

.reveal-on-scroll.delay-400 {
    transition-delay: 0.4s;
}

.reveal-on-scroll.delay-500 {
    transition-delay: 0.5s;
}

/* FAQ styles */
.faq-question svg {
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.faq-panel {
  overflow: hidden;
  transition: all .24s ease;
}

/* Form styles */
#contact-form input:focus,
#contact-form textarea:focus {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Loading animation for submit button */
.submit-loading {
    display: inline-flex;
    align-items: center;
}

.submit-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/error message styles */
.form-success {
    background-color: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.form-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Mobile menu styles */
#mobile-menu {
    transition: all 0.3s ease;
}

/* Gradient backgrounds */
.bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

/* Hover effects */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Text truncation for case study descriptions */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

/* Ensure proper image aspect ratios */
.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-square {
    aspect-ratio: 1 / 1;
}

/* Custom focus styles for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Blog-specific styles */
/* Enhanced Typography & layout */
.article { 
    max-width: 760px; 
    margin: 0 auto; 
    line-height: 1.75; 
    font-size: 1.05rem; 
}

.article h1, .article h2, .article h3 { 
    scroll-margin-top: 90px; 
}

/* Enhanced post header layout */
.post-header {
    text-align: center;
    margin-bottom: 3rem;
}

.post-hero-main { 
    width: 100%; 
    max-width: 800px;
    height: auto; 
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,.1); 
    margin: 0 auto 2rem auto;
    display: block;
}

.post-header-content {
    max-width: 700px;
    margin: 0 auto;
}

/* Legacy post hero (for backwards compatibility) */
.article img.post-hero { 
    width: 100%; 
    height: auto; 
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0,0,0,.07); 
    margin: 1rem 0 2rem; 
}

/* Enhanced article content styling */
.article-content {
    margin-top: 2rem;
}

.article-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
}

.article-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: #334155;
}

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

.article-content ul, .article-content ol {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
}

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

/* Blockquote */
.article blockquote { 
    border-left: 4px solid #10b981; 
    background: #f8fafc;
    padding: 1rem 1.25rem; 
    border-radius: 10px; 
}

/* CTA blocks (rendered from :::cta) */
.article .cta { 
    background: #e8fff6; 
    border: 1px solid #10b98133; 
    padding: 1.25rem;
    border-radius: 14px; 
    text-align: center; 
    margin: 2rem 0; 
}

.article .cta a { 
    display: inline-block; 
    padding: .7rem 1.1rem; 
    border-radius: 10px;
    background: #10b981; 
    color: #fff; 
    text-decoration: none;
    font-weight: 500;
}

.article .cta a:hover {
    background: #059669;
}

/* Blog grid layout */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Blog grid cards */
.blog-card-grid { 
    border: 1px solid #e5e7eb; 
    border-radius: 16px; 
    background: #fff; 
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

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

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

.blog-card-grid:hover { 
    box-shadow: 0 20px 40px rgba(0,0,0,.08); 
    transform: translateY(-4px); 
    transition: all 0.3s ease; 
}

/* Legacy blog card styles (for backwards compatibility) */
.blog-card { 
    border: 1px solid #e5e7eb; 
    border-radius: 16px; 
    padding: 1rem 1.25rem; 
    background: #fff; 
    display: flex; 
    gap: 1rem; 
}

.blog-card img { 
    width: 168px; 
    height: 105px; 
    object-fit: cover; 
    border-radius: 12px; 
}

.blog-card:hover { 
    box-shadow: 0 10px 24px rgba(0,0,0,.06); 
    transform: translateY(-2px); 
    transition: .2s; 
}

.blog-meta { 
    color: #6b7280; 
    font-size: .9rem; 
}

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

/* Banner between sections */
.section-divider { 
    height: 1px; 
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent); 
    margin: 2rem 0; 
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-slate-600 {
        color: #000;
    }
    
    .text-slate-500 {
        color: #333;
    }
    
    .bg-slate-50 {
        background-color: #f9f9f9;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll,
    .faq-answer,
    .hover-lift {
        transition: none;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(0deg); }
    }
}