/*
Theme Name: SpaceVibe
Theme URI: https://spacevibe.space
Author: SpaceVibe Team
Description: Kosmiczny motyw WordPress stworzony specjalnie dla spacevibe.space.
Version: 1.0
Text Domain: spacevibe
*/

:root {
    --neon-color: #00f3ff;
    --neon-rgb: 0, 243, 255;
    --neon-alt-color: #9d00ff;
    --neon-alt-rgb: 157, 0, 255;
}

body {
    background-color: #0b0d17; /* Głęboka kosmiczna czerń/granat */
    color: #e0e0e0; /* Jasnoszary tekst dla kontrastu */
    font-family: 'Space Grotesk', sans-serif;
    margin: 0;
    padding: 0;
}

/* Pasek postępu czytania */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--neon-color), var(--neon-alt-color));
    z-index: 10001;
    transition: width 0.1s ease;
}

/* Podstawowa struktura */
.site-header, .site-main, .site-footer, .site-front-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1; /* Aby treść była nad animacją gwiazd */
}

/* Header i Menu */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(11, 13, 23, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000; /* Header musi być nad overlayem */
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.header-search .search-form-wrapper {
    margin-top: 0;
}

.header-search .search-field {
    padding: 10px 20px;
    max-width: 200px;
    font-size: 0.9rem;
}

.header-search .search-submit {
    padding: 10px 20px;
    font-size: 0.8rem;
}

.site-branding a {
    color: #fff;
    text-decoration: none;
}

/* Stylizacja graficznego Logo */
.site-branding .custom-logo {
    max-width: 220px;
    height: auto;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.site-branding .custom-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px var(--neon-color));
}

/* Stylizacja tekstowego tytułu i opisu (gdy brak logo) */
.site-branding h1 {
    margin: 0;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.site-branding p {
    margin: 5px 0 0 0;
    font-size: 0.85rem;
    color: var(--neon-color);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    color: var(--neon-color); /* Turkusowy neon w kosmicznym klimacie */
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: var(--neon-alt-color); /* Fioletowy efekt hover */
}

/* Menu Mobilne (Hamburger) */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--neon-color);
    color: var(--neon-color);
    font-size: 1.5rem;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.menu-toggle:hover {
    background: var(--neon-color);
    color: #0b0d17;
}

/* Overlay Menu Mobilnego */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 999; /* Pod headerem, nad resztą strony */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.menu-open {
    overflow: hidden; /* Blokada przewijania tła gdy menu jest otwarte */
}

/* Kafelki postów z efektem Glassmorphism */
.site-main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding-top: 50px;
}

.post-card {
    background: #121526; /* Solidny, redakcyjny granat */
    padding: 20px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-thumbnail {
    margin-bottom: 15px;
    border-radius: 4px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    aspect-ratio: 16 / 9; /* Magazynowe, równe proporcje niezależnie od urządzenia */
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border-color: rgba(var(--neon-rgb), 0.3);
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05); /* Delikatny zoom na hover */
}

.post-card h2 a, .post-card h3 a {
    color: #fff;
    text-decoration: none;
}

/* Plakietka kategorii (Badge) */
.news-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 10px;
    background: rgba(var(--neon-rgb), 0.1);
    border: 1px solid var(--neon-color);
    color: var(--neon-color);
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 2px;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

/* Tło Particles (Gwiazdy) */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: -1;
    opacity: 0.2; /* Przygaszenie gwiazd, by nie odwracały uwagi */
}

/* --- Strona Główna (Front Page) --- */

/* Pasek Flash News */
.news-ticker-container {
    display: flex;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(var(--neon-rgb), 0.3);
    border-radius: 5px;
    margin-bottom: 40px;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.ticker-badge {
    background: var(--neon-alt-color);
    color: #fff;
    padding: 12px 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2;
    white-space: nowrap;
}

.ticker-badge::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    animation: space-pulse 1.5s infinite;
}

.ticker-content {
    flex: 1;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.ticker-scroll {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%; /* Zaczyna poza ekranem po prawej */
    animation: ticker-scroll 25s linear infinite;
}

.ticker-scroll:hover {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.ticker-scroll a {
    color: #e0e0e0;
    text-decoration: none;
    margin-right: 50px;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.ticker-scroll a:hover {
    color: var(--neon-color);
}

.ticker-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--neon-color);
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* Wyróżniony News (Główny Temat) */
.featured-news-hero {
    position: relative;
    padding: 80px 40px;
    display: flex;
    align-items: flex-end;
    min-height: 500px;
    border-radius: 4px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 60px;
}

.featured-news-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(11, 13, 23, 0.95) 10%, rgba(11, 13, 23, 0.2) 100%);
    z-index: 0;
}

.hero-overlay {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.hero-title a:hover {
    color: var(--neon-color);
}

.hero-excerpt {
    font-size: 1.2rem;
    color: #b0b0b0;
    margin-bottom: 40px;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    padding: 15px 35px;
    color: var(--neon-color);
    background-color: rgba(var(--neon-rgb), 0.1);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 2px solid var(--neon-color);
    border-radius: 4px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: var(--neon-color);
    color: #0b0d17;
}

.latest-posts-section {
    padding: 50px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: #fff;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* --- Pojedynczy Wpis (Single Post) --- */
.single-post-content, .page-content {
    background: #121526;
    padding: 40px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 900px;
    margin: 0 auto; /* Wyśrodkowanie wpisu na dużych ekranach */
}

.single-post-thumbnail, .page-thumbnail {
    margin-bottom: 30px;
    border-radius: 4px;
    overflow: hidden;
}

.single-post-thumbnail img, .page-thumbnail img {
    width: 100%;
    max-height: 500px; /* Blokada przed gigantycznymi zdjęciami (szczególnie pionowymi) */
    object-fit: cover; /* Chroni przed spłaszczeniem zdjęcia po ucięciu */
    display: block;
}

.entry-title {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #fff;
}

.entry-meta {
    color: #b0b0b0;
    font-size: 0.95rem;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.entry-content {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.8;
    font-size: 1.15rem;
    color: #e0e0e0;
}

.entry-content h2, .entry-content h3 {
    color: var(--neon-color);
    margin-top: 40px;
}

.entry-content a {
    color: var(--neon-alt-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.entry-content a:hover {
    color: var(--neon-color);
}

/* --- Klasy wyrównywania obrazków WordPress (Core Alignments) --- */
.alignleft {
    float: left;
    margin: 0.5em 2em 2em 0;
    max-width: 100%;
}

.alignright {
    float: right;
    margin: 0.5em 0 2em 2em;
    max-width: 100%;
}

.aligncenter {
    display: block;
    margin: 1em auto 2em auto;
}

.alignnone {
    margin-bottom: 2em;
    display: block;
}

/* Czyszczenie opływania (Clearfix) by zdjęcia nie psuły layoutu na dole wpisu */
.entry-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Podpisy pod zdjęciami (Captions) */
.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--neon-color);
    margin-top: 10px;
    font-style: italic;
}

/* --- Paginacja (Stronicowanie wpisów) --- */
.pagination {
    width: 100%;
    text-align: center;
    margin-top: 50px;
    grid-column: 1 / -1; /* Rozciągnięcie na całą szerokość siatki wpisów */
}

.nav-links {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a, .nav-links span {
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-links a:hover {
    background: rgba(var(--neon-rgb), 0.2);
    border-color: var(--neon-color);
    color: var(--neon-color);
}

.nav-links .current {
    background: var(--neon-alt-color);
    border-color: var(--neon-alt-color);
    color: #fff;
    font-weight: bold;
}

/* --- Przyklejona nawigacja (Poprzedni/Następny wpis) --- */
body.single {
    padding-bottom: 80px; /* Rezerwuje miejsce na dolny pasek, by nie zakrywał stopki */
}

.sticky-post-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(11, 13, 23, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(var(--neon-rgb), 0.3);
    display: flex;
    justify-content: space-between;
    z-index: 990;
    padding: 15px 5%;
    transform: translateY(100%);
    animation: slideUpNav 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.5s;
}

@keyframes slideUpNav {
    to { transform: translateY(0); }
}

.sticky-post-nav a {
    display: flex;
    flex-direction: column;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    max-width: 250px;
}

.sticky-post-nav .nav-next {
    text-align: right;
    margin-left: auto;
}

.sticky-post-nav .nav-label {
    font-size: 0.75rem;
    color: var(--neon-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.sticky-post-nav .nav-title {
    font-size: 0.95rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sticky-post-nav a:hover .nav-title {
    color: var(--neon-alt-color);
}

body.single .back-to-top {
    bottom: 100px; /* Podniesienie przycisku nad pasek nawigacji */
}

/* --- Widżety i Stopka --- */
.site-footer {
    margin-top: 60px;
    background: linear-gradient(to bottom, transparent, rgba(var(--neon-rgb), 0.03));
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Wymuszenie 3 równych kolumn na PC */
    gap: 40px;
    margin-bottom: 40px;
    padding-top: 40px;
}

.widget-title {
    color: var(--neon-color);
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Pod-stopka (Sub-Footer) --- */
.site-sub-footer {
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px 20px;
    position: relative;
    z-index: 2;
}

.sub-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.site-info {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Menu w stopce */
.footer-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

.footer-navigation a {
    color: #b0b0b0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-navigation a:hover {
    color: var(--neon-color);
}

/* Ikony Social Media w stopce */
.footer-socials {
    display: flex;
    gap: 15px;
}

.footer-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--neon-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.footer-socials a:hover {
    background: var(--neon-color);
    color: #0b0d17;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(var(--neon-rgb), 0.5);
}

/* --- Komentarze --- */
.comments-area {
    background: #121526;
    padding: 40px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 50px auto 0;
    max-width: 900px;
}

.comments-title, .comment-reply-title {
    color: var(--neon-color);
    font-size: 1.8rem;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list li.comment {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.comment-list .children {
    margin-left: 40px;
    margin-top: 20px;
    list-style: none;
    padding: 0;
}

.comment-author img {
    border-radius: 50%;
    float: left;
    margin-right: 15px;
    border: 2px solid var(--neon-alt-color);
}

.comment-author b {
    color: #fff;
    font-size: 1.1rem;
}

.comment-metadata {
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.comment-metadata a, .comment-content p {
    color: #b0b0b0;
}

/* Formularz komentarzy */
.comment-form label {
    display: block;
    color: #b0b0b0;
    margin-bottom: 5px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--neon-color);
    outline: none;
}

.submit-comment {
    background: transparent;
    cursor: pointer;
}

/* --- Przycisk Powrót do góry --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(var(--neon-rgb), 0.1);
    border: 1px solid var(--neon-color);
    border-radius: 4px;
    color: var(--neon-color);
    font-size: 24px;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--neon-color);
    color: #0b0d17;
    transform: translateY(-5px);
}

/* --- Wyszukiwarka (Search) --- */
.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.page-title {
    font-size: 2.5rem;
    color: #fff;
}

.archive-description {
    color: #b0b0b0;
    font-size: 1.1rem;
    margin-top: 10px;
}

.search-query-highlight {
    color: var(--neon-color);
    font-style: italic;
}

.search-form-wrapper {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.search-field {
    padding: 15px 25px;
    width: 100%;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-field:focus {
    border-color: var(--neon-color);
    outline: none;
}

.no-results {
    text-align: center;
    background: #121526;
    padding: 40px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Przycisk zmiany trybu (Jasny/Ciemny) --- */
.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--neon-color);
    color: var(--neon-color);
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle-btn:hover {
    background: var(--neon-color);
    color: #0b0d17;
}

/* --- Tryb Jasny (Astro / Space Station Mode) --- */
body.light-mode {
    background-color: #f0f3f8; /* Chłodny, laboratoryjny odcień */
    color: #2c3140; /* Głęboki granat zamiast smolistej czerni */
    background-image: radial-gradient(circle at 50% 0%, rgba(var(--neon-rgb), 0.05) 0%, transparent 70%);
}

body.light-mode .site-header {
    background: rgba(255, 255, 255, 0.75);
    border-bottom: 1px solid rgba(var(--neon-rgb), 0.3);
}

body.light-mode .post-card, body.light-mode .single-post-content,
body.light-mode .page-content, body.light-mode .comments-area,
body.light-mode .sidebar-module, body.light-mode .author-box,
body.light-mode .category-card, body.light-mode .no-results,
body.light-mode .apod-container,
body.light-mode .sticky-post-nav,
body.light-mode .search-field, body.light-mode .space-contact-form input,
body.light-mode .space-contact-form textarea, body.light-mode .comment-form input,
body.light-mode .comment-form textarea {
    background: #ffffff; /* Czysta biel w trybie jasnym na kartach wpisów */
    border-color: rgba(var(--neon-rgb), 0.3); /* Zachowujemy turkusowe neony w ramkach! */
    color: #2c3140;
}

body.light-mode .post-card:hover, body.light-mode .category-card:hover {
    border-color: var(--neon-alt-color);
    box-shadow: 0 10px 30px rgba(var(--neon-alt-rgb), 0.15);
}

body.light-mode .site-branding a, body.light-mode .post-card h2 a,
body.light-mode .post-card h3 a, body.light-mode .entry-title,
body.light-mode .page-title, body.light-mode .section-title,
body.light-mode .hero-title a, body.light-mode .related-posts-section .post-card h4 a,
body.light-mode .newsletter-content h2, body.light-mode .comment-author b,
body.light-mode .sticky-post-nav .nav-title {
    color: #0b0d17;
}

body.light-mode .news-ticker-container { background: rgba(255, 255, 255, 0.8); border-color: rgba(var(--neon-rgb), 0.4); }
body.light-mode .ticker-scroll a { color: #2c3140; }
body.light-mode .ticker-scroll a:hover { color: var(--neon-alt-color); }

body.light-mode .hero-excerpt, body.light-mode .entry-meta,
body.light-mode .apod-desc,
body.light-mode .archive-description, body.light-mode .author-info p, body.light-mode .share-label,
body.light-mode .site-info { color: #5a6270; }

body.light-mode #particles-js { filter: invert(1); opacity: 0.05; } /* Delikatniejsze "punkty danych" z tyłu */
body.light-mode .site-sub-footer { background: rgba(255, 255, 255, 0.6); border-color: rgba(var(--neon-rgb), 0.2); }
body.light-mode .site-footer { background: linear-gradient(to bottom, transparent, rgba(var(--neon-rgb), 0.05)); }

/* Przycisk zmiany trybu w Light Mode */
body.light-mode .theme-toggle-btn { background: rgba(255, 255, 255, 0.8); color: var(--neon-alt-color); border-color: var(--neon-alt-color); }
body.light-mode .theme-toggle-btn:hover { background: var(--neon-alt-color); color: #fff; }

/* Paginacja */
body.light-mode .nav-links a { color: #2c3140; border-color: rgba(var(--neon-rgb), 0.3); background: rgba(255, 255, 255, 0.5); }
body.light-mode .nav-links a:hover { background: rgba(var(--neon-rgb), 0.1); color: var(--neon-alt-color); border-color: var(--neon-alt-color); }

/* Przyciski i akcenty przechodzą na fioletowy neon (lepsza czytelność) */
body.light-mode ::selection { background: var(--neon-alt-color); color: #fff; }
body.light-mode .cta-button { color: var(--neon-alt-color); border-color: var(--neon-alt-color); background: rgba(255,255,255, 0.5); }
body.light-mode .cta-button:hover { background: var(--neon-alt-color); color: #fff; }

/* Menu w trybie jasnym */
body.light-mode .main-navigation a { color: #2c3140; }
body.light-mode .main-navigation a:hover { color: var(--neon-alt-color); }
body.light-mode .main-navigation ul ul { background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(var(--neon-rgb), 0.3); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
body.light-mode .main-navigation ul ul a:hover { background: rgba(var(--neon-rgb), 0.1); }

/* Linki w tekście i widżety */
body.light-mode .entry-content a { color: var(--neon-alt-color); font-weight: bold; }
body.light-mode .entry-content a:hover { color: var(--neon-color); }
body.light-mode .widget-title { color: var(--neon-alt-color); }

/* --- Formularz Kontaktowy --- */
.contact-form-wrapper {
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

.space-contact-form .form-group {
    margin-bottom: 25px;
}

.space-contact-form label {
    display: block;
    color: #b0b0b0;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.space-contact-form input[type="text"],
.space-contact-form input[type="email"],
.space-contact-form textarea {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
    font-family: system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.space-contact-form input:focus,
.space-contact-form textarea:focus {
    border-color: var(--neon-color);
    outline: none;
}

.submit-contact {
    background: transparent;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

.submit-contact:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    animation: space-pulse 1.5s infinite;
}

@keyframes space-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

.contact-notice {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: bold;
}

.contact-notice.success {
    background: rgba(var(--neon-rgb), 0.1);
    border: 1px solid var(--neon-color);
    color: var(--neon-color);
}

.contact-notice.error {
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid #ff0055;
    color: #ff0055;
}

/* --- Powiązane Wiadomości (Related Posts) --- */
.related-posts-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.related-title {
    color: var(--neon-color);
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
}

.related-posts-section .post-card h4 {
    margin: 0;
    font-size: 1.2rem;
}

.related-posts-section .post-card h4 a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-posts-section .post-card h4 a:hover {
    color: var(--neon-color);
}

/* --- Kafelki Kategorii (Eksploruj Galaktykę) --- */
.explore-categories {
    padding: 20px 0 60px 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    background: #121526;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.category-card h3 {
    margin: 0 0 10px 0;
    color: var(--neon-color);
    font-size: 1.3rem;
}

.category-card .post-count {
    color: #b0b0b0;
    font-size: 0.9rem;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-alt-color);
    box-shadow: 0 10px 20px rgba(var(--neon-alt-rgb), 0.2);
}

/* --- Kosmiczny Newsletter --- */
.newsletter-section {
    background: linear-gradient(135deg, rgba(var(--neon-rgb), 0.1) 0%, rgba(var(--neon-alt-rgb), 0.1) 100%);
    border: 1px solid rgba(var(--neon-rgb), 0.3);
    border-radius: 4px;
    padding: 60px 20px;
    text-align: center;
    margin: 60px 0;
}

.newsletter-content h2 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 15px;
}

.newsletter-content p {
    color: #e0e0e0;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 30px auto;
}

.newsletter-form {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* --- Social Share (Udostępnianie) --- */
.social-share-module {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-label {
    color: #b0b0b0;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.share-btn {
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.share-btn:hover { opacity: 0.8; transform: translateY(-2px); }
.share-btn.fb { background-color: #1877f2; }
.share-btn.tw { background-color: #000; border: 1px solid rgba(255, 255, 255, 0.3); }

/* --- O Autorze (Author Box) --- */
.author-box {
    margin-top: 50px;
    padding: 30px;
    background: #121526;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.author-box:hover {
    transform: translateY(-5px);
    border-color: rgba(var(--neon-rgb), 0.3);
}

.author-avatar img {
    border-radius: 50%;
    border: 2px solid var(--neon-color);
}

.author-info h4 {
    margin: 0 0 10px 0;
    color: var(--neon-color);
    font-size: 1.3rem;
}

.author-info p {
    margin: 0;
    color: #b0b0b0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* --- Układ z paskiem bocznym (Sidebar) --- */
.single-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
}

/* --- Animacje przewijania (Scroll Reveal) --- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.primary-content {
    min-width: 0; /* Zapobiega wypychaniu grida przez szerokie elementy */
}

.sidebar-module {
    background: #121526;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 30px 20px;
    position: sticky;
    top: 40px; /* Przykleja się podczas scrollowania */
}

.sidebar-module .widget {
    margin-bottom: 40px;
}

.sidebar-module .widget:last-child {
    margin-bottom: 0;
}

.sidebar-module ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-module ul li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    color: #b0b0b0;
}

.sidebar-module ul li a {
    color: var(--neon-alt-color);
    text-decoration: none;
    transition: color 0.3s;
}

.sidebar-module ul li a:hover {
    color: var(--neon-color);
}

/* Widżet Chmura Tagów */
.sidebar-module .tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sidebar-module .tagcloud a {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(var(--neon-rgb), 0.05);
    border: 1px solid var(--neon-color);
    color: var(--neon-color);
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem !important; /* Nadpisanie zróżnicowanych rozmiarów czcionki WP */
    transition: all 0.3s ease;
}

.sidebar-module .tagcloud a:hover {
    background: var(--neon-color);
    color: #0b0d17;
    transform: translateY(-2px);
}

/* --- Kosmiczna Strona 404 --- */
.error-404-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    text-align: center;
}

.error-404-page .page-content {
    background: #121526;
    padding: 40px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.glitch-text {
    font-size: 8rem !important;
    color: var(--neon-color) !important;
    margin: 0 0 10px 0 !important;
    line-height: 1;
    text-shadow: 0 0 20px rgba(var(--neon-rgb), 0.6), 4px 4px 0px rgba(var(--neon-alt-rgb), 0.6);
    font-weight: bold;
    letter-spacing: 5px;
}

.error-actions {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Widżet Wyszukiwarki w Sidebarze */
.sidebar-module .widget_search .search-form-wrapper {
    flex-direction: column;
    gap: 10px;
    margin-top: 0;
}

.sidebar-module .widget_search .search-field {
    max-width: 100%;
    padding: 12px 15px;
    font-size: 0.9rem;
}

.sidebar-module .widget_search .search-submit {
    width: 100%;
    padding: 12px;
    text-align: center;
}

/* Responsywność dla sidebaru */
@media (max-width: 992px) {
    .single-with-sidebar {
        grid-template-columns: 1fr;
    }
}

/* --- NASA APOD (Astronomy Picture of the Day) --- */
.nasa-apod-section {
    padding: 60px 0;
}

.apod-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: #121526;
    border: 1px solid rgba(var(--neon-rgb), 0.2);
    border-radius: 4px;
    padding: 30px;
    align-items: center;
}

.apod-media {
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.apod-media img {
    width: 100%;
    height: auto;
    display: block;
}

.apod-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.apod-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.apod-info h3 {
    color: var(--neon-color);
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 10px;
}

.apod-date {
    color: var(--neon-alt-color);
    font-weight: bold;
    margin-bottom: 20px;
}

.apod-desc {
    color: #e0e0e0;
    line-height: 1.8;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .apod-container {
        grid-template-columns: 1fr;
    }

    /* Stopka na tabletach: przejście na 2 kolumny */
    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsywność dla telefonów (Mobile) */
@media (max-width: 768px) {
    .footer-widgets {
        grid-template-columns: 1fr; /* Na małych ekranach układamy 1 kolumnę (stos) */
        text-align: center; /* Wyśrodkowanie widżetów ładnie wygląda na telefonie */
        gap: 30px;
    }

    /* Pasek nawigacji wpisów na telefonach */
    .sticky-post-nav {
        padding: 10px 15px;
    }
    .sticky-post-nav .nav-title {
        display: none; /* Na wąskim ekranie ukrywamy długie tytuły misji */
    }
    .sticky-post-nav .nav-label {
        margin-bottom: 0;
    }
    body.single { padding-bottom: 50px; }
    body.single .back-to-top { bottom: 70px; }

    /* Pod-stopka na telefonach */
    .sub-footer-inner {
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }
    .footer-navigation ul {
        justify-content: center;
        flex-wrap: wrap;
    }
    .footer-socials { justify-content: center; }

    /* Animacja pojawiania się linków w menu mobilnym */
    .main-navigation.toggled ul li {
        opacity: 0;
        animation: cosmicLinkReveal 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    }
    
    /* Kaskadowe opóźnienia dla kolejnych linków (Stagger effect) */
    .main-navigation.toggled ul li:nth-child(1) { animation-delay: 0.1s; }
    .main-navigation.toggled ul li:nth-child(2) { animation-delay: 0.2s; }
    .main-navigation.toggled ul li:nth-child(3) { animation-delay: 0.3s; }
    .main-navigation.toggled ul li:nth-child(4) { animation-delay: 0.4s; }
    .main-navigation.toggled ul li:nth-child(5) { animation-delay: 0.5s; }
    .main-navigation.toggled ul li:nth-child(6) { animation-delay: 0.6s; }
    .main-navigation.toggled ul li:nth-child(7) { animation-delay: 0.7s; }
    
    /* Dostosowanie rozwijanego menu na telefonach */
    .main-navigation ul ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        border: none;
        padding-left: 20px;
        min-width: auto;
        pointer-events: auto;
        border-left: 1px dashed rgba(255,255,255,0.2);
        margin-top: 10px;
        display: none;
    }
    .main-navigation.toggled ul ul {
        display: flex;
    }
}

/* Kluczowe klatki kosmicznej animacji menu */
@keyframes cosmicLinkReveal {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}