/* ========================================
   GALLERY – COMPLETE CLEAN VERSION
   Arkadiusz Wawer
======================================== */


:root {
  --color-bg-main: #1C1A17;
  --color-bg-soft: #2A2622;

  --color-text-main: #EDE6DC;
  --color-text-muted: #AFA79C;

  --color-accent: #8B6B4A;
  --color-accent-light: #A07A52;

  --color-border: rgba(255, 255, 255, 0.1);
}


/* ========================================
   LAYOUT
======================================== */

.gallery-section .kt-row-column-wrap {
  gap: 10px;
}

/* =========================
   SECTION WRAPPER
========================= */

.gallery-section {
  position: relative;
  z-index: 2;

  background: transparent;

  padding: 40px 280px 120px 180px;
}

/* =========================
   LIGHT TRANSITION (HERO → GALLERY)
========================= */
/*
.gallery-section::before {
  content: "";
  position: absolute;

  top: -80px;
  left: 0;
  width: 100%;
  height: 120px;

  
    background:
    
    radial-gradient(
      ellipse at 50% 0%,
      rgba(255,255,255,0.06) 0%,
      rgba(255,255,255,0.03) 30%,
      rgba(255,255,255,0.01) 55%,
      rgba(0,0,0,0) 100%
    ),

 
    linear-gradient(
      to bottom,
      rgba(28,26,23,0) 0%,
      rgba(28,26,23,0.4) 50%,
      rgba(28,26,23,0.85) 80%,
      rgba(28,26,23,1) 100%
    );



  pointer-events: none;
}

*/


.gallery-main,
.gallery-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* =========================
   ITEM BASE
========================= */

.gallery-item {
  position: relative;
  display: block;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  display: block;

  transition: transform 0.6s ease, filter 0.6s ease;

  filter: drop-shadow(0 25px 60px rgba(0,0,0,0.45));
}




/* ========================================
   IMAGE
======================================== */

.gallery-image {
  position: relative;
  z-index: 1;
}

.gallery-image img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  line-height: 0; 
  transition: transform 0.4s ease, filter 0.4s ease; 
}




/* =========================
   LEFT (MAIN IMAGE)
========================= */

.gallery-main {
  position: relative;
  transform: translateY(40px);
  width: 80%;
}

.gallery-main .gallery-item {
  opacity: 0;
  transform: translateY(40px);
  animation: fadeUpMain 0.9s ease forwards;
}

@keyframes fadeUpMain {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-main img {
  width: 100%;
  display: block;

  transform: scale(1.03);

  filter: drop-shadow(0 40px 80px rgba(0,0,0,0.55));
}


/* =========================
   RIGHT STACK
========================= */

.gallery-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 120%; 
}

.gallery-stack .gallery-item {
  opacity: 0;

  animation: fadeUp 0.8s ease forwards;
}

.gallery-stack .gallery-item:nth-child(1) {
  animation-delay: 0.2s;
}

.gallery-stack .gallery-item:nth-child(2) {
  animation-delay: 0.4s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



/* =========================
   COMPOSITION & SCALE
========================= */
/*
.gallery-stack .gallery-item:first-child {
  transform: translateX(30px);
  width: 90%;
  left: 50px;
}

.gallery-stack .gallery-item:last-child {
  transform: translateX(-20px);
  width: 78%;
  left: 0px;
}
*/
.gallery-stack .gallery-item:first-child {
  width: 90%;
  margin-left: auto; /* przyklej do prawej */
}

.gallery-stack .gallery-item:last-child {
  width: 78%;
  margin-right: auto; /* przyklej do lewej */
}


/* ========================================
   CAPTION
======================================== */

.gallery-caption {
  position: absolute;

  bottom: 40px;
  left: 20px;
  transform: translateX(50%);


  width: auto;
  max-width: 85%;

  padding: 1px 1px;

  
  overflow: hidden;

  background: linear-gradient(
    180deg,
    rgba(15,13,11,0.78) 0%,
    rgba(20,18,16,0.9) 100%
  );

  backdrop-filter: blur(10px);

  box-shadow:
    0 20px 60px rgba(0,0,0,0.45),
    inset 0 0 30px rgba(255,255,255,0.05);

  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  
  max-width: 360px;

  opacity: 0;
  /* transform: translateY(15px); */
  transition: all 0.35s ease;
  z-index: 2;
}

/* CONTENT LAYER */

.gallery-caption > * {
  position: relative;
  z-index: 2;
}


/* ========================================
   CAPTION OVERLAYS (FIXED)
======================================== */

.gallery-caption::before,
.gallery-caption::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.gallery-caption::before {
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.12),
    rgba(255,255,255,0)
  );
}

.gallery-caption::after {
  background: radial-gradient(
    circle at 30% 20%,
    rgba(0,0,0,0.35),
    rgba(0,0,0,0.65)
  );
  z-index: 1;
}

/* ========================================
   HOVER LOGIC (GLOBAL FIX)
======================================== */

.gallery-item:hover .gallery-caption {
  opacity: 1 !important;
  transform: translateY(0) !important;
  
}

.gallery-item:hover .gallery-image img {
  transform: scale(1.02);
  filter: brightness(1.05);
}

/* ========================================
   GLOW (EDGE FLOW)
======================================== */

.gallery-caption-glow {
  position: relative;
  padding: 20px 22px; 
  border-radius: 12px;
}

.gallery-caption-glow::before {
  content: "";
  position: absolute;
  inset: -2.0px;

  border-radius: inherit;
  padding: 1.5px; 

  background: linear-gradient(
    110deg,
    transparent 42%,
    rgba(255,215,140,0.0) 46%,
    rgba(255,215,140,0.35) 48%,
    rgba(255,215,140,0.9) 50%,
    rgba(255,215,140,0.35) 52%,
    rgba(255,215,140,0.0) 54%,
    transparent 58%
  );

  background-size: 250% 250%;

  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;

  filter: blur(1.2px);

  opacity: 0;
  transition: opacity 0.3s ease;

  animation: edgeFlow 6s linear infinite;

  pointer-events: none;
  z-index: 3;
}

.gallery-item:hover .gallery-caption-glow::before,
.gallery-caption:hover .gallery-caption-glow::before {
  opacity: 1;
}


/* ========================================
   ANIMATION
======================================== */

@keyframes edgeFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}


/* ========================================
   TYPOGRAPHY
======================================== */


.gallery-caption p {
  font-size: 13px !important;
  line-height: 1.7 !important;
  color: rgba(255,255,255,0.80) !important;

  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}




.gallery-caption-title strong {
  font-size: 16px !important;
  font-weight: 600;

  background: linear-gradient(
    135deg,
    #e6c98a 0%,
    #fff3c4 25%,
    #d6b97b 50%,
    #b8964f 75%,
    #fff1b8 100%
  );

  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  letter-spacing: 0.06em;

  text-shadow:
    0 2px 6px rgba(0,0,0,0.8),
    0 0 10px rgba(255,220,140,0.2);
}


/* =========================
   TEXT – READABILITY
========================= */

.gallery-caption .wp-block-group__inner-container p {
  hyphens: none;          /* 🔥 blokada dzielenia */
  word-break: keep-all;   /* 🔥 dodatkowe zabezpieczenie */
}


.gallery-more {
  margin-top: 40px;
  text-align: center;
}

.gallery-more-btn {
  display: inline-block;
  font-size: 14px;
  letter-spacing: 0.05em;

  color: #e6c98a;

  text-decoration: none;
  
  border: 1px solid rgba(255,255,255,0.2);
  padding: 10px 20px;
  border-radius: 8px;


  transition: all 0.3s ease;
}

.gallery-more-btn:hover {
  opacity: 1;
  border-color: rgba(230,201,138,0.8);
  transform: translateY(-2px);
  color: #e6c98a;
}

.gallery-more-btn,
.gallery-more-btn:visited {
  color: #d4b679;
  border-color: rgba(212,182,121,0.3);
  filter: brightness(0.85);
}


/* ========================================
   TABLET
======================================== */



/*



@media (min-width: 769px) and (max-width: 1024px) {

  .gallery-caption {
    position: static;
    transform: none;
    opacity: 1;

    background: none;
    backdrop-filter: none;
    padding: 0;
    margin-top: 10px;

    text-align: center;
  }

  .gallery-caption p,
  .gallery-caption .gallery-cta {
    display: none;
  }

  .gallery-caption-title {
    font-size: 15px;
  }
}
@media (max-width: 768px) {
*/

/* ========================================
   MOBILE
======================================== */

@media (max-width: 1024px) {

  .gallery-section {
	transform: none !important;
    padding: 10px 10px;
	text-align: center;
  }
  
  .gallery-section .kt-row-column-wrap {
    align-items: center;
  }

  .gallery-main {
    transform: none !important;
	padding: 10px 10px;
	text-align: center;
	width: 90%;
	margin: 0 auto; 
  }

  .gallery-stack {
    width: 100%;
	margin: 0 auto; 
  }

  .gallery-stack .gallery-item {
    transform: none !important;
	text-align: center;
  }

.gallery-stack .gallery-item:first-child {
  width: 90%;
  margin: 0 auto; 
}

.gallery-stack .gallery-item:last-child {
  width: 90%;
  margin: 0 auto; 
}


  .gallery-item {
    text-align: center;
  }
  
  .gallery-image {
    text-align: center;
  }

  .gallery-image img {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
  }


  .gallery-caption-glow {
    position: static;
    padding: 5px 5px; 
    border-radius: 10px;
	transform: none !important;
  }


.gallery-caption-glow::before {
  content: "";
  position: relative;
  opacity: 1 !important;
  
}  
  .gallery-caption {
	  
	position: static;
	left: 50%;
	transform: none !important;
    /* 
	position: static;
	background: none;
    backdrop-filter: none;
	*/

    opacity: 1 !important;

    margin-top: 10px;

    text-align: center;
  }



  .gallery-caption-title {
    font-size: 14px;
    opacity: 0.85;
  }
  
/* 

 .gallery-caption .gallery-cta {
    display: none; 
  }
  

*/  
}





/* =========================
   RESPONSIVE
========================= */
/*
@media (max-width: 1200px) {
  .gallery-section {
    padding: 100px 40px;
  }

  .gallery-stack {
    gap: 80px;
  }
}

@media (max-width: 768px) {
  .gallery-section {
    padding: 80px 20px;
  }

  .gallery-main {
    transform: none;
  }

  .gallery-stack .gallery-item {
    transform: none !important;
  }
}
*/

/* ========================================
   TYMCZASOWE RAMKI
======================================== */
/*
 .gallery-caption {
  outline: 2px solid white;
}


.gallery-main,
.gallery-stack {
  outline: 2px solid white;
}


.gallery-item {
  outline: 2px solid red;
}

.gallery-item:hover {
  outline: 2px solid blue;
}


*/