/* ═══════════════════════════════════════════
   CATEGORY PAGE — Shared Styles
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --font-primary: 'Outfit', sans-serif;
    --bg-primary: #f8faff;
    --bg-card: rgba(255, 255, 255, 0.92);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-subtle: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.16);
    --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --container: 1260px;
    --radius: 20px;
}

/* Blue theme */
[data-cat="blue"] {
    --cat-color: #2563eb;
    --cat-color-light: #1d4ed8;
    --cat-glow: rgba(37, 99, 235, 0.14);
    --cat-glow-soft: rgba(37, 99, 235, 0.06);
    --cat-gradient: linear-gradient(135deg, #dbeafe 0%, #eff6ff 60%);
}

/* Purple theme */
[data-cat="purple"] {
    --cat-color: #7c3aed;
    --cat-color-light: #6d28d9;
    --cat-glow: rgba(124, 58, 237, 0.14);
    --cat-glow-soft: rgba(124, 58, 237, 0.06);
    --cat-gradient: linear-gradient(135deg, #ede9fe 0%, #f5f3ff 60%);
}

/* Orange theme */
[data-cat="orange"] {
    --cat-color: #ea580c;
    --cat-color-light: #c2410c;
    --cat-glow: rgba(234, 88, 12, 0.14);
    --cat-glow-soft: rgba(234, 88, 12, 0.06);
    --cat-gradient: linear-gradient(135deg, #fed7aa 0%, #fff7ed 60%);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ── Canvas ── */
#cat-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.15;
}

/* ── Nav ── */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.2rem 2rem;
    transition: all 0.4s var(--ease-out);
}

#main-nav.scrolled {
    padding: 0.7rem 2rem;
    background: rgba(248, 250, 255, 0.92);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.07);
}

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.logo-icon {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.4rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 0.4rem 0;
    transition: color 0.3s var(--ease-out);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--cat-color);
    border-radius: 2px;
    transition: width 0.3s var(--ease-out);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--cat-color-light);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
    display: block;
}

.mobile-menu-btn.active span:first-child {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:last-child {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    position: fixed;
    inset: 0;
    background: rgba(248, 250, 255, 0.97);
    backdrop-filter: blur(20px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out);
}

.mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-link {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.mobile-link:hover {
    color: var(--text-primary);
}

/* ── Category Hero ── */
.cat-hero {
    position: relative;
    min-height: 52vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9rem 2rem 5rem;
    overflow: hidden;
    z-index: 2;
}

.cat-hero-bg {
    position: absolute;
    inset: 0;
    background: var(--cat-gradient);
    z-index: -1;
}

.cat-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 0%, var(--cat-glow), transparent 70%);
}

.cat-hero-inner {
    max-width: 700px;
    text-align: center;
    animation: fadeInUp 0.9s var(--ease-out) both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.back-link {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cat-color-light);
    margin-bottom: 2rem;
    padding: 0.4rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.3s var(--ease-out);
    letter-spacing: 0.02em;
}

.back-link:hover {
    background: var(--cat-glow-soft);
    border-color: var(--cat-color);
    transform: translateX(-4px);
}

.cat-icon-lg {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    background: var(--cat-glow-soft);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--cat-color-light);
    animation: iconFloat 3s ease-in-out infinite;
}

.cat-icon-lg svg {
    width: 40px;
    height: 40px;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.cat-title {
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.08;
    margin-bottom: 1rem;
}

.amp {
    color: var(--cat-color-light);
}

.cat-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1.75rem;
}

.cat-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cat-stats strong {
    color: var(--cat-color-light);
    font-weight: 700;
}

.cat-stat-dot {
    opacity: 0.4;
}

/* ── Controls ── */
.posts-controls {
    position: relative;
    z-index: 2;
    max-width: var(--container);
    margin: 0 auto;
    padding: 2.5rem 2rem 0;
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 240px;
    padding: 0.8rem 1.4rem;
    border-radius: 100px;
    border: 1px solid var(--border-subtle);
    background: #ffffff;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s var(--ease-out);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.search-box::placeholder {
    color: var(--text-muted);
}

.search-box:focus {
    border-color: var(--cat-color);
    background: var(--cat-glow-soft);
    box-shadow: 0 0 0 3px var(--cat-glow);
}

.tag-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-btn {
    padding: 0.5rem 1.2rem;
    border-radius: 100px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    letter-spacing: 0.03em;
}

.tag-btn:hover {
    border-color: var(--cat-color);
    color: var(--cat-color-light);
    background: var(--cat-glow-soft);
}

.tag-btn.active {
    background: var(--cat-color);
    border-color: var(--cat-color);
    color: #fff;
    box-shadow: 0 4px 14px var(--cat-glow);
}

/* ── Posts Main ── */
.posts-main {
    position: relative;
    z-index: 2;
    max-width: var(--container);
    margin: 0 auto;
    padding: 2.5rem 2rem 6rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
}

/* ── Post Card ── */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s var(--ease-out);
    backdrop-filter: blur(12px);
    cursor: pointer;
    animation: fadeInUp 0.6s var(--ease-out) both;
}

.post-card:hover {
    border-color: var(--cat-color);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px var(--cat-glow);
}

.post-card.hidden {
    display: none;
}

/* Post image strip */
.post-img {
    height: 176px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

/* Gradient overlays per card variation */
.pi-1 {
    background: linear-gradient(135deg, #0f2744 0%, #1e3a69 40%, #172554 100%);
}

.pi-2 {
    background: linear-gradient(135deg, #1e1040 0%, #312e81 40%, #1e1b4b 100%);
}

.pi-3 {
    background: linear-gradient(135deg, #052e16 0%, #065f46 40%, #064e3b 100%);
}

.pi-4 {
    background: linear-gradient(135deg, #3b0764 0%, #6b21a8 40%, #4c1d95 100%);
}

.pi-5 {
    background: linear-gradient(135deg, #0c1a2e 0%, #1e40af 40%, #1e3a8a 100%);
}

.pi-6 {
    background: linear-gradient(135deg, #1a0a2e 0%, #7c3aed 40%, #4c1d95 100%);
}

.di-1 {
    background: linear-gradient(135deg, #2e0f5e 0%, #7c3aed 40%, #4c1d95 100%);
}

.di-2 {
    background: linear-gradient(135deg, #1e1040 0%, #5b21b6 40%, #312e81 100%);
}

.di-3 {
    background: linear-gradient(135deg, #0f172a 0%, #6d28d9 40%, #4c1d95 100%);
}

.di-4 {
    background: linear-gradient(135deg, #2d1b5e 0%, #8b5cf6 40%, #6d28d9 100%);
}

.di-5 {
    background: linear-gradient(135deg, #1a0840 0%, #7c3aed 40%, #5b21b6 100%);
}

.di-6 {
    background: linear-gradient(135deg, #0f0a2e 0%, #6d28d9 40%, #4c1d95 100%);
}

.ei-1 {
    background: linear-gradient(135deg, #431407 0%, #c2410c 40%, #7c2d12 100%);
}

.ei-2 {
    background: linear-gradient(135deg, #3a1206 0%, #ea580c 40%, #9a3412 100%);
}

.ei-3 {
    background: linear-gradient(135deg, #451a03 0%, #d97706 40%, #92400e 100%);
}

.ei-4 {
    background: linear-gradient(135deg, #3f1505 0%, #f97316 40%, #c2410c 100%);
}

.ei-5 {
    background: linear-gradient(135deg, #4a1503 0%, #f59e0b 40%, #b45309 100%);
}

.ei-6 {
    background: linear-gradient(135deg, #3b1007 0%, #ef4444 40%, #b91c1c 100%);
}

/* Decorative shapes inside the image strip */
.post-img::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.04) 0%, transparent 50%);
}

.post-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.8), transparent);
}

.post-read-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    color: #334155;
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(15, 23, 42, 0.1);
    letter-spacing: 0.04em;
    z-index: 2;
}

.post-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-tags-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.ptag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 100px;
    background: var(--cat-glow-soft);
    border: 1px solid var(--border-subtle);
    color: var(--cat-color);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.post-body h2 {
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.65rem;
    letter-spacing: -0.01em;
    transition: color 0.3s;
}

.post-card:hover h2 {
    color: var(--cat-color-light);
}

.post-body p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
    flex: 1;
    margin-bottom: 1.25rem;
}

.post-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.author-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.av-blue {
    background: linear-gradient(135deg, #1d4ed8, #60a5fa);
}

.av-purple {
    background: linear-gradient(135deg, #6d28d9, #a78bfa);
}

.av-orange {
    background: linear-gradient(135deg, #c2410c, #fb923c);
}

.av-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.av-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
}

.read-btn {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--cat-color);
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--cat-color);
    border-radius: 100px;
    transition: all 0.3s var(--ease-out);
    white-space: nowrap;
}

.read-btn:hover {
    background: var(--cat-color);
    border-color: var(--cat-color);
    color: #fff;
    transform: translateX(2px);
}

/* No results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 1rem;
    grid-column: 1/-1;
}

/* ── Footer ── */
.site-footer {
    position: relative;
    z-index: 2;
    padding: 3.5rem 2rem 0;
    border-top: 1px solid var(--border-subtle);
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    gap: 4rem;
    padding-bottom: 2.5rem;
}

.footer-brand {
    flex: 0 0 260px;
}

.footer-brand p {
    margin-top: 0.65rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-links {
    flex: 1;
    display: flex;
    gap: 3rem;
    justify-content: flex-end;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 130px;
}

.footer-col h5 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.footer-col a {
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    max-width: var(--container);
    margin: 0 auto;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .footer-inner {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-brand {
        flex: none;
    }

    .footer-links {
        flex-direction: column;
        gap: 1.5rem;
        justify-content: flex-start;
    }

    .posts-controls {
        flex-direction: column;
    }

    .search-box {
        min-width: unset;
    }
}

/* ═══════════════════ SCROLL ANIMATION ADDITIONS ═══════════════════ */

/* Section intro divider that slides in from left */
.scroll-section-intro {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 3rem max(1.5rem, calc((100% - var(--container)) / 2 + 1.5rem)) 1.5rem;
    will-change: opacity, transform;
}

.scroll-intro-line {
    width: 48px;
    height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

.scroll-intro-label {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.scroll-intro-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-left: auto;
}

/* Hero slider: GPU hints */
.cat-slider-img-wrap,
.cat-slider-bg,
.cat-slider-left {
    will-change: transform, opacity;
}

/* Post card image: smooth transition for hover parallax */
.post-img {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    overflow: hidden;
}

/* Post card GPU hint */
.post-card {
    will-change: transform, opacity;
    transform-style: preserve-3d;
}

/* Card 3D tilt: smooth transition defined via JS, but we set base here */
.post-card:hover {
    z-index: 2;
}

/* Posts grid: ensure cards don't clip during tilt */
.posts-grid {
    perspective: 1200px;
}

/* Stagger reveal: hide initially (JS overrides for each card) */
.post-card.reveal-ready {
    opacity: 0;
    transform: translateX(60px) translateY(24px);
}

/* Animate the search bar entry */
.posts-controls {
    will-change: opacity, transform;
}

/* "Scroll" indicator pulse enhancement */
@keyframes scrollLinePulse {
    0%, 100% { transform: scaleY(1); opacity: 0.9; }
    50%       { transform: scaleY(0.55); opacity: 0.3; }
}

/* Card image zoom on card hover (CSS fallback if JS parallax not applied) */
.post-card:hover .post-img {
    transform: scale(1.04);
}