/* ========================
   CSS Variables
   ======================== */
:root {
  --primary-blue: #0066CC;
  --primary-blue-light: #3399FF;
  --accent-yellow: #FFB90F;
  --highlight-red: #E63946;
  --text-primary: #333333;
  --text-secondary: #666666;
  --bg-white: #FFFFFF;
  --bg-light: #F0F4F8;
  --border-light: #E2E8F0;
  --gradient-blue-soft: linear-gradient(135deg, #f0f8ff 0%, #daeeff 50%, #b8dcff 100%);
  --gradient-steel: linear-gradient(135deg, #eaf0f8 0%, #d0e0f0 50%, #b4ccec 100%);
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 72px;
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 40px;
  --spacing-xl: 60px;
  --spacing-xxl: 80px;
  --radius: 12px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.10);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
  --transition: 0.3s ease;
}

/* ========================
   Reset & Base
   ======================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; direction: rtl; }
body {
  font-family: var(--font-stack);
  font-size: 18px; line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-light);
  overflow-x: hidden; direction: rtl; text-align: right;
}
a { text-decoration: none; color: inherit; transition: color var(--transition); }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* ========================
   Header & Navigation
   ======================== */
.header {
  position: fixed; top: 0; right: 0; left: 0; z-index: 1000;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: var(--header-height);
}
.logo img { height: 44px; width: auto; }
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-item { position: relative; }
.nav-link {
  display: block; padding: 8px 18px; font-size: 16px; font-weight: 500;
  color: var(--text-primary); border-radius: 8px;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--primary-blue); background: rgba(0,102,204,0.06);
}
.nav-dropdown {
  position: absolute; top: 100%; right: 0;
  min-width: 220px; background: var(--bg-white);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all var(--transition); padding: 8px 0; z-index: 100;
}
.nav-item:hover .nav-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown-link {
  display: block; padding: 10px 20px; font-size: 16px;
  color: var(--text-secondary); transition: all var(--transition);
}
.dropdown-link:hover, .dropdown-link.active {
  background: rgba(0,102,204,0.06); color: var(--primary-blue);
}
.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 40px; height: 40px; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px; padding: 0;
}
.menu-toggle span {
  display: block; width: 24px; height: 2.5px;
  background: var(--text-primary); border-radius: 2px;
  transition: all var(--transition);
}

/* ========================
   Page Banner
   ======================== */
.page-banner {
  position: relative; min-height: 340px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin-top: var(--header-height);
}
.page-banner-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.page-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,40,80,0.88) 0%, rgba(0,70,140,0.75) 100%);
  z-index: 1;
}
.page-banner-content {
  position: relative; z-index: 2; text-align: center;
  padding: var(--spacing-lg) 20px;
}
.page-banner-content h1 {
  font-size: 42px; font-weight: 800; color: var(--bg-white);
  margin-bottom: var(--spacing-xs); line-height: 1.4;
}
.page-banner-content p {
  font-size: 20px; color: rgba(255,255,255,0.9);
  margin-bottom: var(--spacing-md); font-weight: 300; max-width: 700px; margin: 0 auto 24px;
}
.breadcrumb { font-size: 16px; color: rgba(255,255,255,0.6); }
.breadcrumb a { color: rgba(255,255,255,0.8); }
.breadcrumb a:hover { color: var(--accent-yellow); }
.breadcrumb span { margin: 0 8px; }
.breadcrumb .current { color: var(--accent-yellow); font-weight: 600; }

/* ========================
   Filters
   ======================== */
.gallery-section { padding: var(--spacing-xl) 20px; }
.container { max-width: var(--max-width); margin: 0 auto; }

.filter-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: var(--spacing-xl);
  flex-wrap: wrap;
}

.filter-btn {
  padding: 12px 28px;
  border: 2px solid var(--primary-blue);
  background: transparent;
  color: var(--primary-blue);
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary-blue);
  color: var(--bg-white);
  box-shadow: 0 4px 12px rgba(0,102,204,0.3);
}

/* ========================
   Masonry Gallery
   ======================== */
.masonry-gallery {
  column-count: 3;
  column-gap: var(--spacing-md);
  width: 100%;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: var(--spacing-md);
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--bg-white);
  cursor: pointer;
  transform: translateZ(0); /* Hardware acceleration */
}

.gallery-item img {
  width: 100%;
  display: block;
  height: auto;
  transition: transform 0.6s ease;
  border-radius: var(--radius);
}

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

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,30,60,0.85) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  pointer-events: none; /* Let click pass through to item */
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-info {
  color: var(--bg-white);
  transform: translateY(15px);
  transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-info {
  transform: translateY(0);
}

.gallery-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.gallery-location {
  font-size: 14px;
  color: var(--accent-yellow);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ========================
   Lightbox Modal
   ======================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(5px);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
  z-index: 10000;
  transition: color 0.2s;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.lightbox-close:hover {
  color: var(--highlight-red);
  background: rgba(255,255,255,0.2);
}

.lightbox-content-wrapper {
  position: relative;
  max-width: 90%;
  max-height: 80vh;
  display: flex;
  justify-content: center;
}

.lightbox-content {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-caption {
  color: white;
  margin-top: 20px;
  font-size: 18px;
  text-align: center;
  font-weight: 500;
  padding: 10px 20px;
  background: rgba(0,0,0,0.5);
  border-radius: 30px;
}

/* ========================
   Load More Button
   ======================== */
.load-more-container {
  text-align: center;
  margin-top: var(--spacing-xl);
  padding-bottom: var(--spacing-lg);
}

.load-more-btn {
  padding: 14px 36px;
  background: var(--bg-white);
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.load-more-btn:hover {
  background: var(--primary-blue);
  color: var(--bg-white);
  box-shadow: 0 4px 15px rgba(0,102,204,0.3);
}

/* ========================
   Footer
   ======================== */
.footer { background: var(--gradient-steel); padding: var(--spacing-xl) 20px var(--spacing-md); }
.footer-grid {
  max-width: var(--max-width); margin: 0 auto; display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: var(--spacing-lg);
}
.footer-brand p { font-size: 16px; color: var(--text-secondary); margin-top: var(--spacing-sm); line-height: 1.7; }
.footer h4 { font-size: 18px; font-weight: 600; margin-bottom: var(--spacing-sm); color: var(--text-primary); }
.footer-links li { margin-bottom: var(--spacing-xs); }
.footer-links a { font-size: 16px; color: var(--text-secondary); transition: color var(--transition); }
.footer-links a:hover { color: var(--primary-blue); }
.footer-contact-item {
  display: flex; align-items: flex-start; gap: var(--spacing-xs);
  margin-bottom: var(--spacing-sm); font-size: 16px; color: var(--text-secondary);
}
.footer-contact-item i { margin-top: 4px; color: var(--primary-blue); min-width: 20px; }
.footer-contact-item .ltr-text { direction: ltr; display: inline-block; }
.footer-bottom {
  max-width: var(--max-width); margin: var(--spacing-lg) auto 0; padding-top: var(--spacing-sm);
  border-top: 1px solid var(--border-light); text-align: center; font-size: 16px; color: var(--text-secondary);
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 1024px) {
  .masonry-gallery { column-count: 2; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-inner { padding: 0 16px; height: 60px; }
  .logo img { height: 36px; }
  .menu-toggle { display: flex; }
  .nav-menu {
    position: fixed; top: 60px; right: 0; left: 0; bottom: 0;
    background: var(--bg-white); flex-direction: column; align-items: stretch;
    padding: var(--spacing-md) 16px; transform: translateX(100%); transition: transform var(--transition); overflow-y: auto;
  }
  .nav-menu.open { transform: translateX(0); }
  .nav-dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; display: none; padding: 0 16px; }
  .nav-item.dropdown-open .nav-dropdown { display: block; }
  .page-banner { min-height: 280px; margin-top: 60px; }
  .page-banner-content h1 { font-size: 32px; }
  .masonry-gallery { column-count: 1; }
  .gallery-section { padding: var(--spacing-lg) 16px; }
  .filter-btn { padding: 8px 18px; font-size: 14px; }
  .footer-grid { grid-template-columns: 1fr; }
  .lightbox-close { top: 10px; right: 10px; width: 40px; height: 40px; font-size: 30px; }
}