/* CSS Variables - Design System */
:root {
    --background: hsl(0, 0%, 7%);
    --foreground: hsl(0, 0%, 95%);
    
    --card: hsl(0, 0%, 10%);
    --card-foreground: hsl(0, 0%, 95%);
    
    --primary: hsl(0, 72%, 51%);
    --primary-foreground: hsl(0, 0%, 100%);
    
    --secondary: hsl(340, 65%, 47%);
    --secondary-foreground: hsl(0, 0%, 100%);
    
    --muted: hsl(0, 0%, 20%);
    --muted-foreground: hsl(0, 0%, 65%);
    
    --accent: hsl(280, 60%, 50%);
    --accent-foreground: hsl(0, 0%, 100%);
    
    --border: hsl(0, 0%, 20%);
    --ring: hsl(0, 72%, 51%);
    
    --radius: 0.75rem;
    
    --mystery-dark: hsl(0, 0%, 7%);
    --mystery-burgundy: hsl(0, 72%, 51%);
    --mystery-purple: hsl(280, 60%, 50%);
    --mystery-crimson: hsl(340, 65%, 47%);
    
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    --primary-button:hsl(0, 81%, 35%);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
}

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

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: var(--transition-smooth);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}

.navbar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.navbar-brand:hover {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--foreground);
}

.nav-link:hover::after {
    width: 100%;
}

.desktop-menu {
    display: none;
}

@media (min-width: 768px) {
    .desktop-menu {
        display: flex;
    }
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--foreground);
    transition: var(--transition-smooth);
}

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 1rem;
}

.mobile-menu.active {
    display: flex;
}

.mobile-nav-link {
    color: var(--muted-foreground);
    text-decoration: none;
    padding: 0.75rem 1rem;
    transition: var(--transition-smooth);
    border-radius: 0.5rem;
}

.mobile-nav-link:hover {
    background: var(--muted);
    color: var(--foreground);
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 60px;
}

.hero-bg {
    position: absolute;
    inset: 0;
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, 
        hsl(0, 0%, 7%, 0.6) 0%,
        hsl(0, 0%, 7%, 0.8) 50%,
        hsl(0, 0%, 7%) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--primary), var(--secondary), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: var(--muted-foreground);
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-button {
    padding: 1rem 2rem;
    background: var(--primary-button);
    color: var(--primary-foreground);
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.hero-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px hsl(0, 72%, 51%, 0.4);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator-border {
    width: 1.5rem;
    height: 2.5rem;
    border: 2px solid var(--primary);
    border-radius: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0.5rem;
}

.scroll-indicator-dot {
    width: 0.25rem;
    height: 0.5rem;
    background: var(--primary);
    border-radius: 1rem;
    animation: scroll-dot 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

@keyframes scroll-dot {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(12px); }
}

/* Books Section */
.books-section {
    padding: 5rem 0;
    background: var(--background);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-description {
    font-size: 1.1rem;
    color: var(--muted-foreground);
    max-width: 600px;
    margin: 0 auto;
}

/* Carousel */
.carousel-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    /* Dodajemy padding, aby strzałki były widoczne i wewnątrz obszaru kontenera */
    padding: 0 4rem; 
}

.carousel-wrapper {
    overflow: hidden;
    padding: 2rem 0;
}

.carousel-track {
    display: flex;
    gap: 2rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-item {
    /* Mobilna wersja: 1 element na pełną szerokość */
    flex: 0 0 calc(100% - 4rem); 
    min-width: 0;
}

@media (min-width: 768px) {
    .carousel-item {
        /* Tablet: 2 elementy */
        flex: 0 0 calc(50% - 1rem);
    }
}

@media (min-width: 1024px) {
    .carousel-item {
        /* Desktop: 3 elementy */
        flex: 0 0 calc(33.333% - 1.333rem);
    }
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 10;
}

.carousel-button:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.carousel-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Nowe pozycjonowanie przycisków wewnątrz paddingu kontenera */
.carousel-prev {
    left: 0;
}

.carousel-next {
    right: 0;
}

.carousel-hint {
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* Book Card */
.book-card {
    position: relative;
    height: 500px;
    perspective: 1000px;
    transition: var(--transition-smooth);
}

.book-card:hover {
    transform: rotateY(15deg);
    cursor: pointer;
}

.book-cover {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 25px 50px hsl(0, 0%, 0%, 0.5);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        hsl(0, 0%, 0%, 0.8) 0%,
        hsl(0, 0%, 0%, 0.4) 40%,
        transparent 100%
    );
}

.book-spine {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 3rem;
    background: linear-gradient(to right, var(--background), var(--muted));
    border-radius: 0 var(--radius) var(--radius) 0;
    transform-origin: left center;
    transform: translateX(100%) rotateY(90deg);
    opacity: 0;
    transition: opacity 0.6s;
}

.book-card:hover .book-spine {
    opacity: 1;
}

.book-info {
    position: absolute;
    inset: 0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: var(--foreground);
    opacity: 0.8;
    transition: opacity 0.3s;
}

/* Efekt przyciemnienia karty książki po najechaniu */
.book-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0); /* Startujemy od przezroczystości */
    border-radius: var(--radius);
    transition: background 0.4s ease;
    z-index: 5; /* Pomiędzy okładką a tekstem */
    pointer-events: none;
}

.book-card:hover::after {
    background: rgba(0, 0, 0, 0.7); /* Przyciemnienie tła o 70% */
}

/* Upewniamy się, że tekst opisu jest nad przyciemnieniem */
.book-info {
    z-index: 10;
}

.book-card:hover .book-info {
    opacity: 1;
}

.book-description {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgb(255, 255, 255);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s 0.1s;
    text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;
}

.book-card:hover .book-description {
    opacity: 1;
    transform: translateY(0);
}

/* About Section */
.about-section {
    padding: 5rem 0;
    background: hsl(0, 0%, 20%, 0.2);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.about-image-container {
    position: relative;
}

.about-image-glow {
    position: absolute;
    inset: -1rem;
    background: linear-gradient(135deg, hsl(0, 72%, 51%, 0.2), hsl(280, 60%, 50%, 0.2));
    border-radius: var(--radius);
    opacity: 0.5;
    filter: blur(40px);
}

.about-image {
    position: relative;
    width: 100%;
    border-radius: var(--radius);
    box-shadow: 0 25px 50px hsl(0, 0%, 0%, 0.5);
}

.about-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-text {
    color: hsl(0, 0%, 90%);
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 1rem;
}

.about-highlight {
    color: var(--primary);
    font-weight: 600;
}

/* Gallery Preview Section */
.gallery-preview-section {
    padding: 5rem 0;
    background: var(--background);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-smooth);
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.gallery-no-fit img{
    object-fit: fill;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-cta {
    text-align: center;
}

.gallery-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-button);
    color: var(--primary-foreground);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.gallery-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px hsl(0, 72%, 51%, 0.4);
}

/* Gallery Page */
.gallery-page {
    padding: 8rem 0 5rem;
}

.page-header {
    text-align: center;
    margin-bottom: 4rem;
}

.page-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-description {
    font-size: 1.1rem;
    color: var(--muted-foreground);
    max-width: 600px;
    margin: 0 auto;
}

.full-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.full-gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
}

.full-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.full-gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, hsl(0, 0%, 0%, 0.8), transparent);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: var(--transition-smooth);
}

.full-gallery-item:hover .full-gallery-overlay {
    opacity: 1;
}

.full-gallery-item:hover img {
    transform: scale(1.1);
}

.full-gallery-title {
    color: var(--foreground);
    font-size: 1.25rem;
    font-weight: 600;
}


/* --- SEKCJA OPOWIADANIA (POPRAWIONA) --- */
.stories-page {
    padding: 8rem 0 5rem;
}

.stories-grid {
    display: grid;
    gap: 2.5rem;
    max-width: 1100px;
    margin: 0 auto;
    /* Dwa kafelki obok siebie na desktopie, jeden na telefonie */
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

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

.story-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

.story-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 40px hsl(0, 0%, 0%, 0.5);
    transform: translateY(-5px);
}

.story-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.story-date {
    color: var(--muted-foreground);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.story-excerpt {
    color: var(--muted-foreground);
    margin: 1.5rem 0;
    font-style: italic;
    flex-grow: 1;
}

/* PRZYCISKI PDF Z IKONĄ */
.read-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0.9rem 1.5rem;
    background-color: var(--primary-button);
    color: var(--primary-foreground);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.read-more-btn:hover {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px rgba(184, 15, 15, 0.4);
}

.pdf-icon {
    transition: transform 0.3s ease;
}

.read-more-btn:hover .pdf-icon {
    transform: scale(1.2);
}

/* Footer */
.footer {
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    margin-top: 5rem;
}

.footer-content {
    text-align: center;
    margin-bottom: 2rem;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--foreground);
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}

.social-link {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--muted);
    color: var(--foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px hsl(0, 72%, 51%, 0.3);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--muted-foreground);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 1s ease-out;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out;
}

.scale-in {
    animation: scaleIn 0.6s ease-out;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--primary);
    color: var(--primary-foreground);
}