/* Reset i podstawy */
* { box-sizing: border-box; }
:root {
    --font-body: "Space Mono", Tahoma, Verdana, Arial, sans-serif;
    --font-heading: "Space Mono", "Times New Roman", Times, serif;
}
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    background-color: #f0f0f0;
    color: #333;
}

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

/* Layout - styl tabelkowy */
.container {
    width: calc(100% - 24px);
    max-width: 1160px;
    margin: 12px auto;
    background: #fff;
    padding: 16px;
}

/* Nagłówek */
header {
    margin-bottom: 20px;
}

.site-header {
    text-align: center;
}

.site-header .logo-wrap {
    text-align: center;
    padding: 10px 0 12px;
}

.site-header .logo {
    width: 280px;
    max-width: 100%;
    height: auto;
}

.nav-bar {
    background: #ddd;
    border: 2px solid #000;
    padding: 8px 10px;
    text-align: center;
}

.home-extras {
    background: #ddd;
    border: 2px solid #000;
    padding: 6px 10px;
    margin-top: 10px;
}

.home-extras-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
    padding: 2px 0;
}

.home-extras-row + .home-extras-row {
    margin-top: 2px;
}

.nav-bar a {
    margin: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    vertical-align: middle;
}

.nav-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: currentColor;
    shape-rendering: crispEdges;
}

h1 {
    font-family: var(--font-heading);
    margin: 0;
    font-size: 28px;
}

h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    margin: 0 0 12px;
}

h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

/* Linki - klasyczny niebieski */
a { color: #0000FF; text-decoration: underline; }
a:hover { color: #FF0000; }

.muted { color: #666; font-size: 12px; }

.alert {
    border: 2px solid #000;
    background: #fff;
    padding: 10px;
    margin: 10px 0;
}

.alert-error {
    border-color: #000;
}

.form-label {
    display: block;
    margin: 10px 0;
}

.form-input,
.form-textarea {
    width: 100%;
    border: 2px solid #000;
    padding: 8px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
}

.form-textarea { resize: vertical; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.editor-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 6px 0;
}

.editor-textarea {
    min-height: 420px;
}

.admin-image-preview {
    margin: 8px 0;
}

.admin-image-preview img {
    display: block;
    max-width: 320px;
    width: 100%;
    height: auto;
    border: 1px solid #ccc;
    background: #fff;
}

.admin-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border: 2px solid #000;
    background: #ddd;
    padding: 8px 10px;
    margin-bottom: 12px;
}

.inline-form { display: inline; margin: 0; }

.admin-list { margin-top: 10px; }

.admin-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: flex-start;
    border: 1px solid #ccc;
    background: #fafafa;
    padding: 10px;
    margin-bottom: 10px;
}

.admin-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.analytics-chart {
    border: 2px solid #000;
    background: #fff;
    padding: 10px;
    margin: 10px 0;
}

.analytics-chart-svg {
    display: block;
    width: 100%;
    height: 90px;
}

/* Lista postów */
.post-list { list-style: none; padding: 0; }
.post-item {
    border: 1px solid #ccc;
    margin-bottom: 10px;
    padding: 10px;
    background: #fafafa;
}

.post-title { font-weight: bold; font-size: 16px; }
.post-meta { font-size: 12px; color: #666; }

.post-featured-img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid #ccc;
    background: #fff;
}

.post-content p { margin: 10px 0; }
.post-content ul,
.post-content ol { margin: 10px 0 10px 22px; }

/* Pojedynczy post (responsywny układ) */
.post-layout {
    display: block; /* mobile-first: 1 kolumna */
}

.post-sidebar {
    margin: 0 0 12px;
}

.post-featured {
    margin: 10px 0 0;
}

@media (min-width: 860px) {
    .post-layout {
        display: flex;
        gap: 18px;
        align-items: flex-start;
    }

    .post-sidebar {
        flex: 0 0 300px;
        max-width: 300px;
        margin: 0;
        display: flex;
        flex-direction: column;
    }

    /* Na desktopie: zdjęcie nad datą (czytelniej w lewym słupku) */
    .post-sidebar .post-featured { order: 1; margin: 0 0 8px; }
    .post-sidebar .post-meta { order: 2; }

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

    /* Węższa kolumna treści = lepsza czytelność */
    .post-main .post-content {
        max-width: 720px;
    }
}

/* Strona główna */
.intro-box {
    border: 2px solid #000;
    background: #fafafa;
    padding: 14px;
    margin-bottom: 18px;
}

.intro-title {
    margin: 0 0 12px;
}

.intro-grid {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.intro-photo {
    flex: 0 0 220px;
    max-width: 220px;
}

.intro-text {
    flex: 1 1 auto;
}

.tech-made-eu {
    margin-top: 10px;
    border: 2px solid #000;
    background: #fff;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
    font-size: clamp(10px, 2.6vw, 13px);
    line-height: 1.2;
}

.tech-made-eu-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.eu-flag {
    flex: 0 0 auto;
    font-size: clamp(12px, 3.4vw, 18px);
    line-height: 1;
}

.tech-made-eu-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tech-made-eu-right {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: nowrap;
}

.tech-app {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: clamp(68px, 22vw, 150px);
}

.tech-app-icon {
    width: clamp(14px, 4.2vw, 22px);
    height: clamp(14px, 4.2vw, 22px);
    border: 0;
    background: transparent;
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
}

.tech-app-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tech-icon {
    width: clamp(14px, 4.2vw, 22px);
    height: clamp(14px, 4.2vw, 22px);
    border: 2px solid #000;
    background: #fff;
    display: inline-block;
    flex: 0 0 auto;
}

.latest-posts {
    margin-top: 8px;
}

.latest-list {
    margin-top: 6px;
}

.post-row {
    display: flex;
    gap: 12px;
    border: 1px solid #ccc;
    background: #fafafa;
    padding: 10px;
    margin-bottom: 10px;
}

.post-thumb {
    flex: 0 0 140px;
    max-width: 140px;
}

.post-thumb img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #ccc;
    background: #fff;
}

.post-body {
    flex: 1 1 auto;
}

.post-excerpt {
    margin: 0;
}

.latest-cta {
    margin: 12px 0 0;
    text-align: center;
}

.pagination {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.page-center {
    text-align: center;
}

/* Stopka */
footer {
    margin-top: 20px;
    border-top: 2px solid #000;
    padding-top: 10px;
    font-size: 12px;
    text-align: center;
}

/* Przyciski retro */
.btn {
    display: inline-block;
    padding: 5px 10px;
    background: #ddd;
    border: 2px outset #fff;
    cursor: pointer;
    text-decoration: none;
    color: #000;
}
.btn:active { border-style: inset; }

@media (max-width: 480px) {
    body { font-size: 13px; }
    .container { padding: 12px; }
    h1 { font-size: 22px; }
    h2 { font-size: 20px; }
    .nav-bar a { margin: 4px 8px; }
    .intro-grid { flex-direction: column; }
    .intro-photo { max-width: none; }
    .post-row { flex-direction: column; }
    .post-thumb { max-width: none; }
    .admin-row { flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; }

    .tech-made-eu { padding: 5px 6px; gap: 8px; }
    .tech-made-eu-left { gap: 6px; }
    .tech-made-eu-right { gap: 4px; }

    .tech-made-eu { align-items: flex-start; }
    .tech-made-eu-left { align-items: flex-start; }

    .tech-made-eu-text {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .tech-app { gap: 0; max-width: none; }
    .tech-app-name { display: none; }
}