/*
Theme Name: Niumic.pl
Theme URI: https://niumic.pl
Author: Dawid Skórak / dskorak
Author URI: https://niumic.pl
Description: Nowoczesny, minimalistyczny motyw dla portalu Niumic.pl z karuzelą full-width i siatką 2x4.
Version: 1.0.0
Text Domain: niumic
*/

:root {
    --black: #000000;
    --text: #111111;
    --gray: #f2f2f2;
    --accent: #ff3e3e;
    --border: #f0f0f0;
}

/* --- RESET & BAZA --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #ffffff;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

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

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

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

/* --- PASEK POSTĘPU --- */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: var(--accent);
    z-index: 2000;
    transition: width 0.1s;
}

/* --- HEADER & LOGO (Auto-dopasowanie) --- */
.site-header {
    padding: 15px 0;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Kontener logo - brak wymuszonego przycinania */
.logo-wrapper {
    display: flex;
    align-items: center;
    max-width: 220px;
    /* Maksymalna szerokość jaką może zająć logo */
}

.logo-wrapper img,
.custom-logo-link img {
    width: auto;
    /* Pozwala na naturalną szerokość */
    height: auto;
    /* Pozwala na naturalną wysokość */
    max-height: 50px;
    /* Twoja bezpieczna granica wysokości w menu */
    display: block;
    object-fit: contain;
    /* Gwarantuje brak zniekształceń */
}

.text-logo {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--black);
}

.text-logo span {
    color: var(--accent);
}

.nav-list {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-list a {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--black);
}

/* --- SIATKA POSTÓW 2x4 (Zagęszczona) --- */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 35px 30px;
    /* Mniejszy odstęp pionowy */
    margin-top: 40px;
}

.grid-item {
    display: flex;
    flex-direction: column;
}

.img-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    /* Tekst bliżej obrazka */
    aspect-ratio: 16/10;
    background: var(--gray);
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.grid-item:hover img {
    transform: scale(1.05);
}

.grid-item h3 {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--black);
    letter-spacing: -0.5px;
}

.grid-item h3 a {
    color: var(--black) !important;
}

/* --- SINGLE POST --- */
.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.entry-header {
    text-align: center;
    padding: 60px 0 40px;
}

.entry-meta {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 15px;
}

.entry-title {
    font-size: clamp(32px, 5vw, 54px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -2px;
}

.entry-content {
    font-size: 19px;
    line-height: 1.8;
    color: #222;
}

/* Sekcja Share w artykule */
.share-box {
    margin: 50px 0;
    padding: 25px;
    background: var(--gray);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-icons {
    display: flex;
    gap: 20px;
}

.share-icons a {
    color: var(--black);
}

/* --- STOPKA --- */
.site-footer {
    padding: 80px 0 40px;
    background: #fff;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-logo-wrap img {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

.footer-socials {
    display: flex;
    gap: 25px;
    justify-content: center;
    margin: 30px 0;
}

.footer-copyright {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- RESPONSYWNOŚĆ --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle .bar {
    width: 25px;
    height: 2px;
    background: var(--black);
}

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

    .menu-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
    }

    .logo-wrapper {
        max-width: 150px;
    }

    /* Overlay menu mobilnego */
    .main-nav.active {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 999;
    }

    .nav-list {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .nav-list a {
        font-size: 28px;
    }
}

/* --- WYŚRODKOWANIE I SZEROKOŚĆ KARUZELI --- */
.hero-margin {
    margin: 0 auto 60px auto;
    /* Wyśrodkowanie (auto po bokach) */
    max-width: 1300px;
    /* Karuzela może być szersza niż reszta postów */
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    height: 550px;
}

/* --- WYŚRODKOWANIE STOPKI --- */
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Środkuje wszystko w pionowej osi */
    text-align: center;
}

.footer-logo-wrap {
    margin: 0 auto 50px auto;
    /* Zwiększony odstęp (50px) od social mediów */
    display: inline-block;
}

.footer-logo-wrap img {
    margin: 0 auto;
    display: block;
}

.footer-socials {
    display: flex;
    justify-content: center;
    /* Środkuje ikony w poziomie */
    gap: 30px;
    margin-bottom: 40px;
}

/* --- DOPASOWANIE KONTENERA POSTÓW --- */
/* Zostawiamy posty w węższym kontenerze (1100px), 
   ale karuzela powyżej ma swoje 1300px */
.grid-layout {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* --- HERO FULL WIDTH --- */
.hero-full-width {
    width: 100%;
    height: 600px;
    /* Stała wysokość dla elegancji */
    margin-bottom: 60px;
    overflow: hidden;
}

.niumic-hero-swiper,
.hero-slide-link {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-slide-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Gwarantuje wypełnienie bez zniekształceń */
}

/* Nakładka na zdjęcie (ciemniejszy dół, żeby tekst był czytelny) */
.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 100px 0 60px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    color: #fff;
}

.hero-overlay h2 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 900;
    margin: 0;
    max-width: 800px;
    line-height: 1.1;
}

/* Kropki nawigacji Swipera */
.swiper-pagination-bullet {
    background: #fff !important;
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    opacity: 1;
}

/* Mobilki - nieco niższa karuzela */
@media (max-width: 768px) {
    .hero-full-width {
        height: 450px;
    }
}

/* Karuzela Full Width */
.hero-full-width {
    width: 100%;
    height: 600px;
    margin-bottom: 60px;
    overflow: hidden;
    position: relative;
}

.hero-slide-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-slide-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 120px 0 60px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
    color: #fff;
}

.hero-category {
    background: var(--accent);
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 4px;
    margin-bottom: 15px;
    display: inline-block;
}

.hero-overlay h2 {
    font-size: clamp(24px, 4vw, 48px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1.5px;
}

/* Centrowanie stopek */
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-logo-wrap {
    margin-bottom: 50px;
}

.footer-logo-wrap img {
    display: block;
    margin: 0 auto;
    height: 45px;
    width: auto;
}

.footer-socials {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    justify-content: center;
}

.footer-socials a {
    color: var(--text);
    transition: 0.3s;
}

.footer-socials a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

/* Tytuł sekcji najnowsze */
.latest-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    margin-bottom: 30px;
    color: #888;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

/* --- NAKŁADKI NA ZDJĘCIU --- */
.img-container {
    position: relative;
    border-radius: 12px;
    /* Lekko większy promień dla nowoczesności */
    overflow: hidden;
    margin-bottom: 15px;
    aspect-ratio: 16/10;
}

.post-tags-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    /* Kategoria po lewej, licznik po prawej */
    z-index: 2;
}

.grid-cat-tag,
.grid-view-tag {
    background: rgba(255, 255, 255, 0.9);
    /* Półprzezroczysty biały */
    backdrop-filter: blur(5px);
    /* Efekt szkła */
    color: #000;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grid-view-tag {
    background: rgba(0, 0, 0, 0.6);
    /* Ciemniejszy dla licznika */
    color: #fff;
}

/* --- DETALE POD ZDJĘCIEM --- */
.grid-content {
    padding: 0 5px;
}

.grid-date {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.grid-item h3 {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--black);
    transition: color 0.3s;
}

.grid-item:hover h3 {
    color: var(--accent);
}

.gray-placeholder {
    width: 100%;
    height: 100%;
    background: #f2f2f2;
}

/* --- POPRAWKI WIZUALNE: CIEŃ I HOVER --- */

.img-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    aspect-ratio: 16/10;
    background: var(--gray);

    /* Miękki, naturalny cień */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

    /* Płynne przejście */
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1),
        box-shadow 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Efekt uniesienia po najechaniu */
.grid-item:hover .img-container {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Powiększenie zdjęcia wewnątrz */
.grid-item:hover img {
    transform: scale(1.06);
}

/* Upewnienie się, że tytuły są czarne */
.grid-item h3 a,
.grid-item h3 {
    color: #000 !important;
}

/* Stylizacja daty i tekstu w karuzeli */
.hero-text-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-date {
    display: block;
    margin-top: 15px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.85);
}

.hero-overlay h2 {
    margin: 10px 0 0 0;
    font-size: clamp(24px, 4vw, 42px);
    line-height: 1.1;
    color: #fff;
    font-weight: 900;
}

/* --- ZBLIŻENIE SIATKI DO KARUZELI --- */

.hero-full-width {
    margin-bottom: 30px !important;
    /* Zmniejszamy odstęp pod karuzelą (było 60px) */
}

.grid-layout {
    margin-top: 0;
    /* Upewniamy się, że siatka nie ma dodatkowego marginesu */
}

/* Opcjonalnie: usuwamy styl starego nagłówka, jeśli go wcześniej dopisywałeś */
.latest-title,
.section-header {
    display: none;
}

/* Odstęp między karuzelą a siatką */
.hero-full-width {
    margin-bottom: 35px !important;
}

/* Styl przycisku Wczytaj więcej (jeśli potrzebujesz) */
.modern-btn {
    background: #000;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 50px;
}

.modern-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

/* --- SINGLE POST DESIGN --- */
.single-post-layout {
    padding-top: 60px;
}

.entry-header {
    max-width: 850px !important;
    text-align: center;
    margin-bottom: 50px;
}

.entry-meta-top {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 15px;
}

.entry-title {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 20px;
    color: #000;
}

.entry-author {
    font-size: 14px;
    color: #888;
}

.entry-featured-image {
    margin-bottom: 60px;
}

.entry-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

/* Węższa treść dla lepszego czytania */
.entry-content-wrapper {
    max-width: 800px !important;
}

.entry-content {
    font-size: 20px;
    /* Większy font = łatwiejsze czytanie */
    line-height: 1.8;
    color: #333;
}

.entry-content p {
    margin-bottom: 30px;
}

.entry-content h2,
.entry-content h3 {
    margin: 50px 0 20px;
    color: #000;
}

/* Share Box */
.share-box {
    margin-top: 60px;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 12px;
    text-align: center;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.share-buttons a {
    background: #000;
    color: #fff;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 12px;
}

/* --- AKTUALIZACJA SINGLE POST --- */

/* Mniejsza czcionka treści */
.entry-content {
    font-size: 18px;
    /* Zmniejszono z 20px */
    line-height: 1.7;
    color: #333;
}

/* KONTROLA VIDEO (YouTube/Vimeo) */
.entry-content iframe,
.entry-content video,
.entry-content .wp-block-embed {
    max-width: 90%;
    /* Nie na całą szerokość tekstu */
    margin: 40px auto;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Ikony w sekcji Share */
.share-buttons a {
    background: #000;
    color: #fff;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.3s ease;
}

.share-buttons a:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.share-buttons svg {
    display: block;
}

.share-box h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    color: #999;
}

/* --- OPTYMALIZACJA WIDEO W TREŚCI --- */

/* Kontener dla wideo (YouTube, Vimeo, MP4) */
.entry-content iframe,
.entry-content video,
.entry-content .wp-block-embed {
    display: block;
    margin: 50px auto;
    width: 100%;
    /* Na komputerach film może być szerszy niż tekst */
    max-width: 1000px;
    aspect-ratio: 16 / 9;

    /* Biała ramka i stylizacja */
    background: #fff;
    border: 8px solid #fff;
    /* Gruba biała ramka */
    border-radius: 15px;

    /* Podwójny cień dla efektu głębi */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);

    transition: transform 0.3s ease;
}

/* Lekki efekt po najechaniu na film */
.entry-content iframe:hover {
    transform: scale(1.01);
}

/* Responsywność dla mniejszych ekranów */
@media (max-width: 1100px) {

    .entry-content iframe,
    .entry-content video,
    .entry-content .wp-block-embed {
        max-width: 100%;
        /* Na tabletach i telefonach zajmuje całą dostępną szerokość */
        border: 4px solid #fff;
        /* Cieńsza ramka na małych ekranach */
    }
}

/* Poprawka wielkości czcionki (jeśli jeszcze nie zmieniłeś) */
.entry-content {
    font-size: 18px;
    line-height: 1.8;
}