/* ========== FONTS ========== */
/* Libre Franklin - najbliższa legalnie darmowa alternatywa dla ITC Franklin Gothic */
/* Importowana przez <link> w HTMLach (Google Fonts) */

/* ========== RESET ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Libre Franklin", Arial, sans-serif;
    background: #2b2b2b;
    color: white;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== NAVBAR ========== */
.navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 96px 28px 40px;
    z-index: 100;
    background: transparent;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

/* Po zescrollowaniu - półprzezroczyste tło z blurem */
.navbar.scrolled {
    background: rgba(43, 43, 43, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Linia navbara - zaczyna się trochę przed "Art", kończy na prawej krawędzi */
.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    /* Zaczyna się ~40px przed pierwszym linkiem Art */
    width: calc(3 * 120px + 96px + 40px);
    height: 1px;
    background: white;
}

.navbar .nav-name {
    text-decoration: none;
    color: white;
    font-size: 22px;
    font-weight: 700;
    font-style: normal;
    letter-spacing: 0.5px;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.navbar .nav-name:hover {
    opacity: 0.6;
}

.nav-links {
    display: flex;
    gap: 100px;
}

.navbar a {
    text-decoration: none;
    color: white;
    font-size: 16px;
    font-style: italic;
    font-weight: 400;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.navbar a:hover {
    opacity: 0.6;
}

.navbar a.active {
    font-weight: 600;
    font-style: normal;
}

/* ========== COORDS ========== */
.coords {
    position: absolute;
    bottom: 18px;
    right: 28px;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.3px;
}

/* ========== HERO (INDEX) ========== */
.hero {
    position: relative;
    height: 100vh;
    background-image: url("img/bg1.jpg");
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-start;
    padding: 37.5vh 0 0 83px;
    overflow: hidden;
}

.hero-content {
    display: flex;
    flex-direction: column;
}

.hero h1 {
    font-size: 70px;
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.0;
    color: white;
}

.hero-bottom {
    margin-top: 130px;
}

.subtitle {
    font-size: 18px;
    letter-spacing: 3px;
    font-weight: 400;
    color: white;
    margin-bottom: 14px;
}

/* Linia pod subtitle - mniej więcej do końca słowa "Tymoszuk" */
.line-subtitle {
    height: 1px;
    background: white;
    width: 620px;
    margin-left: -83px;
}

/* ========== ART HERO ========== */
.art-hero {
    position: relative;
    height: 60vh;
    background-image: url("img/bg2.jpg");
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
}

.art-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-right: 120px;
    max-width: 520px;
}

.statement {
    font-size: 21px;
    line-height: 1.6;
    font-style: italic;
    font-weight: 400;
    color: white;
    margin-bottom: 18px;
}

.line-right {
    height: 1px;
    background: white;
    width: 520px;
    align-self: flex-end;
    margin-right: -120px;
}

/* ========== GALERIA ========== */
.gallery {
    background: #2b2b2b;
    padding: 80px 83px 100px;
    display: flex;
    flex-direction: column;
    gap: 120px;
}

/* Siatka 3x5 na początku - równe kwadratowe kafelki jak w Canvie */
.gallery-grid-intro {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.gallery-grid-intro img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
}

.gallery-grid-intro img:hover {
    opacity: 0.85;
}

/* Seria prac - meta NAD zdjęciami */
.art-series {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* Meta-dane serii - idą PRZED gridem zdjęć */
.series-meta {
    order: -1;
    line-height: 1;
}

.series-meta .year {
    font-size: 26px;
    font-weight: 400;
    letter-spacing: 0;
    color: white;
    display: block;
    line-height: 1.1;
    margin-bottom: 2px;
}

.series-meta .location {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: white;
    display: block;
    line-height: 1.1;
    margin-bottom: 8px;
}

.series-meta .dimensions,
.series-meta .technique {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    font-weight: 400;
    display: block;
    line-height: 1.4;
}

/* ==========================================================
   SERIES GRID - Safari-safe version
   Zamiast aspect-ratio (który w Safari w kombinacji z grid +
   object-fit: cover powoduje nadmierne kadrowanie zdjęć i
   zapadanie się odstępów) używamy twardej wysokości
   obliczanej przez clamp() z szerokości viewport-u.
   Dzięki temu grid ZAWSZE ma zdefiniowaną wysokość,
   a 1fr wiersze w img-stack też ją mają - więc gap faktycznie
   działa i object-fit kadruje prawidłowo.
   ========================================================== */

/* WARIANT A (pionowy) - 1 duże po lewej + 3 małe w kolumnie po prawej
   Proporcja 3:2. Przy max-width 1100px daje ~733px wysokości,
   a na mobile skaluje się z viewportem. */
.series-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 2fr 1fr;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    /* Wysokość = 2/3 szerokości kontenera. 
       min 250px, max 733px (czyli 2/3 z 1100). 
       Między nimi skaluje się z viewportem - 
       liczymy 2/3 z (100vw - 166px paddingu strony). */
    height: clamp(250px, calc((100vw - 166px) * 0.6667), 733px);
}

/* WARIANT B (poziomy) - 1 duże na górze + 3 małe w rzędzie pod spodem
   Proporcja 4:3. */
.series-grid.horizontal {
    grid-template-columns: 1fr;
    grid-template-rows: 2fr 1fr;
    height: clamp(280px, calc((100vw - 166px) * 0.75), 825px);
}

/* ZDJĘCIE GŁÓWNE - wypełnia kontener bez pustych miejsc.
   min-height/min-width: 0 są KRYTYCZNE dla Safari - bez tego 
   grid item domyślnie ma min-content i się rozpycha. */
.series-grid .img-main {
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
}

.img-stack {
    display: grid;
    gap: 16px;
    min-height: 0;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

/* Stack pionowy (wariant A) */
.img-stack.stack-3 {
    grid-template-rows: repeat(3, 1fr);
}

.img-stack.stack-4 {
    grid-template-rows: repeat(4, 1fr);
}

/* Stack poziomy (wariant B) - 3 zdjęcia w rzędzie pod dużym.
   Wariant B nie ma w HTML-u klasy stack-3 więc używamy selektora
   na .series-grid.horizontal .img-stack */
.series-grid.horizontal .img-stack {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
}

.img-stack img {
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
}

.series-grid .img-main:hover,
.img-stack img:hover {
    opacity: 0.85;
}

/* Kursor "klikalny" dla wszystkich zdjęć galerii */
.gallery-grid-intro img,
.series-grid .img-main,
.img-stack img {
    cursor: zoom-in;
}

/* ========== LIGHTBOX ========== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
    animation: lightbox-fade 0.25s ease;
}

@keyframes lightbox-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    user-select: none;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: transparent;
    border: none;
    color: white;
    font-family: "Libre Franklin", Arial, sans-serif;
    cursor: pointer;
    transition: opacity 0.3s;
    padding: 10px 20px;
    z-index: 1001;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 0.6;
}

.lightbox-close {
    top: 20px;
    right: 30px;
    font-size: 48px;
    line-height: 1;
    font-weight: 300;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    line-height: 1;
    font-weight: 300;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 900px) {
    .lightbox-close {
        font-size: 36px;
        top: 10px;
        right: 15px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 40px;
    }

    .lightbox-prev { left: 5px; }
    .lightbox-next { right: 5px; }
}

/* ========== ARTIST HERO ========== */
.artist-hero {
    position: relative;
    height: 60vh;
    background-image: url("img/bg3.jpg");
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
}

.artist-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-right: 120px;
    max-width: 520px;
}

/* ========== ARTIST INFO (ciemne tło!) ========== */
.artist-info {
    background: #2b2b2b;
    color: white;
    padding: 80px 83px 100px;
    display: flex;
    flex-direction: column;
    gap: 70px;
}

.info-block {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 60px;
    align-items: start;
}

.info-label {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 200px;
}

.info-label span {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    color: white;
}

.label-line {
    height: 1px;
    background: white;
    width: 100%;
}

.info-text p {
    font-size: 15px;
    line-height: 1.8;
    color: white;
    font-weight: 400;
}

/* ========== CONTACT HERO ========== */
.contact-hero {
    position: relative;
    height: 60vh;
    background-image: url("img/bg4.jpg");
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* ========== CONTACT INFO (jasne tło) ========== */
.contact-info {
    background: #ecf0f2;
    color: #2b2b2b;
    padding: 60px 83px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40vh;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
    color: #2b2b2b;
    font-size: 22px;
    font-weight: 400;
    transition: opacity 0.3s;
}

.contact-item:hover {
    opacity: 0.6;
}

.contact-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    color: #2b2b2b;
}

.contact-qr img {
    width: 140px;
    height: 140px;
    display: block;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .navbar {
        padding: 20px 20px 20px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .navbar::after {
        left: 20px;
    }

    .nav-links {
        gap: 30px;
    }

    .nav-name {
        font-size: 14px;
    }

    .navbar a {
        font-size: 14px;
    }

    .hero {
        padding: 40vh 0 0 40px;
    }

    .hero h1 {
        font-size: 48px;
    }

    .line-subtitle {
        margin-left: -40px;
        width: calc(100% + 40px);
    }

    .art-hero,
    .artist-hero {
        align-items: flex-end;
        padding-bottom: 60px;
    }

    .art-hero-inner,
    .artist-hero-inner {
        padding-right: 30px;
        max-width: 100%;
    }

    .line-right {
        width: 80vw;
        margin-right: -30px;
    }

    .statement {
        font-size: 20px;
    }

    .gallery {
        padding: 60px 20px 80px;
        gap: 60px;
    }

    /* Układ galerii zostaje taki jak na desktopie - Basia tak chce :) */
    /* Tylko gap jest mniejszy żeby zmieściło się na wąskim ekranie */
    .series-grid,
    .img-stack {
        gap: 8px;
    }

    /* Na mobile padding galerii to 20px po bokach (40px razem),
       więc rekalkulujemy wysokość gridu: */
    .series-grid {
        height: calc((100vw - 40px) * 0.6667);
    }
    .series-grid.horizontal {
        height: calc((100vw - 40px) * 0.75);
    }

    .artist-info,
    .contact-info {
        padding: 50px 30px 70px;
    }

    .info-block {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .contact-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 40px;
    }

    .contact-item {
        font-size: 18px;
    }
}
