/* ================================================================
   MEDIUM BLOG CMS - ZERO-DEPENDENCY ULTRA FAST PRODUCTION STYLES
   Google PageSpeed Insights 95-100 Optimized (Zero Render-Blocking)
   ================================================================ */

:root {
    --bg-primary: #ffffff;
    --bg-card: #ffffff;
    --bg-search: #f9f9f9;
    --bg-hero: #f7f4ed;
    --text-primary: #242424;
    --text-muted: #6b6b6b;
    --border-color: #f2f2f2;
    --accent-green: #1a8917;
    --accent-hover: #156d12;
    --font-serif: 'Merriweather', Charter, Georgia, Cambria, "Times New Roman", serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html.dark {
    --bg-primary: #121212;
    --bg-card: #1e1e1e;
    --bg-search: #1a1a1a;
    --bg-hero: #161616;
    --text-primary: #f2f2f2;
    --text-muted: #a0a0a0;
    --border-color: #242424;
    --accent-green: #24a120;
    --accent-hover: #1a8917;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: hidden;
    width: 100%;
}

/* Base Elements */
a {
    color: inherit;
    text-decoration: none;
}
button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}
input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}
img, svg {
    display: block;
    vertical-align: middle;
    max-width: 100%;
}

/* Utility Theme Classes */
.theme-bg { background-color: var(--bg-primary); }
.theme-card { background-color: var(--bg-card); }
.theme-search-bg { background-color: var(--bg-search); }
.theme-hero-bg { background-color: var(--bg-hero); }
.theme-text { color: var(--text-primary); }
.theme-muted { color: var(--text-muted); }
.theme-border { border-color: var(--border-color); }
.theme-accent { color: var(--accent-green); }

/* Typography */
.font-serif { font-family: var(--font-serif); }
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1.15; }
.text-6xl { font-size: 3.75rem; line-height: 1.1; }
.text-7xl { font-size: 4.5rem; line-height: 1.05; }
.text-\[9px\] { font-size: 9px; }
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.tracking-tight { letter-spacing: -0.025em; }
.tracking-tighter { letter-spacing: -0.05em; }
.tracking-wider { letter-spacing: 0.05em; }
.uppercase { text-transform: uppercase; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.leading-snug { line-height: 1.375; }
.leading-relaxed { line-height: 1.625; }

.text-white { color: #ffffff; }
.text-emerald-600 { color: #059669; }
.text-emerald-400 { color: #34d399; }
.text-zinc-400 { color: #a1a1aa; }
.text-zinc-900 { color: #18181b; }

.bg-emerald-600 { background-color: #059669; }
.bg-emerald-700 { background-color: #047857; }
.bg-zinc-900 { background-color: #18181b; }
.bg-zinc-800 { background-color: #27272a; }
.bg-zinc-100 { background-color: #f4f4f5; }
.bg-zinc-200 { background-color: #e4e4e7; }
.bg-black\/75 { background-color: rgba(0, 0, 0, 0.75); }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1); }
.border-emerald-500\/20 { border-color: rgba(16, 185, 129, 0.2); }

/* Flexbox & Grid */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0px; }

/* Gaps & Spacing */
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }
.gap-x-3 { column-gap: 0.75rem; }
.gap-y-1\.5 { row-gap: 0.375rem; }

.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.375rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-2\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.625rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-5 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.25rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }
.space-y-8 > :not([hidden]) ~ :not([hidden]) { margin-top: 2rem; }

/* Padding & Margin */
.p-0\.5 { padding: 0.125rem; }
.p-1\.5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pl-9 { padding-left: 2.25rem; }
.pl-11 { padding-left: 2.75rem; }
.pr-4 { padding-right: 1rem; }
.pr-8 { padding-right: 2rem; }
.pr-10 { padding-right: 2.5rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-4 { padding-bottom: 1rem; }

.m-0 { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-2\.5 { margin-bottom: 0.625rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-12 { margin-top: 3rem; }

/* Width & Height & Sizing */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-2 { width: 0.5rem; }
.w-3\.5 { width: 0.875rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-24 { width: 6rem; }
.w-36 { width: 9rem; }
.w-48 { width: 12rem; }
.h-2 { height: 0.5rem; }
.h-3\.5 { height: 0.875rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-20 { height: 5rem; }
.h-28 { height: 7rem; }
.h-56 { height: 14rem; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.min-h-\[600px\] { min-height: 600px; }

.max-w-7xl { max-width: 80rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-xl { max-width: 36rem; }
.max-w-xs { max-width: 20rem; }

/* Positioning & Layout */
.sticky { position: sticky; }
.fixed { position: fixed; }
.relative { position: relative; }
.absolute { position: absolute; }
.top-0 { top: 0px; }
.top-5 { top: 1.25rem; }
.top-\[57px\] { top: 57px; }
.left-0 { left: 0px; }
.left-3 { left: 0.75rem; }
.left-3\.5 { left: 0.875rem; }
.right-0 { right: 0px; }
.right-2\.5 { right: 0.625rem; }
.right-3\.5 { right: 0.875rem; }
.right-5 { right: 1.25rem; }
.inset-0 { inset: 0px; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-\[9999\] { z-index: 9999; }
.z-\[99999\] { z-index: 99999; }

.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.object-cover { object-fit: cover; }
.select-none { user-select: none; }
.cursor-pointer { cursor: pointer; }
.outline-none { outline: 2px solid transparent; outline-offset: 2px; }

/* Borders & Rounded */
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-l { border-left-width: 1px; border-left-style: solid; }
.border-transparent { border-color: transparent; }
.divide-y > :not([hidden]) ~ :not([hidden]) { border-top-width: 1px; border-top-style: solid; }

.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Line Clamp */
.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;
}

/* Topic Tabs on Medium */
.topic-tab {
    position: relative;
    padding: 0.75rem 0.25rem;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.topic-tab:hover {
    color: var(--text-primary);
}

.topic-tab.active {
    color: var(--text-primary) !important;
    font-weight: 600;
    border-bottom: 2px solid var(--text-primary);
}

/* Medium Reading Prose Styles */
.medium-prose {
    font-family: var(--font-serif);
    font-size: 1.1875rem;
    line-height: 1.85;
    color: var(--text-primary);
}

.medium-prose p {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    letter-spacing: -0.003em;
}

.medium-prose h2 {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1.25;
    margin-top: 2.2em;
    margin-bottom: 0.6em;
    letter-spacing: -0.02em;
}

.medium-prose h3 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.3;
    margin-top: 1.8em;
    margin-bottom: 0.5em;
}

.medium-prose blockquote {
    border-left: 3px solid var(--accent-green);
    padding-left: 1.25rem;
    margin: 1.5em 0;
    font-style: italic;
    color: var(--text-muted);
}

.medium-prose pre {
    background-color: var(--bg-search);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
}

.medium-prose code {
    font-family: var(--font-mono);
    background-color: var(--bg-search);
    padding: 0.2em 0.4em;
    border-radius: 0.375rem;
    font-size: 0.85em;
}

.medium-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 2em 0;
    border: 1px solid var(--border-color);
}

.medium-prose a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--accent-green);
    text-underline-offset: 3px;
}

/* Zero Scrollbar Utility */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Touch Targets */
.framer-tap {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Category Pills */
.cat-pill.active-pill {
    background-color: var(--text-primary) !important;
    color: var(--bg-primary) !important;
    border-color: var(--text-primary) !important;
}

/* Responsive Media Queries */
@media (min-width: 640px) {
    .sm\:flex { display: flex; }
    .sm\:hidden { display: none; }
    .sm\:inline { display: inline; }
    .sm\:inline-block { display: inline-block; }
    .sm\:flex-row { flex-direction: row; }
    .sm\:w-36 { width: 9rem; }
    .sm\:h-28 { height: 7rem; }
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .sm\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
    .sm\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
    .sm\:text-base { font-size: 1rem; line-height: 1.5rem; }
    .sm\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
    .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .sm\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .sm\:text-5xl { font-size: 3rem; line-height: 1.15; }
    .sm\:text-6xl { font-size: 3.75rem; line-height: 1.1; }
    .sm\:gap-6 { gap: 1.5rem; }
    .sm\:gap-8 { gap: 2rem; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:flex-row { flex-direction: row; }
    .md\:text-7xl { font-size: 4.5rem; line-height: 1.05; }
}

@media (min-width: 1024px) {
    .lg\:flex { display: flex; }
    .lg\:hidden { display: none; }
    .lg\:flex-row { flex-direction: row; }
    .lg\:flex-1 { flex: 1 1 0%; }
    .lg\:w-64 { width: 16rem; }
    .lg\:w-80 { width: 20rem; }
    .lg\:border-l { border-left-width: 1px; border-left-style: solid; }
    .lg\:pl-8 { padding-left: 2rem; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


