/* ==========================================================
   MAKALA (BLOG) — SELF-CONTAINED STYLESHEET
   Module: /makala/
   Shared by the listing page and every article folder.
   See makala/CULTURE.md before adding or editing content.
   ========================================================== */

/* ── BASE ── */
body {
    background-color: #050505;
    color: #ffffff;
    overflow-x: clip;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── GLASS NAV ── */
.glass-nav {
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── GLASS CARD (matches homepage cards) ── */
.glass-card {
    background: rgba(26, 26, 26, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s ease-out;
}

.glass-card:hover {
    background: rgba(26, 26, 26, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* ── PAGE TRANSITION ── */
#page-transition {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: #050505;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}
#page-transition.fade-out { opacity: 0; }
#page-transition.fade-in  { opacity: 1; pointer-events: all; }
#page-transition .brand-text {
    font-size: 2.5rem; font-weight: 700; letter-spacing: 0.1em;
    color: #ffffff; opacity: 0; transform: translateY(10px);
    transition: all 0.5s ease-out;
}
#page-transition .brand-text.show { opacity: 1; transform: translateY(0); }

/* ── FLEX BODY (keeps footer at bottom) ── */
.flex-body { display: flex; flex-direction: column; min-height: 100vh; }

/* ── SCROLL REVEAL ── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ── READING PROGRESS BAR (article pages) ── */
#reading-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #ffffff, #888888);
    z-index: 9998;
    transition: width 0.1s linear;
}

/* ==========================================================
   LISTING PAGE
   ========================================================== */

/* Search box */
.blog-search {
    background: rgba(26, 26, 26, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}
.blog-search:focus-within {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.blog-search input {
    background: transparent;
    outline: none;
    width: 100%;
    color: #ffffff;
}
.blog-search input::placeholder { color: #6b7280; }

/* Category filter chips */
.chip {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.chip:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}
.chip.active {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
    font-weight: 700;
}

/* Category labels — plain typography, no pill/badge background */
.badge {
    display: inline-block;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #9ca3af;
}
.badge-web { color: #9ca3af; }
.badge-kazi { color: #9ca3af; }
.badge-ai  { color: #9ca3af; }

/* Article cards */
.post-card { cursor: pointer; display: flex; flex-direction: column; }
.post-card .post-title { transition: color 0.3s ease; }
.post-card:hover .post-title { color: #ffffff; }

/* Empty state (no search results) */
.empty-state { display: none; }
.empty-state.show { display: block; }

/* ==========================================================
   ARTICLE PAGES — PROSE TYPOGRAPHY
   Warm, readable, on-brand dark theme.
   ========================================================== */
.article-prose {
    font-size: 1.125rem;
    line-height: 1.9;
    color: #d1d5db;
    font-weight: 300;
}

.article-prose p { margin-bottom: 1.75rem; }

.article-prose h2 {
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-top: 3.5rem;
    margin-bottom: 1.25rem;
}
@media (min-width: 768px) {
    .article-prose h2 { font-size: 2rem; }
}

.article-prose h3 {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.article-prose strong { color: #ffffff; font-weight: 600; }
.article-prose em { color: #e5e7eb; }

.article-prose a {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.35);
    text-underline-offset: 4px;
    transition: text-decoration-color 0.3s ease;
}
.article-prose a:hover { text-decoration-color: #ffffff; }

.article-prose ul, .article-prose ol {
    margin-bottom: 1.75rem;
    padding-left: 1.5rem;
}
.article-prose ul li, .article-prose ol li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}
.article-prose ul { list-style: none; }
.article-prose ul li { position: relative; }
.article-prose ul li::before {
    content: '';
    position: absolute;
    left: -1.25rem;
    top: 0.85rem;
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background: #ffffff;
    opacity: 0.6;
}
.article-prose ol { list-style: decimal; }
.article-prose ol li::marker { color: #9ca3af; font-weight: 600; }

.article-prose blockquote {
    border-left: 2px solid rgba(255, 255, 255, 0.5);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #e5e7eb;
}

.article-prose hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 3rem 0;
}

/* Inline code */
.article-prose code {
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.15em 0.45em;
    color: #f3f4f6;
    font-weight: 400;
}

/* Code blocks */
.article-prose pre {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.75rem;
    line-height: 1.7;
}
.article-prose pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    color: #e5e7eb;
}
.code-caption {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: -1.25rem;
    margin-bottom: 1.75rem;
}

/* Callout boxes ("Kumbuka...", "Siri ndogo...") */
.callout {
    background: rgba(26, 26, 26, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid rgba(255, 255, 255, 0.7);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    font-size: 1rem;
}
.callout .callout-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.callout p:last-child { margin-bottom: 0; }

/* Comparison tables */
.article-prose table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.75rem;
    font-size: 0.95rem;
}
.article-prose th {
    text-align: left;
    padding: 0.875rem 1rem;
    color: #ffffff;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.article-prose td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: #d1d5db;
    vertical-align: top;
}

/* Share buttons */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #d1d5db;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
    border: none;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    text-underline-offset: 4px;
}
.share-btn:hover {
    color: #ffffff;
    text-decoration-color: #ffffff;
}

/* ==========================================================
   THEME TOGGLE BUTTON
   ========================================================== */
.theme-toggle {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    outline: none;
}
.theme-toggle:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.06);
    color: #ffffff;
}
.theme-toggle:active {
    transform: scale(0.94);
}
.theme-toggle:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}
.theme-toggle i {
    position: absolute;
    font-size: 14px;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}
.theme-toggle .ic-sun {
    opacity: 0;
    transform: rotate(-70deg) scale(0.5);
}
.theme-toggle .ic-moon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* ==========================================================
   MAKALA LIGHT THEME ([data-theme="light"])
   ========================================================== */
[data-theme="light"] {
    color-scheme: light;
}

[data-theme="light"] body {
    background-color: #f8f9fa;
    color: #09090b;
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: #f1f5f9;
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Theme toggle in light mode */
[data-theme="light"] .theme-toggle {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.04);
    color: #0f172a;
}
[data-theme="light"] .theme-toggle:hover {
    border-color: rgba(0, 0, 0, 0.28);
    background: rgba(0, 0, 0, 0.08);
    color: #000000;
}
[data-theme="light"] .theme-toggle:focus-visible {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .theme-toggle .ic-sun {
    opacity: 1;
    transform: rotate(0) scale(1);
    color: #09090b;
}
[data-theme="light"] .theme-toggle .ic-moon {
    opacity: 0;
    transform: rotate(70deg) scale(0.5);
}

/* Glass nav & cards */
[data-theme="light"] .glass-nav {
    background: rgba(248, 249, 250, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .glass-nav span {
    color: #09090b;
}
[data-theme="light"] .glass-nav a.notranslate {
    color: #4b5563 !important;
}
[data-theme="light"] .glass-nav a.notranslate:hover {
    color: #09090b !important;
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .glass-card:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.18);
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.08);
}

/* Page Transition */
[data-theme="light"] #page-transition {
    background-color: #f8f9fa;
}
[data-theme="light"] #page-transition .brand-text {
    color: #09090b;
}

/* Reading Progress Bar */
[data-theme="light"] #reading-progress {
    background: linear-gradient(90deg, #09090b, #64748b);
}

/* Search Box */
[data-theme="light"] .blog-search {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 12px -2px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .blog-search:focus-within {
    border-color: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .blog-search input {
    color: #09090b;
}
[data-theme="light"] .blog-search input::placeholder {
    color: #94a3b8;
}
[data-theme="light"] .blog-search i {
    color: #64748b;
}

/* Filter Chips */
[data-theme="light"] .chip {
    border-color: rgba(0, 0, 0, 0.15);
    color: #64748b;
    background: transparent;
}
[data-theme="light"] .chip:hover {
    border-color: rgba(0, 0, 0, 0.35);
    color: #09090b;
}
[data-theme="light"] .chip.active {
    background: #09090b;
    border-color: #09090b;
    color: #ffffff;
}

/* Article Cards */
[data-theme="light"] .post-card .post-title {
    color: #09090b;
}
[data-theme="light"] .post-card:hover .post-title {
    color: #000000;
}
[data-theme="light"] .post-card i.fa-arrow-up-right-from-square {
    color: #94a3b8;
    transition: color 0.3s ease;
}
[data-theme="light"] .post-card:hover i.fa-arrow-up-right-from-square {
    color: #09090b;
}
[data-theme="light"] .badge {
    color: #64748b;
}

/* Typography & Headings */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4 {
    color: #09090b;
}
[data-theme="light"] .text-white {
    color: #09090b !important;
}
[data-theme="light"] .text-gray-200 {
    color: #09090b !important;
}
[data-theme="light"] .text-gray-300 {
    color: #374151 !important;
}
[data-theme="light"] .text-gray-400 {
    color: #4b5563 !important;
}
[data-theme="light"] .text-gray-500 {
    color: #6b7280 !important;
}
[data-theme="light"] .text-brand-light {
    color: #4b5563 !important;
}

/* Article Prose Typography */
[data-theme="light"] .article-prose {
    color: #334155;
}
[data-theme="light"] .article-prose h2,
[data-theme="light"] .article-prose h3 {
    color: #09090b;
}
[data-theme="light"] .article-prose strong {
    color: #09090b;
}
[data-theme="light"] .article-prose em {
    color: #1e293b;
}
[data-theme="light"] .article-prose a {
    color: #09090b;
    text-decoration-color: rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .article-prose a:hover {
    text-decoration-color: #09090b;
}
[data-theme="light"] .article-prose blockquote {
    border-left-color: #09090b;
    color: #475569;
    background: rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .article-prose code {
    background: rgba(0, 0, 0, 0.06);
    color: #09090b;
    border-color: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .article-prose pre {
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .article-prose pre code {
    color: #f8fafc;
    background: transparent;
}
[data-theme="light"] .callout {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #334155;
}
[data-theme="light"] .article-prose th {
    color: #09090b;
    border-bottom: 2px solid rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .article-prose td {
    color: #475569;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}
[data-theme="light"] .share-btn {
    color: #475569;
    text-decoration-color: rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .share-btn:hover {
    color: #09090b;
    text-decoration-color: #09090b;
}

/* Footer */
[data-theme="light"] footer {
    background-color: #f1f5f9 !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
[data-theme="light"] footer p,
[data-theme="light"] footer a {
    color: #64748b !important;
}
[data-theme="light"] footer a:hover {
    color: #09090b !important;
}
[data-theme="light"] .bg-brand-grey {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* Hairline borders in Light Mode */
[data-theme="light"] .border-white\/10 {
    border-color: rgba(0, 0, 0, 0.09) !important;
}
[data-theme="light"] .border-white\/20 {
    border-color: rgba(0, 0, 0, 0.14) !important;
}
[data-theme="light"] .border-white\/5 {
    border-color: rgba(0, 0, 0, 0.06) !important;
}
[data-theme="light"] .border-white {
    border-color: rgba(0, 0, 0, 0.25) !important;
}
[data-theme="light"] .border-gray-700,
[data-theme="light"] .border-gray-800,
[data-theme="light"] .border-gray-900 {
    border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Primary buttons in Light Mode (matches root styles.css) */
[data-theme="light"] a.bg-white,
[data-theme="light"] button.bg-white {
    background-color: #09090b !important;
    color: #ffffff !important;
}
[data-theme="light"] a.bg-white:hover,
[data-theme="light"] button.bg-white:hover {
    background-color: #27272a !important;
    color: #ffffff !important;
}
[data-theme="light"] a.bg-white span,
[data-theme="light"] a.bg-white i,
[data-theme="light"] button.bg-white span,
[data-theme="light"] button.bg-white i {
    color: #ffffff !important;
}

/* Empty state in Light Mode */
[data-theme="light"] #empty-state i {
    color: #cbd5e1 !important;
}
[data-theme="light"] #empty-state p.text-gray-400 {
    color: #334155 !important;
}
[data-theme="light"] #empty-state p.text-gray-600 {
    color: #64748b !important;
}

