/* ================================================
   Mahim Project — Components
   (Gallery, Lightbox, Legal, Social, 404, Misc)
   ================================================ */

/* ===== SOCIAL LINKS ===== */
.social-links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.social-links a {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.65);
  transition: all 0.2s ease;
}
.social-links a svg { width: 16px; height: 16px; }
.social-links a:hover {
  background: var(--accent);
  color: var(--white);
  transform: translateY(-2px);
}

/* ===== GALLERY GRID ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.gallery-item {
  position: relative;
  display: block;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--blue-light);
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.6rem 0.75rem;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: left;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,10,8,0.94);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox-inner { max-width: 900px; width: 100%; text-align: center; }
.lightbox-inner img {
  max-width: 100%;
  max-height: 76vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  margin: 0 auto;
}
.lightbox-caption {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  margin-top: 1.25rem;
  line-height: 1.6;
}
.lightbox-caption strong { color: var(--white); }
.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 1.75rem;
  background: none; border: none;
  color: var(--white);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  width: 46px; height: 46px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* ===== 404 ===== */
.error-page {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 5% 6rem;
}
.error-page .error-code {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(4rem, 12vw, 8rem);
  color: var(--blue);
  line-height: 1;
  opacity: 0.9;
}
.error-page h1 { font-family:'DM Serif Display', serif; font-size: 1.8rem; color: var(--heading); margin: 1rem 0 0.75rem; }
.error-page p { color: var(--body); max-width: 460px; margin-bottom: 2rem; }

/* ===== LEGAL PAGE ===== */
.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.legal-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.75rem;
  background: var(--white);
}
.legal-card h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  color: var(--heading);
  margin-bottom: 1rem;
}
.legal-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.87rem;
}
.legal-row:last-child { border-bottom: none; }
.legal-row span:first-child { color: var(--muted); }
.legal-row span:last-child { color: var(--heading); font-weight: 600; text-align: right; }

.doc-download {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
  background: var(--white);
  transition: all 0.2s;
}
.doc-download:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.doc-download-icon {
  width: 40px; height: 40px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.doc-download-icon svg { width: 20px; height: 20px; }
.doc-download-title { font-size: 0.9rem; font-weight: 600; color: var(--heading); }
.doc-download-sub { font-size: 0.76rem; color: var(--muted); margin-top: 0.15rem; }
.doc-download-arrow { margin-left: auto; color: var(--blue); }

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 1.75rem; right: 1.75rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 90;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--blue-mid); }

/* ===== MOBILE ===== */
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .legal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .lightbox-nav { width: 38px; height: 38px; }
}

/* ===== PROJECT DETAILS PAGE ===== */
@media (max-width: 900px) {
  .pd-layout { grid-template-columns: 1fr !important; gap: 2.5rem !important; }
}
