/* Update background and layout */
.blog-body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.header-hidden {
    transform: translateY(-100%);
}

.back-button {
    color: var(--text-primary);
    font-size: 1.2em;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-button:hover {
    color: var(--text-secondary);
    opacity: 0.7;  /* Add opacity for dimming effect */
}

.back-button i {
    transition: opacity 0.3s ease;  /* Smooth transition for icon */
}

.back-button:hover i {
    opacity: 0.7;  /* Dim the icon on hover */
}

.back-button .hover-text {
    font-size: 0.9em;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: normal;
    color: var(--text-secondary);
}

.back-button:hover .hover-text {
    opacity: 1; /* Show the text on hover */
}

.blog-title {
    font-size: 1.5em;
    font-weight: 500;
    color: var(--heading-color);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-decoration: none;  /* Remove underline */
    transition: opacity 0.2s ease;  /* Smooth hover effect */
}

.blog-title:hover {
    opacity: 0.8;  /* Subtle hover effect */
}

.placeholder {
    display: none;
}

.blog-wrapper {
    max-width: 1200px;
    margin: 20px auto 0; /* Reduced from 40px to 20px to move higher */
    padding: 20px 40px; /* Match the padding with header and footer */
    display: flex;
    justify-content: flex-start;
}

.blog-content {
    width: 100%;
    max-width: 500px;
    margin-left: 0; /* Remove left margin to align with the arrow */
    padding-left: 0; /* Ensure no extra padding */
}

.blog-content h1 {
    font-size: 2.5em;
    margin-bottom: 20px;  /* Reduced from 40px to 20px */
    color: var(--heading-color);
    text-align: left;
    padding-right: 0;
}

.blog-grid {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align items to the left */
    padding-right: 0; /* Remove previous padding */
}

.blog-post {
    width: 100%;
    background: var(--bg-secondary);
    padding: 15px 25px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
    color: inherit;
    text-decoration: none;
}

.blog-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
    text-decoration: none;
}

.blog-post h2 {
    color: var(--heading-color);
    font-size: 1.5em;
    margin: 0 0 15px 0;  /* Reset top margin, keep bottom margin */
    text-decoration: none;
}

.post-meta {
    color: #666666;
    font-size: 0.9em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.post-meta span {
    position: relative;
}

.post-meta span:not(:first-child)::before {
    content: "•";
    position: absolute;
    left: -10px;
}

.excerpt {
    color: #444444;
    line-height: 1.6;
}

.read-more {
    color: #333333;
    text-decoration: none;
}

/* Scrollbar styling */
.middle {
    height: calc(100vh - 160px);
    overflow-y: auto;
}

.middle::-webkit-scrollbar {
    width: 6px;
}

.middle::-webkit-scrollbar-track {
    background: transparent;
}

.middle::-webkit-scrollbar-thumb {
    background: #cccccc;
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-content h1 {
        font-size: 2em;
    }
}

/* Bottom footer styling */
.bottom-footer {
    background: var(--bg-secondary);
    position: fixed;  /* Match other pages */
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 40px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-icons-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-right: 0;  /* Remove any right margin */
    padding-right: 0;  /* Remove any right padding */
}

/* Remove blog-platforms specific styles */
.blog-platforms {
    display: none;
}

/* Update the circle base styling */
.circle {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background-color: var(--icon-bg);
    border-radius: 50%;
    transition: all 0.3s ease;
    color: var(--icon-color);
    text-decoration: none;
}

/* Platform-specific gradients */
.circle.medium:hover {
    background: linear-gradient(135deg, #12100E, #333333);
    color: white;
    transform: translateY(-2px);
}

.circle.substack:hover {
    background: linear-gradient(135deg, #FF6719, #FF4000);
    color: white;
    transform: translateY(-2px);
}

/* Update text colors to be more gray */
.blog-platforms strong {
    color: #333333;
}

.copyright {
    display: flex;
    flex-direction: column;
    align-items: flex-start;  /* Back to left alignment */
    gap: 5px;
}

.copyright strong {
    color: var(--heading-color);
}

.copyright span {
    color: var(--text-secondary);
}

/* Language tag styling */
.tag {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85em;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: #666666;
}

.tag.polish {
    background-color: #f5f5f5;
    color: #555555;
}

/* Remove underline from links */
.blog-grid a {
    text-decoration: none;
}

/* Update social icons grid for blog environment */
.blog-platforms .social-icons {
    display: flex; /* Change from grid to flex */
    gap: 12px; /* Keep the same gap */
    align-items: center;
}

.top-footer {
    padding: 15px 40px;
}

.bottom-footer {
    padding: 15px 40px;
}

.nav-icons {
    display: flex;
    gap: 15px;
    margin-left: 20px;
    align-items: center;  /* Center items vertically */
}

.nav-icon {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.nav-icon:hover {
    color: var(--text-secondary);
}

.search-icon {
    margin-right: 0;  /* Remove the extra spacing */
}

/* Theme toggle button styles */
.theme-toggle {
    position: relative;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px 0 8px 28px;
    font-size: 1.2em;
    margin-left: 10px;
    transition: opacity 0.2s ease;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 1px;
    background-color: var(--border-color);
}

.theme-toggle:hover {
    opacity: 0.8;
}

/* Blog specific footer styles */
.blog-body .bottom-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.blog-body .copyright {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.blog-body .social-links {
    display: flex;
    justify-content: flex-start;
    gap: 40px;
}

.metadata {
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-hover);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    width: fit-content;
    user-select: text;  /* Make text selectable */
    pointer-events: none;  /* Prevent link behavior */
    color: var(--text-primary);
}

.metadata span {
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    color: inherit;  /* Keep the text color */
}

.metadata .dot {
    margin: 0 4px;
    color: var(--text-primary);
}

.circle.substack {
    margin-right: 0;  /* Remove any right margin */
    padding-right: 0;  /* Remove any right padding */
}

/* Search overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);  /* Dimmed background */
    backdrop-filter: blur(5px);       /* Blur effect */
    -webkit-backdrop-filter: blur(5px); /* For Safari */
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.search-overlay.active {
    display: block;
    opacity: 1;
}

.search-overlay.active .search-container {
    transform: translateY(0);
}

.search-results {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    padding: 0 10px;
    min-height: 0;  /* Remove minimum height */
    display: none;  /* Hide when empty */
}

.search-results:not(:empty) {
    display: block;  /* Show only when there are results */
    margin-top: 10px;  /* Add some space between search input and results */
}

/* Adjust container padding when empty */
.search-container {
    max-width: 600px;
    margin: 100px auto 0;
    background: var(--bg-secondary);  /* Use theme variable */
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 10px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 0;
    padding: 5px 10px;
    height: 30px;  /* Reduced from 40px to 30px */
    position: relative;
}

.search-input-group {
    display: flex;
    align-items: center;  /* Center vertically */
    flex: 1;
    position: relative;
}

.search-input-group::before {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #999;  /* Match the color of placeholder and X icon */
    font-size: 0.9em;
    margin-right: 8px;
    display: flex;
    align-items: center;
    height: 30px;
}

#searchInput {
    flex: 1;
    width: calc(100% - 40px);
    padding: 0 0 0 25px;
    font-size: 1.1em;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);  /* Use theme variable */
    margin: 2px 0 0 0;  /* Add tiny top margin */
    height: 30px;
    line-height: 30px;
}

/* Add search icon */
.search-header::before {
    content: '\f002';  /* FontAwesome search icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 0.9em;
    z-index: 1;
}

#searchInput::placeholder {
    color: #999;  /* Keep this color */
}

.close-search {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.1em;
    color: #999;  /* Keep this color */
    cursor: pointer;
    transition: color 0.2s ease;
}

/* Search results styling */
.search-result-item {
    display: block;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: var(--bg-hover);  /* Use theme variable */
}

.search-result-item h3 {
    margin: 0 0 5px 0;
    color: var(--heading-color);  /* Use theme variable */
    font-size: 1.1em;
}

.search-result-metadata {
    font-size: 0.85em;
    color: var(--text-secondary);  /* Use theme variable */
}