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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #f9fafb;
  color: #111827;
  line-height: 1.6;
}

/* ========================================
   HERO (FIXED Z-INDEX STACK)
   ======================================== */

.hero {
  position: relative;
  height: 520px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  overflow: hidden;
  color: white;
  display: flex;
  align-items: flex-end;
}

/* SAFE LAYERS (IMPORTANT FIX) */
.hero > div:first-child {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero > div:nth-child(2) {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* decorative shapes */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.hero::before {
  width: 420px;
  height: 420px;
  background: rgba(255,255,255,0.07);
  top: -140px;
  right: -140px;
}

.hero::after {
  width: 260px;
  height: 260px;
  background: rgba(255,255,255,0.05);
  bottom: -60px;
  left: 8%;
}

/* hero content ALWAYS ABOVE EVERYTHING */
.hero-content {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 70px 50px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* back button FIXED CLICK ISSUE */
.back-btn {
  position: absolute;
  top: 24px;
  left: 40px;
  z-index: 20;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  backdrop-filter: blur(6px);
}

.back-btn:hover {
  background: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

/* ========================================
   CONTAINER
   ======================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 70px 40px;
}

/* ========================================
   GRID (STABLE NO SHIFT)
   ======================================== */

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 40px;
  align-items: start;
}

/* ========================================
   CARD
   ======================================== */

.card {
  background: white;
  border-radius: 18px;
  padding: 42px;
  border: 1px solid #e5e7eb;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  box-shadow: 0 12px 35px rgba(0,0,0,0.06);
  border-color: #d1d5db;
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
  background: white;
  border-radius: 18px;
  padding: 28px;
  border: 1px solid #e5e7eb;
  position: sticky;
  top: 24px;
  align-self: start;
}

/* ========================================
   GALLERY (NO LINK MODE SAFE)
   ======================================== */

.gallery-section {
  margin-top: 10px;
  padding-top: 10px;
}

.gallery-section h2 {
  font-size: 26px;
  margin-bottom: 20px;
  font-weight: 700;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

/* ITEM (NO LAYOUT SHIFT FIXED) */
.gallery-item {
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  will-change: transform;
  transform: translateZ(0);
}

.gallery-item:hover {
  transform: translateY(-5px);
  border-color: #667eea;
  box-shadow: 0 16px 32px rgba(102, 126, 234, 0.18);
}

/* IMAGE (NO JUMPING) */
.gallery-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.gallery-item:hover .gallery-img {
  transform: scale(1.05);
}

/* CAPTION */
.gallery-caption {
  padding: 12px;
  font-size: 13px;
  text-align: center;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

/* ========================================
   LIGHTBOX (FULL SAFE FIX)
   ======================================== */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.lightbox-content {
  position: relative;
  text-align: center;
  max-width: 90vw;
}

.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
}

.lightbox p {
  color: #fff;
  margin-top: 10px;
  font-size: 14px;
  opacity: 0.85;
}

/* ========================================
   TAGS SAFE (UNCHANGED LOGIC)
   ======================================== */

.tags-hero span,
.tags-sidebar span {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

/* ========================================
   RESPONSIVE (CLEAN STABLE)
   ======================================== */

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

  .sidebar {
    position: relative;
    top: auto;
  }

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

@media (max-width: 768px) {
  .container {
    padding: 50px 20px;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-img {
    height: 180px;
  }

  .hero-content {
    padding: 50px 20px;
  }
}

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

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

  .gallery-img {
    height: 170px;
  }
}