/**
 * Theme Name: MBSM Theme
 * Theme URI: https://mbsm.tn
 * Author: MBSM
 * Version: 1.0.0
 * Description: A dynamic, dark-themed WordPress theme with sidebar support
 * Text Domain: mbsm-theme
 */

/* ===== CSS VARIABLES ===== */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #0f111a;
    --border-color: #30363d;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --text-dim: #484f58;
    --green-primary: #41b883;
    --green-glow: rgba(65, 184, 132, 0.4);
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "Courier New", Consolas, monospace;
    --nav-height: 64px;
    --sidebar-width: 320px;
    --transition-fast: 0.2s ease;
    --transition-med: 0.3s ease;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #0a0e17;
    background-image: 
        url('https://mbsm.tn/images/Mbsm-back.jpg'),
        radial-gradient(circle at 50% 0%, rgba(65, 184, 132, 0.2) 0%, transparent 60%);
    background-size: cover, 100% 100%;
    background-position: center, center;
    background-repeat: no-repeat;
    background-blend-mode: overlay;
    
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

ul, ol {
    list-style: none;
}

/* ===== HEADER & NAVIGATION ===== */
.site-header {
    position: relative;
    z-index: 100;
}

.navbar {
    background-color: rgba(15, 17, 26, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    height: var(--nav-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-fast);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    transition: transform var(--transition-fast);
}

.logo:hover {
    transform: scale(1.02);
}

.logo img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

/* ===== DESKTOP NAVIGATION ===== */
.nav-links {
    display: flex;
    list-style: none;
    gap: 24px;
    align-items: center;
}

.nav-links li {
    display: inline-block;
}

.nav-links a {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
    position: relative;
    transition: color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--green-primary);
    transition: width var(--transition-fast);
}

.nav-links a:hover {
    color: var(--green-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.external::after {
    content: '↗';
    font-size: 10px;
    margin-left: 2px;
    opacity: 0.7;
}

/* ===== NAV RIGHT SECTION ===== */
.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ===== DATE/TIME DISPLAY ===== */
.datetime-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    border: 1px solid rgba(65, 184, 132, 0.3);
    border-radius: 8px;
    padding: 6px 12px;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.datetime-display:hover {
    border-color: rgba(65, 184, 132, 0.5);
    box-shadow: 0 0 0 3px rgba(65, 184, 132, 0.1);
}

.datetime-icon {
    width: 28px;
    height: 28px;
    background: rgba(65, 184, 132, 0.15);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-primary);
    flex-shrink: 0;
}

.datetime-icon svg {
    width: 16px;
    height: 16px;
}

.datetime-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.datetime-date {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
}

.datetime-time {
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: #0d1117;
    background: var(--green-primary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

/* ===== SEARCH BOX ===== */
.search-container {
    position: relative;
}

.search-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px 8px 36px;
    color: var(--text-main);
    width: 200px;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.search-box:focus {
    outline: none;
    border-color: var(--green-primary);
    width: 240px;
    box-shadow: 0 0 0 3px rgba(65, 184, 132, 0.1);
}

.search-box::placeholder {
    color: var(--text-dim);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.search-box:focus + .search-icon {
    color: var(--green-primary);
}

.search-icon svg {
    width: 16px;
    height: 16px;
}

.search-shortcut {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    pointer-events: none;
}

/* ===== NAV ICONS ===== */
.nav-icon {
    padding: 8px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    border-radius: 6px;
}

.nav-icon:hover {
    color: var(--green-primary);
    background: rgba(65, 184, 132, 0.1);
}

.nav-icon svg {
    width: 20px;
    height: 20px;
}

/* ===== MOBILE MENU TOGGLE ===== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background: rgba(65, 184, 132, 0.1);
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--green-primary);
    position: relative;
    transition: all var(--transition-med);
    border-radius: 2px;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--green-primary);
    transition: all var(--transition-med);
    border-radius: 2px;
}

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

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

.mobile-menu-toggle.active .hamburger {
    background: transparent;
}

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

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

/* ===== MOBILE MENU ===== */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 360px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    z-index: 1001;
    transition: right var(--transition-med);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.mobile-menu-header span {
    font-size: 18px;
    font-weight: 600;
    color: var(--green-primary);
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.mobile-menu-close:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.mobile-menu-close svg {
    width: 24px;
    height: 24px;
}

/* ===== MOBILE SEARCH ===== */
.mobile-search {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.mobile-search-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text-main);
    font-size: 14px;
    margin-right: 10px;
    transition: border-color var(--transition-fast);
}

.mobile-search-input:focus {
    outline: none;
    border-color: var(--green-primary);
}

.mobile-search-input::placeholder {
    color: var(--text-dim);
}

.mobile-search-btn {
    background: var(--green-primary);
    border: none;
    border-radius: 6px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0d1117;
    transition: all var(--transition-fast);
}

.mobile-search-btn:hover {
    background: var(--green-primary);
    transform: scale(1.05);
}

.mobile-search-btn svg {
    width: 18px;
    height: 18px;
}

/* ===== MOBILE NAVIGATION LINKS ===== */
.mobile-nav-links {
    list-style: none;
    padding: 12px 0;
}

.mobile-nav-links li {
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-links a {
    display: block;
    padding: 14px 20px;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.mobile-nav-links a:hover {
    background: rgba(65, 184, 132, 0.08);
    color: var(--green-primary);
    padding-left: 24px;
}

.mobile-nav-links a.external::after {
    content: '↗';
    margin-left: 6px;
    opacity: 0.6;
}

/* ===== MOBILE MENU FOOTER ===== */
.mobile-menu-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    text-align: center;
    position: sticky;
    bottom: 0;
}

.mobile-datetime {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(65, 184, 132, 0.1);
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--green-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
}

.mobile-datetime svg {
    width: 16px;
    height: 16px;
}

/* ===== MOBILE OVERLAY ===== */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--transition-med);
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== SEARCH MODAL ===== */
.search-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    padding-top: 15vh;
    animation: fadeIn 0.2s ease;
}

.search-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 92%;
    max-width: 640px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.search-modal-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    margin-right: 12px;
    flex-shrink: 0;
}

.search-modal-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 16px;
    outline: none;
    font-family: var(--font-main);
}

.search-modal-input::placeholder {
    color: var(--text-dim);
}

.search-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.search-modal-close:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.search-modal-close svg {
    width: 18px;
    height: 18px;
}

/* ===== SEARCH RESULTS ===== */
.search-results {
    padding: 8px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-primary);
}

.search-results-counter {
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: inherit;
    margin: 4px 0;
}

.search-result-item:hover,
.search-result-item.active {
    background: rgba(65, 184, 132, 0.08);
}

.search-result-icon {
    width: 36px;
    height: 36px;
    background: rgba(65, 184, 132, 0.15);
    border: 1px solid rgba(65, 184, 132, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--green-primary);
    flex-shrink: 0;
}

.search-result-icon svg {
    width: 18px;
    height: 18px;
}

.search-result-text {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 3px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-desc {
    font-size: 12px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.search-result-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(65, 184, 132, 0.15);
    border: 1px solid rgba(65, 184, 132, 0.3);
    border-radius: 4px;
    color: var(--green-primary);
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 6px;
}

.search-result-arrow {
    color: var(--text-dim);
    font-size: 14px;
    margin-left: 12px;
    opacity: 0;
    transition: opacity var(--transition-fast);
    font-family: monospace;
}

.search-result-item:hover .search-result-arrow {
    opacity: 1;
}

.search-view-all {
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    background: linear-gradient(135deg, rgba(65, 184, 132, 0.08), rgba(65, 184, 132, 0.04));
}

.search-view-all .search-result-title {
    color: var(--green-primary);
}

/* ===== LOADING & EMPTY STATES ===== */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--green-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search-no-results {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.search-no-results svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--text-dim);
}

.search-no-results p {
    margin-bottom: 8px;
}

.btn-search-full {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(65, 184, 132, 0.2), rgba(65, 184, 132, 0.1));
    border: 1px solid rgba(65, 184, 132, 0.4);
    border-radius: 8px;
    color: var(--green-primary);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn-search-full:hover {
    background: linear-gradient(135deg, rgba(65, 184, 132, 0.3), rgba(65, 184, 132, 0.2));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(65, 184, 132, 0.2);
}

.btn-search-full svg {
    width: 16px;
    height: 16px;
}

/* ===== SCROLLBAR ===== */
.search-results::-webkit-scrollbar,
.mobile-menu::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track,
.mobile-menu::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb,
.mobile-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover,
.mobile-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== UTILITY CLASSES ===== */
.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-left {
        gap: 16px;
    }

    .logo img {
        height: 32px;
    }

    .datetime-display {
        padding: 5px 10px;
    }

    .datetime-date {
        font-size: 10px;
    }

    .datetime-time {
        font-size: 11px;
        padding: 1px 5px;
    }

    .nav-container {
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .datetime-display {
        display: none;
    }

    .search-modal-content {
        width: 96%;
        border-radius: 10px;
    }

    .mobile-menu {
        width: 90%;
    }
}

@media (max-width: 480px) {
    :root {
        --nav-height: 56px;
    }

    .nav-container {
        padding: 0 12px;
    }

    .logo img {
        height: 28px;
    }

    .search-modal-header {
        padding: 12px 16px;
    }

    .search-modal-input {
        font-size: 15px;
    }

    .search-result-item {
        padding: 10px 12px;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--green-primary);
    outline-offset: 2px;
}

/* Fix mobile menu default state */
.mobile-menu {
    right: -100% !important;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-menu.active {
    right: 0 !important;
    visibility: visible;
    opacity: 1;
}

/* Fix datetime display size */
.datetime-display {
    max-width: 200px;
}

.datetime-icon svg {
    width: 16px !important;
    height: 16px !important;
}

/* Fix large icons */
.mobile-menu svg,
.search-modal svg {
    max-width: 24px;
    max-height: 24px;
}

/* Prevent layout shift */
.navbar {
    min-height: 64px;
}

/* Fix search input visibility */
.search-box,
.mobile-search-input,
.search-modal-input {
    min-width: 150px;
}

/* Overlay fix */
.mobile-overlay {
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

.mobile-overlay.active {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

/* ===== SITE LAYOUT ===== */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content-wrapper {
    display: flex;
    flex: 1;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    padding: 0 24px;
    gap: 32px;
}

.site-content-wrapper.with-sidebar {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
}

.site-content-wrapper.no-sidebar {
    display: block;
}

.site-main {
    flex: 1;
    min-width: 0;
    padding: 40px 0;
}

/* ===== SIDEBAR ===== */
.site-sidebar {
    width: var(--sidebar-width);
    padding: 40px 0;
    border-left: 1px solid var(--border-color);
    padding-left: 24px;
}

.site-sidebar .widget {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    transition: all var(--transition-fast);
}

.site-sidebar .widget:hover {
    border-color: rgba(65, 184, 132, 0.4);
}

.site-sidebar .widget-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--green-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-sidebar .widget-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--green-primary);
    border-radius: 50%;
}

.site-sidebar .widget ul {
    list-style: none;
}

.site-sidebar .widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
    transition: all var(--transition-fast);
}

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

.site-sidebar .widget ul li a {
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.site-sidebar .widget ul li a::before {
    content: '›';
    color: var(--green-primary);
    font-weight: bold;
    font-size: 16px;
}

.site-sidebar .widget ul li a:hover {
    color: var(--green-primary);
    padding-left: 4px;
}

.site-sidebar .widget ul li .count {
    margin-left: auto;
    background: rgba(65, 184, 132, 0.15);
    color: var(--green-primary);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Widget search */
.site-sidebar .widget_search .search-form {
    display: flex;
    gap: 8px;
}

.site-sidebar .widget_search input[type="search"] {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
}

.site-sidebar .widget_search input[type="search"]:focus {
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px rgba(65, 184, 132, 0.1);
}

.site-sidebar .widget_search input[type="submit"] {
    background: var(--green-primary);
    color: #0d1117;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.site-sidebar .widget_search input[type="submit"]:hover {
    background: #38a169;
    transform: translateY(-1px);
}

/* Widget recent posts */
.site-sidebar .widget_recent_entries ul li a {
    font-weight: 500;
    line-height: 1.5;
}

.site-sidebar .widget_recent_entries .post-date {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
    margin-left: 16px;
}

/* Widget categories */
.site-sidebar .widget_categories ul li a {
    justify-content: space-between;
}

/* Widget tag cloud */
.site-sidebar .widget_tag_cloud .tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.site-sidebar .widget_tag_cloud a {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px !important;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.site-sidebar .widget_tag_cloud a:hover {
    background: rgba(65, 184, 132, 0.15);
    border-color: var(--green-primary);
    color: var(--green-primary);
    transform: translateY(-1px);
}

/* Widget calendar */
.site-sidebar .widget_calendar table {
    width: 100%;
    border-collapse: collapse;
}

.site-sidebar .widget_calendar caption {
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

.site-sidebar .widget_calendar th,
.site-sidebar .widget_calendar td {
    padding: 8px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.site-sidebar .widget_calendar th {
    color: var(--green-primary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.site-sidebar .widget_calendar td a {
    color: var(--green-primary);
    font-weight: 600;
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    background: rgba(65, 184, 132, 0.15);
}

.site-sidebar .widget_calendar tfoot td {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* Widget archives */
.site-sidebar .widget_archive select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.site-sidebar .widget_archive select:focus {
    border-color: var(--green-primary);
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 40px 24px;
    margin-top: auto;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-muted);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
    text-align: left;
}

.footer-col h4 {
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: var(--text-muted);
    font-size: 14px;
    transition: color var(--transition-fast);
}

.footer-col ul li a:hover {
    color: var(--green-primary);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-dim);
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    padding: 80px 24px 60px;
    overflow: hidden;
    background: var(--bg-primary);
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hex-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(30deg, rgba(65, 184, 132, 0.03) 12%, transparent 12.5%, transparent 87%, rgba(65, 184, 132, 0.03) 87.5%),
        linear-gradient(150deg, rgba(65, 184, 132, 0.03) 12%, transparent 12.5%, transparent 87%, rgba(65, 184, 132, 0.03) 87.5%),
        linear-gradient(30deg, rgba(65, 184, 132, 0.03) 12%, transparent 12.5%, transparent 87%, rgba(65, 184, 132, 0.03) 87.5%),
        linear-gradient(150deg, rgba(65, 184, 132, 0.03) 12%, transparent 12.5%, transparent 87%, rgba(65, 184, 132, 0.03) 87.5%),
        linear-gradient(60deg, rgba(65, 184, 132, 0.05) 25%, transparent 25.5%, transparent 75%, rgba(65, 184, 132, 0.05) 75%);
    background-size: 80px 140px;
    animation: hexMove 20s linear infinite;
}

@keyframes hexMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(-80px); }
}

.gradient-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(65, 184, 132, 0.15), transparent 70%),
                radial-gradient(ellipse at bottom, rgba(13, 17, 23, 0.9), var(--bg-primary));
}

.hero-container {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.hero-content {
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(65, 184, 132, 0.15);
    border: 1px solid rgba(65, 184, 132, 0.3);
    border-radius: 20px;
    font-size: 13px;
    color: var(--green-primary);
    font-weight: 500;
    margin-bottom: 24px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--green-primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text-main);
}

.gradient-text {
    background: linear-gradient(135deg, var(--green-primary), #38a169);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background: var(--green-primary);
    color: #0d1117;
    border: 2px solid var(--green-primary);
}

.btn-primary:hover {
    background: #38a169;
    border-color: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(65, 184, 132, 0.4);
}

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

.btn-outline:hover {
    border-color: var(--green-primary);
    color: var(--green-primary);
    background: rgba(65, 184, 132, 0.05);
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
}

/* Hero Visual - Code Window */
.hero-visual {
    display: flex;
    justify-content: flex-end;
}

.code-window {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
}

.window-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27ca40; }

.window-title {
    margin-left: 12px;
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.code-content {
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
}

.code-content .keyword { color: #c678dd; }
.code-content .variable { color: #61afef; }
.code-content .property { color: #e5c07b; }
.code-content .string { color: #98c379; }
.code-content .number { color: #d19a66; }
.code-content .boolean { color: #56b6c2; }

/* ===== SECTIONS ===== */
.section-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 24px;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-muted);
}

/* Featured Grid */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.featured-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.featured-card:hover {
    border-color: rgba(65, 184, 132, 0.5);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.featured-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.featured-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.featured-card:hover .featured-image img {
    transform: scale(1.05);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    background: var(--green-primary);
    color: #0d1117;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.featured-content {
    padding: 20px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.post-category {
    color: var(--green-primary);
    font-weight: 500;
}

.post-date {
    color: var(--text-muted);
}

.featured-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.featured-excerpt {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.featured-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.read-more {
    color: var(--green-primary);
    font-weight: 500;
}

.read-time {
    color: var(--text-muted);
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.category-card:hover {
    border-color: rgba(65, 184, 132, 0.5);
    background: rgba(65, 184, 132, 0.05);
}

.category-icon {
    width: 40px;
    height: 40px;
    background: rgba(65, 184, 132, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-primary);
}

.category-info {
    flex: 1;
}

.category-name {
    display: block;
    font-weight: 600;
    font-size: 15px;
}

.category-count {
    font-size: 12px;
    color: var(--text-muted);
}

.category-arrow {
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
}

.category-card:hover .category-arrow {
    opacity: 1;
}

.categories-cta {
    text-align: center;
}

/* Articles Grid */
.article-filters {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--green-primary);
    border-color: var(--green-primary);
    color: #0d1117;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.article-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.article-card:hover {
    border-color: rgba(65, 184, 132, 0.4);
}

.article-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.article-image {
    height: 160px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .article-image img {
    transform: scale(1.03);
}

.article-content {
    padding: 16px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
}

.article-category {
    color: var(--green-primary);
    font-weight: 500;
}

.article-date {
    color: var(--text-muted);
}

.article-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-excerpt {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 14px;
}

.article-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.article-footer svg {
    width: 14px;
    height: 14px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination a:hover,
.pagination .current {
    background: var(--green-primary);
    border-color: var(--green-primary);
    color: #0d1117;
}

.articles-cta {
    text-align: center;
}

/* Newsletter */
.newsletter-section {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.newsletter-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 60px 24px;
    text-align: center;
}

.newsletter-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: rgba(65, 184, 132, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-primary);
}

.newsletter-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.newsletter-description {
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 15px;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--green-primary);
}

.newsletter-form button {
    padding: 12px 24px;
}

.newsletter-note {
    font-size: 13px;
    color: var(--text-dim);
}

/* Footer CTA */
.footer-cta {
    padding: 60px 24px;
    text-align: center;
}

.cta-container {
    max-width: 700px;
    margin: 0 auto;
}

.cta-container h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-container p {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 16px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* ===== SINGLE POST / PAGE ===== */
.entry-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.entry-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-main);
}

.entry-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.entry-meta a {
    color: var(--green-primary);
}

.entry-meta a:hover {
    text-decoration: underline;
}

.entry-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-main);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin: 32px 0 16px;
    color: var(--text-main);
}

.entry-content h2 {
    font-size: 28px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.entry-content h3 {
    font-size: 22px;
}

.entry-content p {
    margin-bottom: 20px;
}

.entry-content a {
    color: var(--green-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.entry-content a:hover {
    color: #38a169;
}

.entry-content blockquote {
    border-left: 4px solid var(--green-primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--bg-secondary);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-muted);
}

.entry-content code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--green-primary);
}

.entry-content pre {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid var(--border-color);
}

.entry-content pre code {
    background: none;
    padding: 0;
    color: var(--text-main);
}

.entry-content ul,
.entry-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.entry-content ul li {
    list-style: disc;
    margin-bottom: 8px;
}

.entry-content ol li {
    list-style: decimal;
    margin-bottom: 8px;
}

.entry-content img {
    border-radius: 8px;
    margin: 24px 0;
}

.entry-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.entry-tags a {
    padding: 4px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.entry-tags a:hover {
    background: rgba(65, 184, 132, 0.15);
    border-color: var(--green-primary);
    color: var(--green-primary);
}

/* ===== COMMENTS ===== */
.comments-area {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.comments-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

.comment-list {
    list-style: none;
}

.comment {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-author .avatar {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.comment-author-name {
    font-weight: 600;
    color: var(--text-main);
}

.comment-date {
    font-size: 12px;
    color: var(--text-dim);
}

.comment-content {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.comment-reply-link {
    color: var(--green-primary);
    font-size: 13px;
    font-weight: 500;
    margin-top: 12px;
    display: inline-block;
}

/* Comment form */
.comment-form {
    margin-top: 32px;
}

.comment-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-muted);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 14px;
    margin-bottom: 16px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px rgba(65, 184, 132, 0.1);
}

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

.comment-form input[type="submit"] {
    background: var(--green-primary);
    color: #0d1117;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.comment-form input[type="submit"]:hover {
    background: #38a169;
    transform: translateY(-1px);
}

/* ===== ARCHIVE / SEARCH RESULTS ===== */
.archive-header {
    padding: 40px 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.archive-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.archive-description {
    color: var(--text-muted);
    font-size: 16px;
}

/* ===== 404 PAGE ===== */
.error-404 {
    text-align: center;
    padding: 80px 24px;
}

.error-404 .error-code {
    font-size: 120px;
    font-weight: 700;
    color: var(--green-primary);
    line-height: 1;
    margin-bottom: 16px;
    opacity: 0.5;
}

.error-404 h2 {
    font-size: 28px;
    margin-bottom: 16px;
}

.error-404 p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        margin: 0 auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-visual {
        justify-content: center;
    }

    .hero-title {
        font-size: 36px;
    }

    .site-content-wrapper.with-sidebar {
        grid-template-columns: 1fr;
    }

    .site-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-left: 0;
        padding-top: 24px;
    }

    .entry-title {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }

    .hero-description {
        font-size: 16px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        flex-wrap: wrap;
        justify-content: center;
    }

    .stat-divider {
        display: none;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .entry-title {
        font-size: 24px;
    }

    .error-404 .error-code {
        font-size: 80px;
    }
}

@media (max-width: 480px) {
    .section-container {
        padding: 60px 16px;
    }

    .section-title {
        font-size: 24px;
    }

    .hero-title {
        font-size: 28px;
    }

    .featured-grid,
    .articles-grid {
        grid-template-columns: 1fr;
    }

    .site-content-wrapper {
        padding: 0 16px;
    }
}
/* Basic Layout Utilities */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-center {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

/* Display Helpers */
.hidden {
    display: none !important;
}

/* Desktop Styles */
@media (min-width: 992px) {
    .desktop-only {
        display: block;
    }
    .mobile-only {
        display: none;
    }
    
    /* Basic Menu Styling */
    .nav-links {
        display: flex;
        list-style: none;
        gap: 20px;
        margin: 0;
        padding: 0;
    }
    
    .nav-search input {
        padding: 5px 10px;
        border: 1px solid #ccc;
        border-radius: 4px;
    }
}

/* Mobile Styles */
@media (max-width: 991px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block;
    }

    /* Mobile Menu Container */
    .mobile-menu-container {
        background-color: #fff;
        border-top: 1px solid #eee;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%; /* Places it right below the header */
        z-index: 999;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }

    /* Mobile Search */
    .mobile-search-wrapper {
        padding: 15px;
        border-bottom: 1px solid #eee;
    }
    
    .mobile-search-wrapper form {
        display: flex;
        gap: 10px;
    }
    
    .mobile-search-wrapper input {
        flex: 1;
        padding: 8px;
        width: 100%;
    }

    /* Mobile Links */
    .mobile-nav-links {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .mobile-nav-links li {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .mobile-nav-links a {
        display: block;
        padding: 15px 20px;
        text-decoration: none;
        color: #333;
    }
}

    /* ===== HEADER V5 - ALL INLINE ===== */

    .h5-wrap{position:fixed;top:0;left:0;right:0;z-index:9000;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif}

    /* Bar */
    .h5-bar{height:60px;background:rgba(10,12,16,.94);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-bottom:1px solid rgba(255,255,255,.07);display:flex;align-items:center;justify-content:space-between;max-width:1340px;margin:0 auto;padding:0 20px;transition:background .3s,box-shadow .3s}
    .h5-wrap.is-scrolled .h5-bar{background:rgba(10,12,16,.98);box-shadow:0 4px 24px rgba(0,0,0,.5)}

    /* Logo */
    .h5-logo{display:flex;align-items:center;gap:9px;text-decoration:none;color:#fff;font-weight:900;font-size:1.3rem;letter-spacing:-.4px;flex-shrink:0}
    .h5-logo:hover{opacity:.85}
    .h5-logo svg{flex-shrink:0}
    .h5-pro{color:#e2001a} /* Changed to Tunisian Red */

    /* Desktop nav */
    .h5-nav{display:flex;align-items:center;gap:2px;list-style:none;margin:0;padding:0}
    .h5-nav>li{position:relative}
    .h5-nav>li>a,.h5-nav>li>button{display:flex;align-items:center;gap:5px;padding:7px 13px;border-radius:7px;color:#7c839a;font-size:.78rem;font-weight:600;text-transform:uppercase;letter-spacing:.6px;text-decoration:none;background:none;border:none;cursor:pointer;font-family:inherit;white-space:nowrap;transition:color .15s,background .15s;line-height:1.4;-webkit-tap-highlight-color:transparent}
    .h5-nav>li>a:hover,.h5-nav>li>a.on,.h5-nav>li>button:hover{color:#fff;background:rgba(255,255,255,.06)}
    .h5-nav>li>a svg,.h5-nav>li>button svg{opacity:.65;flex-shrink:0}
    .h5-nav>li>a:hover svg,.h5-nav>li>a.on svg,.h5-nav>li>button:hover svg{opacity:1}

    /* Chevron */
    .h5-chev{transition:transform .2s;opacity:.45!important}
    .h5-nav>li:hover>.h5-chev,.h5-nav>li.open>.h5-chev{transform:rotate(180deg);opacity:1!important}

    /* Dropdown */
    .h5-drop{position:absolute;top:calc(100% + 6px);left:50%;transform:translateX(-50%) translateY(6px);min-width:210px;background:#14171f;border:1px solid #252938;border-radius:10px;padding:6px;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s,transform .2s,visibility .2s;box-shadow:0 12px 40px rgba(0,0,0,.55);z-index:10}
    .h5-drop::before{content:'';position:absolute;top:-5px;left:50%;transform:translateX(-50%) rotate(45deg);width:10px;height:10px;background:#14171f;border-left:1px solid #252938;border-top:1px solid #252938}
    .h5-nav>li:hover>.h5-drop{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0);pointer-events:auto}
    .h5-drop a{display:flex;align-items:center;justify-content:space-between;padding:9px 12px;border-radius:7px;color:#7c839a;font-size:.84rem;font-weight:500;text-decoration:none;transition:all .12s}
    /* Changed hover color to Tunisian Red */
    .h5-drop a:hover{background:rgba(226,0,26,.1);color:#e2001a;padding-left:16px}
    .h5-drop .cnt{font-size:.67rem;background:#1b1e28;color:#7c839a;padding:2px 7px;border-radius:8px;font-weight:700;transition:background .12s,color .12s}
    /* Changed badge hover to Tunisian Red */
    .h5-drop a:hover .cnt{background:#e2001a;color:#fff}

    /* Hamburger */
    .h5-burg{display:none;width:42px;height:42px;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:0;border:none;border-radius:8px;background:none;cursor:pointer;z-index:10;-webkit-tap-highlight-color:transparent}
    .h5-burg span{display:block;width:20px;height:2px;background:#fff;border-radius:2px;transition:transform .3s,opacity .3s}
    .h5-burg.on span:nth-child(1){transform:translateY(7px) rotate(45deg)}
    .h5-burg.on span:nth-child(2){opacity:0}
    .h5-burg.on span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

    /* ===== FULLSCREEN MOBILE MENU ===== */
    .h5-mobile{position:fixed;inset:0;background:rgba(8,10,14,.98);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);z-index:8999;display:flex;flex-direction:column;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .3s,visibility .3s}
    .h5-mobile.on{opacity:1;visibility:visible;pointer-events:auto}
    .h5-mobile-top{display:flex;align-items:center;justify-content:space-between;height:60px;padding:0 20px;border-bottom:1px solid rgba(255,255,255,.07)}
    .h5-mobile-close{width:42px;height:42px;display:flex;align-items:center;justify-content:center;border:none;border-radius:8px;background:none;color:#7c839a;cursor:pointer;-webkit-tap-highlight-color:transparent}
    .h5-mobile-close:hover{background:rgba(255,255,255,.08);color:#fff}
    .h5-mobile-scroll{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:20px}
    .h5-mobile-list{list-style:none;margin:0;padding:0}
    .h5-mobile-list>li{border-bottom:1px solid rgba(255,255,255,.05)}
    .h5-mobile-list>li>a{display:flex;align-items:center;justify-content:space-between;padding:14px 4px;color:#c0c4d4;font-size:.95rem;font-weight:600;text-decoration:none;transition:color .15s}
    /* Changed mobile hover to Tunisian Red */
    .h5-mobile-list>li>a:hover{color:#e2001a}
    .h5-mobile-list>li>a.on{color:#e2001a}
    .h5-mob-chev{transition:transform .25s;color:#4a5068}
    .h5-mob-chev.flip{transform:rotate(180deg)}
    .h5-mob-sub{display:none;padding:0 0 8px 12px;list-style:none}
    .h5-mob-sub.show{display:block;animation:mobFade .2s ease}
    /* Changed mobile sub hover to Tunisian Red */
    .h5-mob-sub a:hover{color:#e2001a;background:rgba(226,0,26,.08)}

    /* Mobile search button */
    .h5-mobile-search{padding:16px 4px 0}
    .h5-mobile-search button{width:100%;padding:14px;border:1px solid #252938;border-radius:10px;background:#14171f;color:#7c839a;font-size:.9rem;font-weight:500;font-family:inherit;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;transition:all .15s;-webkit-tap-highlight-color:transparent}
    /* Changed mobile search hover to Tunisian Red */
    .h5-mobile-search button:hover{border-color:#e2001a;color:#e2001a}

    /* ===== SEARCH OVERLAY ===== */
    .h5-search{position:fixed;inset:0;background:rgba(8,10,14,.97);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);z-index:10000;display:flex;align-items:flex-start;justify-content:center;padding-top:14vh;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .25s,visibility .25s}
    .h5-search.on{opacity:1;visibility:visible;pointer-events:auto}
    .h5-search-box{width:100%;max-width:620px;padding:0 20px;position:relative}
    .h5-search-x{position:absolute;top:-50px;right:20px;width:42px;height:42px;display:flex;align-items:center;justify-content:center;border:none;border-radius:50%;background:none;color:#7c839a;cursor:pointer;transition:background .15s,color .15s}
    .h5-search-x:hover{background:rgba(255,255,255,.1);color:#fff}
    .h5-search-form{position:relative}
    .h5-search-form input{width:100%;background:#14171f;border:2px solid #252938;border-radius:14px;padding:18px 22px 18px 22px;color:#fff;font-size:1.05rem;font-weight:500;font-family:inherit;box-sizing:border-box;transition:border-color .2s,box-shadow .2s}
    /* Changed focus border and shadow to Tunisian Red */
    .h5-search-form input:focus{outline:none;border-color:#e2001a;box-shadow:0 0 0 4px rgba(226,0,26,.12)}
    .h5-search-form input::placeholder{color:#3e4460}
    /* Changed search button to Tunisian Red */
    .h5-search-go{position:absolute;right:7px;top:50%;transform:translateY(-50%);width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:#e2001a;border:none;border-radius:10px;color:#fff;cursor:pointer;transition:background .15s,transform .15s;padding:0}
    .h5-search-go:hover{background:#b30015;transform:translateY(-50%) scale(1.05)}
    .h5-search-hint{text-align:center;color:#3e4460;font-size:.78rem;margin-top:14px}

    /* Body lock */
    body.h5-locked{overflow:hidden!important}

    /* Skip link */
    .skip-link{position:absolute;top:-100%;left:16px;z-index:99999;padding:12px 20px;background:#e2001a;color:#fff;font-weight:700;font-size:.85rem;border-radius:0 0 8px 8px;text-decoration:none;transition:top .2s}
    .skip-link:focus{top:0}

    /* Focus visible - changed to Tunisian Red */
    .h5-burg:focus-visible,.h5-nav>li>a:focus-visible,.h5-nav>li>button:focus-visible,.h5-search-x:focus-visible,.h5-search-go:focus-visible,.h5-mobile-close:focus-visible{outline:2px solid #e2001a;outline-offset:2px}

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

    /* Tablet */
    @media(max-width:1060px){
        .h5-nav>li>a,.h5-nav>li>button{padding:7px 9px;font-size:.72rem}
        .h5-slabel{display:none}
    }

    /* Mobile */
    @media(max-width:768px){
        .h5-bar{height:56px;padding:0 14px}
        .h5-logo{font-size:1.15rem}
        .h5-logo svg{width:26px;height:26px}
        .h5-nav{display:none}
        .h5-burg{display:flex}
        .h5-search-box{padding:0 14px}
        .h5-search-x{right:14px;width:46px;height:46px}
        .h5-search-form input{font-size:.95rem;padding:16px 18px 16px 18px}
        .h5-search{padding-top:10vh}
    }

    @media(prefers-reduced-motion:reduce){
        *,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}
    }