/* ============================================
   TechWeb Theme - Main Stylesheet
   ============================================ */

/* ============================================
   Animation System
   ============================================ */

/* ---- Keyframes ---- */
@keyframes tw-fadeup {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0);    }
}
@keyframes tw-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes tw-scaleup {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1);    }
}

/* ---- Hero entrance (CSS-only, fires on load) ---- */
@media (prefers-reduced-motion: no-preference) {
    .anim-fadeup  { animation: tw-fadeup  0.72s cubic-bezier(.4,0,.2,1) both; }
    .anim-fadein  { animation: tw-fadein  0.6s  ease both; }
    .anim-scaleup { animation: tw-scaleup 0.6s  cubic-bezier(.4,0,.2,1) both; }

    .anim-d1 { animation-delay: 0.12s; }
    .anim-d2 { animation-delay: 0.24s; }
    .anim-d3 { animation-delay: 0.38s; }
    .anim-d4 { animation-delay: 0.52s; }
}

/* ---- Scroll Reveal (added by JS) ---- */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(26px);
        transition: opacity 0.65s cubic-bezier(.4,0,.2,1),
                    transform 0.65s cubic-bezier(.4,0,.2,1);
    }
    .reveal.is-visible {
        opacity: 1;
        transform: translateY(0);
    }
    .reveal.delay-1 { transition-delay: 0.07s; }
    .reveal.delay-2 { transition-delay: 0.14s; }
    .reveal.delay-3 { transition-delay: 0.21s; }
    .reveal.delay-4 { transition-delay: 0.28s; }
    .reveal.delay-5 { transition-delay: 0.35s; }
    .reveal.delay-6 { transition-delay: 0.42s; }
    .reveal.delay-7 { transition-delay: 0.49s; }
    .reveal.delay-8 { transition-delay: 0.56s; }
    .reveal.delay-9 { transition-delay: 0.63s; }
}

/* ============================================
   Global Selection
   ============================================ */
/* Global Selection */
::selection {
    background-color: #3B82F6;
    color: #ffffff;
}

/* ---- Tech Grid Background ---- */
.tech-grid {
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

/* ---- Glass Navigation ---- */
.glass-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* ---- Hover Lift Card Effect ---- */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

/* ---- Hide Scrollbar (Carousel) ---- */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ---- Ping Animation (Hero Badge) ---- */
@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}
.animate-ping {
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ---- Gradient Text ---- */
.gradient-text {
    background: linear-gradient(to right, #0F172A, #3B82F6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Case Carousel Controls (hover reveal) ---- */
.carousel-wrapper:hover .carousel-btn {
    opacity: 1;
}
.carousel-btn {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ---- FAQ Accordion ---- */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.faq-content.is-open {
    max-height: 600px;
}

/* ---- Responsive Typography ---- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
}


/* ============================================
   Component Classes
   ============================================ */

/* ---- Section Header ---- */
.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 1rem;
}
.section-divider {
    width: 3rem;
    height: 0.25rem;
    background-color: #3B82F6;
    margin-left: auto;
    margin-right: auto;
    border-radius: 9999px;
}
.section-desc {
    color: #64748B;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Body Text ---- */
.body-text {
    color: #64748B;
    line-height: 1.75;
}

/* ---- Card ---- */
.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 0.75rem;
    line-height: 1.75rem;
}
.card-title-sm {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 0.5rem;
    line-height: 1.75rem;
}
.card-title a,
.card-title-sm a {
    transition: color 0.15s ease;
}
.card-title a:hover,
.card-title-sm a:hover {
    color: #3B82F6;
}
.card-cat {
    font-size: 0.75rem;
    color: #3B82F6;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}
.card-excerpt {
    color: #64748B;
    font-size: 0.875rem;
    line-height: 1.5rem;
}
.card-desc {
    color: #64748B;
    font-size: 0.875rem;
    line-height: 1.75;
}
.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #3B82F6;
    transition: color 0.15s ease;
}
.card-link:hover {
    color: #0F172A;
}

/* ---- Buttons ---- */
.btn-primary {
    display: inline-block;
    background-color: #0F172A;
    color: #fff;
    padding: 0.875rem 2rem;
    border-radius: 9999px;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    transition: background-color 0.15s ease;
}
.btn-primary:hover { background-color: #1E293B; color: #fff; }

.btn-primary-sm {
    display: inline-block;
    background-color: #0F172A;
    color: #fff;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: background-color 0.15s ease;
}
.btn-primary-sm:hover { background-color: #1E293B; color: #fff; }

.btn-secondary {
    display: inline-block;
    background-color: #fff;
    color: #0F172A;
    border: 1px solid #E2E8F0;
    padding: 0.875rem 2rem;
    border-radius: 9999px;
    font-weight: 500;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn-secondary:hover {
    background-color: #F8FAFC;
    border-color: #CBD5E1;
}

/* ---- Nav / Footer Links ---- */
.nav-link {
    transition: color 0.15s ease;
}
.nav-link:hover { color: #3B82F6; }

/* ---- Link More (underline + arrow) ---- */
.link-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #0F172A;
    font-weight: 600;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid #0F172A;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.link-more:hover {
    color: #3B82F6;
    border-color: #3B82F6;
}

/* ---- Footer ---- */
.footer-heading {
    color: #0F172A;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

/* ============================================
   Article Content Prose
   ============================================ */
.article-content {
    color: #334155;
    line-height: 1.9;
    font-size: 1rem;
    word-break: break-word;
    overflow-wrap: break-word;
}
.article-content > * + * { margin-top: 1.5rem; }

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0F172A;
    margin-top: 2.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid #EFF6FF;
    line-height: 1.4;
}
.article-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0F172A;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}
.article-content h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1E293B;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.article-content p { margin-bottom: 1.5rem; }

.article-content ul,
.article-content ol {
    padding-left: 1.625rem;
    margin-bottom: 1.5rem;
}
.article-content ul { list-style-type: disc; }
.article-content ol { list-style-type: decimal; }
.article-content li { margin-bottom: 0.5rem; }
.article-content li > ul,
.article-content li > ol { margin-top: 0.5rem; margin-bottom: 0; }

.article-content blockquote {
    border-left: 4px solid #3B82F6;
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: #EFF6FF;
    border-radius: 0 0.75rem 0.75rem 0;
    color: #475569;
    font-style: italic;
}
.article-content blockquote p { margin-bottom: 0; }

.article-content a {
    color: #3B82F6;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}
.article-content a:hover { color: #0F172A; }

.article-content img {
    border-radius: 0.75rem;
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.article-content code {
    background: #F1F5F9;
    color: #0F172A;
    padding: 0.15em 0.4em;
    border-radius: 0.3rem;
    font-size: 0.875em;
    font-family: 'Fira Code', 'Courier New', monospace;
}
.article-content pre {
    background: #0F172A;
    color: #E2E8F0;
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.75;
    margin: 2rem 0;
}
.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.9rem;
    border-radius: 0.75rem;
    overflow: hidden;
}
.article-content th {
    background: #F8FAFC;
    font-weight: 600;
    color: #0F172A;
    padding: 0.75rem 1rem;
    border: 1px solid #E2E8F0;
    text-align: left;
}
.article-content td {
    padding: 0.75rem 1rem;
    border: 1px solid #E2E8F0;
    color: #475569;
}
.article-content tr:nth-child(even) td { background: #F8FAFC; }

.article-content hr {
    border: none;
    border-top: 1px solid #E2E8F0;
    margin: 2.5rem 0;
}

/* ---- TOC Sidebar ---- */
.toc-link {
    display: block;
    font-size: 0.8125rem;
    color: #64748B;
    padding: 0.3rem 0.625rem;
    border-left: 2px solid transparent;
    line-height: 1.4;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.toc-link:hover,
.toc-link.is-active {
    color: #3B82F6;
    border-left-color: #3B82F6;
}
.toc-link.toc-h3 { padding-left: 1.25rem; }

/* ---- Sidebar Navigation ---- */
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748B;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.sidebar-link:hover {
    color: #0F172A;
    background-color: #F8FAFC;
}
.sidebar-link.is-active {
    color: #3B82F6;
    background-color: #EFF6FF;
    font-weight: 600;
}
