/* Base styles */
:root {
  --primary-color: #6d213c;
  --secondary-color: #d4af37;
  --text-color: #333;
  --light-bg: #f8f4e3;
  --dark-bg: #8a8d8f;
  --transition: all 0.3s ease;
}

body {
  font-family: "Palatino", serif;
  margin: 0;
  padding: 0;
  color: var(--text-color);
  background-color: var(--light-bg);
  line-height: 1.6;
  scroll-behavior: smooth;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Typography */
h1,
h2,
h3 {
  font-family: "Cormorant Garamond", serif;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.3rem;
}

h2 {
  font-size: 2rem;
  color: #6d213c; /* Deep Burgundy */
}

p {
  margin-bottom: 1rem;
}

/* Hero section with video */
.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 80px; /* Account for fixed navigation */
}

/* Add video container for better control */
.video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  background-color: #000; /* Fallback color */
}

/* Poster image styling */
.poster-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2; /* Above video but below overlay */
  transition: opacity 1s ease;
  cursor: pointer; /* Indicate it's clickable */
}

.background-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: 1;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

/* Optimize video display for different screen sizes */
@media (max-aspect-ratio: 16 / 9) {
  .background-video {
    width: 100%;
    height: auto;
  }
}

@media (min-aspect-ratio: 16 / 9) {
  .background-video {
    width: auto;
    height: 100%;
  }
}

/* Add responsive video handling */
@media (max-width: 768px) {
  .hero {
    height: 80vh; /* Reduce hero height on mobile */
  }

  .background-video {
    height: 100%;
    /* On mobile, focus on the center portion of the video */
    object-position: center;
  }
}

@media (max-width: 576px) {
  .hero {
    height: 70vh; /* Further reduce height on smaller devices */
  }
}

/* For very wide screens, constrain the video width */
@media (min-width: 1800px) {
  .background-video {
    width: 100%;
    max-width: 1800px;
    left: 50%;
    transform: translateX(-50%);
  }
}

.overlay {
  position: relative;
  z-index: 3; /* Ensure overlay is above the video and poster */
  background: rgba(0, 0, 0, 0.6);
  color: #d4af37; /* Antique Gold */
  text-align: center;
  padding: 2rem;
  width: 100%;
  max-width: 800px;
  border-radius: 8px;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: var(--transition);
  z-index: -1;
}

.btn:hover::before {
  left: 0;
}

.primary {
  background-color: #6d213c; /* Deep Burgundy */
  color: white;
}

.primary:hover {
  background-color: #5a1b32;
}

.secondary {
  background-color: transparent;
  border: 2px solid #d4af37; /* Antique Gold */
  color: #d4af37; /* Antique Gold */
}

.secondary:hover {
  background-color: rgba(212, 175, 55, 0.1);
}

/* Sections */
.about,
.featured,
.education,
.preservation,
.partners {
  padding: 4rem 0;
  text-align: center;
}

.about {
  background-color: #f0ead6;
}

.featured {
  background-color: #f8f4e3;
}

.preservation {
  background-color: #f0ead6;
}

/* Education section */
.education {
  padding: 6rem 0;
  background: linear-gradient(135deg, var(--light-bg) 0%, #fff 100%);
}

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

.education h2 {
  text-align: center;
  margin-bottom: 4rem;
  color: var(--primary-color);
  font-size: 2.5rem;
  position: relative;
}

/* .education h2::after {
  content: '';
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--secondary-color);
}

 */
.split-screen {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  align-items: center;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.split-screen .text {
  width: 100%;
  max-width: 800px;
  text-align: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.split-screen .text p {
  font-size: 1.3rem;
  line-height: 1.8;
  color: var(--text-color);
  margin-bottom: 1.5rem;
}

.split-screen .image {
  width: 100%;
  max-width: 1000px;
  position: relative;
  height: 600px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.split-screen .image:hover {
  transform: translateY(-5px);
}

.iframe-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

/* RTL support for education section */
[dir="rtl"] .split-screen {
  direction: rtl;
}

[dir="rtl"] .split-screen .text {
  text-align: center;
}

/* Responsive design for education section */
@media (max-width: 992px) {
  .education {
    padding: 5rem 0;
  }

  .split-screen {
    padding: 2rem;
    gap: 3rem;
  }

  .split-screen .image {
    height: 500px;
  }
}

@media (max-width: 768px) {
  .education {
    padding: 4rem 0;
  }

  .education h2 {
    font-size: 2rem;
    margin-bottom: 3rem;
  }

  .split-screen {
    padding: 1.5rem;
    gap: 2rem;
  }

  .split-screen .text {
    padding: 1.5rem;
  }

  .split-screen .text p {
    font-size: 1.1rem;
  }

  .split-screen .image {
    height: 400px;
  }
}

@media (max-width: 576px) {
  .education {
    padding: 3rem 0;
  }

  .education .container {
    padding: 0 1rem;
  }

  .split-screen {
    padding: 1rem;
  }

  .split-screen .image {
    height: 300px;
  }
}

/* Iframe container for responsive iframe */
.iframe-container {
  position: relative;
  overflow: hidden;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
}

.iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Blockquote styling */
blockquote {
  font-style: italic;
  font-size: 1.2rem;
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem 2rem;
  border-left: 4px solid #d4af37;
  background-color: rgba(212, 175, 55, 0.1);
}

/* Footer */
footer {
  background: linear-gradient(to bottom, var(--dark-bg), #2c2c2c);
  color: white;
  text-align: center;
  padding: 3rem 0 2rem;
}

.contact-info {
  background: rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem auto;
  max-width: 400px;
}

.contact-info h3 {
  color: #d4af37;
  margin-bottom: 1rem;
}

.contact-info a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-info a:hover {
  color: #d4af37;
}

.footer-nav {
  margin: 1.5rem 0;
}

.footer-nav a {
  color: white;
  text-decoration: none;
  margin: 0 15px;
}

.footer-nav a:hover {
  text-decoration: underline;
}

/* Media Queries for Responsiveness */
@media (max-width: 992px) {
  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  .split-screen {
    flex-direction: column;
  }

  .split-screen .text,
  .split-screen .image {
    width: 100%;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .overlay {
    padding: 1.5rem;
  }

  .about,
  .featured,
  .education,
  .preservation,
  .partners {
    padding: 3rem 0;
  }

  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    transition: var(--transition);
  }

  .nav-links.active {
    left: 0;
  }

  .mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }
}

@media (max-width: 576px) {
  h1 {
    font-size: 1.5rem;
  }

  .overlay {
    padding: 1rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .about,
  .featured,
  .education,
  .preservation,
  .partners {
    padding: 2rem 0;
  }

  .footer-nav a {
    display: block;
    margin: 10px 0;
  }
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.about-item {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.about-item:hover {
  transform: translateY(-5px);
}

.about-item h3 {
  color: #e6c619;
  margin-bottom: 1rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.site {
  background: rgba(255, 255, 255, 0.95);
  padding: 1.5rem;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.site:hover {
  transform: translateY(-5px);
}

.site img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 1rem;
  transition: var(--transition);
}

.site h3 {
  color: #e6c619;
  margin-bottom: 0.5rem;
}

.timeline {
  padding: 4rem 0;
  background: rgba(0, 0, 0, 0.3);
}

.timeline-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

.timeline-container::before {
  content: '';
  position: absolute;
  width: 2px;
  background: #e6c619;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
  box-sizing: border-box;
  animation: fadeIn 0.6s ease-out forwards;
}

.timeline-item:nth-child(odd) {
  left: 0;
}

.timeline-item:nth-child(even) {
  left: 50%;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: #e6c619;
  border-radius: 50%;
  top: 15px;
  right: -10px;
}

.timeline-item:nth-child(even)::after {
  left: -10px;
}

.date {
  color: #e6c619;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.timeline-item .content {
  background: rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

@media (max-width: 768px) {
  .timeline-container::before {
    left: 31px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }
  
  .timeline-item:nth-child(even) {
    left: 0;
  }
  
  .timeline-item::after {
    left: 21px;
  }
  
  .timeline-item:nth-child(even)::after {
    left: 21px;
  }
}

/* Navigation */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.main-nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 15px;
}

.logo {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.8rem;
  color: var(--primary-color);
  font-weight: bold;
  text-decoration: none; /* removes underline */
  outline: none;         /* removes the square when clicked (focus border) */
  border: none;          /* extra safe - removes any accidental border */
}
.logo:focus {
  outline: none; /* Extra: Remove outline when clicked */
}

.logo:visited {
  text-decoration: none; /* No underline after visiting */
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: var(--transition);
}

.nav-links a:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-btn span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--text-color);
  margin: 5px 0;
  transition: var(--transition);
}

/* Enhanced section styles */
section {
  position: relative;
  overflow: hidden;
}

section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(212, 175, 55, 0.1), rgba(109, 33, 60, 0.1));
  pointer-events: none;
}

/* Add smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Add loading animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.about-item, .site, .timeline-item {
  animation: fadeIn 0.6s ease-out forwards;
}

/* Enhanced accessibility */
:focus {
  outline: 3px solid var(--secondary-color);
  outline-offset: 2px;
}

/* Add hover effects */
.site:hover img {
  transform: scale(1.05);
}

/* Add scroll to top button */
.scroll-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary-color);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: var(--transition);
  z-index: 1000;
}

.scroll-top.visible {
  opacity: 1;
}

.scroll-top:hover {
  background: var(--secondary-color);
  transform: translateY(-3px);
}

/* Language switcher */
.lang-switch {
  display: flex;
  gap: 0.5rem;
  margin-left: 2rem;
}

.lang-btn {
  background: none;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.lang-btn.active {
  background: var(--primary-color);
  color: white;
}

.lang-btn:hover {
  background: var(--primary-color);
  color: white;
}

/* RTL Support */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .nav-links {
  padding-right: 0;
}

[dir="rtl"] .lang-switch {
  margin-left: 0;
  margin-right: 2rem;
}

[dir="rtl"] .timeline-container::before {
  left: auto;
  right: 50%;
}

[dir="rtl"] .timeline-item:nth-child(odd) {
  left: auto;
  right: 0;
}

[dir="rtl"] .timeline-item:nth-child(even) {
  left: auto;
  right: 50%;
}

[dir="rtl"] .timeline-item::after {
  right: auto;
  left: -10px;
}

[dir="rtl"] .timeline-item:nth-child(even)::after {
  left: auto;
  right: -10px;
}

[dir="rtl"] .footer-nav a {
  margin: 0 0 0 15px;
}

/* Arabic font */
@font-face {
  font-family: 'Noto Kufi Arabic';
  src: url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@400;500;700&display=swap');
}

[dir="rtl"] body {
  font-family: 'Noto Kufi Arabic', sans-serif;
}

/* Mobile menu adjustments */
@media (max-width: 768px) {
  .lang-switch {
    margin: 1rem 0;
  }

  [dir="rtl"] .lang-switch {
    margin: 1rem 0;
  }

  [dir="rtl"] .nav-links {
    padding-right: 0;
  }
}
