:root {
    --primary: #ff5722; /* Deep Orange */
    --primary-dark: #e64a19;
    --metallic-dark: #263238;
    --metallic-medium: #37474f;
    --metallic-light: #eceff1;
    --text-main: #212121;
    --text-light: #cfd8dc;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --font-stack: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-stack);
    background-color: var(--metallic-light);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Layout & Grid --- */
.container {
    padding: 0 20px;
}

.main-content {
    flex: 1;
    padding: 40px;
    animation: fadeIn 0.5s ease-out;
}

/* --- Header --- */
.site-header {
    background: linear-gradient(135deg, var(--metallic-medium) 0%, var(--metallic-dark) 100%);
    color: var(--white);
    padding: 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--primary);
}

/* --- Menu --- */
.nav-links {
    display: flex;
    gap: 5px;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    font-weight: 600;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* --- Cards (Posty) - ZMODYFIKOWANE --- */
/* Zmiana z grid na flex-column, aby karty były na pełną szerokość */
.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid var(--metallic-medium);
    
    /* Gwarancja pełnej szerokości */
    width: 100%;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-top-color: var(--primary);
}

.card-body {
    padding: 30px; /* Zwiększony padding dla lepszego oddechu przy szerokim widoku */
}

.card-title a {
    color: var(--metallic-dark);
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 700;
    transition: color 0.2s;
}

.card-title a:hover {
    color: var(--primary);
}

.meta-info {
    font-size: 0.85rem;
    color: #757575;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Single Content Styling (Article & Page) --- */
.content-wrapper {
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.article-header {
    text-align: left;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.article-header h1 {
    color: var(--metallic-dark);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Stylizacja treści użytkownika (p, img, table, h1-h4) */
.user-content {
    font-size: 1.125rem;
    color: #333;
}

.user-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.user-content h2, .user-content h3, .user-content h4 {
    color: var(--metallic-medium);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.user-content h2 { font-size: 1.8rem; border-left: 4px solid var(--primary); padding-left: 15px; }
.user-content h3 { font-size: 1.5rem; }
.user-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.user-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 1rem;
}

.user-content table th, .user-content table td {
    border: 1px solid #ddd;
    padding: 12px;
}

.user-content table th {
    background-color: var(--metallic-medium);
    color: var(--white);
    text-align: left;
}

.user-content blockquote {
    border-left: 4px solid var(--primary);
    background: #f9f9f9;
    margin: 20px 0;
    padding: 15px 20px;
    font-style: italic;
}

/* --- Footer --- */
.site-footer {
    background: var(--metallic-dark);
    color: var(--text-light);
    text-align: center;
    padding: 30px 0;
    margin-top: auto;
}

.site-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* --- Auth Form --- */
.auth-box {
    max-width: 450px;
    margin: 40px auto;
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-top: 5px solid var(--primary);
}

.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--metallic-medium); }
.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s;
}
.form-control:focus {
    border-color: var(--primary);
    outline: none;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .navbar { flex-direction: column; height: auto; padding: 15px 0; }
    .nav-links { margin-top: 15px; flex-wrap: wrap; justify-content: center; }
    .article-header h1 { font-size: 1.8rem; }
    .content-wrapper { padding: 20px; }
    .card-body { padding: 20px; }
}