/* ============================================================
   MOBILE.CSS — تنسيقات الموبايل المشتركة لجميع الصفحات
   شركة السعد الكبرى
   ============================================================ */

/* ---- Base Reset for all pages ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- Scroll lock when nav is open ---- */
body.nav-open {
  overflow: hidden;
  touch-action: none;
}

/* ============================================================
   PAGE TITLE — مشترك بين كل الصفحات
   ============================================================ */
.page-title {
  text-align: center;
  padding: 32px 16px 16px;
}

.page-title h1 {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 900;
  margin: 0 0 8px;
  line-height: 1.3;
}

.page-title p {
  color: var(--muted, #475569);
  max-width: 680px;
  margin-inline: auto;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  line-height: 1.8;
  padding: 0 8px;
}

/* ---- Gold divider under page title ---- */
.page-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary, #f5b841), var(--primary-2, #ffcb66));
  border-radius: 3px;
  margin: 12px auto 0;
}

/* ============================================================
   SECTION CONTAINERS
   ============================================================ */
.section-wrap {
  width: var(--container, min(1150px, 92vw));
  margin-inline: auto;
  padding: 24px 0 40px;
}

/* ============================================================
   INFO / DESCRIPTION BOXES
   ============================================================ */
.info-box,
.about-text,
.box-card {
  background: #f0f9ff;
  border: 1px solid var(--line, rgba(14,165,233,0.2));
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
  margin-bottom: 24px;
}

.info-box h2,
.about-text h2,
.box-card h2 {
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 900;
  margin: 0 0 12px;
  color: var(--primary, #0ea5e9);
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-box p,
.about-text p,
.box-card p {
  color: var(--muted, #475569);
  line-height: 1.8;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
}

/* ============================================================
   PHOTO / IMAGE GRIDS
   ============================================================ */

/* Default: 3 columns on desktop */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* 2 columns on desktop */
.photo-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Auto-fill grid */
.photo-grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

/* Photo item base */
.photo-item,
.demolition-item,
.excavation-item,
.rest-item,
.tiling-item,
.image-box {
  position: relative;
  border: 1px solid var(--line, rgba(14,165,233,0.2));
  border-radius: 14px;
  overflow: hidden;
  background: #e0f2fe;
  box-shadow: 0 4px 16px rgba(14,165,233,.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-item:hover,
.demolition-item:hover,
.excavation-item:hover,
.rest-item:hover,
.tiling-item:hover,
.image-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(14,165,233,.2);
  border-color: rgba(14, 165, 233, 0.4);
}

.photo-item img,
.demolition-item img,
.excavation-item img,
.rest-item img,
.tiling-item img,
.image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  cursor: zoom-in;
}

.photo-item:hover img,
.demolition-item:hover img,
.excavation-item:hover img,
.rest-item:hover img,
.tiling-item:hover img,
.image-box:hover img {
  transform: scale(1.05);
}

/* Fixed aspect ratios */
.photo-item,
.demolition-item,
.excavation-item,
.rest-item,
.tiling-item {
  aspect-ratio: 4/3;
}

.image-box {
  aspect-ratio: 1/1;
}

/* ============================================================
   VIDEO SECTIONS
   ============================================================ */
.video-section {
  margin: 32px 0;
}

.video-container {
  border: 1px solid var(--line, rgba(14,165,233,0.2));
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(14,165,233,.12);
  padding: 18px;
  background: #f0f9ff;
}

.video-container h2 {
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 900;
  text-align: center;
  margin: 0 0 14px;
  color: var(--primary, #0ea5e9);
}

.video-frame {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  border: 1px solid var(--line, rgba(14,165,233,0.2));
  background: #000;
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Video grid for achievements */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.video-box {
  background: #f0f9ff;
  border: 1px solid var(--line, rgba(14,165,233,0.2));
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(14,165,233,.1);
  transition: transform 0.3s ease;
}

.video-box:hover {
  transform: translateY(-3px);
}

.video-box video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.video-box-title {
  padding: 10px 14px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text, #0f172a);
  background: rgba(14,165,233,.06);
  border-bottom: 1px solid var(--line, rgba(14,165,233,0.2));
}

/* ============================================================
   GLOBAL IMAGE MOTION + CAROUSEL UX
   ============================================================ */
.photo-item,
.demolition-item,
.excavation-item,
.rest-item,
.tiling-item,
.image-box,
.img-item {
  isolation: isolate;
  transform-style: preserve-3d;
  transition:
    transform 0.55s cubic-bezier(.22,.61,.36,1),
    box-shadow 0.45s ease,
    border-color 0.35s ease,
    filter 0.35s ease;
}

.photo-item::after,
.demolition-item::after,
.excavation-item::after,
.rest-item::after,
.tiling-item::after,
.image-box::after,
.img-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255,255,255,.22) 35%,
    transparent 70%
  );
  transform: translateX(-120%);
  transition: transform 0.9s ease;
}

.photo-item:hover,
.demolition-item:hover,
.excavation-item:hover,
.rest-item:hover,
.tiling-item:hover,
.image-box:hover,
.img-item:hover {
  transform: translateY(-7px) scale(1.015) rotateX(1deg);
  box-shadow: 0 18px 46px rgba(14,165,233,.24);
  filter: saturate(1.04);
}

.photo-item:hover::after,
.demolition-item:hover::after,
.excavation-item:hover::after,
.rest-item:hover::after,
.tiling-item:hover::after,
.image-box:hover::after,
.img-item:hover::after {
  transform: translateX(120%);
}

.photo-item img,
.demolition-item img,
.excavation-item img,
.rest-item img,
.tiling-item img,
.image-box img,
.img-item img {
  transition: transform 0.7s cubic-bezier(.22,.61,.36,1), filter 0.45s ease;
}

.photo-item:hover img,
.demolition-item:hover img,
.excavation-item:hover img,
.rest-item:hover img,
.tiling-item:hover img,
.image-box:hover img,
.img-item:hover img {
  transform: scale(1.07);
  filter: contrast(1.03) saturate(1.06);
}


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

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  margin-top: 48px;
  border-top: 1px solid var(--line, rgba(14,165,233,0.2));
  background: #f0f9ff;
  padding: 18px 0;
}

.footer-wrap {
  width: var(--container, min(1150px, 92vw));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted, #475569);
  font-size: 0.9rem;
}

.footer-social {
  display: flex;
  gap: 10px;
  align-items: center;
}

.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted, #475569);
  background: rgba(14,165,233,.06);
  border: 1px solid var(--line, rgba(14,165,233,0.2));
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.footer-social a:hover { transform: translateY(-2px); }
.footer-social a[aria-label="Facebook"]:hover  { background: #1877f2; color: #fff; border-color: #1877f2; }
.footer-social a[aria-label="WhatsApp"]:hover  { background: #25d366; color: #fff; border-color: #25d366; }
.footer-social a[aria-label="Instagram"]:hover {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
  color: #fff;
  border-color: transparent;
}

@media (max-width: 640px) {
  .footer-wrap {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 24px;
  left: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary, #f5b841), var(--primary-2, #ffcb66));
  color: #111;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  box-shadow: 0 5px 18px rgba(0,0,0,.35);
  cursor: pointer;
  border: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 500;
  -webkit-tap-highlight-color: transparent;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,.4);
}

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.reveal-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
  will-change: transform, opacity;
}

.reveal-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet */
@media (max-width: 900px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .photo-grid-auto {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* Mobile */
@media (max-width: 640px) {
  .section-wrap {
    padding: 16px 0 32px;
  }

  .info-box,
  .about-text,
  .box-card {
    padding: 16px;
    border-radius: 14px;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .photo-grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid-auto {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .image-box {
    aspect-ratio: 1/1;
  }

  .video-container {
    padding: 14px;
    border-radius: 14px;
  }

  footer {
    margin-top: 32px;
    padding: 14px 0;
  }
}

/* Small phones */
@media (max-width: 400px) {
  .photo-grid,
  .photo-grid-2,
  .photo-grid-auto {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .page-title {
    padding: 24px 12px 12px;
  }
}
