/*
Theme Name: Twój Śląsk
Theme URI: https://twojslask.pl
Author: Twój Śląsk Team
Author URI: https://twojslask.pl
Description: Nowoczesny, wydajny motyw dla portalu regionalnego Śląska z obsługą wydarzeń lokalnych, sliderami i blokami newsów po tagach. Zoptymalizowany pod kątem szybkości i kompatybilny z Gutenbergiem.
Version: 1.2.3
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twoj-slask
Tags: news, regional, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready

Twój Śląsk WordPress Theme
*/

:root {
    --primary-color: #0066cc;
    --secondary-color: #ff6600;
    --text-color: #333333;
    --light-gray: #f5f5f5;
    --border-color: #e0e0e0;
    --header-bg: #ffffff;
    --footer-bg: #1a1a1a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #ffffff;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-color);
}

/* Override dla linków w treści artykułu */
.entry-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-color: rgba(0, 102, 204, 0.3);
    transition: all 0.3s;
}

.entry-content a:hover {
    text-decoration-color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
}

/* Header */
.site-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    gap: 20px;
}

.site-branding {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    margin: 0;
    line-height: 1.2;
}

.site-title a {
    color: var(--primary-color);
    text-decoration: none;
}

.site-description {
    display: none;
}

@media (max-width: 768px) {
    .header-inner {
        padding: 12px 0;
    }
    
    .site-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 20px;
    }
}

/* Navigation */
.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s;
    display: block;
    padding: 5px 0;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-color);
    padding: 5px;
    line-height: 1;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-navigation ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        gap: 0;
        border-top: 1px solid var(--border-color);
    }
    
    .main-navigation ul li {
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-navigation ul li:last-child {
        border-bottom: none;
    }
    
    .main-navigation a {
        padding: 12px 0;
        font-size: 16px;
    }
    
    .main-navigation.toggled ul {
        display: flex;
    }
}

/* News Slider */
.news-slider {
    position: relative;
    margin: 30px 0;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.slider-wrapper {
    position: relative;
    height: 500px;
}

.slider-item {
    display: none;
    position: relative;
    height: 100%;
}

.slider-item.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}

.slider-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.85) 50%, rgba(0,0,0,0.3) 100%);
    color: white;
}

.slider-content h2 {
    font-size: 32px;
    margin-bottom: 12px;
    line-height: 1.3;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    font-weight: 700;
}

.slider-content h2 a {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.3s;
}

.slider-content h2 a:hover {
    opacity: 0.9;
}

.slider-content .post-meta {
    font-size: 14px;
    opacity: 0.95;
    margin-bottom: 12px;
    color: #e0e0e0;
    font-weight: 500;
}

.slider-content .excerpt {
    font-size: 16px;
    line-height: 1.5;
    color: #e8e8e8;
    max-width: 800px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.slider-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
}

.slider-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.3s;
}

.slider-btn:hover {
    background: white;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.slider-dot.active {
    background: white;
}

/* City Filter */
.city-filter {
    margin: 40px 0 30px;
    text-align: center;
}

.city-filter h2 {
    margin-bottom: 20px;
    font-size: 28px;
    color: var(--text-color);
}

.city-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
}

.city-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s;
    white-space: nowrap;
}

.city-btn:hover,
.city-btn.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
    .city-filter h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    .city-buttons {
        gap: 8px;
    }
    
    .city-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .city-filter {
        margin: 30px 0 20px;
    }
    
    .city-filter h2 {
        font-size: 20px;
    }
    
    .city-buttons {
        gap: 6px;
    }
    
    .city-btn {
        padding: 6px 12px;
        font-size: 13px;
        border-radius: 20px;
    }
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
}

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

.news-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    line-height: 1.4;
    flex-grow: 1;
}

.news-card h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.news-card h3 a:hover {
    color: var(--primary-color);
}

.news-card .post-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.news-card .post-meta .separator {
    margin: 0 6px;
}

.news-card .excerpt {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.news-card .tags {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.news-card .tag {
    padding: 4px 10px;
    background: var(--light-gray);
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.news-card .tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.news-card .city-tag {
    background: rgba(0, 102, 204, 0.1);
    color: var(--primary-color);
    font-weight: 500;
    border-color: rgba(0, 102, 204, 0.2);
}

.news-card .city-tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Tag Blocks */
.tag-block {
    margin: 60px 0;
}

.tag-block h2 {
    font-size: 28px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    color: var(--text-color);
    font-weight: 700;
}

/* Category Sections - Grid 2 kolumny */
.category-sections {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin: 60px 0;
}

.category-section {
    background: var(--light-gray);
    padding: 30px;
    border-radius: 8px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Simple Card - z miniaturą dla Kultura/Sport */
.simple-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.simple-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.simple-card-thumbnail {
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.simple-card-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.simple-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.simple-card:hover .simple-card-thumbnail img {
    transform: scale(1.05);
}

.simple-card-title {
    margin: 0;
    padding: 15px;
    font-size: 15px;
    line-height: 1.4;
}

.simple-card-title a {
    color: var(--text-color) !important;
    text-decoration: none !important;
    transition: color 0.3s;
}

.simple-card-title a:hover {
    color: var(--primary-color) !important;
}

/* Featured Card - dla Warto zobaczyć / Firmy lokalne */
.featured-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.featured-card a {
    color: var(--text-color) !important;
    text-decoration: none !important;
}

.featured-card a:hover {
    color: var(--primary-color) !important;
}

.featured-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.featured-card-content {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.featured-card-title {
    font-size: 17px;
    margin: 0 0 8px 0; /* Zmniejszona przerwa */
    line-height: 1.3;
}

.featured-card-title a {
    color: var(--text-color) !important;
    text-decoration: none !important;
    transition: color 0.3s;
}

.featured-card-title a:hover {
    color: var(--primary-color) !important;
}

.featured-card-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

.section-title {
    font-size: 28px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    color: var(--text-color);
    font-weight: 700;
}

/* Featured Sections - Horizontal */
.featured-section {
    margin: 60px 0;
}

.horizontal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* Load More Button */
.load-more-wrapper {
    text-align: center;
    margin: 40px 0;
}

.load-more-btn {
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.load-more-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 102, 0, 0.4);
}

.load-more-btn:active {
    transform: translateY(0);
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 16px;
}

.loading-spinner::before {
    content: "⏳ ";
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* No results message */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* Recent Posts Section */
.recent-posts-section {
    margin: 40px 0;
}

@media (max-width: 1024px) {
    .category-sections {
        gap: 30px;
    }
    
    .horizontal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .tag-block {
        margin: 40px 0;
    }
    
    .tag-block h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .category-sections {
        grid-template-columns: 1fr;
        gap: 30px;
        margin: 40px 0;
    }
    
    .category-section {
        padding: 20px;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .horizontal-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .featured-section {
        margin: 40px 0;
    }
    
    .simple-card-thumbnail {
        height: 150px;
    }
    
    .simple-card-title {
        font-size: 15px;
        padding: 12px;
    }
    
    .featured-card-content {
        padding: 15px;
    }
    
    .featured-card-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .tag-block h2,
    .section-title {
        font-size: 22px;
    }
    
    .category-section {
        padding: 15px;
    }
    
    .load-more-btn {
        padding: 12px 30px;
        font-size: 15px;
    }
    
    .simple-card-thumbnail {
        height: 120px;
    }
    
    .simple-card-title {
        font-size: 14px;
        padding: 10px;
    }
    
    .featured-card img {
        height: 150px;
    }
}

/* Footer */
.site-footer {
    background: var(--footer-bg);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-widget h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: white;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widget ul li {
    margin-bottom: 8px;
}

.footer-widget a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-widget a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}

.footer-bottom a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}

.footer-bottom a:hover {
    color: white;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 30px 0 15px;
        margin-top: 40px;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-bottom {
        font-size: 13px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-navigation ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    
    .main-navigation.toggled ul {
        display: flex;
    }
    
    /* Slider mobile fixes */
    .slider-wrapper {
        height: 400px;
    }
    
    .slider-content {
        padding: 20px;
    }
    
    .slider-content h2 {
        font-size: 22px;
        margin-bottom: 8px;
        line-height: 1.2;
    }
    
    .slider-content .post-meta {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .slider-content .excerpt {
        font-size: 14px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .slider-controls {
        padding: 0 10px;
    }
    
    .slider-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .slider-dots {
        bottom: 15px;
    }
    
    .slider-dot {
        width: 10px;
        height: 10px;
    }
    
    /* News grid */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* City filter */
    .city-filter h2 {
        font-size: 22px;
    }
    
    .city-buttons {
        gap: 8px;
    }
    
    .city-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    /* Header */
    .site-title {
        font-size: 24px;
    }
    
    .header-inner {
        padding: 12px 0;
    }
}

@media (max-width: 480px) {
    .slider-wrapper {
        height: 300px;
    }
    
    .slider-content {
        padding: 15px;
    }
    
    .slider-content h2 {
        font-size: 18px;
    }
    
    .slider-content .excerpt {
        display: none;
    }
    
    .slider-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .city-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Performance optimizations */
img {
    height: auto;
    max-width: 100%;
}

.lazyload {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazyloaded {
    opacity: 1;
}
