/* =========================================
   Piotr Koralewski – Portfolio
   Inspired by karolinajonderko.com template
   ========================================= */

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

:root {
  --black: #111;
  --white: #fff;
  --gray-light: #e8e8e8;
  --gray-mid: #888;
  --font-main: 'Lato', Helvetica, Arial, sans-serif;
  --outer-pad: 60px;
  --header-height: 61px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  font-weight: 300;
  color: var(--black);
  background: var(--white);
  font-size: 13px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.6; }
img { display: block; width: 100%; height: auto; }

/* ---- HEADER ---- */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--white);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--outer-pad);
  border-bottom: 1px solid var(--gray-light);
}

#logo .logo {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#topNav nav ul {
  list-style: none;
  display: flex;
  gap: 36px;
}

#topNav nav ul li a {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#topNav nav ul li.active-link a {
  border-bottom: 1px solid var(--black);
  padding-bottom: 1px;
}

/* ---- GALLERY BAR ---- */
#gallery-bar {
  position: fixed;
  top: var(--header-height);
  left: 0; right: 0;
  z-index: 99;
  background: var(--white);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--outer-pad);
}

.gallery-bar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--black);
}

/* ---- MAIN CONTENT ---- */
#page {
  margin-top: var(--header-height);
  padding: var(--outer-pad);
}

/* Na stronach galerii — dodatkowy offset pod gallery-bar */
body:has(#gallery-bar) #page {
  margin-top: calc(var(--header-height) + 60px);
  padding-top: 1px;
}

/* ---- HOMEPAGE GRID ---- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.project-tile {
  cursor: pointer;
  overflow: hidden;
}

.project-tile-link {
  display: block;
}

.project-tile-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--gray-light);
}

.project-tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.project-tile:hover .project-tile-thumb img {
  transform: scale(1.04);
  opacity: 0.85;
}

.project-tile-title {
  margin-top: 5px;
  font-size: 14.3px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--black);
}

/* ---- PROJECT PAGE ---- */
.project-page {
  max-width: 960px;
  margin: 0 auto;
}

.project-page-header {
  margin-bottom: 40px;
}

.project-page-header h1 {
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.project-page-header p {
  font-size: 14px;
  font-weight: 300;
  max-width: 100%;
  line-height: 1.8;
  color: #333;
  text-align: justify;
  margin-bottom: 0;
}

.project-page-header p + p {
  margin-top: 0.6em;
}

.project-page-header p.gap {
  margin-top: 0;
  margin-bottom: 0;
  line-height: 0.8;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.project-gallery-item {
  overflow: hidden;
  cursor: pointer;
}

.project-gallery-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: opacity 0.3s ease;
  aspect-ratio: 3/2;
}

.project-gallery-item:hover img {
  opacity: 0.8;
}

/* Single-column large gallery */
.project-gallery--single {
  grid-template-columns: 1fr;
  max-width: 960px;
  gap: 32px;
}

.project-gallery--single .project-gallery-item img {
  aspect-ratio: unset;
  height: auto;
  width: 100%;
}

.project-gallery--single .project-gallery-item--landscape img {
  aspect-ratio: 3 / 2;
}

.project-gallery--single .project-gallery-item--portrait img {
  aspect-ratio: 2 / 3;
  max-width: 640px;
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  margin-bottom: 36px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--black);
  padding-bottom: 2px;
}

/* ---- ABOUT PAGE ---- */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1000px;
  margin: 0 auto;
  align-items: stretch;
}

.about-image {
  display: flex;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.about-text h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.about-text p {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.8;
  color: #333;
  margin-bottom: 16px;
  text-align: justify;
}

.btn-galeria {
  display: block;
  width: fit-content;
  margin: 8px auto 28px;
  padding: 8px 18px;
  border: 1px solid var(--black);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--black);
  background: transparent;
  cursor: pointer;
}

.btn-galeria:hover {
  background: var(--black);
  color: var(--white);
  opacity: 1;
}

.about-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--black);
  margin-top: 36px;
  margin-bottom: 14px;
}

.about-text .about-section-title {
  margin-top: 0;
}

.about-workshops {
  list-style: none;
  padding: 0;
}

.about-workshops li {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.9;
  color: #333;
}

.about-exhibitions {
  list-style: none;
  padding: 0;
}

.about-exhibitions li {
  display: grid;
  grid-template-columns: 3em 1fr;
  column-gap: 0.5em;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.9;
  color: #333;
}

.about-exhibitions li strong {
  font-weight: 700;
  white-space: nowrap;
}

/* ---- EXHIBITIONS PAGE ---- */
.exhibitions-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1000px;
  margin: 0 auto;
  align-items: start;
}

.exhibitions-column .about-section-title {
  margin-top: 0;
}

/* ---- ABOUT / EXHIBITIONS CENTERED ---- */
.page--centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-height));
}

/* ---- CONTACT PAGE ---- */
.page--contact {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-height) - 36px);
}

.contact-layout {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact-layout h1 {
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 30px;
}

.contact-layout p {
  font-size: 14px;
  font-weight: 300;
  line-height: 2.2;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

.contact-layout .contact-name {
  font-size: 21px;
  margin-bottom: 1em;
}

.contact-layout a {
  color: var(--black);
  border-bottom: 1px solid var(--gray-light);
}

/* ---- LIGHTBOX ---- */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-img-wrap {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.lightbox-img-wrap img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  opacity: 0.7;
  user-select: none;
}

.lightbox-prev:hover, .lightbox-next:hover { opacity: 1; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ---- FOOTER ---- */
#footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--white);
  border-top: 1px solid var(--gray-light);
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--outer-pad);
}

#footer span,
#footer a {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.10em;
  color: var(--gray-mid);
  white-space: nowrap;
}

#footer a:hover { opacity: 0.6; }

.footer-left, .footer-right {
  display: contents;
}

.footer-mid {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: space-around;
}

#page {
  padding-bottom: calc(var(--outer-pad) + 36px);
}

/* ---- MOBILE NAV ---- */
#mobileMenuLink {
  display: none;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#mobileNav {
  display: none;
}

@media (max-width: 768px) {
  #header {
    padding: 0 20px;
  }

  #topNav { display: none; }

  #mobileMenuLink { display: block; }

  #mobileNav.open {
    display: block;
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-light);
    z-index: 99;
    padding: 20px;
  }

  #mobileNav nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  #mobileNav nav ul li a {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  #page {
    padding: 24px 20px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .project-gallery {
    grid-template-columns: 1fr;
  }
}

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