/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #080E1C;
  --bg-card: #0E1628;
  --bg-card2: #121D35;
  --border: rgba(59,130,246,0.12);
  --border-hover: rgba(59,130,246,0.28);
  --blue: #2563EB;
  --blue-light: #60A5FA;
  --orange: #F97316;
  --orange-light: #FB923C;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --transition: 0.22s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  direction: rtl;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

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

a { text-decoration: none; color: inherit; }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,14,28,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo-link { display: flex; align-items: center; }
.logo-img { height: 44px; width: auto; }
.logo-text {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo-accent { color: var(--orange); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
}
.nav-link:hover { color: var(--text); }

.btn-whatsapp-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #25D366;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  transition: opacity var(--transition), transform var(--transition);
}
.btn-whatsapp-nav:hover { opacity: 0.9; transform: translateY(-1px); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
}
.nav-mobile.open { display: flex; }

/* ===== HERO ===== */
.hero { padding: 3.5rem 0 2rem; }

.hero-video-wrap {
  max-width: 960px;
  margin: 0 auto 2.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.hero-video {
  width: 100%;
  max-height: 540px;
  display: block;
  object-fit: contain;
  background: #000;
}

.yt-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.yt-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.hero-content {
  text-align: center;
  padding: 0 1rem;
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.35;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #25D366;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(37,211,102,0.25);
}
.btn-cta:hover { opacity: 0.92; transform: translateY(-2px); box-shadow: 0 6px 28px rgba(37,211,102,0.35); }

/* ===== CATEGORIES SECTION ===== */
.categories-section {
  padding: 4rem 0 5rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 3rem;
  max-width: 560px;
  margin-inline: auto;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37,99,235,0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}
.category-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.category-card:hover::before { opacity: 1; }

.category-icon-wrap {
  width: 52px;
  height: 52px;
  background: rgba(37,99,235,0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-light);
}

.category-icon-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 10px;
}

.category-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.category-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.category-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--blue-light);
  font-weight: 600;
  margin-top: 0.5rem;
  transition: gap var(--transition);
}
.category-card:hover .category-btn { gap: 0.65rem; }

/* ===== CATEGORY PAGE ===== */
.category-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  transition: color var(--transition);
}
.back-link:hover { color: var(--text); }
.back-link svg { transform: scaleX(-1); }

.category-hero-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.category-hero-desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 560px;
}

.media-section { padding: 1rem 0 3.5rem; }

.media-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

/* ===== GALLERY ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.gallery-item { cursor: pointer; }

.gallery-img-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  aspect-ratio: auto;
}

.gallery-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  color: #fff;
}
.gallery-item:hover .gallery-img { transform: scale(1.04); }
.gallery-item:hover .gallery-overlay { opacity: 1; }

.gallery-info { padding: 0.6rem 0.25rem 0; }
.gallery-item-title { font-size: 0.9rem; color: var(--text); font-weight: 500; }
.gallery-brand {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--orange-light);
  background: rgba(249,115,22,0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.25rem;
}

/* ===== VIDEOS GRID ===== */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
}
.video-card:hover { transform: translateY(-2px); border-color: var(--border-hover); }

.video-thumb-wrap { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #000; }
.video-thumb { width: 100%; height: 100%; object-fit: cover; }
.video-thumb-placeholder { width: 100%; height: 100%; background: var(--bg-card2); display: flex; align-items: center; justify-content: center; color: var(--text-dim); }

.video-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform var(--transition);
}
.video-card:hover .video-play-btn { transform: scale(1.08); }

.video-info { padding: 0.8rem; }
.video-card-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }

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

.lightbox-close {
  position: fixed;
  top: 1rem;
  left: 1rem;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 1001;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }

.lightbox-prev, .lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 2.5rem;
  width: 48px;
  height: 64px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 1001;
}
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { right: 1rem; }
.lightbox-next { left: 1rem; }

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}
.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-info {
  margin-top: 0.75rem;
  color: #fff;
  font-size: 0.95rem;
}

/* ===== CTA SECTION ===== */
.cta-section { padding: 3rem 0 4rem; text-align: center; }

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* ===== WHATSAPP FLOAT ===== */
.whatsapp-float {
  position: fixed;
  bottom: 2rem;
  left: 1.5rem;
  width: 58px;
  height: 58px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  z-index: 500;
  transition: transform var(--transition), box-shadow var(--transition);
}
.whatsapp-float:hover { transform: scale(1.1) translateY(-2px); box-shadow: 0 6px 28px rgba(37,211,102,0.5); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-sub { font-size: 0.9rem; color: var(--text-dim); margin-top: 0.4rem; }

/* ===== GRID — overflow-safe columns ===== */
.gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}
.videos-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
/* Every direct grid child must not expand past its column */
.gallery-grid > *,
.videos-grid  > * {
  min-width: 0;
}

/* ===== PUBLIC CARD CONTENT (images + videos) ===== */
.portfolio-video-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.portfolio-video-item .portfolio-video-card {
  width: 100%;
  border-radius: 8px 8px 0 0;
  min-width: 0;
}

/* When there is no content block, keep full radius */
.portfolio-video-item .portfolio-video-card:only-child {
  border-radius: 8px;
}

.portfolio-card-content {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  padding: 14px 16px 16px;
  text-align: right;
  background: var(--bg-card, #0E1628);
  border: 1px solid var(--border, rgba(59,130,246,0.12));
  border-top: none;
  border-radius: 0 0 8px 8px;
}

/* gallery-item also gets the content block */
.gallery-item {
  min-width: 0;
  overflow: hidden;
}
.gallery-item .portfolio-card-content {
  border-radius: 0 0 6px 6px;
  border-top: none;
}

/* ── Shared text-overflow rules ─────────────────────────────────────────── */
.portfolio-title,
.portfolio-description,
.portfolio-brand {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.portfolio-title {
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.portfolio-description {
  margin: 6px 0 0;
  color: rgba(255,255,255,0.68);
  font-size: 0.9rem;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.portfolio-brand {
  display: block;
  margin-top: 10px;
  color: #ff8a00;
  font-size: 0.82rem;
  background: rgba(255,138,0,0.10);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .gallery-img { height: 160px; }
  .videos-grid { grid-template-columns: 1fr; }
  .lightbox-prev { right: 0.25rem; }
  .lightbox-next { left: 0.25rem; }
}

@media (max-width: 480px) {
  .categories-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 2rem 0 1.5rem; }
}
