/* IT-Proffs.net — dark technical theme */
:root {
    --bg:        #0d1117;
    --bg-soft:   #161b22;
    --bg-card:   #1b222c;
    --border:    #2a3340;
    --text:      #e6edf3;
    --muted:     #9aa7b4;
    --accent:    #2f9e8f;
    --accent-2:  #58a6ff;
    --danger:    #f85149;
    --radius:    10px;
    --maxw:      1080px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* ------------------------------- Header / nav ----------------------------- */
.site-header {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 60px; }

.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); font-family: monospace; font-size: 1.2rem; }
.brand-text { font-size: 1.15rem; }

.main-nav { display: flex; flex: 1; align-items: center; justify-content: space-between; }
.nav-list { list-style: none; display: flex; align-items: center; gap: .25rem; margin: 0; padding: 0; }
.nav-list > li > a {
    display: block; padding: .55rem .8rem; color: var(--text); border-radius: 6px; font-size: .95rem;
}
.nav-list > li > a:hover { background: var(--bg-card); text-decoration: none; }
.caret { font-size: .7rem; color: var(--muted); }

/* Dropdowns */
.has-dropdown { position: relative; }
.dropdown {
    list-style: none; margin: 0; padding: .4rem; position: absolute; top: 100%; left: 0;
    min-width: 260px; background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0,0,0,.45);
    opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s ease;
}
.has-dropdown:hover > .dropdown,
.has-dropdown.open > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown li a { display: block; padding: .5rem .65rem; border-radius: 6px; color: var(--text); font-size: .9rem; }
.dropdown li a:hover { background: var(--bg-card); text-decoration: none; }
.dropdown-all { border-top: 1px solid var(--border); margin-top: .3rem; padding-top: .3rem; }
.dropdown-all a { color: var(--accent); }
.dropdown-empty span { display: block; padding: .5rem .65rem; color: var(--muted); font-size: .85rem; }

.btn-link { border: 1px solid var(--border); }

/* Hamburger */
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .4rem; margin-left: auto; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; }

/* --------------------------------- Layout --------------------------------- */
.site-main { padding: 2.5rem 1.25rem 3.5rem; min-height: 60vh; }

.hero { text-align: center; padding: 2rem 0 2.5rem; }
.hero h1 { font-size: 2.4rem; margin: 0 0 .4rem; }
.hero-small { padding: 1rem 0 1.5rem; text-align: left; }
.tagline { color: var(--muted); font-size: 1.1rem; margin: 0; }

.article-list h2 { border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.25rem; transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: .5rem 0; font-size: 1.15rem; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent-2); }
.card-cat {
    display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--accent); background: rgba(47,158,143,.12); padding: .15rem .5rem; border-radius: 999px;
}
.excerpt { color: var(--muted); font-size: .92rem; margin: .5rem 0; }
.card-date { color: var(--muted); font-size: .8rem; }
.empty { color: var(--muted); }

/* --------------------------------- Article -------------------------------- */
.post { max-width: 760px; margin: 0 auto; }
.post-header h1 { font-size: 2rem; margin: .6rem 0 .3rem; }
.post-meta { color: var(--muted); font-size: .9rem; }
.post-body { font-size: 1.05rem; margin-top: 1.5rem; }
.post-body h2, .post-body h3 { margin-top: 1.8rem; }
.post-body pre {
    background: #0b0f14; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem; overflow-x: auto;
}
.post-body code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .92em; }
.post-body :not(pre) > code { background: var(--bg-soft); padding: .1rem .35rem; border-radius: 5px; }
.post-body img { max-width: 100%; border-radius: var(--radius); }
.post-footer { margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }

/* ---------------------------------- Forms --------------------------------- */
.auth, .form { max-width: 420px; margin: 0 auto; }
.form-wide { max-width: 820px; }
.form label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }
.form input, .form textarea, .form select {
    display: block; width: 100%; margin-top: .35rem; padding: .6rem .7rem;
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-size: 1rem; font-weight: 400; font-family: inherit;
}
.form input:focus, .form textarea:focus, .form select:focus {
    outline: none; border-color: var(--accent);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.form-actions { margin-top: .5rem; }

.btn {
    display: inline-block; background: var(--accent); color: #fff; border: 0; cursor: pointer;
    padding: .6rem 1.2rem; border-radius: 8px; font-size: .95rem; font-weight: 600;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }

.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert.error { background: rgba(248,81,73,.12); border: 1px solid var(--danger); color: #ffb4b0; }
.alert.success { background: rgba(47,158,143,.12); border: 1px solid var(--accent); color: #9fe8dc; }
.alert ul { margin: 0; padding-left: 1.2rem; }

/* ---------------------------------- Admin --------------------------------- */
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.admin-head h1 { margin: 0; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.row-actions { display: flex; gap: 1rem; align-items: center; }
.row-actions form { margin: 0; }
.link-danger { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: .95rem; padding: 0; }
.link-danger:hover { text-decoration: underline; }

.badge { font-size: .72rem; padding: .15rem .55rem; border-radius: 999px; text-transform: capitalize; }
.badge-published { background: rgba(47,158,143,.15); color: var(--accent); }
.badge-draft { background: rgba(154,167,180,.15); color: var(--muted); }

/* ---------------------------------- Tags ---------------------------------- */
.section-title { border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.crumb { color: var(--muted); font-size: .85rem; margin: 0 0 .25rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 .6rem; }
.tag {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--accent); background: rgba(47,158,143,.12);
    padding: .15rem .55rem; border-radius: 999px;
}
.tag:hover { background: rgba(47,158,143,.25); text-decoration: none; }
.post-header .tags { margin-top: .8rem; }

/* ------------------------------ Menus admin ------------------------------- */
.menus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.menu-block {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem;
}
.menu-block.unattached { margin-top: 1.5rem; border-style: dashed; }
.menu-block-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.menu-block-head .rename { display: flex; gap: .4rem; flex: 1; }
.menu-block-head input[type=text] {
    background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
    border-radius: 6px; padding: .35rem .5rem; font-size: 1rem; font-weight: 600; width: 100%;
}
.menu-block-tools { display: flex; gap: .5rem; white-space: nowrap; }
.inline { display: inline; margin: 0; }
.link { background: none; border: 0; color: var(--accent-2); cursor: pointer; font-size: .85rem; padding: 0 .2rem; }
.link:hover { text-decoration: underline; }
.link:disabled { color: var(--muted); cursor: default; text-decoration: none; }

.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; min-height: 2rem; }
.tag-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: 999px; padding: .2rem .3rem .2rem .7rem; font-size: .85rem;
}
.tag-chip small { color: var(--muted); }
.tag-chip select {
    background: var(--bg); border: 1px solid var(--border); color: var(--text);
    border-radius: 6px; font-size: .75rem; padding: .1rem .2rem;
}
.add-tag { display: flex; gap: .4rem; margin-top: .8rem; }
.add-tag input { flex: 1; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: .4rem .55rem; }
.btn-sm { padding: .35rem .8rem; font-size: .85rem; }
.add-menu { max-width: 480px; margin-top: 2rem; }
.add-menu .row { display: flex; gap: .5rem; margin-top: .35rem; }
.add-menu .row input { flex: 1; }

/* --------------------------------- Footer --------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: 0; text-align: center; }

/* ------------------------------- Responsive ------------------------------- */
@media (max-width: 800px) {
    .nav-toggle { display: block; }
    .main-nav {
        display: none; position: absolute; top: 60px; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--bg-soft); border-bottom: 1px solid var(--border); padding: .5rem;
    }
    .main-nav.open { display: flex; }
    .nav-list { flex-direction: column; align-items: stretch; width: 100%; }
    .nav-right { margin-top: .5rem; border-top: 1px solid var(--border); padding-top: .5rem; }
    .dropdown {
        position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
        border: 0; padding-left: 1rem; display: none;
    }
    .has-dropdown.open > .dropdown { display: block; }
    .has-dropdown:hover > .dropdown { opacity: 1; }
    .form-row { grid-template-columns: 1fr; }
}
