/* ============================================
   2byte-software.net — Main Stylesheet
   Rebuilt to match actual HTML structure
   ============================================ */

/* Google Fonts fallback for Arial Black look on Linux */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,700;0,800;0,900;1,700;1,800;1,900&display=swap');

/* ============================================
   FONT STACK & CSS VARIABLES
   ============================================ */
:root {
    --font-heading:  'Arial Black', 'Arial Bold', 'Barlow Condensed', Arial, sans-serif;
    --font-body:     Arial, Verdana, Helvetica, sans-serif;
    --font-mono:     'Courier New', Courier, monospace;

    /* Light mode palette */
    --bg:            #e8e8e8;
    --bg-box:        #ffffff;
    --bg-bar:        #ececec;
    --border:        #cccccc;
    --border-hi:     #aaaaaa;
    --text:          #111111;
    --text-sub:      #444444;
    --text-muted:    #777777;
    --green:         #007a1f;
    --green-dark:    #005a16;
    --red:           #cc0000;
    --warn:          #cc8800;

    --max-width:     960px;
    --gap:           16px;
}

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

html { scroll-behavior: smooth; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* ============================================
   BASE BODY
   ============================================ */
body {
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(185, 185, 185, 0.6), rgba(185, 185, 185, 0.6)),
        url('media/bg.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-sub);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text);
    line-height: 1.15;
    font-weight: 900;
}

a {
    color: var(--green);
    text-decoration: none;
    transition: color 0.15s;
}
a:hover {
    color: var(--text);
    text-decoration: underline;
}

::selection {
    background: var(--green);
    color: #fff;
}

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg-bar); }
::-webkit-scrollbar-thumb { background: var(--border); border: 1px solid var(--border-hi); }
::-webkit-scrollbar-thumb:hover { background: var(--green-dark); }

/* ============================================
   LAYOUT WRAPPERS
   ============================================ */
.page-wrap {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 16px 16px 32px;
    flex: 1;
}

.content-grid {
    display: flex;
    gap: var(--gap);
    align-items: flex-start;
}

.main-col {
    flex: 1;
    min-width: 0;
}

.sidebar-col {
    width: 230px;
    flex-shrink: 0;
}

/* ============================================
   WHITE BOX  — universal panel/card
   ============================================ */
.white-box {
    background-color: var(--bg-box);
    border: 1px solid var(--border);
    margin-bottom: var(--gap);
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    background-color: var(--bg-box);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.header-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    height: 60px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: 16px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    padding-right: 12px;
}

.logo-link img {
    height: 42px;
    width: auto;
}

.logo-link:hover {
    text-decoration: none;
    opacity: 0.88;
}

/* Navigation — stretches to fill header height, flush to the right edge */
.site-nav {
    display: flex;
    align-items: stretch;
    height: 60px;
    border-left: 1px solid var(--border);
    margin-left: auto;
}

.site-nav a {
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-right: 1px solid var(--border);
    text-decoration: none;
    transition: color 0.15s, background-color 0.15s;
    white-space: nowrap;
}

.site-nav a:hover {
    color: var(--text);
    background-color: var(--bg-bar);
    text-decoration: none;
}

.site-nav a.active {
    color: var(--green);
    background-color: var(--bg-bar);
    border-bottom: 2px solid var(--green);
}

/* ============================================
   PAGE TITLE BAR  (inside white-box)
   ============================================ */
.page-title-bar {
    background-color: var(--bg-bar);
    border-bottom: 1px solid var(--border);
    padding: 10px 18px;
}

.page-title-bar h1 {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text);
    font-family: var(--font-heading);
}

/* ============================================
   STATUS BAR
   ============================================ */
.status-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 7px 18px;
    background-color: var(--bg-box);
    border: 1px solid var(--border);
    margin-bottom: var(--gap);
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.dot-online {
    color: var(--green);
    margin-right: 4px;
}

.online-label {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--green);
}

/* ============================================
   HERO BOX  (index.html)
   ============================================ */
.hero-box {
    padding: 28px 32px 24px;
    position: relative;
    overflow: hidden;
    margin-bottom: var(--gap);
}

.hero-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--green), transparent);
}

.hero-box h1 {
    font-size: 26px;
    font-weight: 900;
    font-style: italic;
    margin-bottom: 12px;
    color: var(--text);
    font-family: var(--font-heading);
}

.hero-box h1 .green,
.green {
    color: var(--green);
}

.hero-desc {
    font-size: 13px;
    color: var(--text-sub);
    max-width: 620px;
    line-height: 1.75;
}

.terminal-line {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--green);
    margin-top: 16px;
}

/* Blinking block cursor appended to terminal line */
.terminal-line::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 13px;
    background: var(--green);
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 50%   { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ============================================
   SECTION BAR  (Latest Posts header)
   ============================================ */
.section-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-bar);
}

.section-bar h2 {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text);
    font-family: var(--font-heading);
}

.view-all {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--green);
    text-decoration: none;
}

.view-all:hover {
    color: var(--text);
    text-decoration: underline;
}

/* ============================================
   POST CARD  (index.html featured post)
   ============================================ */
.post-card {
    border-bottom: 1px solid var(--border);
}

.post-card:last-child { border-bottom: none; }

.post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 18px;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-bar);
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.post-card-image-placeholder {
    padding: 9px 18px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    background-color: var(--bg-bar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.post-card-body {
    padding: 14px 18px 18px;
}

.post-card-body h3 {
    font-size: 15px;
    font-weight: 900;
    margin-bottom: 8px;
    font-family: var(--font-heading);
    color: var(--text);
}

.post-card-body h3 a { color: var(--text); }
.post-card-body h3 a:hover { color: var(--green); text-decoration: none; }

.post-card-body p {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.7;
}

.date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   AUTHOR BADGE
   ============================================ */
.author-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--green);
}

.author-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border: 1px solid currentColor;
    flex-shrink: 0;
}

.author-dot.color-green  { background-color: var(--green);  border-color: var(--green); }
.author-dot.color-blue   { background-color: #2255bb;        border-color: #2255bb; }
.author-dot.color-red    { background-color: #cc0000;        border-color: #cc0000; }
.author-dot.color-purple { background-color: #7722cc;        border-color: #7722cc; }

/* ============================================
   SIDEBAR WIDGETS
   ============================================ */
.widget {
    padding: 0;
    overflow: hidden;
}

.widget-title {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--green);
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-bar);
}

/* Team rows */
.team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.team-row:last-child { border-bottom: none; }

.team-name {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--green);
}

.team-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Quick links */
.quick-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.quick-link-row:last-child { border-bottom: none; }

.quick-link-row a {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--green);
}

.quick-link-row a:hover { color: var(--text); text-decoration: none; }

.quick-link-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* Site info */
.site-info-text {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    line-height: 1.9;
    padding: 10px 14px;
}

/* ============================================
   BLOG ARCHIVE ROWS  (blog.html)
   ============================================ */
.blog-post-row {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.blog-post-row:last-child { border-bottom: none; }

.blog-post-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--green);
    margin-bottom: 5px;
}

.blog-post-row h3 {
    font-size: 14px;
    font-weight: 900;
    font-family: var(--font-heading);
    margin-bottom: 5px;
}

.blog-post-row h3 a { color: var(--text); }
.blog-post-row h3 a:hover { color: var(--green); text-decoration: none; }

.blog-post-excerpt {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.65;
}

/* ============================================
   PORTFOLIO GRID  (portfolio.html)
   ============================================ */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1px;
    background-color: var(--border);
    border-top: 1px solid var(--border);
}

.project-card {
    background-color: var(--bg-box);
    padding: 18px 20px;
    transition: background-color 0.15s;
}

.project-card:hover { background-color: var(--bg-bar); }

.project-card h3 {
    font-size: 14px;
    font-weight: 900;
    font-family: var(--font-heading);
    color: var(--text);
    margin-bottom: 8px;
}

.project-card p {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.65;
    margin-bottom: 12px;
}

.project-tag {
    display: inline-block;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background-color: var(--bg-bar);
    margin-right: 4px;
    margin-bottom: 4px;
    font-family: var(--font-heading);
}

/* ============================================
   DOWNLOAD ROWS  (downloads.html)
   ============================================ */
.download-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}

.download-row:last-child { border-bottom: none; }

.download-name {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}

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

.download-btn {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--green);
    white-space: nowrap;
    border: 1px solid var(--green);
    padding: 4px 12px;
    text-decoration: none;
    flex-shrink: 0;
    transition: background-color 0.15s, color 0.15s;
}

.download-btn:hover {
    background-color: var(--green);
    color: #fff;
    text-decoration: none;
}

/* ============================================
   CONTACT PAGE
   ============================================ */
.contact-box {
    padding: 28px 32px;
}

.contact-box h2 {
    font-size: 22px;
    font-weight: 900;
    font-style: italic;
    margin-bottom: 12px;
    font-family: var(--font-heading);
}

.contact-box p {
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 10px;
    line-height: 1.7;
}

.contact-email {
    font-family: var(--font-mono) !important;
    font-size: 15px !important;
    color: var(--green) !important;
    font-weight: 700;
    margin-top: 14px !important;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background-color: var(--bg-box);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 0 20px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: auto;
}

.site-footer::before {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--green), transparent);
    margin-bottom: 10px;
}

/* ============================================
   UTILITIES
   ============================================ */
.green       { color: var(--green); }
.text-muted  { color: var(--text-muted); }
.mono        { font-family: var(--font-mono); }

/* ============================================
   POST PAGE — meta bar + body
   ============================================ */
.post-meta-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 7px 18px;
    background-color: var(--bg-bar);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 11px;
}

.post-author { color: var(--green); font-weight: 700; }
.post-date   { color: var(--text-muted); }

/* Rendered Markdown body */
.post-body {
    padding: 24px 24px 28px;
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-sub);
}

.post-body h2 {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 900;
    color: var(--text);
    margin: 28px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border);
}

.post-body h3 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 900;
    color: var(--text);
    margin: 20px 0 8px;
}

.post-body h4, .post-body h5, .post-body h6 {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 900;
    color: var(--text-sub);
    margin: 16px 0 6px;
}

.post-body p {
    margin-bottom: 14px;
}

.post-body strong { color: var(--text); }
.post-body em     { font-style: italic; }

.post-body a {
    color: var(--green);
    text-decoration: underline;
}
.post-body a:hover { color: var(--text); }

/* Inline code */
.post-body code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    background-color: var(--bg-bar);
    border: 1px solid var(--border);
    padding: 1px 5px;
    color: var(--text);
}

/* Fenced code blocks */
.post-body pre {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-left: 3px solid var(--green);
    padding: 14px 16px;
    overflow-x: auto;
    margin: 16px 0;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.6;
    color: #d4d4d4;
}

.post-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Lists */
.post-body ul,
.post-body ol {
    margin: 0 0 14px 24px;
}

.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }

.post-body li {
    margin-bottom: 5px;
    line-height: 1.65;
}

.post-body ul ul,
.post-body ol ul { list-style: circle; margin-bottom: 0; }

/* Blockquote */
.post-body blockquote {
    margin: 16px 0;
    padding: 10px 16px;
    border-left: 3px solid var(--green);
    background-color: var(--bg-bar);
    color: var(--text-muted);
    font-style: italic;
}

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

/* Horizontal rule */
.post-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* Images */
.post-body img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--border);
    margin: 18px 0;
}

/* Tables (markdown extra) */
.post-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 16px 0;
}

.post-body th {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: var(--bg-bar);
    border: 1px solid var(--border);
    padding: 7px 12px;
    text-align: left;
    color: var(--text);
}

.post-body td {
    border: 1px solid var(--border);
    padding: 7px 12px;
    color: var(--text-sub);
}

.post-body tr:nth-child(even) td {
    background-color: var(--bg-bar);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 720px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 14px;
        gap: 8px;
    }

    .site-nav {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        height: auto;
        flex-wrap: wrap;
        margin-left: 0;
    }

    .site-nav a {
        padding: 8px 12px;
        font-size: 10px;
        height: auto;
    }

    .content-grid {
        flex-direction: column;
    }

    .sidebar-col { width: 100%; }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .download-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .hero-box h1 { font-size: 20px; }
    .page-wrap { padding: 10px 10px 24px; }
}

/* ============================================
   LANGUAGE FILTER BAR  (blog.html)
   ============================================ */
.lang-filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background-color: var(--bg-box);
    border-bottom: 1px solid var(--border);
}

.lang-filter-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-right: 4px;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    background-color: var(--bg-bar);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
    line-height: 1.6;
}

.lang-btn:hover {
    color: var(--text);
    border-color: var(--border-hi);
    background-color: #e2e2e2;
}

.lang-btn.active {
    color: var(--green);
    border-color: var(--green);
    background-color: var(--bg-box);
    font-weight: 700;
}

/* Flag + label in post meta bar */
.post-lang-flag {
    font-size: 15px;
    line-height: 1;
    margin-right: 2px;
}

/* ============================================
   ABOUT / PROFILE PAGE
   ============================================ */
.profile-body {
    overflow: hidden; /* contain the float */
}

.profile-photo-wrap {
    float: right;
    margin: 0 0 20px 28px;
    width: 160px;
    flex-shrink: 0;
}

.profile-photo-wrap img {
    width: 100%;
    height: auto;
    display: block;
    border: 2px solid var(--border);
    border-top: 3px solid var(--green);
}

@media (max-width: 520px) {
    .profile-photo-wrap {
        float: none;
        width: 120px;
        margin: 0 auto 20px;
    }
}

/* ============================================
   SITE LANGUAGE SWITCHER
   ============================================ */
.site-lang-switcher {
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 8px;
    border-right: 1px solid var(--border);
}
.site-lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.5;
    transition: opacity 0.15s;
    padding: 0;
    line-height: 1;
}
.site-lang-btn:hover,
.site-lang-btn.active {
    opacity: 1;
}

/* Base translation logic */
html.lang-en [data-i18n="hr"] { display: none !important; }
html.lang-hr [data-i18n="en"] { display: none !important; }
