/* Self-Hosted Fonts */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-v20-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/inter-v20-latin-700.woff2') format('woff2'); }
@font-face { font-family: 'Orbitron'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/orbitron-v35-latin-regular.woff2') format('woff2'); }
@font-face { font-family: 'Orbitron'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/orbitron-v35-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Orbitron'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/orbitron-v35-latin-700.woff2') format('woff2'); }

/* Font Fallbacks for Performance */
@font-face { font-family: 'Inter Fallback'; src: local('Arial'); size-adjust: 107.5%; ascent-override: 90%; }
@font-face { font-family: 'Orbitron Fallback'; src: local('Arial'); size-adjust: 104%; ascent-override: 90%; }

/* Core Styles */
:root { --menu-width: 200px; --accent-color: #00C9FF; --bg-main: #1a202c; --bg-article: #1f2937; --border-color: #4a5568; --text-color: #e2e8f0; --text-muted: #a8b5c7; --code-bg: #2d3748; }
html { height: 100%; width: 100%; overflow-x: hidden; scroll-behavior: smooth; }
body { font-family: 'Inter Fallback', 'Inter', sans-serif; background-color: var(--bg-main); background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3e%3crect width='10' height='10' fill='%231a202c'/%3e%3cpath d='M0 0L10 10M10 0L0 10' stroke='%232d3748' stroke-width='0.2'/%3e%3c/svg%3e"); background-repeat: repeat; min-height: 100vh; margin: 0; padding: 0; box-sizing: border-box; color: var(--text-color); display: flex; flex-direction: row; }

/* Utility & Font Families */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.left-menu, .page-header h1, .section-title, .blog-post-card h3, .mobile-title { font-family: 'Orbitron Fallback', 'Orbitron', sans-serif; }

/* Left Menu */
.left-menu { width: var(--menu-width); min-width: var(--menu-width); height: 100vh; position: fixed; top: 0; left: 0; background: rgba(10, 10, 10, 0.9); box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3); padding: 0 20px; box-sizing: border-box; z-index: 1001; font-weight: 600; display: flex; flex-direction: column; justify-content: center; overflow-y: auto; }
.left-menu ul { list-style: none; padding: 0; margin: 0; }
.left-menu li { margin-bottom: 20px; }
.left-menu a { font-family: 'Orbitron', sans-serif; font-size: 24px; font-weight: 400; color: #00C9FF; text-decoration: none; text-shadow: 0 0 2px #00C9FF, 0 0 3px rgba(0, 201, 255, 0.6); display: block; padding: 8px 0; transition: color 0.3s ease, text-shadow 0.3s ease, background-color 0.3s ease; }
.left-menu a:hover, .left-menu a:focus { color: #fff; text-shadow: 0 0 6px #fff, 0 0 8px rgba(255, 255, 255, 0.5); outline: none; }
.left-menu a.active-page-link { color: #fff; text-shadow: 0 0 8px #fff, 0 0 12px rgba(255, 255, 255, 0.7); background-color: rgba(0, 190, 255, 0.1); border-radius: 5px; padding-left: 10px; padding-right: 10px; }
.mobile-header, .menu-overlay { display: none; }

/* Main Content Wrapper */
.main-content-wrapper { flex-grow: 1; padding-left: calc(var(--menu-width) + 40px); padding-top: 40px; padding-right: 40px; padding-bottom: 40px; display: flex; flex-direction: column; min-height: 100vh; box-sizing: border-box; width: calc(100% - var(--menu-width)); }
.blog-container { width: 100%; max-width: 1200px; margin: 0 auto; }

/* Breadcrumbs & Header */
.breadcrumbs { margin-bottom: 2rem; }
.breadcrumbs ol { display: flex; list-style: none; padding: 0; margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.breadcrumbs li:not(:last-child)::after { content: '>'; margin: 0 0.75rem; }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-color); }
.page-header { text-align: center; margin-bottom: 3rem; }
.page-header h1 { font-size: 3rem; color: var(--accent-color); text-shadow: 0 0 5px var(--accent-color), 0 0 10px rgba(0, 201, 255, 0.4); margin: 0 0 1rem 0; }

/* Search */
.search-container { position: relative; max-width: 600px; margin: auto; }
#search-input { width: 100%; padding: 15px 20px 15px 50px; background-color: var(--bg-article); border: 1px solid var(--border-color); border-radius: 50px; color: var(--text-color); font-size: 1.1rem; transition: all 0.2s; box-sizing: border-box; }
#search-input:focus { border-color: var(--accent-color); box-shadow: 0 0 10px rgba(0, 201, 255, 0.3); outline: none; }
.search-container .search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 1em; height: 1em; }

/* Posts Grid & Cards */
.section-title { font-size: 2rem; color: var(--text-color); margin: 3rem 0 2rem 0; text-align: center; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.blog-post-card { background-color: var(--bg-article); border-radius: 1rem; border: 1px solid var(--border-color); text-decoration: none; color: var(--text-color); display: flex; flex-direction: column; height: 100%; transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; }
.blog-post-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4); border-color: var(--accent-color); }
.blog-post-card .post-image { width: 100%; height: 200px; object-fit: cover; border-top-left-radius: 1rem; border-top-right-radius: 1rem; background-color: var(--code-bg); }
.blog-post-card .post-content { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.blog-post-card h3 { color: var(--accent-color); margin-top: 0; margin-bottom: 0.5rem; font-size: 1.4rem; line-height: 1.4; }
.blog-post-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5ch; }
.blog-post-meta .read-time { margin-left: 1rem; display: flex; align-items: center; gap: 0.5ch;}
.blog-post-meta svg { width: 1em; height: 1em; fill: currentColor; }
.blog-post-card p { line-height: 1.6; margin-bottom: 1rem; flex-grow: 1; color: var(--text-muted); }
.tags-container { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background-color: var(--bg-main); color: var(--text-muted); padding: 5px 10px; border-radius: 5px; font-size: 0.75rem; font-weight: 600; }
.read-more-link { font-weight: 600; color: var(--accent-color); text-decoration: none; margin-top: auto; align-self: flex-start; }
.read-more-link:after { content: ' →'; transition: transform 0.2s; display: inline-block; }
.blog-post-card:hover .read-more-link:after { transform: translateX(5px); }
.no-results { text-align: center; padding: 4rem; color: var(--text-muted); font-style: italic; font-size: 1.2rem; grid-column: 1 / -1; }

/* Pagination */
.pagination-container { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 3rem; }
.pagination-btn { background-color: var(--bg-article); border: 1px solid var(--border-color); color: var(--text-muted); font-family: 'Orbitron', sans-serif; font-weight: 600; padding: 10px 15px; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.pagination-btn:hover:not(:disabled) { background-color: var(--border-color); color: var(--text-color); }
.pagination-btn.active { background-color: var(--accent-color); color: var(--bg-main); border-color: var(--accent-color); }
.pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Responsive Styles */
@media (max-width: 992px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .posts-grid { grid-template-columns: 1fr; } }
@media (max-width: 992px) {
    :root { --menu-width: 250px; }
    body { flex-direction: column; }
    body.menu-open { overflow: hidden; }
    .main-content-wrapper { padding: 80px 20px 40px; width: 100%; box-sizing: border-box; margin-left: 0; }
    .mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 60px; background-color: #1a202c; border-bottom: 1px solid #4a5568; position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; box-sizing: border-box; }
    .hamburger-btn { background: none; border: none; padding: 10px; cursor: pointer; z-index: 1002; }
    .hamburger-btn .line { display: block; width: 24px; height: 3px; background-color: #e2e8f0; margin: 5px 0; transition: transform 0.3s ease, opacity 0.3s ease; }
    .mobile-title { font-family: 'Orbitron', sans-serif; font-size: 1.2rem; color: var(--accent-color); }
    .left-menu { transform: translateX(-100%); transition: transform 0.3s ease-in-out; height: 100vh; width: var(--menu-width); min-width: var(--menu-width); }
    .left-menu.menu-open { transform: translateX(0); }
    .menu-overlay { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
    .menu-overlay.menu-open { opacity: 1; pointer-events: auto; }
    .page-header h1 { font-size: 2.2rem; }
}