/* ==========================================================================
   هوى نجد للمقاولات - ملف التنسيق الوحيد
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. الخط
   -------------------------------------------------------------------------- */
/* خط الموقع الوحيد للنص الحي: العناوين بوزن ثقيل والفقرات بوزن عادي.
   مدروميت لم يعد يُستخدم في أي نص، وهو محصور في رسم الشعار (مسارات داخل SVG). */
@font-face {
  font-family: "AE Sharjah";
  src: url("../assets/fonts/ArbFONTS-ae_Sharjah.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. المتغيرات
   -------------------------------------------------------------------------- */
:root {
  /* الألوان */
  --navy: #0E2A47;
  --cyan: #0E7490;
  --page-bg: #F3F6F9;
  /* خلفية الصفحة كما قيست بالبكسل من شرائح بروفايل.pptx */
  --page-bg-tint: #C7D5ED;
  /* اللوحة الكحلية خلف كتل النص في البروفايل، وهي نفس الكحلي الأساسي */
  --navy-panel: #0E2A47;
  --card-bg: #FFFFFF;
  --muted: #6B7280;
  --glass: linear-gradient(135deg, #CFFAFE 0%, #06B6D4 50%, #0E7490 100%);

  /* حدود خفيفة مشتقة من الكحلي، بلا لون جديد */
  --hairline: rgba(14, 42, 71, 0.10);
  --hairline-strong: rgba(14, 42, 71, 0.16);

  /* الخطوط */
  --font-display: "AE Sharjah", system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-body: "AE Sharjah", system-ui, "Segoe UI", Tahoma, sans-serif;

  /* القياسات */
  --container: 1140px;
  --radius: 12px;
  --gutter: 20px;
}

/* --------------------------------------------------------------------------
   3. إعادة ضبط أساسية
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--page-bg-tint);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.9;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   4. العناوين وأحجام الخطوط
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
  margin: 0 0 16px;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 19px;
}

h4 {
  font-size: 18px;
}

/* خط سماوي تحت عناوين الأقسام */
.section-title {
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 28px;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 56px;
  height: 3px;
  background-color: var(--cyan);
}

.muted {
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   5. الحاوية والأقسام
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: 48px;
}

/* --------------------------------------------------------------------------
   6. البطاقات والأزرار
   -------------------------------------------------------------------------- */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 24px;
}

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.4;
  padding: 14px 32px;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  background-color: var(--navy);
  color: var(--card-bg);
  text-align: center;
}

.btn:hover {
  text-decoration: none;
  opacity: 0.92;
}

/* الزر الوحيد الذي يحمل التدرج الزجاجي */
.btn-glass {
  background: var(--glass);
  border-color: transparent;
  color: var(--navy);
}

.btn-outline {
  background-color: transparent;
  color: var(--navy);
}

/* --------------------------------------------------------------------------
   7. الشريط الزجاجي الرفيع أعلى الصفحة
   -------------------------------------------------------------------------- */
.topbar {
  height: 4px;
  background: var(--glass);
}

/* --------------------------------------------------------------------------
   8. الترويسة
   -------------------------------------------------------------------------- */
/* الترويسة والتذييل على نقش البطاقة: لوح كحلي وموجة سماوية أفقية */
.site-header {
  background-color: var(--navy-panel);
  background-image: url("../assets/images/decor/bar-wave.svg");
  /* الموجة بارتفاع ثابت ملتصقة بأسفل الشريط، فلا تمر فوق النص ولا تتمدد عند فتح القائمة */
  background-size: 100% 44px;
  background-position: left bottom;
  background-repeat: no-repeat;
  border-bottom: 0;
}


.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding-block: 10px 18px;
}

.site-header__logo {
  display: block;
  flex: 0 0 auto;
}

.site-header__logo:hover {
  text-decoration: none;
}

.site-header__logo img {
  width: 168px;
  height: auto;
}

/* زر القائمة على الجوال */
.nav-toggle {
  border-color: rgba(255, 255, 255, 0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background-color: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
}

.nav-toggle__icon {
  width: 22px;
  height: 16px;
}

.nav-toggle__icon rect {
  fill: var(--card-bg);
}

.main-nav {
  display: none;
  flex: 1 1 auto;
}

.main-nav.is-open {
  display: block;
  flex-basis: 100%;
  order: 3;
  padding-bottom: 12px;
}

.main-nav__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.main-nav__link {
  display: block;
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--card-bg);
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.main-nav__link:hover {
  color: #06B6D4;
  text-decoration: none;
}

.main-nav__link[aria-current="page"] {
  color: #06B6D4;
}

/* --------------------------------------------------------------------------
   9. التذييل
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--navy-panel);
  background-image: url("../assets/images/decor/bar-wave.svg");
  background-size: 100% 74px;
  background-position: left bottom;
  background-repeat: no-repeat;
  border-top: 0;
  margin-top: 48px;
  padding-block: 40px 44px;
}

.site-footer__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
}

.site-footer__logo img {
  width: 164px;
  height: auto;
}

.footer-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
}

.footer-nav__list > li {
  flex: 0 0 auto;
}

.footer-nav__link {
  display: block;
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--card-bg);
  white-space: nowrap;
}

.footer-nav__link:hover {
  color: #06B6D4;
  text-decoration: none;
}

.site-footer__bottom {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  text-align: center;
}

.site-footer__legal,
.site-footer__copy {
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
}

.site-footer__legal {
  margin-bottom: 6px;
}

/* كل رقم يبقى مع عنوانه في سطر واحد */
.site-footer__legal > span {
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   10. مواضع الصور غير المتوفرة
   -------------------------------------------------------------------------- */
.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background-color: #EDF1F5;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 16px;
}

/* --------------------------------------------------------------------------
   10ب. أقسام الصفحة الرئيسية
   -------------------------------------------------------------------------- */

/* الجملة الافتتاحية على صورة زخرفية من البروفايل مع تدرج كحلي فوقها */
.hero {
  padding-block: 56px 48px;
  background-color: var(--navy-panel);
  background-image:
    linear-gradient(to left, rgba(14, 42, 71, 0.94) 0%, rgba(14, 42, 71, 0.82) 45%, rgba(14, 42, 71, 0.45) 100%),
    url("../assets/images/decor/hero-bg.jpg");
  background-size: auto, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

.hero__inner {
  max-width: var(--container);
}

.hero__title,
.hero__lead {
  color: var(--card-bg);
}

.hero__title {
  margin-bottom: 12px;
}

.hero__lead {
  max-width: 680px;
  margin-bottom: 28px;
}

/* زر فوق خلفية داكنة */
.btn-on-dark {
  background-color: var(--card-bg);
  border-color: var(--card-bg);
  color: var(--navy);
}

/* يمنع تمدد الأعمدة بعرض محتواها الأدنى */
.services-grid > li,
.projects-grid > li {
  min-width: 0;
}

/* مقتطف النبذة */
.teaser__text {
  max-width: 820px;
  margin-bottom: 16px;
}

.link-more {
  font-family: var(--font-body);
  font-size: 18px;
}

/* شبكة الخدمات */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.service-card__title {
  font-size: 18px;
  line-height: 1.4;
  text-wrap: balance;
  overflow-wrap: break-word;
  margin-bottom: 8px;
}

/* أيقونة الخدمة: خطوط رفيعة بلا تعبئة بلون السماوي */
.service-card__icon {
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-card__text {
  color: var(--muted);
  margin: 0;
}

/* شبكة الأعمال */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* بطاقة فيها صورة أعلاها (الأعمال والخدمات) */
.media-card {
  padding: 0;
  overflow: hidden;
}

/* تأثير مرور ناعم: تكبير خفيف وظل أعمق، بلا حركة تلقائية */
.service-card,
.media-card,
.gallery-item {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.service-card:hover,
.media-card:hover,
.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 28px rgba(14, 42, 71, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  .service-card,
  .media-card,
  .gallery-item {
    transition: none;
  }

  .service-card:hover,
  .media-card:hover,
  .gallery-item:hover {
    transform: none;
  }
}

.media-card .img-placeholder {
  border-radius: 0;
}

.media-card__body {
  padding: 16px 20px 20px;
}

.project-card__name {
  margin-bottom: 4px;
}

.project-card__type {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}

.project-card__meta {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 2px;
}

.section__footer-link {
  margin-top: 28px;
}

/* صورة حقيقية داخل بطاقة (الرئيسية) */
.media-card__img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* معرض الأعمال: كل مشروع بصوره كاملة بلا قص */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.gallery > li {
  min-width: 0;
}

/* على الجوال: صور المشروع واحدة تحت الأخرى، كل صورة كاملة بلا قص */
.gallery-photos {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: var(--page-bg);
}

.gallery-photo {
  margin: 0;
}

.gallery-photo img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
}

.gallery-item .project-card__name {
  font-size: 22px;
  margin-bottom: 4px;
}

/* --------------------------------------------------------------------------
   10د. صفحة تواصل معنا
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.contact-grid > li {
  min-width: 0;
}

.contact-card__icon {
  width: 28px;
  height: 28px;
  fill: var(--cyan);
  margin-bottom: 12px;
}

.contact-card__label {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--navy);
  margin: 0 0 4px;
}

.contact-card__value {
  color: var(--muted);
  margin: 0;
  overflow-wrap: break-word;
}

a.contact-card__value {
  color: var(--cyan);
}

/* النموذج */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field__label {
  font-size: 16px;
  color: var(--navy);
  margin-bottom: 6px;
}

.field__control {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--navy);
  background-color: var(--card-bg);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  width: 100%;
}

.field__control:focus {
  border-color: var(--cyan);
}

textarea.field__control {
  min-height: 140px;
  resize: vertical;
}

.form-actions {
  grid-column: 1 / -1;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.form-note {
  margin: 12px 0 0;
  color: var(--muted);
}

.form-note[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   10ج. الصفحات الداخلية
   -------------------------------------------------------------------------- */

/* عنوان الصفحة */
.page-head {
  padding-block: 40px 8px;
}

.page-head h1 {
  margin-bottom: 8px;
}

.page-head__lead {
  max-width: 680px;
  color: var(--muted);
  margin: 0;
}

.section--tight {
  padding-block: 24px;
}

/* أقسام على اللوحة الكحلية بنص أبيض، كما في شرائح البروفايل */
.section--panel {
  background-color: var(--navy-panel);
  color: var(--card-bg);
}

.section--panel h2,
.section--panel .teaser__text,
.section--panel .prose p {
  color: var(--card-bg);
}

/* عناوين البطاقات داخل اللوحة تبقى كحلية لأن البطاقة بيضاء */
.section--panel .card h2,
.section--panel .card h3 {
  color: var(--navy);
}

/* الخط تحت العنوان بسماوي الشريط العلوي في البروفايل ليظهر على الكحلي */
.section--panel .section-title::after {
  background-color: #06B6D4;
}

.section--panel .link-more {
  color: var(--card-bg);
  text-decoration: underline;
}

/* البطاقات داخل اللوحة تبقى بيضاء بنصها الكحلي */
.section--panel .card {
  border-color: transparent;
}

/* النبذة: صورة زخرفية يميناً ونص على اللوحة الكحلية يساراً كما في شريحة البروفايل */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
}

.intro-grid__figure {
  margin: 0;
  min-width: 0;
}

.intro-grid__figure img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
}

.intro-grid__text {
  min-width: 0;
  background-color: var(--navy-panel);
  color: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
}

/* فقرات النبذة */
.prose {
  max-width: 820px;
}

.prose p + p {
  margin-top: 0;
}

/* الرسالة والرؤية */
.pair-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card__title {
  font-size: 22px;
  margin-bottom: 10px;
}

/* القيم */
.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.values-grid > li {
  min-width: 0;
}

.value-card {
  padding: 18px 20px;
  text-align: center;
}

.value-card__title {
  font-size: 20px;
  margin: 0;
}

/* جدول معلومات المؤسسة */
.table-card {
  padding: 8px 8px;
  overflow-x: auto;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
}

.info-table th,
.info-table td {
  padding: 14px 16px;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid var(--hairline);
}

.info-table tr:last-child th,
.info-table tr:last-child td {
  border-bottom: 0;
}

.info-table th {
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  width: 40%;
}

.info-table td {
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   11. من 768px وما فوق: الخطوط والمسافات
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  :root {
    --gutter: 28px;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 27px;
  }

  h3 {
    font-size: 20px;
  }

  .section {
    padding-block: 72px;
  }

  .site-header {
    background-size: 100% 62px;
  }

  .site-footer {
    background-size: 100% 104px;
    padding-block: 56px 52px;
  }

  .hero {
    padding-block: 72px 40px;
  }

  .hero__lead {
    font-size: 20px;
  }

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

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

  /* من 768px: صور المشروع في صف واحد متوسط بارتفاع واحد لا يتجاوز 420px،
     وعرض كل صورة = نسبة أبعادها (--r) × ذلك الارتفاع */
  .gallery-photos {
    container-type: inline-size;
    flex-direction: row;
    justify-content: center;
  }

  .gallery-photo {
    flex: 0 0 auto;
    width: calc(var(--r) * min(420px, (100cqi - 8px) / var(--sum)));
  }

  .gallery-photo img {
    max-height: none;
  }

  .page-head {
    padding-block: 64px 8px;
  }

  .section--tight {
    padding-block: 32px;
  }

  .intro-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

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

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

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

  .form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 24px;
  }

  .table-card {
    padding: 8px 16px;
  }

  .info-table th {
    width: 30%;
  }
}

/* --------------------------------------------------------------------------
   12. من 992px وما فوق: تخطيط التذييل
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
  /* السطر الأول: الشعار يميناً، والروابط في سطر تحته */
  .site-footer__top {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    text-align: start;
    gap: 24px 32px;
  }

  .site-footer__logo {
    flex: 0 0 auto;
  }

  .footer-nav {
    flex: 1 0 100%;
    order: 3;
  }

  .footer-nav__list {
    justify-content: center;
    gap: 12px 32px;
  }
}

/* --------------------------------------------------------------------------
   13. من 992px وما فوق: شريط التنقل الأفقي في الترويسة
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
  .site-header__inner {
    flex-wrap: nowrap;
    min-height: 92px;
  }

  .site-header__logo img {
    width: 208px;
  }

  .nav-toggle {
    display: none;
  }

  .main-nav,
  .main-nav.is-open {
    display: block;
    flex: 0 0 auto;
    order: 0;
    padding-bottom: 0;
  }

  .main-nav__list {
    flex-direction: row;
    gap: 24px;
  }

  .main-nav__link {
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }

  .main-nav__link[aria-current="page"] {
    border-bottom-color: #06B6D4;
  }

  .service-card__title {
    font-size: 19px;
    line-height: 1.35;
  }

  .projects-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .values-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .contact-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --------------------------------------------------------------------------
   14. من 1140px وما فوق: شبكات الخدمات ثلاثية
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
  /* شبكة الخدمات التسع: ثلاثة أعمدة في ثلاثة صفوف */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
