/*
Theme Name: أمجاد وطن
Theme URI: https://www.amjadwatan.sa/
Author: أمجاد وطن
Author URI: https://www.amjadwatan.sa/
Description: ثيم ووردبريس لموقع أمجاد وطن — من الفكرة نصنع ذكرى
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: amjad-watan
Tags: rtl-language-support, custom-menu, featured-images, translation-ready
*/

/* أمجاد وطن — نسخة محسّنة مطابقة للأصل */
:root {
  --c1: #ffffff;
  --c2: #f8f8f8;
  --c3: #e7e7e7;
  --c4: #666666;
  --c5: #0070b3;
  --c6: #3f3f3f;
  --c7: #2f6dae;
  --c8: #0a0a0a;
  --sidebar: 380px;
  --radius: 10px;
  --font: 'Tajawal', sans-serif;
  --site-pad: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--c2);
  color: var(--c6);
  direction: ltr;
  overflow-x: hidden;
  font-size: 17.5px;
  line-height: 1.48;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ===== SHELL (Avada side-header-right) ===== */
#boxed-wrapper { background: var(--c2); min-height: 100vh; }

#wrapper {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--site-pad);
  padding: var(--site-pad);
  max-width: 100%;
  min-height: calc(100vh - 20px);
}

#main {
  flex: 1;
  min-width: 0;
  padding: 0;
}

#side-header {
  width: var(--sidebar);
  min-width: var(--sidebar);
  flex-shrink: 0;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: var(--site-pad);
  scrollbar-width: thin;
  scrollbar-color: rgba(10,10,10,.12) transparent;
}

#side-header::-webkit-scrollbar { width: 4px; }
#side-header::-webkit-scrollbar-thumb { background: rgba(10,10,10,.12); border-radius: 4px; }

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.side-block {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 5px;
}

/* ===== HERO ===== */
.hero-section {
  position: relative;
  min-height: calc(100vh - 20px);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c8);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(125%) brightness(95%) contrast(125%);
}

.hero-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(10, 0, 0, 0.37) 100%, rgba(255, 255, 255, 0.04) 36%);
  z-index: 1;
}

.hero-glass {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 20px);
  padding: 5%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 104%;
  max-width: 104%;
  margin-left: calc(-4% / 2);
  margin-right: calc(-4% / 2);
}

.hero-col-70 { width: 70%; padding: 0 2.74%; margin-bottom: 20px; direction: rtl; }
.hero-col-100 { width: 100%; padding: 0 1.92%; margin-bottom: 20px; direction: rtl; }
.hero-col-20 { width: 20%; padding: 0 9.6%; margin-bottom: 20px; }
.hero-col-60 { width: 60%; padding-left: 2.24%; margin-bottom: 0; align-self: stretch; display: flex; align-items: center; }

.hero-h1 {
  font-size: 64px;
  font-weight: 400;
  color: var(--c1);
  line-height: 96px;
  text-align: right;
  margin: 0;
}

.hero-h1 strong { font-weight: 700; }

.hero-lead {
  font-size: 32px;
  color: var(--c1);
  text-align: right;
  margin: 0 0 20px;
  line-height: 1.4;
}

.hero-mission-text {
  font-size: 32px;
  font-weight: 400;
  color: var(--c1);
  text-align: right;
  line-height: 1.23;
  letter-spacing: -0.01em;
  margin: 0;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c8);
  color: var(--c1);
  padding: 20px 30px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.375;
  margin-top: 10%;
  transition: background 0.3s;
  white-space: nowrap;
}

.hero-cta:hover { background: var(--c5); }

.hero-cta .fa-caret { font-size: 15px; }

.stats-grid {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: stretch;
}

.stat-cell {
  flex: 1;
  max-width: 168px;
  text-align: center;
  color: var(--c1);
  padding: 0 7px;
  margin-bottom: 14px;
}

.stat-value {
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 2px;
}

.stat-caption {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
}

/* ===== SIDEBAR: HEADER CARD ===== */
.block-header {
  background: var(--c1);
  padding: 20px 30px 20px 20px;
}

.block-header-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: calc(100% + 10px);
  margin: 0 -5px;
}

.bh-logo-col { width: 66.666%; padding: 0 5px; margin-bottom: 40px; }
.bh-menu-col { width: 33.333%; padding: 0 5px; display: flex; justify-content: flex-end; }
.bh-social-col { width: 100%; padding: 0 0 0 5px; display: flex; justify-content: flex-end; }

.bh-logo img { width: 120px; height: auto; }

.menu-icon-btn {
  width: 40px;
  height: 40px;
  background: var(--c8);
  border: 2px solid var(--c8);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c1);
  font-size: 24px;
  line-height: 36px;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.menu-icon-btn:hover {
  background: var(--c1);
  border-color: var(--c3);
  color: var(--c8);
}

.menu-icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

.social-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0;
  margin-bottom: 1px;
}

.social-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--c8);
  transition: color 0.25s;
}

.social-bar a:hover { color: var(--c5); }
.social-bar svg { width: 14px; height: 14px; }

/* ===== ABOUT ===== */
.block-about {
  background: var(--c5);
  padding: 30px 20px 20px;
  direction: rtl;
}

.block-about p {
  font-size: 18px;
  color: var(--c1);
  line-height: 1.5;
  text-align: justify;
  margin: 0 0 20px;
}

.btn-profile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.47);
  color: var(--c1);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  letter-spacing: 0.05em;
  transition: background 0.3s;
}

.btn-profile:hover { background: var(--c7); }
.btn-profile svg { width: 14px; height: 14px; transform: rotate(-45deg); }

/* ===== SERVICES ===== */
.block-services {
  background: var(--c3);
  padding: 20px;
  direction: rtl;
}

.svc-title-row { margin-bottom: 0; padding-bottom: 0; }
.svc-title-row h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--c8);
  text-align: right;
  line-height: 1.13;
  width: 75%;
  margin-bottom: 40px;
}

.svc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1.5px solid rgba(10, 10, 10, 0.1);
  transition: color 0.25s;
}

.svc-item:first-of-type { padding-top: 0; }
.svc-item:last-child { border-bottom: none; padding-bottom: 0; }

.svc-item span {
  font-size: 17.5px;
  font-weight: 400;
  color: var(--c8);
  line-height: 1.48;
  text-align: right;
  flex: 1;
}

.svc-item:hover span { color: var(--c5); }

.svc-item .ico-arrow {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
  margin-right: 12.5px;
  color: #000;
}

/* ===== PROJECTS ===== */
.block-projects-head {
  padding: 20px 50px 16px;
  direction: rtl;
}

.block-projects-head h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--c4);
  text-align: center;
  line-height: 1.3;
}

.projects-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
}

.proj-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 373px;
  padding: 220px 20px 20px;
  margin: 0 5px;
  transition: transform 0.4s ease;
  direction: rtl;
}

.proj-card:hover { transform: scale(0.96); }

.proj-card .bg-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.proj-card .bg-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 32%, rgba(10,10,10,0.72) 100%);
  z-index: 1;
}

.proj-card .inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.proj-card h3 {
  font-size: 22px;
  font-weight: 400;
  color: var(--c1);
  line-height: 1.3;
  margin-bottom: 4px;
  text-align: right;
}

.proj-card .client-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--c1);
  text-align: right;
}

.proj-card .btn-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  color: var(--c1);
  padding: 8px;
  border-radius: var(--radius);
  font-size: 11px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.3s;
}

.proj-card:hover .btn-more { background: rgba(255,255,255,0.3); }

/* ===== CONTACT ===== */
.block-contact {
  background: var(--c5);
  padding: 20px 10px 16px 20px;
  direction: rtl;
}

.block-contact-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.block-contact h2 {
  font-size: 22px;
  font-weight: 400;
  color: var(--c1);
  line-height: 1.3;
  flex: 0 0 60%;
}

.block-contact .contact-arrow {
  flex: 0 0 16.666%;
  display: flex;
  justify-content: flex-end;
  padding-left: 18px;
  color: var(--c1);
  transition: transform 0.35s;
}

.block-contact .contact-arrow:hover { transform: scale(1.1); }
.block-contact .contact-arrow svg { width: 30px; height: 30px; transform: rotate(-45deg); }

/* ===== OFF-CANVAS MENU ===== */
.oc-overlay {
  position: fixed;
  inset: 0;
  background: var(--c2);
  z-index: 19999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
  padding: 10px;
  overflow-y: auto;
}

.oc-overlay.open { opacity: 1; visibility: visible; }

.oc-panel {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 20px);
  background: var(--c1);
  border-radius: var(--radius);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  direction: rtl;
  scrollbar-width: thin;
}

.oc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 53px 20px 0;
  flex-shrink: 0;
}

.oc-logo img { width: 180px; max-width: 100%; height: auto; }

.oc-close {
  width: 96px;
  height: 96px;
  background: rgba(10, 10, 10, 0.06);
  color: var(--c8);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.3s, color 0.3s;
}

.oc-close svg { width: 40px; height: 40px; }
.oc-close:hover { background: var(--c8); color: var(--c1); }

.oc-nav-wrap {
  padding: 20px 40px 0;
  flex-shrink: 0;
}

.oc-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.oc-nav-link {
  display: block;
  font-size: 54px;
  font-weight: 400;
  line-height: 1.15;
  color: rgba(102, 102, 102, 0.6);
  padding: 4px 0;
  transition: color 0.25s;
  text-align: right;
}

.oc-nav-link.is-active,
.oc-nav-link:hover { color: var(--c5); }

.oc-projects-section {
  margin-top: 60px;
  padding: 0 0 40px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.oc-projects-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--c4);
  text-align: center;
  padding: 0 40px 24px;
  flex-shrink: 0;
}

.oc-projects-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 40px 10px;
  overflow: visible;
}

.oc-proj-card {
  position: relative;
  width: 100%;
  min-height: 480px;
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  transition: transform 0.35s ease;
}

.oc-proj-card:hover { transform: scale(0.97); }

.oc-proj-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.oc-proj-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 32%, rgba(10,10,10,0.72) 100%);
}

.oc-proj-body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  z-index: 1;
}

.oc-proj-body h3 {
  font-size: 20px;
  font-weight: 400;
  color: var(--c1);
  line-height: 1.3;
  margin-bottom: 4px;
}

.oc-proj-body p {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--c1);
}

.oc-proj-more {
  display: inline-flex;
  background: rgba(255,255,255,0.2);
  color: var(--c1);
  padding: 8px;
  border-radius: var(--radius);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== SITE FOOTER ===== */
.site-footer {
  padding: 28px 30px;
  margin-top: 10px;
  direction: rtl;
}

.site-footer-inner {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.site-footer-social {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-footer-social a {
  opacity: 0.85;
  transition: opacity 0.25s;
}

.site-footer-social a:hover { opacity: 1; }

/* ===== SCROLL TOP ===== */
.scroll-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  background: var(--c8);
  color: var(--c1);
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background 0.3s;
  z-index: 100;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-top.show { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--c5); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  /* Home: logo + menu above hero video */
  #boxed-wrapper:not(.inner-layout) #wrapper {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 0;
  }

  #boxed-wrapper:not(.inner-layout) #side-header {
    display: contents;
    width: auto;
    min-width: 0;
    max-height: none;
    position: static;
    overflow: visible;
  }

  #boxed-wrapper:not(.inner-layout) .side-stack {
    display: contents;
  }

  #boxed-wrapper:not(.inner-layout) .block-header {
    order: 1;
    width: calc(100% - 10px);
    margin: 0 5px 10px;
    padding: 14px 16px;
    position: sticky;
    top: 10px;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(10, 10, 10, 0.06);
  }

  #boxed-wrapper:not(.inner-layout) .block-header-grid {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0;
  }

  #boxed-wrapper:not(.inner-layout) .bh-logo-col {
    width: auto;
    flex: 1;
    margin-bottom: 0;
    padding: 0;
  }

  #boxed-wrapper:not(.inner-layout) .bh-menu-col {
    width: auto;
    flex-shrink: 0;
    padding: 0;
  }

  #boxed-wrapper:not(.inner-layout) .bh-social-col {
    display: none;
  }

  #boxed-wrapper:not(.inner-layout) #main {
    order: 2;
    width: 100%;
    padding: 0;
  }

  #boxed-wrapper:not(.inner-layout) .side-block:not(.block-header) {
    width: 100%;
    margin-left: 0px;
    margin-top: 15px;
  }

  #boxed-wrapper:not(.inner-layout) .block-about { order: 3; }
  #boxed-wrapper:not(.inner-layout) .block-services { order: 4; }
  #boxed-wrapper:not(.inner-layout) .block-contact { order: 5; }
  #boxed-wrapper:not(.inner-layout) .block-projects-head { order: 6; }

  #boxed-wrapper:not(.inner-layout) .projects-stack {
    order: 7;
    width: calc(100% - 10px);
    margin: 0 5px 10px;
  }

  /* Fallback for any non-home wrapper using column stack */
  #wrapper { flex-direction: column; }
  #main { padding: 0 10px; }
  #side-header {
    width: 100%;
    min-width: 100%;
    max-height: none;
    position: relative;
    top: 0;
  }

  .hero-col-70, .hero-col-20, .hero-col-60 { width: 100%; padding: 0 1.92%; }
  .hero-h1 { font-size: 48px; line-height: 1.2; }
}

@media (max-width: 1200px) {
  .oc-projects-track { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  #boxed-wrapper:not(.inner-layout) .block-header {
    padding: 12px 14px;
    top: 6px;
    margin-bottom: 8px;
  }

  #boxed-wrapper:not(.inner-layout) .bh-logo img {
    width: 100px;
  }

  #boxed-wrapper:not(.inner-layout) .menu-icon-btn {
    width: 44px;
    height: 44px;
  }

  #boxed-wrapper:not(.inner-layout) #wrapper {
    padding: 6px;
  }

  .hero-section {
    min-height: 72vh;
  }

  .hero-glass {
    min-height: 72vh;
    padding: 24px 16px;
  }

  .hero-h1 { font-size: 36px; line-height: 1.2; }
  .hero-lead, .hero-mission-text { font-size: 22px; }
  .stat-value { font-size: 24px; }
  .stat-caption { font-size: 14px; }
  .stat-cell { max-width: 50%; flex: 0 0 50%; }
  .stats-grid { flex-wrap: wrap; }
  .oc-nav-link { font-size: 34px; }
  .oc-top { padding-top: 20px; }
  .oc-projects-track { grid-template-columns: 1fr; padding: 0 20px 10px; }
  .oc-proj-card { min-height: 380px; }
  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 16px;
  }
  .site-footer-text {
    font-size: 13px;
  }
}
