/* ==========================================================================
   ZMIENNE GLOBALNE (ROOT)
   Definiują kolorystykę, cienie i zaokrąglenia dla całego motywu.
   Wartości te są nadpisywane przez panel admina.
   ========================================================================== */
:root {
    --primary: #333;
    --accent: #007bff;
    --headings: #111;
    --links: #007bff;
    --bg: #f4f4f9;
    --white: #ffffff;
    --text: #333;
    --coffee: #6f4e37;
    --radius: 8px;
    --footer-bg: #ddd;
    --footer-text: #111;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   RESET I STYLE BAZOWE
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--headings);
}

a {
    color: var(--links);
    transition: color 0.2s;
}

a:hover {
    opacity: 0.8;
}

/* ==========================================================================
   NAGŁÓWEK I NAWIGACJA (HEADER & NAV)
   ========================================================================== */
header {
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
    text-align: center;
    position: relative;
    background: var(--white);
    z-index: 1001;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
    color: var(--primary);
}

.logo img {
    max-height: 60px;
    vertical-align: middle;
}

/* Kontener nawigacji - linki ułożone obok siebie */
nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

/* Stylizacja poszczególnych linków w menu */
nav a {
    text-decoration: none;
    color: #555;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.burger-menu {
    display: none;
}

/* --- RESPONSYWNOŚĆ MENU (MOBILE) --- */
@media (max-width: 768px) {
    .burger-menu {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
    }

    nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--white);
        border-top: 1px solid #eee;
        padding: 10px 0;
        z-index: 999;
        position: relative;
    }

    nav.active {
        display: flex;
    }

    nav a {
        padding: 15px;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #f9f9f9;
    }
}

/* ==========================================================================
   UKŁAD TREŚCI (LAYOUT)
   ========================================================================== */
.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 768px) {
    .container {
        flex-direction: row;
    }

    main {
        flex: 3;
    }

    aside {
        flex: 1;
        min-width: 300px;
    }
}

main,
aside {
    padding: 40px;
    box-shadow: var(--box-shadow);
    background: var(--white);
    border-radius: var(--radius);
}

aside {
    padding: 30px;
    height: fit-content;
}

/* ==========================================================================
   ELEMENTY WIDŻETÓW (SIDEBAR)
   ========================================================================== */
.profile-card img {
    width: 100%;
    border-radius: var(--radius);
    object-fit: cover;
}

.profile-desc {
    margin-bottom: 15px;
    line-height: 1.6;
}

.profile-contact {
    font-size: 0.9em;
}

.btn-green {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 12px 25px;
    border-radius: 30px;
    text-decoration: none;
    margin-top: 15px;
    width: 100%;
    text-align: center;
    font-weight: 600;
}

.btn-green:hover {
    opacity: 0.9;
    color: #fff;
}

/* ==========================================================================
   BANER PROFILOWY I BLOG
   ========================================================================== */
.header-profile {
    position: relative;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius);
    margin-bottom: 30px;
    color: white;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: flex-end;
    background-color: #333;
}

.hp-content {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 30px;
    display: flex;
    align-items: flex-end;
    gap: 20px;
    width: 100%;
}

.hp-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #fff;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hp-info h1 {
    margin: 0;
    font-size: 2rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hp-info p {
    margin: 5px 0 0;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.fb-post {
    border: 1px solid #eaeaea;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
    border-radius: var(--radius);
    background: #fff;
}

.fb-header {
    color: #555;
    font-weight: 700;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fb-date {
    font-size: 0.85em;
    color: #999;
    font-weight: 400;
}

.post-body {
    display: flex;
    gap: 25px;
    margin-bottom: 20px;
}

.media-bottom { flex-direction: column-reverse; }
.media-top    { flex-direction: column; }
.media-left   { flex-direction: row; }
.media-right  { flex-direction: row-reverse; }

.post-text {
    flex: 1;
    line-height: 1.7;
    min-width: 0;
}

.post-media-box {
    flex-shrink: 0;
    text-align: center;
}

.media-left .post-media-box,
.media-right .post-media-box {
    width: 45%;
}

.media-top .post-media-box,
.media-bottom .post-media-box {
    width: 100%;
}

.post-media {
    display: block;
    max-height: 400px;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    object-fit: cover;
    border-radius: var(--radius);
}

.media-link-button {
    display: block;
    background: #f8f9fa;
    padding: 25px;
    border-radius: var(--radius);
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    border: 2px dashed #e0e0e0;
    width: 100%;
    transition: background 0.3s;
}

.media-link-button:hover {
    background: #f0f0f0;
}

.media-link-icon {
    font-size: 2em;
    display: block;
    margin-bottom: 5px;
}

.media-link-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 4rem;
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    opacity: 0.8;
}

.post-actions {
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-coffee,
.btn-share {
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95em;
    width: auto;
    font-weight: 600;
}

.btn-coffee {
    background: var(--coffee);
    color: #fff;
}

.btn-share {
    background: #e9ecef;
    color: #333;
}

.btn-right-action {
    margin-left: auto;
    background: transparent;
    color: #555;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 30px;
    transition: all 0.3s;
}

.btn-right-action:hover {
    border-color: #bbb;
    background: #f9f9f9;
}

/* ==========================================================================
   UKRYTA TREŚĆ (LOCKED CONTENT)
   ========================================================================== */
.locked-content-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    margin: 30px auto;
    max-width: 500px;
    box-shadow: var(--box-shadow);
}

.locked-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.7;
}

.locked-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.locked-form input {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 30px;
    outline: none;
    font-size: 1rem;
}

.locked-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
}

/* ==========================================================================
   STOPKA (FOOTER)
   ========================================================================== */
footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: auto;
    color: var(--footer-text);
    background: var(--footer-bg);
    font-size: 0.9rem;
}

/* Responsywność postów */
@media (max-width: 600px) {
    .media-left,
    .media-right {
        flex-direction: column;
    }

    .media-left .post-media-box,
    .media-right .post-media-box {
        width: 100%;
    }

    .post-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-coffee,
    .btn-share,
    .btn-right-action {
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
        margin-left: 0;
        padding: 14px;
    }
}

/* Responsywność formularza hasła */
@media (max-width: 600px) {
    .locked-form {
        flex-direction: column;
        width: 100%;
    }

    .locked-form input {
        width: 100%;
        margin-bottom: 10px;
        border-radius: 8px;
    }

    .locked-form button {
        width: 100%;
        padding: 12px;
        border-radius: 8px;
    }
}

/* ==========================================================================
   WIELOPOZIOMOWE MENU (FINAL - MINIMALIST)
   ========================================================================== */

/* --- 1. RESET I BAZA --- */
nav ul {
    list-style: none; margin: 0; padding: 0; position: relative;
}

nav ul.root-menu {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 0; 
}

nav ul li { position: relative; }

/* --- 2. LINKI (STYL OGÓLNY) --- */
nav a {
    text-decoration: none;
    color: #666; /* Szary wyjściowy */
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 12px 18px;
    display: block;
    transition: color 0.2s ease;
    border: none;
    background: transparent;
}

/* EFEKT PO NAJECHANIU (Wspólny) */
nav a:hover,
nav li:hover > a,
nav li.mobile-active > a {
    color: #111; /* Tylko przyciemnienie */
    opacity: 1;
}

/* --- 3. SEPARATORY (KROPKI - TYLKO DESKTOP) --- */
@media (min-width: 769px) {
    nav ul.root-menu > li:not(:last-child) > a::after {
        content: "•";
        margin-left: 20px;
        color: #ccc;
        font-weight: normal;
        position: absolute;
        right: 0;
    }
}

/* --- 4. PODMENU (DESKTOP - CZYSTY KAFELEK) --- */
nav ul ul {
    display: none;
    position: absolute;
    background: #fff;
    
    /* Czysty styl, brak cienia (poświaty), tylko ramka */
    box-shadow: none; 
    border: 1px solid #ddd;
    
    border-radius: 4px;
    min-width: 200px;
    z-index: 1000;
    top: 100%; /* Główne podmenu spada w dół */
    left: 0;
    padding: 0;
    text-align: left;
}

/* WAŻNE: To naprawia problem uciekania podmenu do góry */
nav ul ul li { 
    width: 100%; 
    position: relative; 
}

/* Linki w podmenu */
nav ul ul a {
    text-align: left;
    padding: 12px 20px;
    text-transform: none; 
    font-weight: 500;
    color: #555;
    transition: background 0.1s, color 0.1s;
    border-bottom: 1px solid #f5f5f5;
}

/* Ostatni element bez linii */
nav ul ul li:last-child a {
    border-bottom: none;
}

/* Hover w podmenu */
nav ul ul a:hover {
    background: #f0f0f0;
    color: #000;
}

/* Ukrycie separatorów w podmenu */
nav ul ul a::after { content: none !important; }


/* --- 5. LOGIKA DESKTOP (HOVER) --- */
@media (min-width: 769px) {
    .arrow { display: none; } /* Ukrywamy strzałkę na desktopie */

    /* Główny poziom otwiera się w dół */
    nav li:hover > ul { 
        display: block;
        animation: fadeInMenu 0.2s ease-out;
    }
    
    /* --- TRZECI POZIOM (Podmenu w podmenu) --- */
    /* To sprawia, że otwiera się w prawo, w linii rodzica */
    nav ul ul ul { 
        top: 0;       /* Wyrównaj do górnej krawędzi rodzica */
        left: 100%;   /* Przesuń na prawo od rodzica */
        margin-left: -1px; /* Nałóż ramki na siebie, żeby nie było podwójnej kreski */
        margin-top: -1px;  /* Drobna korekta pionowa dla wyrównania ramek */
    }
}

@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 6. WERSJA MOBILNA (MINIMALIST) --- */
@media (max-width: 768px) {
    nav ul.root-menu { flex-direction: column; }

    nav ul ul, nav ul ul ul {
        position: static;
        box-shadow: none;
        background: transparent;
        border: none;
        padding: 0;
        margin: 0;
    }

    nav a {
        text-align: center;
        padding: 15px;
        width: 100%;
        border-bottom: 1px solid #f9f9f9;
        
        /* Wyśrodkowanie z flexboxa */
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    nav ul ul a {
        padding: 12px;
        font-size: 0.85rem;
        color: #888;
        background: #fdfdfd;
    }
    
    /* Reset efektu hover dla mobile */
    nav ul ul a:hover { background: #fdfdfd; color: #888; }

    nav li:hover > ul { display: none; }
    nav li.mobile-active > ul { display: block; }

    /* Strzałka minimalistyczna */
    .arrow {
        display: inline-block;
        margin-left: 8px; /* Blisko tekstu */
        font-size: 0.8em;
        opacity: 0.4;
        
        /* Duży obszar dotyku */
        padding: 10px; 
        margin-right: -10px; /* Kompensacja */
        
        cursor: pointer;
        transition: transform 0.3s;
    }
    
    nav li.mobile-active > a .arrow {
        /* Statyczna strzałka (nie obraca się) */
        transform: none; 
        opacity: 1;
        color: #000;
    }
}