/**
 * NetFlow Theme Styles
 *
 * @package netflow
 */

/* ========================================
   CSS Variables - set dynamically via PHP
   Fallbacks only for development
   ======================================== */
:root {
    --nf-primary: #016FEB;
    --nf-secondary: #663399;
    --nf-dark: #1B2349;
    --nf-accent: #00A9D5;
    --nf-text: #1E293B;
    --nf-text-secondary: #64748B;
    --nf-success: #34A853;
    --nf-warning: #FBBC05;
    --nf-danger: #EA4335;
    --nf-info: #4285F4;
    --nf-bg: #ffffff;
    --nf-bg-secondary: #f8fafc;
    --nf-border: #e2e8f0;
    --nf-radius: 8px;
    --nf-shadow: 0 1px 3px rgba(0,0,0,0.1);
    --nf-shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --nf-transition: 0.2s ease;
    --nf-container: 1200px;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--nf-text);
    background: var(--nf-bg);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--nf-text);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 1rem;
}

a {
    color: var(--nf-primary);
    text-decoration: none;
    transition: color var(--nf-transition);
}

a:hover {
    color: var(--nf-secondary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
    padding: 2rem 0;
}

.content-wrapper {
    display: grid;
    gap: 2rem;
}

/* Sidebar layouts */
.sidebar-right .content-wrapper {
    grid-template-columns: 1fr 300px;
}

.sidebar-left .content-wrapper {
    grid-template-columns: 300px 1fr;
}

.sidebar-left .site-main {
    order: 2;
}

.sidebar-left .sidebar {
    order: 1;
}

.no-sidebar .content-wrapper {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}

/* ========================================
   Header
   ======================================== */
.site-header {
    background: var(--nf-bg);
    border-bottom: 1px solid var(--nf-border);
    position: relative;
    z-index: 100;
}

.sticky-header .site-header {
    position: sticky;
    top: 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nf-primary);
    margin: 0;
}

.site-title:hover {
    color: var(--nf-secondary);
}

.site-description {
    font-size: 0.875rem;
    color: var(--nf-text-secondary);
    margin: 0.25rem 0 0;
}

.site-logo img {
    max-height: 60px;
    width: auto;
}

/* Header icons (cart, etc) */
.header-icons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--nf-text);
    border-radius: var(--nf-radius);
    transition: background var(--nf-transition), color var(--nf-transition);
}

.header-cart-icon:hover {
    background: var(--nf-bg-secondary);
    color: var(--nf-primary);
}

.header-cart-icon .cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--nf-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
}

/* Navigation */
.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--nf-text);
    font-weight: 500;
    border-radius: var(--nf-radius);
    transition: all var(--nf-transition);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: var(--nf-primary);
    background: var(--nf-bg-secondary);
}

/* Dropdown */
.main-navigation .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--nf-bg);
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    box-shadow: var(--nf-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--nf-transition);
    flex-direction: column;
    padding: 0.5rem 0;
}

.main-navigation li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-navigation .sub-menu a {
    padding: 0.5rem 1rem;
    border-radius: 0;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1001;
    position: relative;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--nf-text);
    position: relative;
    transition: background 0.2s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--nf-text);
    left: 0;
    transition: transform 0.3s ease, top 0.3s ease;
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

/* Hamburger animation when menu is open */
.menu-toggle.active .hamburger {
    background: transparent;
}

.menu-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Body scroll lock when menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* ========================================
   Breadcrumbs
   ======================================== */
.breadcrumbs {
    background: var(--nf-bg-secondary);
    padding: 0.75rem 0;
    font-size: 0.875rem;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--nf-text-secondary);
}

.breadcrumb-item a:hover {
    color: var(--nf-primary);
}

.breadcrumb-item.current {
    color: var(--nf-text);
}

.breadcrumb-separator {
    color: var(--nf-text-secondary);
}

/* ========================================
   Posts List
   ======================================== */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.posts-list.card-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ========================================
   Post Card - Standard
   ======================================== */
.post-card {
    background: var(--nf-bg);
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    overflow: hidden;
    transition: box-shadow var(--nf-transition);
}

.post-card:hover {
    box-shadow: var(--nf-shadow-lg);
}

.post-card-standard {
    display: grid;
    grid-template-columns: 300px 1fr;
}

.post-card-thumb {
    position: relative;
    overflow: hidden;
}

.post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--nf-transition);
}

.post-card:hover .post-card-thumb img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.post-card-categories {
    margin-bottom: 0.5rem;
}

.post-card-categories a {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--nf-primary);
}

.post-card-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    line-height: 1.4;
}

.post-card-title a {
    color: var(--nf-text);
}

.post-card-title a:hover {
    color: var(--nf-primary);
}

.post-card-excerpt {
    color: var(--nf-text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
    flex: 1;
}

.post-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--nf-text-secondary);
}

/* Post Card - Grid */
.post-card-grid {
    display: flex;
    flex-direction: column;
}

.post-card-grid .post-card-thumb {
    aspect-ratio: 16/10;
}

.post-card-grid .post-card-title {
    font-size: 1.125rem;
}

/* Post Card - Horizontal */
.post-card-horizontal {
    display: grid;
    grid-template-columns: 200px 1fr;
}

.post-card-horizontal .post-card-thumb {
    aspect-ratio: 4/3;
}

.post-card-horizontal .post-card-title {
    font-size: 1.125rem;
}

/* Post Card - Compact */
.post-card-compact {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1rem;
    padding: 1rem;
    border: none;
    border-bottom: 1px solid var(--nf-border);
    border-radius: 0;
}

.post-card-compact .post-card-thumb {
    border-radius: var(--nf-radius);
}

.post-card-compact .post-card-content {
    padding: 0;
}

.post-card-compact .post-card-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

/* ========================================
   Single Post
   ======================================== */
.single-post,
.single-page {
    background: var(--nf-bg);
}

.entry-header {
    margin-bottom: 2rem;
}

.entry-categories {
    margin-bottom: 0.75rem;
}

.entry-categories a {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--nf-primary);
    background: rgba(1, 111, 235, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
}

.entry-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--nf-secondary);
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--nf-text-secondary);
}

.entry-thumbnail {
    margin-bottom: 2rem;
    border-radius: var(--nf-radius);
    overflow: hidden;
}

.entry-content {
    font-size: 1.0625rem;
    line-height: 1.75;
}

.entry-content h2 {
    margin-top: 2rem;
    color: var(--nf-primary);
}

.entry-content h3,
.entry-content h4 {
    margin-top: 1.5rem;
}

.entry-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--nf-primary);
    background: var(--nf-bg-secondary);
    font-style: italic;
}

.entry-content pre {
    background: var(--nf-dark);
    color: #fff;
    padding: 1rem;
    border-radius: var(--nf-radius);
    overflow-x: auto;
}

.entry-content code {
    background: var(--nf-bg-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.875em;
}

.entry-content pre code {
    background: none;
    padding: 0;
}

.entry-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--nf-border);
}

.entry-tags a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--nf-bg-secondary);
    border-radius: 100px;
    font-size: 0.8125rem;
    color: var(--nf-text-secondary);
    margin: 0.25rem 0.25rem 0.25rem 0;
}

.entry-tags a:hover {
    background: var(--nf-primary);
    color: #fff;
}

/* Author box */
.author-box {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--nf-bg-secondary);
    border-radius: var(--nf-radius);
    margin: 2rem 0;
}

.author-avatar img {
    border-radius: 50%;
}

.author-name {
    margin: 0 0 0.5rem;
}

.author-bio {
    color: var(--nf-text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

/* Related posts */
.related-posts {
    margin-top: 3rem;
}

.related-title {
    margin-bottom: 1.5rem;
    color: var(--nf-secondary);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.related-post-item {
    background: var(--nf-bg-secondary);
    border-radius: var(--nf-radius);
    overflow: hidden;
}

.related-post-thumb {
    display: block;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.related-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--nf-transition);
}

.related-post-item:hover .related-post-thumb img {
    transform: scale(1.05);
}

.related-post-title {
    padding: 1rem;
    margin: 0;
    font-size: 1rem;
}

.related-post-title a {
    color: var(--nf-text);
}

.related-post-title a:hover {
    color: var(--nf-primary);
}

/* Post navigation */
.post-navigation {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--nf-border);
}

.post-navigation .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.nav-subtitle {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--nf-text-secondary);
    margin-bottom: 0.25rem;
}

.nav-title {
    font-weight: 600;
    color: var(--nf-text);
}

.post-navigation a:hover .nav-title {
    color: var(--nf-primary);
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.widget {
    background: var(--nf-bg);
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    padding: 1.5rem;
}

.widget-title {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    color: var(--nf-secondary);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--nf-border);
}

.widget li:last-child {
    border-bottom: none;
}

/* Widget posts list */
.widget-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.widget-post-item {
    display: flex;
    gap: 1rem;
    padding: 0;
    border: none;
}

.widget-post-thumb {
    flex-shrink: 0;
    width: 80px;
    border-radius: var(--nf-radius);
    overflow: hidden;
}

.widget-post-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
}

.widget-post-content {
    flex: 1;
    min-width: 0;
}

.widget-post-title {
    display: block;
    font-weight: 600;
    color: var(--nf-text);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.widget-post-title:hover {
    color: var(--nf-primary);
}

.widget-post-date {
    font-size: 0.75rem;
    color: var(--nf-text-secondary);
}

/* Social links */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--nf-bg-secondary);
    border-radius: var(--nf-radius);
    color: var(--nf-text);
    transition: all var(--nf-transition);
}

.social-link:hover {
    background: var(--nf-primary);
    color: #fff;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: var(--nf-dark);
    color: #fff;
    margin-top: auto;
}

.footer-widgets {
    padding: 3rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-widgets-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-widget-area .widget {
    background: transparent;
    border: none;
    padding: 0;
}

.footer-widget-area .widget-title {
    color: #fff;
}

.footer-widget-area .widget a {
    color: rgba(255,255,255,0.7);
}

.footer-widget-area .widget a:hover {
    color: var(--nf-accent);
}

.footer-bottom {
    padding: 1.5rem 0;
}

.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.footer-copyright {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
}

.footer-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

.footer-navigation a {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
}

.footer-navigation a:hover {
    color: var(--nf-accent);
}

/* ========================================
   Pagination
   ======================================== */
.pagination,
.navigation.pagination {
    margin-top: 2rem;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: var(--nf-bg);
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    color: var(--nf-text);
    font-weight: 500;
    transition: all var(--nf-transition);
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--nf-primary);
    border-color: var(--nf-primary);
    color: #fff;
}

/* ========================================
   Search Form
   ======================================== */
.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-field {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--nf-transition);
}

.search-field:focus {
    border-color: var(--nf-primary);
}

.search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: var(--nf-primary);
    border: none;
    border-radius: var(--nf-radius);
    color: #fff;
    cursor: pointer;
    transition: background var(--nf-transition);
}

.search-submit:hover {
    background: var(--nf-secondary);
}

/* ========================================
   Comments
   ======================================== */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--nf-border);
}

.comments-title {
    margin-bottom: 1.5rem;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .comment {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--nf-border);
}

.comment-list .children {
    margin-left: 2rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--nf-border);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-author img {
    border-radius: 50%;
}

.comment-author .fn {
    font-weight: 600;
}

.comment-metadata {
    font-size: 0.8125rem;
    color: var(--nf-text-secondary);
    margin-bottom: 0.75rem;
}

.comment-form {
    margin-top: 2rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.comment-form .submit {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--nf-primary);
    border: none;
    border-radius: var(--nf-radius);
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--nf-transition);
}

.comment-form .submit:hover {
    background: var(--nf-secondary);
}

/* ========================================
   404 Page
   ======================================== */
.error-404 {
    text-align: center;
    padding: 4rem 0;
}

.error-code {
    font-size: 8rem;
    font-weight: 700;
    color: var(--nf-primary);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-message {
    color: var(--nf-text-secondary);
    max-width: 500px;
    margin: 0 auto 2rem;
}

.error-actions {
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: var(--nf-radius);
    font-weight: 500;
    transition: all var(--nf-transition);
}

.btn-primary {
    background: var(--nf-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--nf-secondary);
    color: #fff;
}

.error-search {
    max-width: 400px;
    margin: 0 auto;
}

/* ========================================
   Archive/Search Header
   ======================================== */
.archive-header,
.search-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--nf-border);
}

.archive-title,
.search-title {
    color: var(--nf-secondary);
}

.archive-description {
    color: var(--nf-text-secondary);
    margin-top: 0.5rem;
}

/* ========================================
   Utility Classes
   ======================================== */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link {
    background: var(--nf-dark);
    color: #fff;
    padding: 0.5rem 1rem;
    position: fixed;
    top: -100px;
    left: 0;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .sidebar-right .content-wrapper,
    .sidebar-left .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar-left .site-main,
    .sidebar-left .sidebar {
        order: initial;
    }
    
    .footer-widgets-inner {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1, .entry-title { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    .header-inner {
        flex-wrap: nowrap;
    }
    
    .menu-toggle {
        display: block;
    }
    
    /* Mobile overlay menu */
    .mobile-menu-overlay {
        display: block;
    }
    
    .main-navigation {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background: var(--nf-bg);
        z-index: 999;
        overflow-y: auto;
        transition: right 0.3s ease;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    }
    
    .main-navigation.toggled {
        right: 0;
    }
    
    .main-navigation ul {
        flex-direction: column;
        width: 100%;
        padding: 1rem 0;
        margin: 0;
        gap: 0;
    }
    
    .main-navigation > ul {
        padding-top: 70px;
    }
    
    .main-navigation li {
        border-bottom: 1px solid var(--nf-border);
    }
    
    .main-navigation li:last-child {
        border-bottom: none;
    }
    
    .main-navigation a {
        padding: 1rem 1.5rem;
        border-radius: 0;
        font-size: 1rem;
    }
    
    .main-navigation a:hover,
    .main-navigation .current-menu-item > a {
        background: var(--nf-bg-secondary);
    }
    
    .main-navigation .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: var(--nf-bg-secondary);
        margin: 0;
        padding: 0;
        display: none;
    }
    
    .main-navigation .menu-item-has-children.submenu-open > .sub-menu {
        display: block;
    }
    
    .main-navigation .sub-menu a {
        padding-left: 2.5rem;
        font-size: 0.9375rem;
        color: var(--nf-text-secondary);
    }
    
    .main-navigation .sub-menu .sub-menu a {
        padding-left: 3.5rem;
    }
    
    /* Menu close button inside */
    .main-navigation::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--nf-bg);
        border-bottom: 1px solid var(--nf-border);
    }
    
    /* Header icons on mobile */
    .header-icons {
        margin-left: auto;
    }
    
    .header-cart-icon {
        width: 36px;
        height: 36px;
    }
    
    .post-card-standard {
        grid-template-columns: 1fr;
    }
    
    .post-card-horizontal {
        grid-template-columns: 1fr;
    }
    
    .post-navigation .nav-links {
        grid-template-columns: 1fr;
    }
    
    .footer-widgets-inner {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .error-code {
        font-size: 5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .site-content {
        padding: 1.5rem 0;
    }
    
    .post-card-compact {
        grid-template-columns: 60px 1fr;
    }
    
    .author-box {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   Table of Contents
   ======================================== */
.table-of-contents {
    background: var(--nf-bg-secondary);
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.toc-header {
    margin-bottom: 1rem;
}

.toc-title,
.toc-toggle {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--nf-secondary);
}

.toc-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-toggle::after {
    content: '▼';
    font-size: 0.75rem;
    transition: transform var(--nf-transition);
}

.toc-collapsed .toc-toggle::after {
    transform: rotate(-90deg);
}

.toc-list {
    margin: 0;
    padding-left: 1.25rem;
    list-style: decimal;
}

.toc-item {
    padding: 0.25rem 0;
    line-height: 1.4;
}

.toc-item a {
    color: var(--nf-text);
    text-decoration: none;
}

.toc-item a:hover {
    color: var(--nf-primary);
}

.toc-level-2 {
    margin-left: 1rem;
}

.toc-level-3 {
    margin-left: 2rem;
}

/* ========================================
   Spoiler
   ======================================== */
.spoiler-box {
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    margin: 1rem 0;
}

.spoiler-title {
    padding: 0.75rem 1rem;
    background: var(--nf-bg-secondary);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: var(--nf-radius) var(--nf-radius) 0 0;
}

.spoiler-title::before {
    content: '▶';
    font-size: 0.75rem;
    transition: transform var(--nf-transition);
}

.spoiler-open .spoiler-title::before {
    transform: rotate(90deg);
}

.spoiler-content {
    padding: 1rem;
}

/* ========================================
   Notes/Alerts
   ======================================== */
.note {
    padding: 1rem 1.25rem;
    border-radius: var(--nf-radius);
    margin: 1rem 0;
    border-left: 4px solid;
}

.note-info {
    background: rgba(66, 133, 244, 0.1);
    border-color: var(--nf-info);
}

.note-success {
    background: rgba(52, 168, 83, 0.1);
    border-color: var(--nf-success);
}

.note-warning {
    background: rgba(251, 188, 5, 0.1);
    border-color: var(--nf-warning);
}

.note-danger {
    background: rgba(234, 67, 53, 0.1);
    border-color: var(--nf-danger);
}

/* ========================================
   Masked Links
   ======================================== */
.masked-link {
    color: var(--nf-primary);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.masked-link:hover {
    color: var(--nf-secondary);
}

/* ========================================
   Buttons (Shortcode)
   ======================================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--nf-radius);
    font-weight: 500;
    text-align: center;
    transition: all var(--nf-transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--nf-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--nf-secondary);
    color: #fff;
}

.btn-secondary {
    background: var(--nf-secondary);
    color: #fff;
}

.btn-secondary:hover {
    background: var(--nf-dark);
    color: #fff;
}

.btn-accent {
    background: var(--nf-accent);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--nf-primary);
    color: var(--nf-primary);
}

.btn-outline:hover {
    background: var(--nf-primary);
    color: #fff;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ========================================
   Header Variants
   ======================================== */

/* Centered Header */
.header-centered .header-inner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
}

.header-centered .site-branding {
    order: 1;
}

.header-centered .main-navigation {
    order: 2;
    width: 100%;
    border-top: 1px solid var(--nf-border);
    padding-top: 1rem;
}

.header-centered .main-navigation ul {
    justify-content: center;
}

/* Minimal Header */
.header-minimal .main-navigation ul {
    display: none;
}

.header-minimal .main-navigation.toggled ul {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nf-bg);
    border-top: 1px solid var(--nf-border);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--nf-shadow-lg);
    z-index: 1000;
}

.header-minimal .menu-toggle {
    display: block !important;
}

/* Wide Header with Search */
.header-wide .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-wide .header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    justify-content: flex-end;
}

.header-wide .main-navigation {
    flex-shrink: 0;
}

.header-wide .header-search {
    flex-shrink: 0;
}

.header-wide .header-search .search-form {
    display: flex;
    align-items: center;
}

.header-wide .header-search .search-field {
    width: 180px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius) 0 0 var(--nf-radius);
    border-right: none;
}

.header-wide .header-search .search-submit {
    padding: 0.5rem 0.75rem;
    border-radius: 0 var(--nf-radius) var(--nf-radius) 0;
}

@media (max-width: 768px) {
    .header-wide .header-search {
        display: none;
    }
    
    .header-wide .header-right {
        gap: 1rem;
    }
}

/* ========================================
   Footer Variants
   ======================================== */

/* Minimal Footer */
.footer-minimal {
    background: var(--nf-bg-secondary);
    padding: 1.5rem 0;
}

.footer-minimal-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-minimal .footer-copyright {
    color: var(--nf-text-secondary);
    font-size: 0.875rem;
}

.footer-minimal .footer-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

.footer-minimal .footer-navigation a {
    color: var(--nf-text-secondary);
    font-size: 0.875rem;
}

/* Dark Footer */
.footer-dark {
    background: var(--nf-dark);
    color: #fff;
}

.footer-dark .footer-main {
    padding: 3rem 0;
}

.footer-dark-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}

.footer-dark .footer-brand {
    padding-right: 2rem;
}

.footer-dark .footer-logo img {
    max-height: 50px;
    filter: brightness(0) invert(1);
}

.footer-dark .footer-site-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.footer-dark .footer-description {
    color: rgba(255,255,255,0.7);
    margin: 0;
}

.footer-dark .footer-links h4 {
    color: #fff;
    margin-bottom: 1rem;
}

.footer-dark .footer-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-dark .footer-links li {
    margin-bottom: 0.5rem;
}

.footer-dark .footer-links a {
    color: rgba(255,255,255,0.7);
}

.footer-dark .footer-links a:hover {
    color: var(--nf-accent);
}

.footer-dark .footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 0;
}

.footer-dark .footer-copyright {
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
    text-align: center;
}

/* Centered Footer */
.footer-centered {
    background: var(--nf-bg-secondary);
    padding: 3rem 0 2rem;
    text-align: center;
}

.footer-centered-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-centered .footer-logo img {
    max-height: 50px;
}

.footer-centered .footer-site-title a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nf-text);
}

.footer-centered .footer-navigation ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

.footer-centered .footer-navigation a {
    color: var(--nf-text);
    font-weight: 500;
}

.footer-centered .footer-navigation a:hover {
    color: var(--nf-primary);
}

.footer-centered .footer-copyright {
    color: var(--nf-text-secondary);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .footer-dark-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-minimal-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   Tables
   ======================================== */
.entry-content table,
.wp-block-table table,
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
    background: var(--nf-bg);
    border-radius: var(--nf-radius);
    overflow: hidden;
    box-shadow: var(--nf-shadow);
}

.entry-content table thead,
.wp-block-table table thead,
table thead {
    background: var(--nf-primary);
    color: #fff;
}

.entry-content table th,
.wp-block-table table th,
table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.entry-content table td,
.wp-block-table table td,
table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--nf-border);
    vertical-align: top;
}

.entry-content table tbody tr:last-child td,
.wp-block-table table tbody tr:last-child td,
table tbody tr:last-child td {
    border-bottom: none;
}

.entry-content table tbody tr:nth-child(even),
.wp-block-table table tbody tr:nth-child(even),
table tbody tr:nth-child(even) {
    background: var(--nf-bg-secondary);
}

.entry-content table tbody tr:hover,
.wp-block-table table tbody tr:hover,
table tbody tr:hover {
    background: rgba(var(--nf-primary-rgb, 1, 111, 235), 0.08);
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0;
}

.table-responsive table {
    margin: 0;
    min-width: 600px;
}

/* Striped variant */
table.striped tbody tr:nth-child(odd) {
    background: var(--nf-bg);
}

table.striped tbody tr:nth-child(even) {
    background: var(--nf-bg-secondary);
}

/* Bordered variant */
table.bordered,
table.bordered th,
table.bordered td {
    border: 1px solid var(--nf-border);
}

table.bordered {
    border-radius: var(--nf-radius);
    border-collapse: separate;
    border-spacing: 0;
}

table.bordered thead th:first-child {
    border-top-left-radius: var(--nf-radius);
}

table.bordered thead th:last-child {
    border-top-right-radius: var(--nf-radius);
}

table.bordered tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--nf-radius);
}

table.bordered tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--nf-radius);
}

/* Compact variant */
table.compact th,
table.compact td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Table caption */
table caption {
    padding: 0.75rem 1rem;
    font-weight: 600;
    text-align: left;
    color: var(--nf-text);
    background: var(--nf-bg-secondary);
    border-bottom: 1px solid var(--nf-border);
}

/* Mobile tables */
@media (max-width: 768px) {
    .entry-content table,
    .wp-block-table table,
    table {
        font-size: 0.875rem;
    }
    
    .entry-content table th,
    .entry-content table td,
    .wp-block-table table th,
    .wp-block-table table td,
    table th,
    table td {
        padding: 0.625rem 0.75rem;
    }
    
    /* Stack on mobile option */
    table.stack-mobile {
        display: block;
    }
    
    table.stack-mobile thead {
        display: none;
    }
    
    table.stack-mobile tbody,
    table.stack-mobile tr,
    table.stack-mobile td {
        display: block;
    }
    
    table.stack-mobile tr {
        margin-bottom: 1rem;
        border: 1px solid var(--nf-border);
        border-radius: var(--nf-radius);
        overflow: hidden;
    }
    
    table.stack-mobile td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid var(--nf-border);
    }
    
    table.stack-mobile td:last-child {
        border-bottom: none;
    }
    
    table.stack-mobile td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.75rem;
        width: 45%;
        text-align: left;
        font-weight: 600;
        color: var(--nf-text);
    }
}

/* ========================================
   FAQ Styles
   ======================================== */
.nf-faq {
    margin: 2rem 0;
}

.nf-faq__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--nf-text);
    margin: 0 0 1rem 0;
}

.nf-faq__item {
    background: var(--nf-bg);
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    margin-bottom: 0.625rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nf-faq__item:last-child {
    margin-bottom: 0;
}

.nf-faq__item:hover {
    border-color: var(--nf-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nf-faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: 1rem;
    color: var(--nf-text);
    line-height: 1.5;
    transition: background 0.2s ease, color 0.2s ease;
}

.nf-faq__question::-webkit-details-marker {
    display: none;
}

.nf-faq__question::marker {
    display: none;
    content: '';
}

.nf-faq__question::after {
    content: '';
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    position: relative;
    border-radius: 50%;
    background: rgba(var(--nf-primary-rgb, 1, 111, 235), 0.1);
    transition: all 0.2s ease;
}

/* Plus icon via pseudo-elements */
.nf-faq__question::after {
    background: 
        linear-gradient(var(--nf-primary), var(--nf-primary)) center/2px 10px no-repeat,
        linear-gradient(var(--nf-primary), var(--nf-primary)) center/10px 2px no-repeat,
        rgba(var(--nf-primary-rgb, 1, 111, 235), 0.1);
}

.nf-faq__item:hover .nf-faq__question::after {
    background: 
        linear-gradient(var(--nf-primary), var(--nf-primary)) center/2px 10px no-repeat,
        linear-gradient(var(--nf-primary), var(--nf-primary)) center/10px 2px no-repeat,
        rgba(var(--nf-primary-rgb, 1, 111, 235), 0.15);
}

/* Open state */
.nf-faq__item[open] {
    border-color: var(--nf-primary);
}

.nf-faq__item[open] .nf-faq__question {
    color: var(--nf-primary);
    background: rgba(var(--nf-primary-rgb, 1, 111, 235), 0.03);
}

/* Minus icon when open */
.nf-faq__item[open] .nf-faq__question::after {
    background: 
        linear-gradient(#fff, #fff) center/10px 2px no-repeat,
        var(--nf-primary);
}

.nf-faq__answer {
    padding: 0.75rem 1.25rem 1.25rem;
    color: var(--nf-text-secondary);
    line-height: 1.7;
    animation: nfFaqFadeIn 0.25s ease;
}

@keyframes nfFaqFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nf-faq__answer p:first-child,
.nf-faq__answer > div > p:first-child {
    margin-top: 0;
}

.nf-faq__answer p:last-child,
.nf-faq__answer > div > p:last-child {
    margin-bottom: 0;
}

.nf-faq__answer ul,
.nf-faq__answer ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.nf-faq__answer li {
    margin-bottom: 0.5rem;
}

/* Mobile */
@media (max-width: 768px) {
    .nf-faq__question {
        font-size: 0.9375rem;
        padding: 0.875rem 1rem;
        gap: 0.75rem;
    }
    
    .nf-faq__question::after {
        width: 22px;
        height: 22px;
    }
    
    .nf-faq__answer {
        padding: 0.5rem 1rem 1rem;
    }
}

/* Native details/summary in content */
.entry-content details:not(.nf-faq__item) {
    background: var(--nf-bg);
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    margin: 0.75rem 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease;
}

.entry-content details:not(.nf-faq__item):hover {
    border-color: var(--nf-primary);
}

.entry-content details:not(.nf-faq__item) summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.entry-content details:not(.nf-faq__item) summary::-webkit-details-marker {
    display: none;
}

.entry-content details:not(.nf-faq__item) summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--nf-primary);
}

.entry-content details:not(.nf-faq__item)[open] summary {
    color: var(--nf-primary);
}

.entry-content details:not(.nf-faq__item)[open] summary::after {
    content: '−';
}

.entry-content details:not(.nf-faq__item) > *:not(summary) {
    padding: 0 1.25rem 1.25rem;
}
