/* =================== KHÔNG GIAN / GALLERY =================== */

/* ----- Hero ----- */
.space-hero {
  background:
    linear-gradient(90deg, var(--cream-light) 0%, rgba(245, 236, 219, 0.65) 40%, rgba(245, 236, 219, 0) 75%),
    url('./top.jpg?w=1800&auto=format&fit=crop&q=80') center/cover no-repeat;
  border-bottom: 1px solid rgba(177, 61, 44, 0.1);
}
.space-hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}
.space-hero-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: var(--red);
  color: var(--gold-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 10px 26px rgba(132, 38, 23, 0.3);
}
.space-hero h1 {
  font-size: 54px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--red-deep);
  line-height: 1.05;
  margin-bottom: 10px;
}
.space-hero .sh-sub {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 1px;
  margin-bottom: 22px;
}
.space-hero .sh-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.85;
  margin-bottom: 14px;
  max-width: 460px;
}
.space-hero-img {
  height: 430px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 46px rgba(44, 24, 16, 0.28);
  border: 3px solid #fff;
}
.space-hero-img img { width: 100%; height: 100%; object-fit: cover; }

/* ----- Section wrapper + deco title ----- */
.space-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 32px;
}
.deco-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 44px;
}
.deco-title span { color: var(--gold); font-size: 16px; }
.deco-title h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--ink);
  text-align: center;
}

/* ----- Space cards ----- */
.space-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.space-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(217, 200, 168, 0.5);
  box-shadow: 0 6px 20px rgba(44, 24, 16, 0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.space-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 36px rgba(44, 24, 16, 0.16);
}
.sc-thumb {
  position: relative;
  height: 200px;
  overflow: hidden;
}
.sc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.space-card:hover .sc-thumb img { transform: scale(1.07); }
.sc-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(44, 24, 16, 0.35));
}
.sc-icon {
  position: absolute;
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(44, 24, 16, 0.2);
  z-index: 2;
}
.sc-body { padding: 38px 22px 26px; text-align: center; }
.sc-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--ink);
  margin-bottom: 10px;
}
.sc-desc { font-size: 13px; color: var(--muted); line-height: 1.65; }

/* ----- Gallery intro ----- */
.gallery-intro {
  max-width: 760px;
  margin: -24px auto 40px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.85;
}

/* ----- Masonry gallery ----- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 16px;
}
.g-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 6px 18px rgba(44, 24, 16, 0.1);
}
.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.g-item:hover img { transform: scale(1.08); }
.g-item .g-cap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(44, 24, 16, 0.6));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.g-item:hover .g-cap { opacity: 1; }
.g-item .g-zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}
.g-item:hover .g-zoom { opacity: 1; transform: scale(1); }
.g-wide { grid-column: span 2; }
.g-tall { grid-row: span 2; }

/* Center NGUYÊN badge tile (not clickable) */
.g-badge {
  cursor: default;
  background: var(--red);
  border: 2px solid var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
}
.g-badge .b-main { font-size: 30px; font-weight: 900; letter-spacing: 4px; }
.g-badge .b-sub { font-size: 10px; letter-spacing: 3px; color: var(--gold-light); margin-top: 4px; }

/* ----- CTA bar ----- */
.space-cta {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cream) 0%, var(--cream-soft) 100%);
  border: 1px solid rgba(217, 200, 168, 0.7);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}
.space-cta .cta-q {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
}
.space-cta .cta-d { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.space-cta .cta-deco {
  position: absolute;
  right: 0;
  bottom: -10px;
  opacity: 0.6;
  pointer-events: none;
}

/* =================== LIGHTBOX =================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(20, 12, 8, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lightbox.open { display: flex; }
.lb-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lb-img {
  max-width: 90vw;
  max-height: 86vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transform: scale(1);
  transition: transform 0.15s ease-out;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}
.lb-img.grabbing { cursor: grabbing; transition: none; }

.lb-btn {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.25s ease;
  z-index: 3;
}
.lb-btn:hover { background: var(--red); }
.lb-close { top: 22px; right: 24px; }
.lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 24px; top: 50%; transform: translateY(-50%); }

.lb-toolbar {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(4px);
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 3;
}
.lb-toolbar button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
}
.lb-toolbar button:hover { background: rgba(255,255,255,0.22); }
.lb-zoom-level {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  min-width: 48px;
  text-align: center;
}
.lb-counter {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  z-index: 3;
}

/* ----- Responsive ----- */
@media (max-width: 1024px) {
  .space-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .space-hero-inner { grid-template-columns: 1fr; gap: 30px; padding: 56px 24px; }
  .space-hero h1 { font-size: 40px; }
  .space-hero-img { height: 320px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .g-wide { grid-column: span 2; }
}
@media (max-width: 600px) {
  .space-cards { grid-template-columns: 1fr; }
  .deco-title h2 { font-size: 21px; }
  .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 220px; }
  .g-wide, .g-tall { grid-column: auto; grid-row: auto; }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
}
