/* TeachCloud – Software Engineer Edition */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* ── Dark IDE palette (default) ── */
    --bg-primary:   #0d1117;   /* GitHub-dark canvas */
    --bg-secondary: #161b22;   /* panel */
    --bg-tertiary:  #1c2333;   /* input / hover */
    --bg-card:      #161b22;
    --border-color: rgba(48, 54, 61, 0.9);
    --border-hover: rgba(0, 212, 255, 0.35);
    --text-primary:   #e6edf3;
    --text-secondary: #8b949e;
    --text-muted:     #484f58;

    /* cyan → violet – the "developer tools" gradient */
    --accent-cyan:    #00d4ff;
    --accent-violet:  #a855f7;
    --accent-blue:    #58a6ff;   /* links */
    --accent-emerald: #3fb950;   /* success / green badges */
    --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #a855f7 100%);
    --accent-glow:     rgba(0, 212, 255, 0.25);
    --accent-glow-v:   rgba(168, 85, 247, 0.25);

    --card-bg:      rgba(22, 27, 34, 0.85);
    --card-shadow:  0 8px 32px rgba(0,0,0,.55);
    --navbar-bg:    rgba(13, 17, 23, 0.88);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Smooth Screen Background & Color Transition ── */
body, .navbar, .card, .post-card, .user-dropdown, footer, .weather-time-widget, .form-input, .form-textarea, .theme-panel, .location-time-panel {
    transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s ease,
                color 0.3s ease,
                box-shadow 0.35s ease;
}

/* ── Dynamic Ambient Living Sky & Background System ── */
.dynamic-ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base sky orbs (Sun and Moon lighting) */
.sky-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    opacity: 0;
}

/* Day Mode (Sun Aura) */
.sun-orb {
    top: -60px;
    right: 8%;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(255, 198, 55, 0.45) 0%, rgba(255, 140, 0, 0.2) 50%, transparent 75%);
    transform: scale(0.6) translateY(-40px);
}

/* Night Mode (Moon & Celestial Aura) */
.moon-orb {
    top: -40px;
    right: 12%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.3) 0%, rgba(168, 85, 247, 0.22) 50%, transparent 75%);
    transform: scale(0.6) translateY(-40px);
}

/* Stars layer for nighttime */
.ambient-stars-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease;
    background-image: 
        radial-gradient(1px 1px at 25px 35px, #fff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 120px 80px, rgba(255,255,255,0.9), rgba(0,0,0,0)),
        radial-gradient(1px 1px at 280px 190px, rgba(0,212,255,0.8), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 450px 120px, rgba(255,255,255,0.95), rgba(0,0,0,0)),
        radial-gradient(1px 1px at 620px 240px, rgba(168,85,247,0.8), rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 800px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 980px 180px, rgba(0,212,255,0.7), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 1150px 90px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 1320px 210px, rgba(255,255,255,0.8), rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 600px 400px;
    animation: starsTwinkle 6s ease-in-out infinite alternate;
}

@keyframes starsTwinkle {
    0% { opacity: 0.35; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(1.02); }
    100% { opacity: 0.45; transform: scale(0.99); }
}

/* Atmospheric Gradients & Unified Navbar/Footer by Time Phase */
[data-time-phase="day"] .sun-orb {
    opacity: 1;
    transform: scale(1) translateY(0);
}

[data-time-phase="day"] {
    --bg-primary: #f6f9fc;
}

[data-time-phase="day"] body {
    background-color: #f6f9fc;
    background-image: 
        radial-gradient(at 90% 10%, rgba(255, 204, 0, 0.15) 0px, transparent 50%),
        radial-gradient(at 10% 20%, rgba(0, 162, 255, 0.08) 0px, transparent 50%),
        radial-gradient(rgba(0, 102, 204, 0.05) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 28px 28px;
}

[data-time-phase="day"] .navbar {
    background: rgba(246, 249, 252, 0.86);
    border-bottom: 1px solid rgba(31, 35, 40, 0.12);
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.05);
}

[data-time-phase="day"] footer {
    background: rgba(240, 244, 250, 0.86);
    border-top: 1px solid rgba(31, 35, 40, 0.12);
    box-shadow: inset 0 1px 0 0 rgba(255, 198, 55, 0.18);
}

[data-time-phase="twilight"] .sun-orb {
    opacity: 0.8;
    top: 5%;
    background: radial-gradient(circle, rgba(255, 94, 98, 0.35) 0%, rgba(255, 153, 102, 0.25) 50%, transparent 75%);
    transform: scale(1.1) translateY(20px);
}

[data-time-phase="twilight"] body {
    background-color: #12101e;
    background-image: 
        radial-gradient(at 85% 15%, rgba(255, 94, 98, 0.18) 0px, transparent 55%),
        radial-gradient(at 15% 40%, rgba(138, 43, 226, 0.15) 0px, transparent 55%),
        radial-gradient(rgba(255, 153, 102, 0.06) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 28px 28px;
}

[data-time-phase="twilight"] .navbar {
    background: rgba(18, 16, 30, 0.86);
    border-bottom: 1px solid rgba(255, 94, 98, 0.22);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-time-phase="twilight"] footer {
    background: rgba(14, 12, 24, 0.88);
    border-top: 1px solid rgba(255, 94, 98, 0.22);
    box-shadow: inset 0 1px 0 0 rgba(255, 94, 98, 0.18);
}

[data-time-phase="night"] .moon-orb,
[data-time-phase="night"] .ambient-stars-layer {
    opacity: 1;
    transform: scale(1) translateY(0);
}

[data-time-phase="night"] body {
    background-color: #0b0f17;
    background-image: 
        radial-gradient(at 85% 10%, rgba(0, 212, 255, 0.12) 0px, transparent 50%),
        radial-gradient(at 10% 30%, rgba(168, 85, 247, 0.10) 0px, transparent 50%),
        radial-gradient(rgba(88, 166, 255, 0.04) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 28px 28px;
}

[data-time-phase="night"] .navbar {
    background: rgba(11, 15, 23, 0.86);
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

[data-time-phase="night"] footer {
    background: rgba(8, 12, 20, 0.88);
    border-top: 1px solid rgba(0, 212, 255, 0.15);
    box-shadow: inset 0 1px 0 0 rgba(0, 212, 255, 0.12);
}

/* ── Light IDE palette ── */
[data-theme="light"] {
    --bg-primary:   #f6f8fa;
    --bg-secondary: #ffffff;
    --bg-tertiary:  #eaeef2;
    --bg-card:      #ffffff;
    --border-color: rgba(31, 35, 40, 0.15);
    --border-hover: rgba(0, 162, 194, 0.4);
    --text-primary:   #1f2328;
    --text-secondary: #656d76;
    --text-muted:     #9198a1;

    --accent-cyan:    #0969da;
    --accent-violet:  #8250df;
    --accent-blue:    #0969da;
    --accent-emerald: #1a7f37;
    --accent-gradient: linear-gradient(135deg, #0969da 0%, #8250df 100%);
    --accent-glow:    rgba(9, 105, 218, 0.18);
    --accent-glow-v:  rgba(130, 80, 223, 0.18);

    --card-bg:     rgba(255,255,255,0.92);
    --card-shadow: 0 4px 20px rgba(31,35,40,.08);
    --navbar-bg:   rgba(246,248,250,0.9);
}

/* ── Midnight OLED Deep Black palette ── */
[data-theme="midnight"] {
    --bg-primary:   #000000;
    --bg-secondary: #080c14;
    --bg-tertiary:  #0f172a;
    --bg-card:      #050811;
    --border-color: rgba(255, 255, 255, 0.14);
    --border-hover: rgba(0, 212, 255, 0.5);
    --text-primary:   #ffffff;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;

    --accent-cyan:    #00e5ff;
    --accent-violet:  #c084fc;
    --accent-blue:    #38bdf8;
    --accent-emerald: #10b981;
    --accent-gradient: linear-gradient(135deg, #00e5ff 0%, #c084fc 100%);
    --accent-glow:    rgba(0, 229, 255, 0.3);
    --accent-glow-v:  rgba(192, 132, 252, 0.3);

    --card-bg:     rgba(8, 12, 20, 0.95);
    --card-shadow: 0 12px 40px rgba(0,0,0,.85);
    --navbar-bg:   rgba(0,0,0,0.92);
}

/* ── Custom Screen Accents ── */
[data-accent="emerald"] {
    --accent-cyan:    #3fb950 !important;
    --accent-blue:    #2ea043 !important;
    --accent-glow:    rgba(63, 185, 80, 0.28) !important;
    --accent-gradient: linear-gradient(135deg, #3fb950 0%, #10b981 100%) !important;
}

[data-accent="violet"] {
    --accent-cyan:    #c084fc !important;
    --accent-blue:    #a855f7 !important;
    --accent-glow:    rgba(168, 85, 247, 0.28) !important;
    --accent-gradient: linear-gradient(135deg, #c084fc 0%, #a855f7 100%) !important;
}

[data-accent="amber"] {
    --accent-cyan:    #fbbf24 !important;
    --accent-blue:    #f59e0b !important;
    --accent-glow:    rgba(245, 158, 11, 0.28) !important;
    --accent-gradient: linear-gradient(135deg, #fbbf24 0%, #ea580c 100%) !important;
}

[data-accent="blue"] {
    --accent-cyan:    #38bdf8 !important;
    --accent-blue:    #0284c7 !important;
    --accent-glow:    rgba(2, 132, 199, 0.28) !important;
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%) !important;
}

/* Basic Reset & Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img, picture, video, canvas, svg {
    max-width: 100%;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    /* Subtle dot-grid — IDE / terminal feel */
    background-image: radial-gradient(rgba(88,166,255,.04) 1px, transparent 1px);
    background-size: 28px 28px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-feature-settings: 'kern' 1, 'liga' 1;
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

/* Monospace accent for h1 — feels like an IDE title */
h1 { font-family: var(--font-mono); font-size: clamp(1.5rem,3.5vw,2.4rem); }

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--text-primary); }

/* Base Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Navbar — IDE top-bar style ── */
.navbar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--navbar-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-color);
    /* thin cyan accent line at very top */
    box-shadow: 0 1px 0 0 var(--border-color),
                inset 0 1px 0 0 rgba(0,212,255,.06);
    transition: var(--transition);
}

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

/* ── Logo: transparent icon + monospace wordmark ── */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    flex-shrink: 0;
    /* NO background, NO text-fill here — handled on children */
}

/* The PNG icon — transparent, no frame */
.logo-icon {
    display: block;
    width: auto;
    height: 48px;
    max-width: 120px;
    object-fit: contain;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.logo:hover .logo-icon {
    transform: scale(1.05);
}

/* Mobile Navigation Backdrop & Scroll-lock */
body.nav-open {
    overflow: hidden !important;
    touch-action: none;
}

.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 990;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Wordmark text */
.logo-word {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* "Cloud" — lighter weight inside the wordmark */
.logo-word-accent {
    font-weight: 400;
    opacity: 0.85;
    /* inherits gradient from parent via background-clip */
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 0 auto;
}

.nav-item {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    text-decoration: none;
}

.nav-item:hover {
    color: var(--text-primary);
}

.nav-item.active {
    color: var(--accent-cyan);
}

.nav-item.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-gradient);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Icons styling */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.btn-icon:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-glow);
}
    .user-menu {
    position: relative;
    display: inline-block;
}

.user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 999px;               /* pill shape */
    padding: 0.3rem 0.75rem 0.3rem 0.35rem;
    cursor: pointer;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
    max-width: 180px;                   /* hard cap — never spills */
    white-space: nowrap;
}

.user-menu-btn:hover {
    border-color: var(--border-hover);
    background: var(--card-bg);
}

/* Gradient initial circle */
.nav-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Truncated username label */
.nav-username {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
}

/* Animated chevron */
.nav-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.user-menu:hover .nav-chevron,
.user-menu.active .nav-chevron,
.user-menu-btn[aria-expanded="true"] .nav-chevron {
    transform: rotate(180deg);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    z-index: 1000;
    box-shadow: 0 12px 32px rgba(0,0,0,.45);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Invisible bridge over the 6px gap to prevent hover flicker */
.user-dropdown::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

/* Role label header inside dropdown */
.nav-dropdown-label {
    display: block;
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    padding: .65rem 1rem .3rem;
}

/* Divider line before Logout */
.nav-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: .35rem 0;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem 1rem;
    font-size: .88rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: background .15s;
}

.user-dropdown a:hover {
    background: var(--bg-tertiary);
}

/* Logout link in red tint */
.user-dropdown .nav-logout {
    color: #f87171;
}
.user-dropdown .nav-logout:hover {
    background: rgba(239, 68, 68, .08);
}

.user-menu:hover .user-dropdown,
.user-menu.active .user-dropdown {
    display: block;
}

/* IP-restricted padlock indicator */
.nav-ip-lock {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: default;
    opacity: 0.7;
    transition: var(--transition);
    user-select: none;
}

.nav-ip-lock:hover {
    opacity: 1;
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}


/* ── Proximity & Hover Theme Control System ── */
.theme-control-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.theme-toggle-btn {
    border-radius: 50% !important; /* Elegant circle button */
    width: 38px;
    height: 38px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.theme-control-wrapper:hover .theme-toggle-btn,
.theme-control-wrapper.proximity .theme-toggle-btn {
    transform: scale(1.08);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 14px var(--accent-glow), 0 0 0 3px rgba(0, 212, 255, 0.12);
}

.theme-btn-pulse {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 6px var(--accent-cyan);
    pointer-events: none;
}

/* Glassmorphic Dropdown Panel */
.theme-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: -10px;
    width: 250px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.9rem;
    z-index: 1100;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    animation: panelPop 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Show on hover of wrapper or when opened via click */
.theme-control-wrapper:hover .theme-panel,
.theme-control-wrapper.open .theme-panel {
    display: block;
}

/* Invisible hover bridge to prevent flicker */
.theme-panel::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

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

.theme-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.theme-panel-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.theme-status-tag {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    font-weight: 600;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--accent-cyan);
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.theme-modes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    margin-bottom: 0.8rem;
}

.theme-mode-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.theme-mode-btn:hover {
    border-color: var(--accent-cyan);
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.theme-mode-btn.active {
    border-color: var(--accent-cyan);
    background: var(--bg-secondary);
    color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-glow);
    font-weight: 600;
}

.theme-mode-icon {
    font-size: 0.88rem;
}

.theme-panel-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.65rem 0;
}

.theme-accents-section {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.theme-accent-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.theme-swatches {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.theme-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--swatch-color);
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

.theme-swatch:hover {
    transform: scale(1.22);
    box-shadow: 0 0 10px var(--swatch-color);
}

.theme-swatch.active {
    border-color: #ffffff;
    box-shadow: 0 0 12px var(--swatch-color), 0 0 0 2px var(--border-color);
    transform: scale(1.15);
}

/* ── Navigation Tools Group & Navbar Controls ── */
.nav-tools-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-left: 2rem; /* Clean spacing between search bar and date/time widget */
    flex-shrink: 0;
}

@media (min-width: 1200px) {
    .nav-tools-group {
        margin-left: 2.5rem; /* Generous breathing room on large displays */
    }
}

@media (max-width: 1200px) and (min-width: 992px) {
    .nav-links {
        gap: 0.9rem;
    }
    .search-wrapper {
        width: 220px;
    }
    .nav-tools-group {
        margin-left: 1.5rem;
        gap: 0.65rem;
    }
}

/* ── Live Date, Time & Location Controller Widget ── */
.location-time-widget-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.weather-time-widget {
    display: inline-flex;
    align-items: center;
    height: 38px;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.weather-time-widget:hover,
.location-time-widget-wrapper.open .weather-time-widget {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 14px var(--accent-glow);
    transform: translateY(-1px);
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
    flex-shrink: 0;
    animation: livePulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.widget-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

.location-pin-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.widget-datetime {
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.widget-phase-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    line-height: 1;
}

.widget-weather {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-left: 1px solid var(--border-color);
    padding-left: 0.5rem;
    color: var(--text-secondary);
}

.weather-icon {
    font-size: 0.88rem;
    line-height: 1;
}

.weather-temp {
    font-weight: 600;
    color: var(--accent-cyan);
}

.widget-chevron {
    color: var(--text-muted);
    transition: transform 0.25s ease;
    margin-left: 2px;
}

.location-time-widget-wrapper.open .widget-chevron {
    transform: rotate(180deg);
    color: var(--accent-cyan);
}

/* ── Location & World Time Dropdown Panel ── */
.location-time-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 350px;
    max-width: 92vw;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    z-index: 1100;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55), 0 0 20px var(--accent-glow);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    animation: panelPop 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.location-time-widget-wrapper.open .location-time-panel {
    display: block;
}

.location-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.location-panel-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.location-panel-subtitle {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.btn-detect-location {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent-cyan);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-detect-location:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-glow);
    transform: translateY(-1px);
}

.location-search-box {
    position: relative;
    margin-bottom: 0.75rem;
}

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

.location-search-input {
    width: 100%;
    height: 32px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 0.75rem 0 2rem;
    color: var(--text-primary);
    font-size: 0.76rem;
    outline: none;
    transition: var(--transition);
}

.location-search-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
}

.world-locations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
    max-height: 230px;
    overflow-y: auto;
    padding-right: 2px;
    margin-bottom: 0.75rem;
}

.world-locations-grid::-webkit-scrollbar {
    width: 4px;
}
.world-locations-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.location-card-item {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    user-select: none;
}

.location-card-item:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-1px);
    background: var(--bg-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.location-card-item.active {
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 10px var(--accent-glow);
}

.loc-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.loc-card-city {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.loc-card-phase {
    font-size: 0.8rem;
    line-height: 1;
}

.loc-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.loc-card-time {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-cyan);
}

.loc-card-tz {
    font-size: 0.62rem;
    color: var(--text-muted);
}

.location-panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.72rem;
}

.temp-unit-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.temp-toggle-label {
    color: var(--text-muted);
    font-size: 0.68rem;
}

.unit-pill-group {
    display: inline-flex;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 2px;
}

.btn-unit-chip {
    padding: 2px 7px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-unit-chip.active {
    background: var(--accent-cyan);
    color: #0d1117;
}

.click-hint-pill {
    font-size: 0.65rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .weather-time-widget {
        height: 34px;
        padding: 0 0.6rem;
        font-size: 0.72rem;
        gap: 0.35rem;
    }
    .widget-weather {
        padding-left: 0.35rem;
    }
    .location-time-panel {
        width: 310px;
    }
}

@media (max-width: 540px) {
    .widget-datetime {
        display: none;
    }
    .world-locations-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
}

/* Layout Wrapper */
.main-wrapper {
    margin-top: 100px;
    padding-bottom: 5rem;
    min-height: calc(100vh - 100px - 250px);
}

.layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.layout-grid > * {
    min-width: 0;
    max-width: 100%;
}

@media (min-width: 992px) {
    .layout-grid {
        grid-template-columns: 8fr 4fr;
    }
}

article {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Search Bar & Global Controls */
.search-wrapper {
    position: relative;
    width: 290px;
    transition: width 0.25s ease;
}

@media (min-width: 1200px) {
    .search-wrapper {
        width: 320px;
    }
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input {
    width: 100%;
    height: 38px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0 4.8rem 0 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    outline: none;
    display: flex;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    border-color: var(--accent-cyan);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15), 0 0 14px var(--accent-glow);
}

.search-kbd {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    pointer-events: none;
    line-height: 1;
    transition: var(--transition);
}

.search-wrapper:focus-within .search-kbd {
    opacity: 0.4;
}

.search-clear-btn {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-clear-btn:hover {
    color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.1);
}

.search-submit-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-submit-btn:hover,
.search-wrapper:focus-within .search-submit-btn {
    color: var(--accent-cyan);
}

/* ── Highlighted Search Terms ────────────────────────────────────────────── */
mark.search-highlight {
    background: rgba(0, 212, 255, 0.22);
    color: var(--accent-cyan, #00d4ff);
    font-weight: 600;
    padding: 0.08em 0.28em;
    border-radius: 3px;
    border-bottom: 1.5px solid var(--accent-cyan, #00d4ff);
}

/* Real-time Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 380px;
    max-width: 90vw;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 1000;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.suggestion-item:last-of-type {
    border-bottom: 1px solid var(--border-color);
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: var(--bg-tertiary);
    text-decoration: none;
}

.suggestion-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.suggestion-info {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    line-height: 1.3;
}

.suggestion-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-badge {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    line-height: 1.2;
}

.suggestion-category {
    color: var(--text-secondary);
    font-weight: 500;
}

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

.suggestion-arrow {
    color: var(--text-muted);
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.suggestion-item:hover .suggestion-arrow,
.suggestion-item.selected .suggestion-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--accent-cyan);
}

.suggestion-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    background: var(--bg-tertiary);
    color: var(--accent-cyan);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.suggestion-footer:hover {
    background: rgba(0, 212, 255, 0.12);
    text-decoration: none;
}

.suggestion-enter-badge {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.suggestion-empty {
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
}

.suggestion-empty-text span {
    display: block;
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.suggestion-empty-text small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* DEDICATED SEARCH RESULTS PAGE STYLING                                     */
/* ══════════════════════════════════════════════════════════════════════════ */

.search-page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem 1.5rem;
}

/* ── Hero & Main Search Bar ── */
.search-hero {
    margin-bottom: 2rem;
    background: radial-gradient(circle at top left, rgba(0, 212, 255, 0.08), transparent 70%), var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.search-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.search-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.search-breadcrumb a:hover {
    color: var(--accent-cyan);
}

.bc-sep {
    color: var(--border-color);
}

.bc-current {
    color: var(--accent-cyan);
    font-weight: 600;
}

.search-hero-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-title-icon {
    font-size: 1.8rem;
}

.search-hero-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.75rem;
    max-width: 650px;
    line-height: 1.5;
}

.search-main-form {
    width: 100%;
    margin-bottom: 1.25rem;
}

.search-main-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-main-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-cyan);
    pointer-events: none;
}

.search-main-input {
    width: 100%;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.1rem 140px 1.1rem 3.4rem;
    font-size: 1.05rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
    transition: all 0.25s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.search-main-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.2), 0 0 20px rgba(0, 212, 255, 0.2);
}

.search-main-clear {
    position: absolute;
    right: 120px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 50%;
    transition: var(--transition);
}

.search-main-clear:hover {
    color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.1);
}

.search-main-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--accent-cyan, #00d4ff), #3b82f6);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.25rem;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.search-main-btn:hover {
    transform: translateY(-50%) scale(1.03);
    box-shadow: 0 6px 18px rgba(0, 212, 255, 0.45);
}

/* Quick Topic Pills */
.search-quick-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.82rem;
}

.quick-tags-label {
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 4px;
}

.quick-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quick-tag-chip {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: 12px;
    text-decoration: none;
    font-family: var(--font-mono, monospace);
    font-size: 0.78rem;
    transition: var(--transition);
}

.quick-tag-chip:hover,
.quick-tag-chip.active {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    text-decoration: none;
}

/* ── Toolbar: Tabs & Sort ── */
.search-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-type-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.search-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.55rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.search-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-color: var(--border-color-hover, #4b5563);
}

.search-tab.active {
    background: var(--accent-cyan, #00d4ff);
    color: #0b1120;
    border-color: var(--accent-cyan);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.25);
}

.tab-badge {
    background: rgba(0, 0, 0, 0.2);
    color: inherit;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.search-tab.active .tab-badge {
    background: rgba(0, 0, 0, 0.25);
    color: #000;
}

.search-sort-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-sort-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

.search-sort-buttons {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2px;
}

.sort-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 6px;
    text-decoration: none;
    transition: var(--transition);
}

.sort-btn:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.sort-btn.active {
    background: var(--bg-tertiary);
    color: var(--accent-cyan);
    font-weight: 700;
}

/* ── Stats Summary Bar ── */
.search-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.query-highlight {
    color: var(--accent-cyan);
    font-weight: 700;
}

.tab-specifier {
    color: var(--text-muted);
    margin-left: 4px;
}

.stats-pages {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono, monospace);
}

/* ── Result Cards ── */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.search-result-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.search-result-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-cyan);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25), 0 0 15px rgba(0, 212, 255, 0.1);
}

.card-accent {
    width: 4px;
    background: var(--accent-bar-color, #6366f1);
    flex-shrink: 0;
}

.card-content-wrap {
    flex: 1;
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.result-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--badge-color, var(--accent-cyan));
    letter-spacing: 0.02em;
}

.type-sub-cat {
    color: var(--text-muted);
    font-weight: 500;
}

.result-card-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.result-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.result-card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.result-card-title a:hover {
    color: var(--accent-cyan);
    text-decoration: none;
}

.result-card-snippet {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.result-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.result-card-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.author-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: 6px;
}

.author-avatar-xs {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
}

.result-tag-pill {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: var(--font-mono, monospace);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: var(--transition);
}

.result-tag-pill:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    text-decoration: none;
}

.result-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-cyan);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: gap 0.2s ease;
}

.result-action-btn:hover {
    gap: 10px;
    text-decoration: underline;
}

/* ── Pagination ── */
.search-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 0.9rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.page-btn:hover:not(.disabled):not(.current) {
    background: var(--bg-tertiary);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    text-decoration: none;
}

.page-btn.current {
    background: var(--accent-cyan);
    color: #0b1120;
    font-weight: 700;
    border-color: var(--accent-cyan);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-dots {
    color: var(--text-muted);
    padding: 0 4px;
}

/* ── Empty State ── */
.search-empty-state {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3.5rem 2rem;
    text-align: center;
    margin-top: 1rem;
}

.empty-icon-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem auto;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon {
    font-size: 2.2rem;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.empty-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 550px;
    margin: 0 auto 2rem auto;
    line-height: 1.6;
}

.search-tips-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: left;
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
}

.tips-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.tips-list {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
}

.tips-list code {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-cyan);
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
}

.empty-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
    text-align: left;
}

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

.category-explore-card:hover {
    border-color: var(--cat-colour, var(--accent-cyan));
    transform: translateY(-2px);
    background: var(--bg-tertiary);
    text-decoration: none;
}

.cat-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.cat-card-body {
    flex: 1;
    min-width: 0;
}

.cat-card-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
}

.cat-card-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.recommended-section {
    margin-top: 2rem;
    text-align: left;
}

.section-heading {
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.section-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.recommended-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.rec-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.rec-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-cyan);
}

.rec-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
}

.rec-views {
    color: var(--text-muted);
}

.rec-title {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
}

.rec-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.rec-title a:hover {
    color: var(--accent-cyan);
}

.rec-excerpt {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.rec-link {
    color: var(--accent-cyan);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    margin-top: 0.25rem;
}

.rec-link:hover {
    text-decoration: underline;
}

/* ── Responsive Search Adjustments ── */
@media (max-width: 768px) {
    .search-wrapper {
        width: 100%;
    }

    .search-suggestions {
        width: 100%;
    }

    .search-hero {
        padding: 1.5rem 1rem;
    }

    .search-hero-title {
        font-size: 1.5rem;
    }

    .search-main-input {
        padding-right: 100px;
        font-size: 0.95rem;
    }

    .search-main-btn span {
        display: none;
    }

    .search-main-btn {
        padding: 0.65rem;
    }

    .search-main-clear {
        right: 50px;
    }

    .search-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-type-tabs {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        flex-wrap: nowrap;
    }

    .card-content-wrap {
        padding: 1.25rem 1rem;
    }

    .result-card-title {
        font-size: 1.1rem;
    }
}

/* ── Featured card — IDE file-explorer header style ── */
.featured-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    margin-bottom: 3rem;
    position: relative;
}
.featured-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: var(--accent-gradient);
}
.featured-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 40px rgba(0,212,255,.08);
}

@media (min-width: 768px) {
    .featured-card {
        grid-template-columns: 1fr 1.1fr;
    }
}

.featured-img-container {
    min-height: 250px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.featured-img-placeholder {
    font-size: 5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.65;
}

.featured-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.badge {
    align-self: flex-start;
    padding: 0.2rem 0.65rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(0, 212, 255, 0.08);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 212, 255, 0.2);
    margin-bottom: 1rem;
}
.badge.cloud {
    background: rgba(63, 185, 80, 0.08);
    color: var(--accent-emerald);
    border-color: rgba(63, 185, 80, 0.2);
}
.badge.backend {
    background: rgba(168, 85, 247, 0.08);
    color: var(--accent-violet);
    border-color: rgba(168, 85, 247, 0.2);
}

.featured-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.featured-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.author-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.author-info {
    display: flex;
    flex-direction: column;
}

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

.author-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Post Cards Grid */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 600px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
}
/* left-edge accent line on hover */
.post-card::after {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 3px; height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 3px 0 0 3px;
}
.post-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: 0 8px 28px rgba(0,212,255,.07);
}
.post-card:hover::after { opacity: 1; }

.post-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #090d16 0%, #151d2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.post-card-link-img {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.post-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1), filter 0.3s ease;
    filter: brightness(0.96) contrast(1.02);
}

.post-card:hover .post-card-thumb {
    transform: scale(1.05);
    filter: brightness(1.05) contrast(1.04);
}

.post-card-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(9, 13, 22, 0.7) 100%);
    pointer-events: none;
}

/* Branded procedural tech blueprint when no image is uploaded */
.post-card-blueprint {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at 50% 40%, rgba(0, 212, 255, 0.12) 0%, rgba(9, 13, 22, 0.95) 75%);
    overflow: hidden;
    transition: background 0.4s ease;
}

.post-card:hover .post-card-blueprint {
    background: radial-gradient(circle at 50% 40%, rgba(0, 212, 255, 0.2) 0%, rgba(9, 13, 22, 0.98) 75%);
}

.post-card-blueprint::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.post-card-blueprint-icon {
    font-size: 2.4rem;
    line-height: 1;
    z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 212, 255, 0.35));
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.post-card:hover .post-card-blueprint-icon {
    transform: scale(1.15);
}

.post-card-blueprint-tag {
    z-index: 1;
    margin-top: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent-cyan);
    text-transform: uppercase;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.25);
    padding: 2px 8px;
    border-radius: 12px;
}

/* Floating type badge on card image (e.g. </> CODE / 📖 GUIDE) */
.card-img-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 6px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(9, 13, 22, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.card-img-badge.badge-code {
    border-color: rgba(0, 212, 255, 0.35);
    color: var(--accent-cyan);
    background: rgba(9, 24, 38, 0.82);
}

.card-img-badge.badge-cloud {
    border-color: rgba(34, 197, 94, 0.35);
    color: #4ade80;
    background: rgba(10, 30, 20, 0.82);
}

.post-card-icon {
    font-size: 3.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.5;
}

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

.post-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.post-card-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: auto;
}

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

.widget {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-tertiary);
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-blue);
}

/* Category List widget */
.category-list {
    list-style: none;
}

.category-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.category-item:last-child {
    border-bottom: none;
}

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

.category-item a:hover {
    color: var(--accent-blue);
    padding-left: 4px;
}

.category-count {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

/* Tag Cloud widget */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-item {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.tag-item:hover {
    background: var(--accent-gradient);
    color: #ffffff;
    border-color: transparent;
}

/* Newsletter Widget */
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.form-input {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--accent-blue);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.01em;
}
.btn-primary:hover {
    box-shadow: 0 0 18px var(--accent-glow), 0 0 32px var(--accent-glow-v);
    transform: translateY(-1px);
    opacity: 0.93;
}

/* Blog Post Detail View */
.post-detail-header {
    margin-bottom: 2rem;
}

.post-title {
    font-size: 2.25rem;
    margin: 1rem 0;
    line-height: 1.2;
}

.post-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.post-body {
    font-size: 1.08rem;
    line-height: 1.85;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    background-color: #000000;
    color: #ffffff;
    border-radius: var(--radius-md);
    padding: 2.5rem 2.75rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.post-body img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
    margin: 2rem auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.post-body a {
    color: var(--accent-cyan, #00d4ff);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
    transition: color 0.2s ease;
}
.post-body a:hover {
    color: var(--accent-blue, #38bdf8);
}

/* ── Word Document Layout & Distinct Line Separation ── */
.post-body p {
    margin: 0 0 1.5rem 0;
    line-height: 1.85;
    color: inherit;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
    color: inherit;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.post-body h1 {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 2.8rem 0 1.4rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.65rem;
}

.post-body h1:first-child {
    margin-top: 0.5rem;
}

.post-body h2 {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 2.4rem 0 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.45rem;
}

.post-body h3 {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 2rem 0 0.95rem;
}

.post-body h4 {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.45;
    margin: 1.6rem 0 0.8rem;
}

/* Lists: Distinct indentation & clear separation between lines */
.post-body ul,
.post-body ol {
    margin: 1.25rem 0 1.6rem;
    padding-left: 2.25rem;
    color: inherit;
}

.post-body li {
    margin-bottom: 0.7rem;
    line-height: 1.8;
    color: inherit;
    position: relative;
}

.post-body li:last-child {
    margin-bottom: 0;
}

.post-body ul > li {
    list-style-type: disc;
}

.post-body ol > li {
    list-style-type: decimal;
}

.post-body li > ul,
.post-body li > ol {
    margin: 0.5rem 0 0.5rem;
    padding-left: 1.75rem;
}

.post-body ul ul > li {
    list-style-type: circle;
}

/* Underline formatting */
.post-body u,
.post-body ins {
    text-decoration: underline !important;
    text-underline-offset: 3.5px !important;
    text-decoration-thickness: 1.5px !important;
    text-decoration-color: currentColor !important;
}

/* Strikethrough & Highlight */
.post-body s,
.post-body del,
.post-body strike {
    text-decoration: line-through;
    opacity: 0.78;
}

.post-body mark {
    background-color: rgba(250, 204, 21, 0.28);
    color: #fde047;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}

.post-body blockquote {
    border-left: 4px solid var(--accent-cyan, #00d4ff);
    background: #0b0f17;
    padding: 1.1rem 1.6rem;
    margin: 1.75rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: inherit;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.3);
}

.post-body blockquote p {
    margin-bottom: 0;
    color: inherit;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.98rem;
    color: inherit;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.post-body th,
.post-body td {
    padding: 0.85rem 1.15rem;
    border: 1px solid var(--border-color);
    text-align: left;
    color: inherit;
}

.post-body th {
    background-color: var(--bg-tertiary, #0f172a);
    font-weight: 700;
    letter-spacing: 0.01em;
    color: inherit;
}

.post-body tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.025);
}

/* Horizontal Rule */
.post-body hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    margin: 2.75rem 0;
}

/* Inline code and Code block formatting */
.post-body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background-color: #161b22;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    color: #38bdf8;
}

.post-body pre {
    background-color: #0d1117 !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    padding: 1.25rem;
    overflow-x: auto;
    position: relative;
}

.post-body pre code {
    background-color: transparent;
    padding: 0;
    font-size: 0.9rem;
    color: #e2e8f0;
    display: block;
}

/* ── Day Light Mode: White Background & Black Text for Blog Body ── */
[data-theme="light"] .post-body,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: rgba(31, 35, 40, 0.15) !important;
    box-shadow: 0 4px 20px rgba(31, 35, 40, 0.08) !important;
}

[data-theme="light"] .post-body p,
[data-theme="light"] .post-body li,
[data-theme="light"] .post-body h1,
[data-theme="light"] .post-body h2,
[data-theme="light"] .post-body h3,
[data-theme="light"] .post-body h4,
[data-theme="light"] .post-body h5,
[data-theme="light"] .post-body h6,
[data-theme="light"] .post-body table,
[data-theme="light"] .post-body td,
[data-theme="light"] .post-body th,
[data-theme="light"] .post-body div,
[data-theme="light"] .post-body span:not(.badge):not(.tag):not(.csv-action-pill):not(.csv-lang-badge),
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body p,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body li,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body h1,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body h2,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body h3,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body h4,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body h5,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body h6,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body table,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body td,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body th,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body div,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body span:not(.badge):not(.tag):not(.csv-action-pill):not(.csv-lang-badge) {
    color: #000000 !important;
}

[data-theme="light"] .post-body a,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body a {
    color: #0969da !important;
}

[data-theme="light"] .post-body blockquote,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body blockquote {
    background-color: #f6f8fa !important;
    border-left-color: #0969da !important;
    color: #1f2328 !important;
}

[data-theme="light"] .post-body blockquote p,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body blockquote p {
    color: #1f2328 !important;
}

[data-theme="light"] .post-body th,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body th {
    background-color: #eaeef2 !important;
    color: #000000 !important;
}

[data-theme="light"] .post-body tr:nth-child(even),
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body tr:nth-child(even) {
    background-color: #f6f8fa !important;
}

[data-theme="light"] .post-body code,
[data-time-phase="day"]:not([data-theme="dark"]):not([data-theme="midnight"]) .post-body code {
    background-color: #eaeef2 !important;
    color: #0969da !important;
}

/* ── Night Dark Mode: Black Background & White Text for Blog Body ── */
[data-theme="dark"] .post-body,
[data-theme="midnight"] .post-body,
[data-time-phase="night"] .post-body,
[data-time-phase="twilight"] .post-body {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .post-body p,
[data-theme="dark"] .post-body li,
[data-theme="dark"] .post-body h1,
[data-theme="dark"] .post-body h2,
[data-theme="dark"] .post-body h3,
[data-theme="dark"] .post-body h4,
[data-theme="dark"] .post-body h5,
[data-theme="dark"] .post-body h6,
[data-theme="dark"] .post-body table,
[data-theme="dark"] .post-body td,
[data-theme="dark"] .post-body th,
[data-theme="dark"] .post-body div,
[data-theme="dark"] .post-body span:not(.badge):not(.tag):not(.csv-action-pill):not(.csv-lang-badge),
[data-theme="midnight"] .post-body p,
[data-theme="midnight"] .post-body li,
[data-theme="midnight"] .post-body h1,
[data-theme="midnight"] .post-body h2,
[data-theme="midnight"] .post-body h3,
[data-theme="midnight"] .post-body h4,
[data-theme="midnight"] .post-body h5,
[data-theme="midnight"] .post-body h6,
[data-theme="midnight"] .post-body table,
[data-theme="midnight"] .post-body td,
[data-theme="midnight"] .post-body th,
[data-theme="midnight"] .post-body div,
[data-theme="midnight"] .post-body span:not(.badge):not(.tag):not(.csv-action-pill):not(.csv-lang-badge),
[data-time-phase="night"] .post-body p,
[data-time-phase="night"] .post-body li,
[data-time-phase="night"] .post-body h1,
[data-time-phase="night"] .post-body h2,
[data-time-phase="night"] .post-body h3,
[data-time-phase="night"] .post-body h4,
[data-time-phase="night"] .post-body h5,
[data-time-phase="night"] .post-body h6,
[data-time-phase="night"] .post-body table,
[data-time-phase="night"] .post-body td,
[data-time-phase="night"] .post-body th,
[data-time-phase="night"] .post-body div,
[data-time-phase="night"] .post-body span:not(.badge):not(.tag):not(.csv-action-pill):not(.csv-lang-badge),
[data-time-phase="twilight"] .post-body p,
[data-time-phase="twilight"] .post-body li,
[data-time-phase="twilight"] .post-body h1,
[data-time-phase="twilight"] .post-body h2,
[data-time-phase="twilight"] .post-body h3,
[data-time-phase="twilight"] .post-body h4,
[data-time-phase="twilight"] .post-body h5,
[data-time-phase="twilight"] .post-body h6,
[data-time-phase="twilight"] .post-body table,
[data-time-phase="twilight"] .post-body td,
[data-time-phase="twilight"] .post-body th,
[data-time-phase="twilight"] .post-body div,
[data-time-phase="twilight"] .post-body span:not(.badge):not(.tag):not(.csv-action-pill):not(.csv-lang-badge) {
    color: #ffffff !important;
}

[data-theme="dark"] .post-body a,
[data-theme="midnight"] .post-body a,
[data-time-phase="night"] .post-body a,
[data-time-phase="twilight"] .post-body a {
    color: var(--accent-cyan, #00d4ff) !important;
}

[data-theme="dark"] .post-body blockquote,
[data-theme="midnight"] .post-body blockquote,
[data-time-phase="night"] .post-body blockquote,
[data-time-phase="twilight"] .post-body blockquote {
    background-color: #0b0f17 !important;
    border-left-color: var(--accent-cyan, #00d4ff) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .post-body th,
[data-theme="midnight"] .post-body th,
[data-time-phase="night"] .post-body th,
[data-time-phase="twilight"] .post-body th {
    background-color: #0f172a !important;
    color: #ffffff !important;
}

/* Copy Button for code blocks */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #161b22;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 0.5rem 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
}

.code-header+pre {
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.copy-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: var(--transition);
}

.copy-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

/* Post Detail Tags widget */
.post-tags-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ── Footer — terminal status-bar accent ── */
footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    /* thin cyan top stripe */
    box-shadow: inset 0 1px 0 0 rgba(0,212,255,.1);
    padding: 4rem 0 2rem;
    margin-top: auto;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 1rem;
    font-size: 0.9rem;
    max-width: 320px;
}

.footer-title {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
}

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

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent-blue);
    padding-left: 4px;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

/* Admin Dashboard CSS */
.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.admin-table th {
    font-weight: 600;
    color: var(--text-primary);
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.flash-messages {
    list-style: none;
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.flash-message.success {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.flash-message.error {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.flash-message.info {
    background-color: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* ── Page header — IDE command-palette style ── */
.page-header {
    background: linear-gradient(135deg,
        rgba(0,212,255,.04) 0%,
        rgba(168,85,247,.04) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent-gradient);
}
.page-header h1 {
    font-family: var(--font-mono);
    font-size: clamp(1.6rem,3vw,2.2rem);
    margin-bottom: 0.5rem;
}
.page-header p { color: var(--text-secondary); }

/* Responsive Mobile Navigation Overlay & Layout */
@media (max-width: 991px) {
    .nav-container {
        height: 64px;
        padding: 0 1rem;
        max-width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo-icon {
        height: 42px;
        max-width: 95px;
    }

    .nav-tools-group {
        margin-left: auto;
        gap: 0.5rem;
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .weather-time-widget {
        height: 36px;
        padding: 0 0.55rem;
        font-size: 0.74rem;
        gap: 0.35rem;
    }

    .widget-datetime {
        display: none;
    }

    .theme-toggle-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        flex-shrink: 0;
    }

    .menu-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: var(--radius-sm);
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        cursor: pointer;
        flex-shrink: 0;
        z-index: 1001;
        transition: var(--transition);
    }

    .menu-toggle:hover,
    .menu-toggle:focus,
    .menu-toggle[aria-expanded="true"] {
        border-color: var(--accent-cyan);
        color: var(--accent-cyan);
        box-shadow: 0 0 12px var(--accent-glow);
    }

    /* Mobile Navigation Drawer */
    .nav-links {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 64px);
        max-height: calc(100dvh - 64px);
        height: auto;
        min-height: 0;
        background: var(--bg-primary);
        background-color: var(--bg-primary);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 1.25rem 1rem 3.5rem 1rem;
        gap: 0.6rem;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        z-index: 1000;
        transform: translateY(-110%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
        transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                    opacity 0.22s ease,
                    visibility 0.32s ease;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-backdrop.active {
        display: block;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Mobile Location & Theme Dropdown Panels */
    .location-time-panel {
        position: fixed;
        top: 68px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: 440px;
        margin: 0 auto;
        z-index: 1100;
    }

    .theme-panel {
        position: fixed;
        top: 68px;
        right: 12px;
        left: auto;
        width: 270px;
        max-width: calc(100vw - 24px);
        z-index: 1100;
    }

    /* Mobile Search Priority: Place at top of drawer */
    .nav-links .nav-actions {
        order: -1;
        width: 100%;
        margin-bottom: 0.5rem;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-links .search-wrapper {
        width: 100%;
        position: relative;
    }

    .nav-links .search-input {
        height: 44px;
        font-size: 0.95rem;
        padding: 0 4.2rem 0 1.1rem;
        background: var(--bg-secondary);
    }

    .nav-links .search-suggestions {
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        z-index: 1100;
    }

    /* Mobile Link Items */
    .nav-links > .nav-item,
    .nav-links > a.nav-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.85rem 1.1rem;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        font-size: 1.02rem;
        font-weight: 600;
        color: var(--text-primary);
        text-decoration: none;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-links > .nav-item:hover,
    .nav-links > .nav-item:focus,
    .nav-links > a.nav-item:hover,
    .nav-links > a.nav-item:focus {
        background: var(--bg-tertiary);
        border-color: var(--accent-cyan);
        color: var(--accent-cyan);
        transform: translateX(4px);
    }

    .nav-links > .nav-item.active,
    .nav-links > a.nav-item.active {
        background: var(--bg-tertiary);
        border-color: var(--accent-cyan);
        color: var(--accent-cyan);
        box-shadow: 0 0 14px var(--accent-glow);
        font-weight: 700;
    }

    .nav-links > .nav-item.active::after,
    .nav-links > a.nav-item.active::after {
        display: none;
    }

    /* Mobile User Menu */
    .nav-links .user-menu {
        width: 100%;
        position: static;
        display: block;
        margin-top: 0.25rem;
    }

    .nav-links .user-menu-btn {
        width: 100%;
        max-width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.85rem 1.1rem;
        border-radius: var(--radius-md);
        font-size: 1rem;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        cursor: pointer;
    }

    .nav-links .user-menu-btn:hover,
    .nav-links .user-menu-btn:focus,
    .nav-links .user-menu.active .user-menu-btn {
        border-color: var(--accent-cyan);
        color: var(--accent-cyan);
    }

    .nav-links .user-dropdown {
        position: static;
        width: 100%;
        min-width: 100%;
        margin-top: 0.4rem;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        box-shadow: none;
        display: none;
        padding: 0.5rem;
        border-radius: var(--radius-md);
        animation: none;
    }

    .nav-links .user-menu.active .user-dropdown,
    .nav-links .user-dropdown.mobile-expanded {
        display: block;
    }

    .nav-links .user-dropdown a {
        padding: 0.75rem 1rem;
        border-radius: var(--radius-sm);
        font-size: 0.95rem;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 0.6rem;
        background: transparent;
        border: none;
        color: var(--text-primary);
        text-decoration: none;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .nav-links .user-dropdown a:hover,
    .nav-links .user-dropdown a:focus {
        background: var(--bg-secondary);
        color: var(--accent-cyan);
        transform: none;
        box-shadow: none;
    }

    .main-wrapper {
        margin-top: 85px;
    }
}

@media (max-width: 576px) {
    .nav-container {
        height: 60px;
        padding: 0 0.75rem;
    }

    .nav-links {
        top: 60px;
        max-height: calc(100vh - 60px);
        max-height: calc(100dvh - 60px);
        padding: 1rem 0.75rem 3rem 0.75rem;
    }

    .location-time-panel {
        top: 64px;
        right: 8px;
        left: 8px;
        max-width: calc(100vw - 16px);
        padding: 0.85rem;
    }

    .theme-panel {
        top: 64px;
        right: 8px;
        width: 260px;
        max-width: calc(100vw - 16px);
        padding: 0.85rem;
    }

    .world-locations-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.35rem;
        max-height: 200px;
    }

    .location-card-item {
        padding: 0.45rem 0.5rem;
    }

    .logo-icon {
        height: 36px;
        max-width: 80px;
    }

    .nav-tools-group {
        gap: 0.35rem;
    }

    .weather-time-widget {
        height: 34px;
        padding: 0 0.45rem;
        font-size: 0.7rem;
        gap: 0.25rem;
    }

    .theme-toggle-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .menu-toggle {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .location-time-panel {
        width: 290px;
        max-width: 90vw;
        right: 0;
    }

    .theme-panel {
        width: 240px;
        max-width: 90vw;
        right: 0;
    }

    .main-wrapper {
        margin-top: 75px;
    }
}

@media (max-width: 380px) {
    .nav-container {
        padding: 0 0.5rem;
    }

    .logo-icon {
        height: 32px;
        max-width: 68px;
    }

    .weather-time-widget {
        padding: 0 0.35rem;
        font-size: 0.66rem;
    }

    .widget-weather {
        display: none;
    }
}

/*The button of update and delete in post detail to display in the same line*/
.post-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1.5rem 0;
}

.delete-form {
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* with proper spacing and responsive behavior. On mobile, you can add: */
@media (max-width: 576px) {
    .post-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .post-actions .btn,
    .post-actions button {
        width: 100%;
    }
}

.center {
  text-align: center;
}


/* Pagination*/
.pagination {
    display: inline-block;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    padding: 0 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* ── Post card engagement micro-stats ───────────────────── */
.card-engagement {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.card-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.card-stat svg { flex-shrink: 0; }

/* ── Brand Hero (home page) – IDE terminal title-bar ── */
.brand-hero {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2.25rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
}
.brand-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px 0 0 3px;
}
.brand-hero::after {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(0,212,255,.06) 0%, transparent 70%);
    pointer-events: none;
}

.brand-hero-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.brand-hero-icon img {
    border-radius: 12px;
    object-fit: cover;
    width: 58px; height: 58px;
    box-shadow: 0 0 0 1px var(--border-color), 0 4px 18px rgba(0,212,255,.2);
    transition: transform 0.3s ease, box-shadow 0.3s;
}
.brand-hero-icon img:hover {
    transform: scale(1.07) rotate(-2deg);
    box-shadow: 0 0 0 1px rgba(0,212,255,.3), 0 8px 28px rgba(0,212,255,.35);
}

.brand-hero-name {
    font-family: var(--font-mono);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.2rem;
    line-height: 1.1;
}
.brand-hero-accent {
    font-weight: 400;
    -webkit-text-fill-color: transparent;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
}

.brand-hero-tagline {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin: 0;
    position: relative;
    display: inline-block;
    letter-spacing: 0.02em;
}
.brand-hero-tagline::after {
    content: '';
    position: absolute;
    bottom: -3px; left: 0;
    width: 0; height: 1px;
    background: var(--accent-gradient);
    transition: width 0.5s ease;
}
.brand-hero:hover .brand-hero-tagline::after { width: 100%; }

.brand-hero-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.brand-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-width: 52px;
}
.brand-stat-value {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}
.brand-stat-label {
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.brand-stat-divider {
    width: 1px; height: 32px;
    background: var(--border-color);
}
@media (max-width: 600px) {
    .brand-hero { flex-direction: column; align-items: flex-start; padding: 1.25rem; }
    .brand-hero-stats { align-self: stretch; justify-content: space-around; }
}

/* ── Utility ── */
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}
.btn-outline:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: rgba(0,212,255,.05);
}

/* ── 🍪 Cookie Consent & Session Preferences Banner ── */
.cookie-consent-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: calc(100% - 2.5rem);
    max-width: 960px;
    z-index: 1050;
    background: var(--card-bg, rgba(18, 24, 38, 0.94));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4), 0 0 24px var(--accent-glow);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    opacity: 0;
    pointer-events: none;
}

.cookie-consent-banner.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.cookie-banner-container {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-banner-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.cookie-banner-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 0 12px var(--accent-glow);
}

.cookie-banner-text {
    flex: 1;
    min-width: 0;
}

.cookie-banner-heading-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
}

.cookie-banner-title {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.cookie-banner-tag {
    font-size: 0.65rem;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(0, 212, 255, 0.12);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 212, 255, 0.25);
}

.cookie-banner-desc {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-secondary);
    margin: 0;
}

.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.btn-cookie-accept {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1.15rem;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 212, 255, 0.3);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.btn-cookie-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.45);
}

.btn-cookie-essential {
    display: inline-flex;
    align-items: center;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-cookie-essential:hover {
    border-color: var(--text-secondary);
    background: var(--bg-secondary);
}

.btn-cookie-details {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    text-decoration: underline;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.btn-cookie-details:hover {
    color: var(--text-primary);
}

/* Detailed Cookie Category Panel */
.cookie-details-panel {
    border-top: 1px solid var(--border-color);
    padding-top: 0.85rem;
}

.cookie-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.cookie-detail-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
}

.cookie-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.cookie-detail-title {
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.cookie-detail-card p {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.35;
    margin: 0;
}

.cookie-badge {
    font-size: 0.62rem;
    font-weight: 600;
    font-family: var(--font-mono);
    padding: 1px 5px;
    border-radius: 4px;
}

.badge-required {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-active {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.badge-session {
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-violet);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.footer-cookie-link {
    cursor: pointer;
}

@media (max-width: 860px) {
    .cookie-banner-main {
        flex-direction: column;
        align-items: flex-start;
    }
    .cookie-banner-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}