/*
Theme Name: HMN Contracting
Theme URI: https://hemamona.com/
Description: قالب همّمنا للمقاولات العامة — تصميم بسيط بخلفية بيضاء، بهوية الشركة.
Author: HMN
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: hmn
*/

:root {
  --lime: #D2DE26;
  --ink: #000;
  --line: #e8e8e8;
  --mute: #5f5f5f;
  --soft: #fafafa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-size: 16px;
  line-height: 2;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* الصفحة عربية (rtl). أي نص لاتيني أو رقم هاتف بداخلها يُعزل حتى لا
   تنتقل علاماته إلى الطرف الخطأ. الحاوية تبقى rtl، والمحتوى وحده ltr. */
bdi {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* ---------- الهيدر ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 50;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand img { height: 46px; width: auto; }

.menu {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
  color: #3d3d3d;
}

.menu a {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.menu a:hover { border-color: var(--line); }

.menu .current-menu-item > a,
.menu .current_page_item > a {
  color: #000;
  font-weight: 500;
  border-color: var(--lime);
}

.burger {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #000;
  margin: 3px 0;
}

/* ---------- الهيرو ---------- */

.hero {
  padding: 96px 0 88px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 24px;
  max-width: 800px;
}

/* التظليل الليموني تحت الجزء الثاني من العنوان */
.hero h1 em {
  font-style: normal;
  background: linear-gradient(transparent 64%, var(--lime) 64%);
}

.hero p {
  font-size: 16.5px;
  line-height: 2.1;
  color: var(--mute);
  max-width: 720px;
  margin: 0;
}

/* ---------- الأقسام ---------- */

.section { padding: 72px 0; border-bottom: 1px solid var(--line); }
.section.alt { background: var(--soft); }
.section:last-of-type { border-bottom: 0; }

.head { margin-bottom: 36px; }
.head h2 { font-size: 30px; font-weight: 700; margin: 0 0 10px; line-height: 1.4; }
.head p { font-size: 16px; line-height: 2; color: var(--mute); margin: 0; max-width: 720px; }

/* ---------- بطاقات الخدمات ---------- */

.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.card {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px 24px;
  transition: border-color .15s;
}

.card:hover { border-color: #c9c9c9; }

.card .ic {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--lime);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: transform .2s;
}

.card:hover .ic { transform: translateY(-2px); }

.card .ic svg {
  width: 27px;
  height: 27px;
  stroke: #000;
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 { font-size: 15.5px; font-weight: 500; margin: 0; line-height: 1.7; }

/* ---------- بطاقات النص (رؤيتنا، رسالتنا) ---------- */

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.textcard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px 26px;
}

.textcard h3 { font-size: 17px; font-weight: 600; margin: 0 0 14px; }

.textcard h3::before {
  content: '';
  display: block;
  width: 26px;
  height: 3px;
  background: var(--lime);
  margin-bottom: 14px;
  border-radius: 2px;
}

.textcard p { margin: 0; font-size: 15px; line-height: 2.05; color: var(--mute); }

/* ---------- الأهداف ---------- */

.goals {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.goals li {
  background: #fff;
  padding: 22px 26px;
  font-size: 15.5px;
  line-height: 1.9;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.goals li b { color: var(--lime); font-size: 22px; line-height: 1.5; }

/* ---------- شعارات الجهات ---------- */

/* شبكة موحّدة الخلايا. الشعارات تصل بمقاسات وهوامش مختلفة، فنثبّت
   حجم الخلية ونضع الشعار في وسطها بدل تركه يفرض مقاسه.
   بلا إطار للخلية: ملفات الشعارات تحمل إطارها الخاص، والإطاران معاً
   يعطيان حداً مزدوجاً. */
.logos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 20px;
}

.logo-cell {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.logo-cell img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity: .65;
  transition: filter .25s, opacity .25s;
}

.logo-cell:hover img { filter: none; opacity: 1; }

@media (max-width: 560px) {
  .logos { grid-template-columns: repeat(2, 1fr); }
  .logo-cell { padding: 18px 20px; }
}

/* ---------- المعرض ---------- */

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.gallery figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f2f2f2;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .5s;
}

.gallery figure:hover img { transform: scale(1.05); }

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .93);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99;
  cursor: zoom-out;
  padding: 28px;
}

#lightbox img { max-width: 94vw; max-height: 92vh; object-fit: contain; border-radius: 8px; }

/* ---------- تواصل معنا ---------- */

.contact { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: start; }

.info {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px 28px;
}

.info h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.info > p { margin: 0 0 22px; font-size: 15px; color: var(--mute); line-height: 1.9; }

.info .row {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.info .row span { color: var(--mute); min-width: 120px; }
.info .row a { font-weight: 500; }

.map { margin-top: 20px; border: 0; width: 100%; height: 230px; border-radius: 10px; }

/* نموذج التواصل — يغطي WPForms و Contact Form 7 */
.hmn-form input[type=text],
.hmn-form input[type=email],
.hmn-form input[type=tel],
.hmn-form textarea,
.wpforms-field input,
.wpforms-field textarea,
.wpcf7 input[type=text],
.wpcf7 input[type=email],
.wpcf7 textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid #dcdcdc;
  border-radius: 10px;
  background: #fff;
  color: inherit;
}

/* البريد يُكتب لاتينياً. نجعل اتجاهه ltr مع بقائه محاذياً لليمين
   حتى لا يخرج عن صف بقية الحقول. */
.hmn-form input[type=email],
.wpcf7 input[type=email] { direction: ltr; text-align: right; }

.hmn-form textarea, .wpcf7 textarea { min-height: 130px; resize: vertical; }
.hmn-form input:focus, .hmn-form textarea:focus,
.wpcf7 input:focus, .wpcf7 textarea:focus { outline: none; border-color: var(--ink); }

.hmn-form label { display: block; font-size: 14px; margin-bottom: 7px; color: #3d3d3d; }
.hmn-form .field { margin-bottom: 16px; }

/* الحقل الخفي لصد الرسائل المزعجة. مخفي عن العين وعن قارئ الشاشة. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice {
  margin: 0 0 22px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.8;
}

.notice.ok { background: #f2f7d8; border: 1px solid var(--lime); }
.notice.bad { background: #fdf1f1; border: 1px solid #f0c9c9; }

.btn, .wpforms-submit, .wpcf7 input[type=submit] {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 13px 34px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  transition: .15s;
}

.btn:hover, .wpforms-submit:hover, .wpcf7 input[type=submit]:hover {
  background: var(--lime);
  color: #000;
}

/* ---------- محتوى الصفحات العادية ---------- */

.entry h2 { font-size: 24px; font-weight: 700; margin: 40px 0 14px; }
.entry h3 { font-size: 19px; font-weight: 600; margin: 30px 0 12px; }
.entry p { color: var(--mute); }
.entry a { text-decoration: underline; }

/* ---------- الفوتر ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 40px 0 34px; }

.site-footer .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.site-footer .brand img { height: 50px; }
.site-footer .menu { font-size: 14.5px; }
.site-footer .btm { padding-top: 20px; font-size: 13.5px; color: #8a8a8a; display: flex; gap: 8px; }

/* ---------- الجوال ---------- */

@media (max-width: 960px) {
  .grid4, .grid3, .gallery { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: 1fr; }
  .hero { padding: 56px 0; }
  .hero h1 { font-size: 30px; }
  .section { padding: 52px 0; }
  .burger { display: block; }
  .site-header .menu {
    position: fixed;
    inset: 78px 0 auto;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 32px 20px;
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-header .menu.open { display: flex; }
  .site-header .menu a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-footer .top { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .grid4, .grid3, .gallery { grid-template-columns: 1fr; }
  .wrap { padding: 0 20px; }
}

/* ---------- تعديلات لاحقة ---------- */

/* شريط أدوات ووردبريس يغطي الهيدر الثابت. للمشرف فقط. */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }

/* الشعارات: صفوف متوسّطة. الشبكة تترك الصف الأخير
   محاذياً لطرف واحد، والفلكس يوسّطه. */
.logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px 48px;
}

.logo-cell {
  flex: 0 0 auto;
  width: 210px;
  aspect-ratio: 16 / 9;
  padding: 8px;
}

@media (max-width: 780px) {
  .logos { gap: 20px 28px; }
  .logo-cell { width: 140px; }
}
