/* ===========================
   HERO SECTION
=========================== */
.hero {
  background: url('../images/hero_bg.png') center/cover no-repeat;
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  color: #fff;
}
.hero .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}
.hero .container {
  position: relative;
  z-index: 2;
  max-width: 800px;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}
.hero .display-4 {
  text-transform: uppercase;
  letter-spacing: 2px;
}
.hero .lead-hero {
  background: rgba(255,255,255,0.85);
  color: #222;
  padding: 1.5rem;
  border-radius: .5rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* ===========================
   CATEGORIES BUTTONS - IMPROVED
=========================== */
.category-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.category-btns button {
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.category-btns button:not(.active) {
  background: white;
  color: #225785;
  border-color: #225785;
}

.category-btns button.active {
  background: #225785;
  color: white;
}

.category-btns button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* =================================
   PHOTO PORTFOLIO - FIXED THUMBNAILS WITH SCROLL
================================= */
.photo-portfolio {
  padding: 2rem 0;
}

.photo-portfolio h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: #225785;
  font-size: 2rem;
  font-weight: 600;
}

.photo-portfolio .gallery-scroll-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow-y: auto; /* Scroll VERTICAL */
  overflow-x: hidden; /* Fără scroll orizontal */
  max-height: 500px; /* Înălțime maximă (ajustabilă) */
  padding: 10px;
}

/* Grid-ul cu poze */
.photo-portfolio .gallery-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Coloane de minim 200px */
  gap: 10px; /* Distanța dintre poze (controllable) */
}

.photo-portfolio .photo-thumb {
  width: 200px !important;
  height: 200px !important;
  flex-shrink: 0; /* Previne micșorarea */
  border-radius: 4px;
  overflow: hidden;
  background: #f0f0f0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.photo-portfolio .photo-thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.photo-portfolio .photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Stilizare scrollbar */
.photo-portfolio .gallery-scroll-container::-webkit-scrollbar {
  height: 8px;
}
.photo-portfolio .gallery-scroll-container::-webkit-scrollbar-thumb {
  background: #225785;
  border-radius: 4px;
}
.photo-portfolio .gallery-scroll-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

/* Load More Button */
.photo-portfolio #load-more-all {
  display: block;
  margin: 1.5rem auto 0;
  padding: 0.6rem 1.8rem;
  background: #225785;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
}

.photo-portfolio #load-more-all:hover {
  background: #1a466b;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* =================================
   CUSTOM OVERLAY VIEWER
================================= */
.gallery-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Navigation arrows */
.gallery-nav {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 1001;
}
.gallery-arrow {
  pointer-events: all;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  user-select: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: color .2s;
}
#galleryPrev { left: 1rem; }
#galleryNext { right: 1rem; }
.gallery-arrow:hover {
  color: #ddd;
}

/* Close button */
.gallery-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  transition: color .2s;
  pointer-events: all;
}
.gallery-close:hover {
  color: #ddd;
}

/* Main image area */
.gallery-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.gallery-main img {
  max-width: 80%;
  max-height: 70%;
  object-fit: contain;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  transition: opacity .3s ease;
}

/* Thumbnail strip */
.gallery-thumbs {
  position: absolute;
  bottom: .5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .5rem;
  padding: .5rem;
  background: rgba(0,0,0,0.7);
  overflow-x: auto;
  z-index: 1001;
}
.gallery-thumbs img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  opacity: .6;
  border: 2px solid transparent;
  cursor: pointer;
  transition: opacity .2s, border-color .2s;
}
.gallery-thumbs img.active-thumb {
  opacity: 1;
  border-color: #fff;
}

/* =================================
   VIDEOS SECTION
================================= */
.video-wrapper {
  margin-bottom: 30px;
}
.video-wrapper iframe {
  width: 100%;
  height: 315px;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0,0,0,0.1);
}
.video-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 10px;
  color: #225785;
  text-align: center;
}

/* ===========================
   RESPONSIVE ADJUSTMENTS
=========================== */
@media (max-width: 768px) {
  .photo-portfolio .photo-thumb {
    width: 180px !important;
    height: 180px !important;
  }
  
  .gallery-main img {
    max-width: 90%;
    max-height: 60%;
  }
}

@media (max-width: 576px) {
  .photo-portfolio .photo-thumb {
    width: 160px !important;
    height: 160px !important;
  }
  
  .category-btns button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .hero .display-4 {
    font-size: 2.2rem;
  }
  
  .hero .lead-hero {
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  /* pe mobil: fix 2 coloane */
  .photo-portfolio .gallery-wrapper {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
}