/* 
   ==========================================================================
   1. FUNDAMENTY I DESIGN SYSTEM
   ========================================================================== 
*/

:root {
    --color-background: #FFFFFF;
    --color-text: #0F0F0F;
    --color-text-secondary: #4A4A4A;
    --color-accent: #0A2342; /* Granat */
    --color-border: #EDEDED;
    --color-section-bg: #F7F7F7;

    --content-width: 1180px;
    --spacing-unit: 8px;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    font-size: 18px;
    line-height: 1.7;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3); /* 24px */
}

h1, h2, h3, h4 {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

h1 { font-size: clamp(2.5rem, 5vw, 3.75rem); /* 40-60px */ }
h2 { font-size: clamp(2rem, 4vw, 2.25rem); /* 32-36px */ }
h3 { font-size: clamp(1.5rem, 3vw, 1.625rem); /* 24-26px */ }

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    text-decoration: underline;
}

/* 
   ==========================================================================
   2. NAGŁÓWEK (HEADER)
   ========================================================================== 
*/

/* Reading Progress Bar */
#reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1000;
}

#reading-progress-bar {
    height: 100%;
    background: var(--color-accent);
    width: 0%;
    transition: width 0.1s;
}

.main-header {
    background-color: var(--color-background);
    height: 72px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo a {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-text);
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* Logo Styles - Mobile First */
.logo img.logo-desktop {
    display: none; /* Hidden on mobile by default */
}

.logo-mobile {
    display: block; /* Visible on mobile by default */
    font-weight: 700;
    font-size: 20px;
    text-transform: uppercase;
    color: var(--color-text);
    letter-spacing: 1px;
}

@media (min-width: 769px) {
    .logo img.logo-desktop {
        display: block;
        max-height: 50px;
        width: auto;
    }
    .logo-mobile {
        display: none;
    }
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: calc(var(--spacing-unit) * 4); /* 32px */
}

.main-nav a {
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    position: relative;
    padding-bottom: 4px;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

/* Dropdown Menu */
.main-nav .has-dropdown {
    position: relative;
}
.main-nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--color-background);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 0 0 8px 8px;
    padding: var(--spacing-unit) 0;
    min-width: 200px;
    z-index: 101;
    list-style: none;
}
.main-nav .has-dropdown:hover .dropdown-menu {
    display: block;
}
.dropdown-menu li a {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2.5);
    display: block;
    white-space: nowrap;
}
.dropdown-menu li a::after {
    content: none; /* Remove underline effect from dropdown items */
}
.dropdown-menu li a:hover {
    background-color: var(--color-section-bg);
}

.header-actions .search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
}

.mobile-nav-toggle { display: none; }

/* 
   ==========================================================================
   3. SEKCJE GŁÓWNE I KARTY
   ========================================================================== 
*/

.section {
    padding: calc(var(--spacing-unit) * 10) 0; /* 80px */
}

.hero-section {
    text-align: center;
    padding: calc(var(--spacing-unit) * 15) 0; /* 120px */
}

.hero-section h1 {
    max-width: 800px;
    margin: 0 auto;
}

.hero-section .subtitle {
    font-size: 20px;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: calc(var(--spacing-unit) * 3) auto;
}

.hero-section .divider {
    width: 100px;
    height: 2px;
    background-color: var(--color-border);
    margin: calc(var(--spacing-unit) * 4) auto;
}

.btn {
    display: inline-block;
    background-color: var(--color-accent);
    color: #fff;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4); /* 16px 32px */
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-decoration: none;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: calc(var(--spacing-unit) * 4); /* 32px */
}

.post-card {
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.post-card-thumbnail img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.post-card-content {
    padding: calc(var(--spacing-unit) * 3); /* 24px */
}

.post-card-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #003366; /* Darker accent for contrast */
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.post-card-title {
    font-size: 22px;
    margin: 0 0 calc(var(--spacing-unit) * 1.5) 0;
}

.post-card-title a {
    color: var(--color-text);
}

.post-card-excerpt {
    color: var(--color-text-secondary);
    font-size: 16px;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.post-card-meta {
    font-size: 14px;
    color: #555; /* Darker for contrast */
    font-weight: 500;
}

/* -- Style dla treści wpisu (np. tabele) -- */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 16px;
}
.post-content th,
.post-content td {
    border: 1px solid var(--color-border);
    padding: 12px;
    text-align: left;
}
.post-content th {
    background-color: var(--color-section-bg);
    font-weight: bold;
}
.post-content tr:nth-child(even) {
    background-color: var(--color-section-bg);
}

/* 
   ==========================================================================
   4. STOPKA (FOOTER)
   ========================================================================== 
*/

.main-footer {
    background-color: var(--color-text);
    color: #fff;
    padding: calc(var(--spacing-unit) * 8) 0;
    font-size: 16px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: calc(var(--spacing-unit) * 5);
    margin-bottom: calc(var(--spacing-unit) * 6);
}

.footer-column .footer-title {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    color: #fff;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.footer-column p, .footer-column ul {
    color: #FFFFFF;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-footer a {
    color: #FFFFFF;
    opacity: 0.9;
    transition: opacity 0.2s ease-in-out;
}

.main-footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-column ul li {
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: calc(var(--spacing-unit) * 3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #aaa;
}

.footer-bottom ul {
    display: flex;
    gap: calc(var(--spacing-unit) * 3);
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 
   ==========================================================================
   SEKCJE STRONY GŁÓWNEJ
   ========================================================================== 
*/

.featured-post-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing-unit) * 5);
    align-items: center;
}
.featured-post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}
.featured-post-content h2 {
    font-size: 16px;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    letter-spacing: 1px;
}
.featured-post-content h3 {
    font-size: 32px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: calc(var(--spacing-unit) * 4);
}
.category-card {
    border: 1px solid var(--color-border);
    padding: calc(var(--spacing-unit) * 4);
    border-radius: 8px;
}
.category-card a {
    font-weight: bold;
}

.about-me-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 40px;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}
.about-me-image img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.about-me-content h2 { margin-top: 0; font-size: 2rem; }

.newsletter-form {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.newsletter-form input {
    flex-grow: 1;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 16px;
}

/* 
   ==========================================================================
   ANIMACJE I EFEKTY
   ========================================================================== 
*/

.fade-in-section {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.fade-in-section.visible {
    opacity: 1;
}

.category-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

/* 
   ==========================================================================
   5. RESPONSYWNOŚĆ
   ========================================================================== 
*/

@media (max-width: 768px) {
    .main-nav { display: none; } /* Ukryj nawigację na mobile */
    .mobile-nav-toggle { display: block; } /* Pokaż przycisk hamburgera */
    
    .logo-desktop { display: none !important; }
    .logo-mobile { display: block; }

    .featured-post-card, .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .about-me-grid {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: calc(var(--spacing-unit) * 2);
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    cursor: default;
}

/* Contrast Fixes */
.post-meta-top {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: #333; /* Darker for contrast */
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.post-category-badge {
    background: #003366; /* Darker blue for contrast */
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
}
.post-category-badge:hover {
    background: #002244; /* Darker hover */
}

.social-share a {
    color: #111; /* Darker text */
}
.post-updated-date { 
    font-size: 12px; 
    color: #222; /* Very dark for max contrast */ 
    font-weight: 700;
}
