/* blog.by-hahn.com Main page css */

/* Responsive Design Breakpoints:
   - Desktop: > 900px (2-column layout with sidebar)
   - Tablet: 600px - 900px (1-column layout, sidebar hidden)
   - Mobile: <= 600px (1-column layout, mobile menu visible) */

:root {
    --bg: #0f1724;
    --card: #0b1220;
    --accent: #3b82f6;
    --muted: #9aa4b2;
    --glass: rgba(255, 255, 255, 0.03);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background: #071029;
    color: #e6eef6
}

.wrap {
    max-width: 980px;
    margin: 48px auto;
    padding: 24px
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap
}

h1 {
    margin: 0;
    font-size: 1.6rem
}

.title {
    color: inherit;
    text-decoration: none;
}

.title:hover {
    text-decoration: underline;
}

p.lead {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.95rem
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px
}

a.btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--glass);
    color: inherit;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease
}

a.btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1)
}

a.btn:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    margin-top: 22px
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03)
}

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

li.post {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.02)
}

li.post:last-child {
    border-bottom: none
}

li.post a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s
}

li.post a:hover {
    color: var(--accent)
}

.muted {
    color: var(--muted);
    font-size: 0.9rem
}

.category-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px
}

.cat {
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.2s
}

.cat:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px)
}

footer {
    margin-top: 36px;
    color: var(--muted);
    font-size: 0.85rem
}

/* Alert messages */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    border-left: 3px solid
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: #fca5a5
}

.alert.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: #fcd34d
}

.alert.info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent);
    color: #93c5fd
}

/* Article styles */
article h1,
article h2,
article h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.3
}

article h1 {
    font-size: 2rem
}

article h2 {
    font-size: 1.5rem
}

article h3 {
    font-size: 1.25rem
}

article p {
    line-height: 1.7;
    margin: 1em 0
}

article code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em
}

article pre {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.05)
}

article pre code {
    background: none;
    padding: 0
}

article a {
    color: var(--accent);
    text-decoration: none
}

article a:hover {
    text-decoration: underline
}

article img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0
}

article blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    margin: 1em 0;
    color: var(--muted);
    font-style: italic
}

article ul,
article ol {
    padding-left: 1.5em;
    line-height: 1.7
}

/* Link styles */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: inherit;
}

/* Tablet Layout (screens 600px - 900px) */
@media(max-width:900px) {
    .grid {
        grid-template-columns: 1fr
    }

    .category-list {
        grid-template-columns: 1fr
    }
}


/* Mobile Layout (screens <= 600px) */
@media(max-width:600px) {
    .wrap {
        padding: 16px;
        margin: 24px auto
    }

    h1 {
        font-size: 1.4rem
    }

    #nav-menu {
        display: none !important;
    }

    .nav-toggle {
        display: block !important;
    }

    .mobile-menu {
        display: block;
    }

    aside {
        display: none;
    }
}


/* Navigation toggle */
.nav-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(15, 23, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e6eef6;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s;
    z-index: 1997;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Mobile Menu Styles (visible only on screens <= 600px) */

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

/* Mobile menu */
.mobile-menu {
    display: block !important;
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: linear-gradient(180deg, #0f1724 0%, #0b1220 100%);
    z-index: 1999;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

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

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #e6eef6;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #e6eef6;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}

.mobile-menu-close:hover {
    color: var(--accent);
}

.mobile-menu-content {
    padding: 20px;
}

.mobile-menu-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-content li {
    padding: 0;
    margin-bottom: 8px;
}

.mobile-menu-content a {
    display: block;
    padding: 14px 16px;
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    color: #e6eef6;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 1rem;
}

.mobile-menu-content a:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(-4px);
}

/* Quick links sticky on desktop */
@media(min-width:901px) {
    #quicklinks-card {
        position: sticky;
        top: 20px;
    }
}