﻿/* ==========================================================================
   1. RESET, CZCIONKI I ZMIENNE GLOBALNE
   ========================================================================== */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	--primary-color: #a00000;
	--secondary-color: #cc0033;
	--accent-color: #808080;
	--background-color: #f6f6f6;
	--text-color: #444444;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	color: var(--text-color);
	line-height: 1.4;
}

.project-title { text-transform: uppercase; font-weight: 700; line-height: 1.2; }
.project-type { font-weight: 600; }
.work-done-title { text-transform: uppercase; font-weight: 700; }

.work-done-list a {
	color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.work-done-list a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Styl komunikatu o braku ilustracji */
.no-images-fallback {
    grid-column: 1 / -1 !important;
    grid-row: 1 / -1 !important;
    background-color: #eaeaea;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    border: 2px dashed #bdc3c7;
    height: 100%;
    width: 100%;
}

.gallery-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    overflow: hidden;
        /*grid-template-columns: repeat(2, 1fr);*/
        /*grid-template-rows: repeat(6, 1fr);*/
	grid-column: span 2; 
    grid-row: span 6;
}

/* ==========================================================================
   5. STYLIZACJA PRZYCISKU POWROTU
   ========================================================================== */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: transparent;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: calc(10px + 0.2vh);
    padding: 4px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

.back-button:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background-color: rgba(22, 160, 133, 0.05);
}



/* ==========================================================================
   2. STYLE EKRANOWE DLA MONITORÓW (DESKTOP)
   ========================================================================== */
@media screen and (min-width: 769px) {
body {
	background-color: var(--background-color);
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	overflow: hidden;
}

.page-container {
	background: #fff;
	height: 85vh; 
	width: calc(85vh * 1.414);
	max-width: 95vw;
	padding: 2.5vh;
	box-shadow: 0 0 15px rgba(0,0,0,0.1);
	display: flex;
	gap: 4%; 
	overflow: hidden; 
}

.left-column {
	width: 38%;
	flex-shrink: 0; 
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
}

.header-section {
	border-bottom: 1px solid var(--accent-color);
	padding-bottom: 1vh;
}

.project-title { font-size: calc(14px + 1vh); color: var(--primary-color); }
.project-type { font-size: calc(10px + 0.3vh); color: var(--secondary-color); margin-top: 5px; }

.details-section {
	margin-top: 1.5vh;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	overflow: hidden;
}
    
.page-container:not(.portfolio-page) .details-section {
	justify-content: space-around; 
}

.meta-info { font-size: calc(10px + 0.3vh); color: var(--accent-color); font-weight: 600; margin-bottom: 1.5vh; }
.project-description { font-size: calc(11px + 0.3vh); text-align: justify; margin-bottom: 2vh; }

.work-done-title { font-size: calc(11px + 0.3vh); color: var(--primary-color); margin-bottom: 1vh; }
.work-done-container { flex-grow: 1; overflow-y: auto; padding-right: 5px; }
.work-done-list { font-size: calc(10.5px + 0.3vh); padding-left: 18px; }
.work-done-list li { margin-bottom: 4px; }

.footer-section {
	border-top: 1px solid #e0e0e0;
	padding-top: 1vh;
	display: flex;
	justify-content: space-between;
	align-items: left;/* center */
	font-size: calc(11px + 0.3vh);
}
.project-leader span { font-weight: bold; color: var(--primary-color); }
.status-badge { background-color: var(--accent-color); color: white; padding: 3px 8px; border-radius: 3px; font-size: calc(9px + 0.2vh); font-weight: bold; text-transform: uppercase; }
.footer-text { color: var(--secondary-color); font-style: italic; }

/* ==========================================================================
       ELASTYCZNA PRAWA KOLUMNA DESKTOP
       ========================================================================== */
.right-column {
	Sherwood: 1;
	flex-grow: 1; 
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	grid-template-rows: repeat(6, 1fr);
	gap: 1.2vh;
	height: 100%;
}

.collage-item { position: relative; overflow: hidden; background-color: #eaeaea; border-radius: 4px; }
.collage-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --- UKŁAD DLA TRYBU PORTFOLIO (SZTYWNE 6 ZDJĘĆ OD GÓRY DO DOŁU) --- */
.portfolio-page .right-column {
	grid-template-columns: repeat(2, 1fr) !important;
	grid-template-rows: repeat(3, 1fr) !important;
}
.portfolio-page .right-column .collage-item {
	grid-column: span 1 !important;
	grid-row: span 1 !important;
}

/* --- UKŁADY DLA TRYBU KARTY PROJEKTU (Bezpieczne klasy PHP) --- */
    
/* 1 zdjęcie: zajmuje całość */
.images-count-1 .collage-item { grid-column: span 2; grid-row: span 6; }

/* 2 zdjęcia: dwa równe poziome pasy */
.images-count-2 .collage-item { grid-column: span 2; grid-row: span 3; }

/* 3 zdjęcia: duże na górze, dwa małe pod spodem */
.images-count-3 .collage-item:nth-child(1) { grid-column: span 2; grid-row: span 4/*3.4*/; }
.images-count-3 .collage-item:nth-child(n+2) { grid-column: span 1; grid-row: span 2/*2.6*/; }

/* 4 zdjęcia: duże na górze, trzy mniejsze na dole (teraz na 100% rozciągnie je do dołu) */
.images-count-4 { grid-template-columns: repeat(3, 1fr) !important; }
.images-count-4 .collage-item:nth-child(1) { grid-column: span 3 !important; grid-row: span 4 !important; }
.images-count-4 .collage-item:nth-child(n+2) { grid-column: span 1 !important; grid-row: span 2 !important; }

/* 5 zdjęć: dwa średnie na górze, trzy mniejsze na dole */
.images-count-5 { grid-template-columns: repeat(6, 1fr) !important; }
.images-count-5 .collage-item:nth-child(1),
.images-count-5 .collage-item:nth-child(2) { grid-column: span 3 !important; grid-row: span 3 !important; }
.images-count-5 .collage-item:nth-child(n+3) { grid-column: span 2 !important; grid-row: span 3 !important; }
/**/

/* --- EFEKT SKALOWANIA ZDJĘĆ PO NAJECHANIU (HOVER) --- */
.collage-item {
	position: relative;
	overflow: hidden; /* Ukrywa wystające krawędzie powiększanego zdjęcia */
	background-color: #eaeaea;
	border-radius: 4px;
}

.collage-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	/* Definiujemy czas i płynność animacji (0.4 sekundy) */
	transition: transform 0.4s ease-in-out; 
}

/* Reguła powiększająca zdjęcie o 5% (scale 1.05) po najechaniu myszką */
.collage-item:hover img {
	transform: scale(1.05);
}

}/* @media screen and (min-width: 769px) */



/* ==========================================================================
   3. STYLE EKRANOWE DLA SMARTFONÓW I TABLETÓW
   ========================================================================== */
@media screen and (max-width: 768px) {
	
body { padding: 10px; background-color: #fff; overflow: auto; }

.page-container { width: 100%; height: auto; display: flex; flex-direction: column; gap: 25px; padding: 10px; }

.left-column { width: 100%; height: auto; gap: 15px; }

.header-section { border-bottom: 1px solid var(--accent-color); padding-bottom: 8px; }

.project-title { font-size: 22px; color: var(--primary-color); }
.project-type { font-size: 13px; color: var(--secondary-color); }
.meta-info { font-size: 12px; color: var(--accent-color); margin-bottom: 10px; font-weight: 600; }
.project-description { font-size: 13px; text-align: justify; margin-bottom: 15px; }

.work-done-title { font-size: 13px; color: var(--primary-color); margin-bottom: 5px; }
.work-done-list { font-size: 14px; padding-left: 20px; }
.work-done-list li { margin-bottom: 6px; }
.work-done-list a { font-weight: bold; }

.footer-section { border-top: 1px solid #e0e0e0; padding-top: 10px; display: flex; justify-content: space-between; font-size: 13px; }
.project-leader span { font-weight: bold; }
.status-badge { background-color: var(--accent-color); color: white; padding: 2px 6px; border-radius: 3px; font-size: 11px; }
.footer-text { color: var(--secondary-color); font-style: italic; }

.right-column { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.collage-item { height: 200px; border-radius: 4px; overflow: hidden; }
.collage-item img { width: 100%; height: 100%; object-fit: cover; }
.no-images-fallback { height: 150px; }

}/* @media screen and (max-width: 768px) */


/* ==========================================================================
   6. AKTYWNA NAKŁADKA NA ZDJĘCIA (LIGHTBOX)
   ========================================================================== */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85); /* Ciemne tło maskujące */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Maksymalny priorytet warstwy, by przykryć wszystko */
    
    /* Efekt płynnego pojawiania się (Fade-in) */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

/* Klasa aktywowana przez JavaScript */
#lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain; /* Zdjęcie zachowa swoje proporcje i nie wyjdzie poza ekran */
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    cursor: zoom-out; /* Kursor sugerujący kliknięcie w celu zamknięcia */
    
    /* Efekt lekkiego wyskakiwania zdjęcia (Pop-out) */
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
}

#lightbox-overlay.active #lightbox-img {
    transform: scale(1);
}



/* ==========================================================================
   4. STYLE DLA WYDRUKU (A4 POZIOMO - BEZBŁĘDNE DOPASOWANIE)
   ========================================================================== */
@media print {
    @page {
        size: A4 landscape;
        margin: 0; /* Zerujemy marginesy systemowe, aby kontrolować je wewnątrz */
    }
    
/* Reset i czyszczenie tła strony */
body {
	background-color: #fff !important;
	padding: 0 !important;
	margin: 0 !important;
	display: block !important;
	min-height: auto !important;
	-webkit-print-color-adjust: exact !important;
	print-color-adjust: exact !important;
}

/* Sztywny kontener A4 Poziom (wymiary techniczne papieru) */
.page-container {
	display: flex !important;
	flex-direction: row !important;
	width: 297mm !important;
	height: 210mm !important;
	max-width: 297mm !important;
	max-height: 210mm !important;
	padding: 15mm 15mm 15mm 15mm !important; 
	gap: 10mm !important; /* Sztywny odstęp w mm zamiast % */
	background: #fff !important;
	box-shadow: none !important;
	overflow: hidden !important;
	box-sizing: border-box !important;
}

/* Lewa kolumna (tekst) */
.left-column {
	width: 100mm !important; /* Sztywna szerokość */
	height: 180mm !important; /* Wysokość dopasowana do paddingu kontenera */
	display: flex !important;
	flex-direction: column !important;
	justify-content: space-between !important;
	flex-shrink: 0 !important;
}

.header-section {
	border-bottom: 2px solid var(--accent-color) !important;
	padding-bottom: 4mm !important;
}

.project-title { font-size: 22pt !important; color: var(--primary-color) !important; }
.project-type { font-size: 11pt !important; color: var(--secondary-color) !important; }
.meta-info { font-size: 10pt !important; color: var(--accent-color) !important; margin-bottom: 4mm !important; }
.project-description { font-size: 10.5pt !important; text-align: justify !important; margin-bottom: 4mm !important; /**/flex-grow: 1; justify-content: flex-start !important;/**/ }
.work-done-title { font-size: 11pt !important; color: var(--primary-color) !important; margin-bottom: 2mm !important; }
    
/* W druku pozwalamy liście zająć tyle miejsca, ile potrzebuje (bez scrollbara) */
.work-done-container { overflow: visible !important; }
.work-done-list { font-size: 10pt !important; padding-left: 5mm !important; }
.work-done-list li { margin-bottom: 1.5mm !important; }
.work-done-list a { color: #000 !important; text-decoration: none !important; }

.meta-info { margin-bottom: 4mm !important; }
.project-description { margin-bottom: 5mm !important; }
.work-done-container { margin-bottom: 5mm !important; overflow: visible }

.footer-section { 
	border-top: 1px solid #e0e0e0 !important;
	padding-top: 3mm !important;
	font-size: 9.5pt !important; 
}
    
.project-leader span { font-weight: bold; }
.status-badge { 
	background-color: #ffffff !important; 
	color: #808080 !important; 
	padding: 1mm 3mm !important; 
	border-radius: 3px !important; 
	font-size: 8.5pt !important; 
	display: inline-block !important;
}
.footer-text { color: #7f8c8d !important; font-style: italic; }

/* Prawa kolumna (galeria) - Sztywna siatka w milimetrach */
.right-column {
	width: 157mm !important; /* Pozostała przestrzeń z 297mm */
	height: 180mm !important;
	display: grid !important;
	grid-template-columns: repeat(2, 1fr) !important;
	grid-template-rows: repeat(6, 1fr) !important;
	gap: 4mm !important; /* Odstępy między zdjęciami */
}

.collage-item {
	background-color: #eaeaea !important;
	border-radius: 4px !important;
	overflow: hidden !important;
	height: 100% !important;
}
.collage-item img { width: 100% !important; height: 100% !important; object-fit: cover !important; }

/* Sztywne odwzorowanie układów zdjęć w klasach PHP dla druku */
.portfolio-page .right-column {
	grid-template-columns: repeat(2, 1fr) !important;
	grid-template-rows: repeat(6, 1fr) !important;/*3?6*/
}
.portfolio-page .right-column .collage-item { grid-column: span 1 !important; grid-row: span 1 !important; }

.images-count-1 .collage-item { grid-column: span 2 !important; grid-row: span 6 !important; }
.images-count-2 .collage-item { grid-column: span 2 !important; grid-row: span 3 !important; }
    
.images-count-3 .collage-item:nth-child(1) { grid-column: span 2 !important; grid-row: span 4/*3.4*/ !important; }
.images-count-3 .collage-item:nth-child(n+2) { grid-column: span 1 !important; grid-row: span 2/*2.6*/ !important; }

.images-count-4 { grid-template-columns: repeat(3, 1fr) !important; }
.images-count-4 .collage-item:nth-child(1) { grid-column: span 3 !important; grid-row: span 4/*3.4*/ !important; }
.images-count-4 .collage-item:nth-child(n+2) { grid-column: span 1 !important; grid-row: span 2/*2.6*/ !important; }

.images-count-5 { grid-template-columns: repeat(6, 1fr) !important; }
.images-count-5 .collage-item:nth-child(1), .images-count-5 .collage-item:nth-child(2) { grid-column: span 3 !important; grid-row: span 3 !important; }
.images-count-5 .collage-item:nth-child(n+3) { grid-column: span 2 !important; grid-row: span 3 !important; }

/* Ukrywamy elementy czysto nawigacyjne w druku */
.back-button { display: none !important; }
#lightbox-overlay { display: none !important; }

}/* @media print */



