/* ====================================================================
 * PODSTAWOWE STYLE I RESET
 * ==================================================================== */

* {
    box-sizing: border-box;
}

/* Płynne przewijanie do sekcji po kliknięciu w link (kotwicę) */
html {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background: #faf9f6;
    /* Warm Paper White */
    color: #333;
}

/* ====================================================================
 * NAGŁÓWEK (HEADER)
 * ==================================================================== */

header {
    background: linear-gradient(135deg, #2c3e50, #1a252f);
    /* More sophisticated dark gradient */
    color: #fff;
    padding: 2rem 0;
    /* More spacing */
    text-align: center;
}

header img {
    max-width: 500px;
    width: 95%;
    height: auto;
    margin: 0 auto;
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    /* Add depth to cover */
    border-radius: 4px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

header img:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

header h1,
header h2,
header h3,
header p {
    margin: 0.8rem;
}

header h1 {
    font-family: 'Libre Baskerville', serif;
    font-size: 2.5rem;
    letter-spacing: -0.5px;
}

header h2 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    color: #a8d5db;
    /* Teal accent for subheadings */
}

/* Klasa dla opisu w nagłówku - ogranicza szerokość i ładnie formatuje */
.header-description {
    max-width: 800px;
    margin: 1.5rem auto;
    padding: 0 1rem;
    line-height: 1.8;
    color: #e0e6ed;
    font-size: 1.1rem;
}

/* Header Action Buttons Grid */
.header-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    justify-content: center;
    max-width: 600px;
    margin: 2rem auto 1rem auto;
}

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

/* ====================================================================
 * GŁÓWNA ZAWARTOŚĆ (MAIN) I SEKCJE
 * ==================================================================== */

main {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem;
    background-color: transparent;
    box-shadow: none;
}

section {
    padding: 2rem 3rem;
    margin: 2rem auto;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    /* Softer shadow */
    max-width: 960px;
    border-radius: 8px;
    /* Softer corners */
}

h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-family: 'Libre Baskerville', serif;
    border-bottom: 2px solid #008b8b;
    /* Teal underline */
    display: inline-block;
    padding-bottom: 5px;
}

blockquote {
    background: #f0f7f7;
    /* Very light teal bg */
    border-left: 6px solid #008b8b;
    /* Teal border */
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    font-style: italic;
    font-family: 'Libre Baskerville', serif;
    color: #444;
}

/* ====================================================================
 * STOPKA (FOOTER)
 * ==================================================================== */

footer {
    background: #1a252f;
    color: #bdc3c7;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Social Media Icons */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.social-icon-link {
    display: inline-block;
    color: #bdc3c7;
    /* Base color matching footer text */
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-icon-link:hover {
    color: #008b8b;
    /* Teal hover */
    transform: translateY(-3px);
}

.social-svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    /* Inherit color from parent for easy hover */
}

footer a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
    color: #008b8b;
}

/* ====================================================================
 * ELEMENTY OGÓLNE I LINKI
 * ==================================================================== */

a {
    color: #008b8b;
    /* Teal links */
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #005f5f;
    text-decoration: underline;
}

.white-link {
    color: #fff;
}

.submenu {
    display: none;
}

.toggle-button {
    cursor: pointer;
    margin-right: 5px;
}

.read-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 280px;
    margin-top: 5px;
    padding: 12px 25px;
    background-color: #008b8b;
    /* Teal button */
    color: white;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.read-link:hover {
    background-color: #005f5f;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

/* Secondary Action Button (Outline) */
.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 280px;
    margin-top: 5px;
    padding: 10px 22px;
    background-color: transparent;
    border: 2px solid #008b8b;
    color: #008b8b;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95em;
    text-align: center;
}

.secondary-link:hover {
    background-color: #008b8b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 139, 139, 0.2);
    text-decoration: none;
}

/* UI Icons */
.btn-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    margin-right: 10px;
    flex-shrink: 0;
}

.center {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.external-links-notice {
    margin: 2rem 0 1.5rem 0;
    padding: 1rem;
    background: #242438;
    color: #eaeaea;
    border-radius: 8px;
    font-size: 1.07rem;
}

/* ====================================================================
 * ELEMENTY AUDIO (DLA AUDIO-PLAYER.HTML)
 * ==================================================================== */

audio {
    width: 100%;
    margin: 20px 0;
    /* Removed fixed height/radius to fix Firefox clipping */
}

audio::-webkit-media-controls-panel {
    height: 60px;
    background-color: #f0f0f0;
    border-radius: 30px;
    /* Rounded corners for WebKit */
}

audio::-webkit-media-controls-play-button,
audio::-webkit-media-controls-pause-button,
audio::-webkit-media-controls-mute-button,
audio::-webkit-media-controls-volume-slider {
    transform: scale(1.5);
}

audio::-moz-media-controls-play-button,
audio::-moz-media-controls-pause-button,
audio::-moz-media-controls-mute-button,
audio::-moz-media-controls-volume-slider {
    transform: scale(1.5);
}

/* ====================================================================
 * STYLE DLA SPISU TREŚCI (TOC) - GŁÓWNY INDEX
 * ==================================================================== */

#toc ul {
    list-style-type: none;
    padding-left: 20px;
}

#toc li {
    padding: 6px 0;
    position: relative;
}

#toc .toc-main-list>li {
    font-weight: 600;
    font-size: 1.1em;
    cursor: pointer;
    padding-left: 25px;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: 4px;
}

#toc .toc-main-list>li:hover {
    background-color: #e0f7fa;
    /* Light teal hover */
    color: #006064;
}

#toc .toggle-button {
    position: absolute;
    left: 0;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid #555;
    margin-right: 10px;
    transition: transform 0.3s ease-out;
}

#toc .submenu .toggle-button {
    left: -20px;
}

#toc li.submenu-open>.toggle-button {
    transform: rotate(90deg);
}

#toc .submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    border-left: 2px solid #e0e0e0;
    margin-left: 8px;
    padding-left: 25px;
    display: block;
}

#toc .submenu .submenu {
    padding-left: 15px;
    border-left: 2px solid #f0f0f0;
    margin-left: 0;
}

#toc .submenu.submenu-active {
    max-height: 1500px;
    transition: max-height 0.6s ease-in;
}

/* ====================================================================
 * STYLE DLA SPISU TREŚCI AUDIOBOOKA (AUDIO-PLAYER.HTML)
 * ==================================================================== */

.container {
    position: relative;
}

#audio-toc ul {
    list-style-type: none;
    padding-left: 0;
}

#audio-toc li {
    background: #fff;
    margin-bottom: 5px;
    padding: 12px 15px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Center items vertically */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#audio-toc li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    flex-grow: 1;
    /* Allow text to take up space */
    margin-right: 15px;
    /* Space between text and button */
    white-space: normal;
    /* Allow wrapping! */
    line-height: 1.4;
    /* Improve readability of wrapped text */
    word-break: break-word;

    /* Flex Setup for Stacked Layout */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

#audio-toc li a:hover {
    text-decoration: none;
    color: #008b8b;
}

/* Audio TOC Headers & Separators (Generated by JS) */
.chapter-header {
    background: #eef2f3;
    color: #2c3e50;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    padding: 10px 15px;
    margin-top: 15px;
    margin-bottom: 5px;
    border-radius: 6px;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: none !important;
    /* Override default li shadow */
    cursor: default;
}

.chapter-separator {
    background: transparent;
    color: #7f8c8d;
    font-weight: 400;
    text-align: center;
    padding: 15px 0 5px 0;
    font-size: 0.9em;
    box-shadow: none !important;
    cursor: default;
    border: none;
}

.chapter-time {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: #008b8b;
    background-color: rgba(0, 139, 139, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    /* Space below time */
    font-size: 0.75em;
    /* Label size */
    letter-spacing: 0.5px;
    display: inline-block;
    align-self: flex-start;
    margin-right: 0;
}

.chapter-title {
    display: block;
    width: 100%;
    margin-top: 2px;
}

/* ====================================================================
 * PRZYCISK UDOSTĘPNIANIA I POWIADOMIENIE (TOAST)
 * ==================================================================== */

.share-btn {
    cursor: pointer;
    padding: 6px 12px;
    background-color: #f8f9fa;
    border-radius: 5px;
    font-size: 1.1em;
    color: #7f8c8d;
    transition: all 0.2s;
    line-height: 1;
    flex-shrink: 0;
    border: 1px solid #eee;
}

.share-btn:hover {
    background-color: #008b8b;
    color: #fff;
    border-color: #008b8b;
}

.share-btn:active {
    transform: scale(0.95);
}

/* Style dla powiadomienia "toast" */
#toast-notification {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: #222;
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    z-index: 1000;
    font-size: 0.95em;
    transition: visibility 0.3s, opacity 0.3s, transform 0.3s ease-out;
}

#toast-notification.toast-visible {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ====================================================================
 * NAKŁADKA "PLAY" NA AUDIOBOOKA
 * ==================================================================== */

#play-overlay-btn {
    display: none;
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    cursor: pointer;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 30px;
    /* Match audio player */
}

#play-overlay-btn.show-overlay {
    display: flex;
}

#play-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

#play-overlay-icon {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
    transition: transform 0.2s ease;
}

#play-overlay-text {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    margin-top: 5px;
}

#play-overlay-btn:hover #play-overlay-icon {
    transform: scale(1.15);
}

/* Player Controls Section */
.player-controls {
    margin-top: 10px;
    margin-bottom: 30px;
    width: 100%;
}

@media (max-width: 768px) {
    .player-controls {
        flex-direction: column;
    }
}

/* FIREFOX SPECIFIC OVERLAY FIX */
@-moz-document url-prefix() {
    #play-overlay-btn {
        border-radius: 0;
        /* Firefox player is shorter (~40px) */
        height: 70px;
        /* Increased to cover text below */
        top: 20px;
        /* Moved up to start higher */
    }
}

/* ====================================================================
 * SEKCJA LINKÓW YOUTUBE
 * ==================================================================== */

.youtube-links-section {
    background-color: transparent;
    /* Seamless blend */
    box-shadow: none;
    /* No box for this container section itself */
    padding: 0;
}

.youtube-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
        /* Reduced from 1rem/20px to 10px for more space */
    }

    /* Adjust header padding if needed */
    header {
        padding: 1.5rem 0;
    }

    /* Revert to comfortable padding for text readability */
    section {
        padding: 1.5rem 20px;
    }

    /* Target ONLY audio-toc for maximum width */
    #audio-toc {
        padding: 1.5rem 10px;
    }

    h1 {
        font-size: 1.75rem;
    }

    /* Fix Footer Mobile Padding */
    footer {
        padding: 2rem 20px;
    }

    /* Ensure TOC fits well */
    #audio-toc li {
        padding: 10px 8px;
        /* Slightly tighter internal padding */
    }

    .youtube-links {
        grid-template-columns: 1fr;
    }

    .youtube-link-block {
        padding: 1rem 1rem;
    }
}

.youtube-link-block {
    background-color: #fff;
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: center;
    flex-basis: auto;
    flex-grow: 0;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    /* Remove underline from the block itself */
    color: inherit;
    /* Inherit text color */
    cursor: pointer;
}

.youtube-link-block:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
    text-decoration: none;
    color: inherit;
}

.youtube-block-icon {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0;
}


.youtube-title {
    font-weight: 700;
    flex-grow: 1;
    font-size: 1.15rem;
    margin-bottom: 0;
    color: #2c3e50;
    font-family: 'Inter', sans-serif;
}

/* Style the fake button to look like the real one did */
.youtube-link-fake-button {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.4);
}

/* Hover effect on outer block triggers button effect */
.youtube-link-block:hover .youtube-link-fake-button {
    background-color: #c0392b;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.6);
    transform: translateY(-1px);
}

.youtube-link-icon {
    fill: #FFFFFF;
    height: 22px;
    width: 22px;
    vertical-align: middle;
    margin-right: 6px;
}

/* ====================================================================
 * Nawigacja do Galerii (Pills / Pastylki)
 * ==================================================================== */

.gallery-nav-container {
    text-align: center;
    margin: 2rem 0 3rem 0;
}

.gallery-nav-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Inter', sans-serif;
}

.gallery-nav-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* Wygląd "Pastylki" - Quick Win Improvement */
.gallery-chip {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    /* Gradient Background */
    background: linear-gradient(135deg, #008b8b, #006666);
    color: #fff;
    /* White text */
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 139, 139, 0.3);
    /* Teal shadow */
}

/* Hover - Lift up and shine */
.gallery-chip:hover {
    background: linear-gradient(135deg, #00a8a8, #007777);
    color: #fff;
    transform: translateY(-3px);
    /* Lift */
    box-shadow: 0 8px 15px rgba(0, 139, 139, 0.4);
    /* Deeper shadow */
    text-decoration: none;
}

/* ====================================================================
 * Losowe zdjęcie (Featured Image)
 * ==================================================================== */

.featured-image-wrapper {
    margin: 2rem auto 3rem auto;
    max-width: 800px;
    position: relative;
    text-align: center;
}

/* Styl dla tytułu nad zdjęciem */
/* .gallery-nav-title jest już zdefiniowana wyżej */

.featured-image-wrapper a {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.featured-image-wrapper a:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.featured-img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 600px;
    object-fit: contain;
    /* Tło dla spójności, gdy proporcje obrazu nie pasują do kontenera */
    background-color: #fff;
    min-height: 250px;
}

/* Nakładka z tekstem pojawiająca się po najechaniu */
.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding-top: 40px;
}

.featured-image-wrapper a:hover .featured-overlay {
    opacity: 1;
}

.featured-icon {
    font-size: 1.2rem;
}

/* Na urządzeniach mobilnych (dotykowych) nakładka może być widoczna zawsze */
@media (hover: none) {
    .featured-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
    }
}




/* ====================================================================
 * GALERIE / KARUZELE
 * ==================================================================== */

/* Klasa dla sekcji galerii */
.gallery-section {
    text-align: center;
    position: relative;
    padding-bottom: 3rem;
}

.gallery-section h2 a {
    color: inherit;
    text-decoration: none;
}

.gallery-section h2 a:hover {
    color: #008b8b;
}

/* Strona esejów */
.essay-article {
    max-width: 720px;
    margin: 0 auto 3rem;
    text-align: left;
    line-height: 1.9;
}

.essay-toc {
    max-width: 720px;
    margin: 2rem auto;
}

.essay-toc ol {
    padding-left: 1.5rem;
    line-height: 2;
}

.essay-toc a {
    color: #008b8b;
    text-decoration: none;
    font-family: 'Libre Baskerville', serif;
}

.essay-toc a:hover {
    text-decoration: underline;
}

.essay-date {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: #7f8c8d;
    text-align: right;
    font-style: italic;
}

.essay-section-heading {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.1rem;
    color: #2c3e50;
    margin: 2rem 0 0.8rem;
    border-bottom: none;
    display: block;
}

.essay-separator {
    border: none;
    border-top: 1px solid #d0dce0;
    margin: 3rem auto;
    max-width: 720px;
}

/* Kontener karuzeli */
.gallery-carousel-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Obszar przewijania */
.gallery-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding: 30px 10px;
    /* More padding for hover transform */
    width: 100%;
    scrollbar-width: thin;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Element galerii (pojedyncze zdjęcie) */
.gallery-item {
    flex: 0 0 auto;
    width: 260px;
    height: 190px;
    scroll-snap-align: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    /* Ustawienie tła i flexa do wyśrodkowania obrazu */
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #f0f0f0;
}



/* Nowa struktura: Dwie warstwy dla efektu Crossfading & Zoom Out */
.gallery-item {
    position: relative;
    /* Important for absolute positioning of children */
}

/* Warstwa Tła (Cover) - widoczna domyślnie */
.thumb-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.5s ease;
    opacity: 1;
    z-index: 1;
}

/* Warstwa Wierzchnia (Contain) - widoczna po najechaniu */
.thumb-contain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #1a1a1a;
    display: block;
    opacity: 0;
    transform: scale(1.1);
    /* Start slightly zoomed in */
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 2;
}



/* HOVER EFFECTS - Only for devices with mouse/pointer (no sticky mobile hover) */
@media (hover: hover) {
    .gallery-item:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
        z-index: 2;
        background-color: #1a1a1a;
    }

    .gallery-item:hover .thumb-cover {
        opacity: 0;
        /* Hide cover layer */
    }

    .gallery-item:hover .thumb-contain {
        opacity: 1;
        /* Show contain layer */
        transform: scale(1.0);
        /* Smoothly zoom out to normal fit */
    }
}

/* Strzałki nawigacji w karuzeli */
.gallery-nav-btn {
    background-color: #fff;
    color: #333;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    position: absolute;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Etykiety VIDEO / AUDIO */
.media-type-label {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.4);
    /* Delikatne tło */
    color: rgba(255, 255, 255, 0.8);
    /* Delikatny tekst */
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 5;
    /* Zawsze nad warstwami tłami (thumb-contain ma z-index: 2) */
    transition: all 0.3s ease;
    pointer-events: none;
    /* Nie blokuje kliknięć */
    letter-spacing: 0.5px;
}

.gallery-item:hover .media-type-label {
    background: rgba(0, 0, 0, 0.8);
    /* Mocne tło */
    color: #fff;
    /* Biały tekst */
    transform: scale(1.05);
    /* Lekkie powiększenie */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Tytuł pliku na ikonie zastępczej (jeśli brak miniatury) */
.media-fallback-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    text-align: center;
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;

    /* Tło dla lepszej czytelności */
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);

    pointer-events: none;
    z-index: 4;
    /* Pomiędzy obrazkiem a etykietą typu */
    line-height: 1.4;
    overflow-wrap: break-word;
}

.gallery-nav-btn:hover {
    background-color: #008b8b;
    color: #fff;
    transform: scale(1.1);
}

.gallery-prev {
    left: -20px;
}

.gallery-next {
    right: -20px;
}

@media (max-width: 768px) {
    .gallery-item {
        width: 180px;
        height: 130px;
    }

    .gallery-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        left: -10px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    .gallery-next {
        right: -10px;
        left: auto;
    }
}

/* ====================================================================
 * LIGHTBOX (POWIĘKSZANIE ZDJĘĆ)
 * ==================================================================== */

.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 20, 25, 0.98);
    /* Slightly bluish black */
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: color 0.3s, transform 0.3s;
    line-height: 1;
    z-index: 100;
}

.lightbox-close:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

.lightbox-caption {
    color: #ccc;
    margin-top: 15px;
    font-size: 1.1rem;
    text-align: center;
    font-family: 'Inter', sans-serif;
    max-width: 900px;
    max-height: 20vh;
    overflow-y: auto;
    padding: 0 10px;
    line-height: 1.5;
}

/* Versteckt caption-Element vollständig wenn leer (verhindert Leerraum in Essay-Ansicht) */
.lightbox-caption:empty {
    display: none;
}

/* Nota o AI w Lightboxie */
.lightbox-ai-notice {
    color: #666;
    font-size: 0.8rem;
    margin-top: 10px;
    text-align: center;
    max-width: 80%;
}

/* Przycisk pobierania w Lightboxie */
/* Kontener na przyciski w lightboxie */
.lightbox-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding: 0 10px;
}

/* Przyciski pobierania i udostępniania w Lightboxie */
.lightbox-download-btn,
.lightbox-share-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px 30px;
    background-color: transparent;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .lightbox-download-btn,
    .lightbox-share-btn {
        padding: 8px 16px;
        font-size: 0.82rem;
    }
}

.lightbox-download-btn:hover,
.lightbox-share-btn:hover {
    background-color: #fff;
    color: #000;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Autoplay Controls */
.autoplay-container {
    display: flex;
    gap: 8px;
    align-items: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    padding-right: 15px;
    margin-right: 5px;
}

@media (max-width: 480px) {
    .autoplay-container {
        border-right: none;
        padding-right: 0;
        margin-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        padding-bottom: 8px;
        width: 100%;
        justify-content: center;
    }
}

.lightbox-action-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 8px 15px;
    background-color: transparent;
    color: white;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    gap: 5px;
}

.lightbox-action-btn:hover,
.lightbox-action-btn.active {
    background-color: #008b8b;
    /* Teal active */
    border-color: #008b8b;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 139, 139, 0.5);
}

.lightbox-interval-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
}

.lightbox-interval-select:focus {
    outline: none;
    border-color: #008b8b;
}

.lightbox-interval-select option {
    background: #222;
    color: white;
}

/* Przyciski nawigacji w Lightboxie (Strzałki) */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.3s;
    z-index: 100;
}

.lightbox-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {
    .lightbox-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        background-color: rgba(0, 0, 0, 0.5);
    }
}

/* LIGHTBOX ESSAY */

.lightbox-essay-content {
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2.5rem 3rem;
    color: #e0e0e0;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.1rem;
    line-height: 1.9;
    text-align: left;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.4);
    /* Delikatna scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.lightbox-essay-content::-webkit-scrollbar {
    width: 6px;
}

.lightbox-essay-content::-webkit-scrollbar-track {
    background: transparent;
}

.lightbox-essay-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.lightbox-essay-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.lightbox-essay-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    letter-spacing: 0.3px;
}

.lightbox-essay-text {
    font-family: 'Libre Baskerville', Georgia, serif;
}

.lightbox-essay-text p {
    margin-bottom: 1.2rem;
    text-indent: 1.5em;
}

.lightbox-essay-text p:first-child {
    text-indent: 0;
}

.lightbox-essay-text p:first-child::first-letter {
    font-size: 2.2em;
    float: left;
    line-height: 1;
    margin-right: 0.1em;
    margin-top: 0.05em;
    color: #a8d5db;
    font-weight: 700;
}

@media (max-width: 768px) {
    .lightbox-essay-content {
        max-width: 95%;
        padding: 1.5rem 1.2rem;
        font-size: 1rem;
        max-height: 75vh;
    }

    .lightbox-essay-title {
        font-size: 1.3rem;
    }
}

/* Author Bottom Section Layout - Ghost Overlay Style */
.author-layout {
    position: relative;
    max-width: 900px;
    margin: 1rem auto 3rem auto;
    text-align: left;
    overflow: hidden;
    padding: 2rem 0;
}

/* Avatar styling */
.author-avatar {
    position: absolute;
    left: 0;
    top: 0;
    transform: none;
    width: auto;
    /* Allow width to scale */
    height: 100%;
    /* Force full height of the container */
    object-fit: cover;
    object-position: top left;
    /* Anchor image to top-left to avoid cropping head */
    border-radius: 0;
    opacity: 0.35;
    z-index: 1;
    mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 85%);
    -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 85%);
    border: none;
    box-shadow: none;
}

.author-text {
    position: relative;
    z-index: 2;
    /* On top of image */
    padding-left: 200px;
    /* Push text to not overlap the heaviest part of image */
}

/* Responsive constraints */
@media (max-width: 768px) {
    .author-layout {
        text-align: center;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .author-avatar {
        display: none;
        /* Hide ghost image on mobile for simpler reading, or make it very subtle background? */
        /* Let's try making it a subtle background header */
        display: block;
        width: 100%;
        left: 0;
        top: 0;
        transform: none;
        height: 300px;
        object-fit: cover;
        opacity: 0.2;
        mask-image: linear-gradient(to bottom, black, transparent);
        -webkit-mask-image: linear-gradient(to bottom, black, transparent);
    }

    .author-text {
        padding-left: 0;
    }
}

/* Mentoring Section */
#mentoring {
    background-color: #f9f9f9;
    color: #333;
    padding: 2rem 3rem;
    /* Match global section padding */
    border-top: 1px solid #ddd;
}

.mentoring-content {
    margin: 0;
    text-align: left;
    line-height: 1.6;
}

/* Remove mobile media query as it's no longer needed for reset */

.mentoring-content>p {
    margin-bottom: 1.5rem;
}

/* Alert Box for Conditions */
.mentoring-alert {
    background-color: #fff3cd;
    /* Light warning yellow */
    border-left: 5px solid #ffc107;
    /* Amber border */
    padding: 1.5rem;
    margin: 2rem 0;
    color: #856404;
}

.mentoring-alert h3 {
    margin-top: 0;
    color: #856404;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.mentoring-alert ul {
    list-style-type: none;
    padding-left: 0;
}

.mentoring-alert li {
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(133, 100, 4, 0.2);
}

.mentoring-alert strong {
    color: #533f03;
}

/* Application Section */
.mentoring-apply {
    background-color: #fff;
    padding: 2rem;
    border: 1px solid #eee;
    margin-top: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.mentoring-apply h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.apply-list {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.apply-list li {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    #mentoring {
        padding: 1.5rem 1rem;
        /* Adjust padding for mobile to prevent squeezing */
    }
}

/* ====================================================================
 * LICZNIK ODWIEDZIN
 * ==================================================================== */

.visitor-counter {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #5d6d7e;
    /* Stone/Subtle text color */
    opacity: 0.8;
    text-align: center;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}

.visitor-counter span {
    font-weight: 700;
    color: #7f8c8d;
    /* Slightly lighter/different tone */
    background: rgba(255, 255, 255, 0.05);
    /* Very subtle background */
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}