@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;700&display=swap");

:root {
    --bg-color: #fdfaf6;
    --text-color: #333;
    --primary-color: #000;
    /* NEOM Palette */
    --color-sindalah: #00a89d; /* Turquoise */
    --color-trojena: #5b92e5;   /* Sky Blue */
    --color-oxagon: #003b5c;    /* Deep Blue */
    --color-the-line: #f37736; /* Vibrant Orange */
    
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --hero-text-color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    overflow-x: hidden;
}

.container {
    width: 95%;
    max-width: 2500px;
    margin: 0 auto;
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    text-align: center;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background-color: var(--color-the-line);
    bottom: -15px;
    right: 50%;
    transform: translateX(50%);
}

/* --- Header & Hero Section --- */
.hero {
    height: 70vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('images/hero_background.jpeg');
    background-size: cover;
    background-position: center;
    color: var(--hero-text-color);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background-image 1s ease-in-out;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    width: 100%;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
}

.logo-icon {
    width: 40px;
    height: 40px;
    margin-left: 15px;
    background-size: contain;
    background-repeat: no-repeat;
}

nav a {
    color: var(--hero-text-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    transition: opacity 0.3s ease;
    margin: 0 10px;
}

nav a:hover {
    opacity: 0.8;
}

.hero-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 5%;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    animation: typing 3s steps(22) forwards, blink-caret .75s step-end infinite;
    white-space: nowrap;
    overflow: hidden;
    border-right: .15em solid orange; /* The caret */
}

/* Typing animation */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

/* Blinking caret animation */
@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: orange }
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

/* ===== Vision Section – تعديلات أساسية ===== */
.vision-content {
  display: flex;
  flex-direction: row-reverse;      /* صورة يسار عند RTL */
  align-items: center;
  gap: 2rem;                        /* مسافة معقولة بينهما */
  flex-wrap: nowrap;                /* لا تسمح بالالتفاف أفقياً */
}

.vision-image {
  flex: 0 0 35%;                    /* ثبّت الصورة على ٣٥٪ من العرض */
  max-width: 35%;
  height: auto;
  border-radius: 10px;
}

.vision-content p {
  flex: 1;                          /* يشغل بقية المساحة */
  max-width: 65%;
  font-size: 1.3rem;                /* خط أوضح على الديسكتوب */
  line-height: 2;
  margin: 0;
  padding-right: 10px;              /* بَدء قريب من اليمين */
  text-align: right;
}

/* ===== استجابة للجوال والأجهزة الصغيرة ===== */
@media (max-width: 768px) {
  .vision-content {
    flex-direction: column;         /* ترتيب عمودي */
    text-align: center;
  }

  .vision-image {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
  }

  .vision-content p {
    max-width: 100%;
    font-size: 1.1rem;              /* تصغير بسيط للخط */
    padding: 0 15px;
    text-align: center;
  }
}





/* --- Innovation Section --- */
#innovation-section {
    background-color: var(--card-bg);
}
.innovation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}
.innovation-card {
    text-align: center;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.innovation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}
.icon-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background-color: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}
.innovation-card:hover .icon-container {
    transform: scale(1.1);
}
.icon-container svg {
    width: 40px;
    height: 40px;
    fill: var(--text-color);
}
.innovation-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* --- Map Section --- */
.map-container {
    width: 100%;
    max-width: 800px;
    margin: 3rem auto 0;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 10px 20px var(--shadow-color);
}

.interactive-map {
    width: 100%;
    height: auto;
}

.map-marker {
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-marker circle {
    stroke: var(--card-bg);
    stroke-width: 4px;
    transition: all 0.3s ease;
}

.map-marker:hover circle {
    r: 18;
    filter: brightness(1.2);
}

#sindalah-marker circle { fill: var(--color-sindalah); }
#trojena-marker circle { fill: var(--color-trojena); }
#oxagon-marker circle { fill: var(--color-oxagon); }
#the-line-marker circle { fill: var(--color-the-line); }

.map-label {
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    font-weight: 700;
    fill: var(--text-color);
    pointer-events: none;
}

/* --- Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    max-width: 100%; /* زيادة أقصى عرض للبطاقة */
    margin: 0 auto; /* توسيط البطاقات */
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.project-card img {
    width: 100%;
    height: 300px; /* زيادة ارتفاع الصورة */
    object-fit: cover;
}

.project-card-content {
    padding: 1.5rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-card-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

/* --- Media Gallery Section --- */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.gallery-item {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    max-width: 600px; /* حجم متوسط */
    margin: 0 auto; /* توسيط البطاقات */
    height: auto; /* ليتناسب مع المحتوى */
}
.gallery-item img {
    width: 100%;
    height: 400px; /* ارتفاع أعلى */
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gallery-item:hover img {
    transform: scale(1.1);
}
.gallery-item .overlay {
    display: none; /* إخفاء التراكب بالكامل */
}
.gallery-item:hover .overlay {
    transform: translateY(0);
}
.overlay h4 {
    font-size: 1.2rem;
}

/* --- News Section --- */
#news-section {
    background-color: var(--card-bg);
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.news-article {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 10px;
    border-right: 5px solid var(--color-the-line);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.news-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}
.news-date {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 0.5rem;
}
.news-article h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.news-article a {
    text-decoration: none;
    color: var(--color-the-line);
    font-weight: 700;
    transition: opacity 0.3s;
}
.news-article a:hover {
    opacity: 0.8;
}

/* --- Modal --- */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); animation: fadeIn 0.5s; }
.modal-content { background-color: var(--bg-color); margin: 5% auto; padding: 40px; border-radius: 15px; width: 80%; max-width: 900px; position: relative; animation: slideIn 0.5s; max-height: 85vh; overflow-y: auto; }
.modal-content img.modal-header-image { width: 100%; height: 300px; object-fit: cover; border-radius: 10px; margin-bottom: 2rem; }
.modal-content h2 { font-size: 3rem; margin-bottom: 1rem; color: var(--primary-color); }
.modal-content p { font-size: 1.1rem; margin-bottom: 1rem; }
.close-btn { color: #aaa; position: absolute; top: 15px; left: 25px; font-size: 35px; font-weight: bold; transition: color 0.3s; }
.close-btn:hover, .close-btn:focus { color: black; text-decoration: none; cursor: pointer; }
@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }
@keyframes slideIn { from {transform: translateY(-50px); opacity: 0;} to {transform: translateY(0); opacity: 1;} }

/* --- Footer --- */
footer { background-color: var(--text-color); color: var(--bg-color); text-align: center; padding: 2rem 1rem; }

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .hero { height: 60vh; }
    .hero-content h1 { font-size: 2.8rem; }
    .hero-content p { font-size: 1rem; }
    header { flex-direction: column; gap: 1rem; }
    nav { display: flex; flex-wrap: wrap; justify-content: center; }
    .container { padding: 2rem 0; }
    .section-title, .modal-content h2 { font-size: 2rem; }
    .modal-content { width: 95%; margin: 10% auto; padding: 25px; }
    .map-label { font-size: 14px; }
}


