/* ===================================================================
   Al-Aqrabiyah Company for Mills & Feeds — Stylesheet
   =================================================================== */

@font-face {
  font-family: 'Cairo';
  src: local('Cairo');
}

:root {
  /* Brand palette, drawn from the company mark */
  --green-950: #0a2119;
  --green-900: #0d2b21;
  --green-800: #123c2d;
  --green-700: #1a5038;
  --green-600: #226646;
  --gold-600: #a97a24;
  --gold-500: #c4952f;
  --gold-400: #d7ac4d;
  --gold-300: #e6c579;

  --cream-50: #faf8f2;
  --cream-100: #f2ede0;
  --cream-200: #e8e0cc;

  --ink-900: #16201b;
  --ink-700: #384338;
  --ink-500: #5c665c;

  /* Semantic tokens — light theme (default) */
  --bg: var(--cream-50);
  --bg-raised: #ffffff;
  --bg-sunken: var(--cream-100);
  --text: var(--ink-900);
  --text-muted: var(--ink-700);
  --text-soft: var(--ink-500);
  --border: #ded4bc;
  --accent: var(--green-800);
  --accent-strong: var(--green-900);
  --gold: var(--gold-500);
  --header-bg: rgba(250, 248, 242, 0.92);
  --shadow: 0 1px 0 rgba(20, 30, 22, 0.06);

  --font: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --measure: 62ch;
  --radius: 2px;
}

html[data-theme="dark"] {
  --bg: #0d1712;
  --bg-raised: #142019;
  --bg-sunken: #0a130f;
  --text: #ece7da;
  --text-muted: #b9c2b6;
  --text-soft: #8a988c;
  --border: #24352a;
  --accent: var(--gold-400);
  --accent-strong: var(--gold-300);
  --gold: var(--gold-400);
  --header-bg: rgba(13, 23, 18, 0.92);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background .25s ease, color .25s ease;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
}

p { margin: 0 0 1em; color: var(--text-muted); }
p:last-child { margin-bottom: 0; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 88px 0; }
section.tight { padding: 56px 0; }

/* ---------- Structural rule motif (echoes the steel frame photos) ---------- */
.rule {
  height: 1px;
  background: linear-gradient(90deg, var(--gold) 0, var(--border) 40%, transparent 100%);
  margin: 0 0 48px;
}
[dir="rtl"] .rule { background: linear-gradient(270deg, var(--gold) 0, var(--border) 40%, transparent 100%); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-600);
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 14px;
}
html[data-theme="dark"] .eyebrow { color: var(--gold-400); }
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--gold);
  display: inline-block;
}

/* ---------- Header ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  max-width: 1180px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img { height: 46px; width: auto; }
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand-text strong { font-size: 1rem; font-weight: 800; }
.brand-text span { font-size: 0.72rem; color: var(--text-soft); font-weight: 600; }

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}
nav.main-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--text);
  border-bottom-color: var(--gold);
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
}
.icon-btn svg { width: 18px; height: 18px; }

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.lang-toggle button {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-soft);
}
.lang-toggle button.active {
  background: var(--accent-strong);
  color: var(--bg);
}
html[data-theme="dark"] .lang-toggle button.active { color: var(--green-950); }

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 0;
  overflow: hidden;
  background: var(--green-950);
  color: #f4f1e6;
}
.hero-media {
  position: absolute;
  inset: 0;
}
.hero-media img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.34;
}
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,33,25,.55) 0%, rgba(10,33,25,.88) 75%, rgba(10,33,25,1) 100%);
}
.hero-content {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 130px 24px 100px;
}
.hero-content .eyebrow { color: var(--gold-400); }
.hero-content .eyebrow::before { background: var(--gold-400); }
.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  max-width: 16ch;
  color: #faf7ee;
}
.hero-sub {
  margin-top: 22px;
  max-width: 56ch;
  font-size: 1.08rem;
  color: #cdd8cc;
}
.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 38px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-gold {
  background: var(--gold-500);
  color: #21170a;
}
.btn-gold:hover { background: var(--gold-400); }
.btn-outline {
  border-color: rgba(244,241,230,.4);
  color: #f4f1e6;
}
.btn-outline:hover { border-color: #f4f1e6; }

.hero-stats {
  position: relative;
  border-top: 1px solid rgba(244,241,230,.14);
  margin-top: 64px;
}
.hero-stats .container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-top: 34px;
}
.stat b {
  display: block;
  font-size: 1.9rem;
  color: var(--gold-400);
  font-weight: 800;
}
.stat span {
  font-size: 0.86rem;
  color: #b9c4b6;
}

/* ---------- Page header (non-home pages) ---------- */
.page-header {
  background: var(--green-950);
  color: #f4f1e6;
  padding: 74px 0 56px;
  position: relative;
}
.page-header h1 { color: #faf7ee; font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.page-header .eyebrow { color: var(--gold-400); }
.page-header .eyebrow::before { background: var(--gold-400); }
.page-header p { color: #c3cdc1; max-width: 60ch; margin-top: 14px; }

/* ---------- Generic content blocks ---------- */
.lead {
  font-size: 1.12rem;
  color: var(--text);
  max-width: var(--measure);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.framed-photo {
  position: relative;
  border: 1px solid var(--border);
  padding: 10px;
  background: var(--bg-raised);
}
.framed-photo img { width: 100%; height: 100%; object-fit: cover; }
.framed-photo::before {
  content: "";
  position: absolute;
  top: -8px; inset-inline-start: -8px;
  width: 26px; height: 26px;
  border-top: 2px solid var(--gold);
  border-inline-start: 2px solid var(--gold);
}
.framed-photo::after {
  content: "";
  position: absolute;
  bottom: -8px; inset-inline-end: -8px;
  width: 26px; height: 26px;
  border-bottom: 2px solid var(--gold);
  border-inline-end: 2px solid var(--gold);
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 32px 26px;
}
.card .mark {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  margin-bottom: 20px;
  color: var(--gold-600);
}
html[data-theme="dark"] .card .mark { color: var(--gold-400); }
.card .mark svg { width: 22px; height: 22px; }
.card h3 { font-size: 1.08rem; margin-bottom: 10px; }
.card p { font-size: 0.96rem; }

.pillars-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--border); }
.pillars-row .card { border: 0; border-inline-end: 1px solid var(--border); }
.pillars-row .card:last-child { border-inline-end: 0; }

.value-band {
  background: var(--green-900);
  color: #f2efe4;
  padding: 70px 0;
  position: relative;
}
.value-band::before {
  content: "";
  position: absolute; inset-inline-start: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--gold-500);
}
.value-band h2 { color: #faf7ee; font-size: clamp(1.5rem, 2.8vw, 2.1rem); max-width: 22ch; }
.value-band p { color: #c9d2c6; max-width: 62ch; margin-top: 18px; }

.founding-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  padding: 12px 20px;
  background: var(--bg-raised);
}
.founding-badge .ring {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  color: var(--gold-600);
  font-size: 0.78rem;
}
html[data-theme="dark"] .founding-badge .ring { color: var(--gold-400); }
.founding-badge div span { display: block; font-size: 0.78rem; color: var(--text-soft); }
.founding-badge div strong { font-size: 0.98rem; }

/* ---------- Facility gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.gallery figure { margin: 0; }
.gallery .framed-photo { aspect-ratio: 3/4; }
.gallery figcaption {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--text-soft);
}
.gallery figcaption strong { display: block; color: var(--text); font-size: 0.98rem; margin-bottom: 4px; }

/* ---------- Contact ---------- */
.contact-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  background: var(--bg-raised);
}
.contact-panel > div { padding: 48px 40px; }
.contact-panel .info { border-inline-end: 1px solid var(--border); }
.contact-line {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.contact-line:last-child { border-bottom: 0; }
.contact-line .mark {
  width: 40px; height: 40px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--gold-600);
}
html[data-theme="dark"] .contact-line .mark { color: var(--gold-400); }
.contact-line .mark svg { width: 18px; height: 18px; }
.contact-line span { display: block; font-size: 0.82rem; color: var(--text-soft); }
.contact-line strong { font-size: 1.05rem; }

.map-note {
  background: var(--bg-sunken);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
}
.map-note h3 { font-size: 1.05rem; }

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--green-950);
  color: #cbd4c8;
  padding: 60px 0 26px;
  margin-top: 0;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(244,241,230,.12);
}
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-brand img { height: 40px; }
.footer-brand strong { color: #f4f1e6; font-size: 1rem; }
footer.site-footer h4 { color: #f4f1e6; font-size: 0.92rem; margin-bottom: 18px; }
footer.site-footer p { color: #a9b5a6; font-size: 0.92rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: #a9b5a6; font-size: 0.92rem; }
.footer-links a:hover { color: var(--gold-400); }
.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: #7d8a7a;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; gap: 36px; }
  .grid-3 { grid-template-columns: 1fr; }
  .pillars-row { grid-template-columns: 1fr; }
  .pillars-row .card { border-inline-end: 0; border-bottom: 1px solid var(--border); }
  .pillars-row .card:last-child { border-bottom: 0; }
  .gallery { grid-template-columns: 1fr; }
  .contact-panel { grid-template-columns: 1fr; }
  .contact-panel .info { border-inline-end: 0; border-bottom: 1px solid var(--border); }
  .footer-top { grid-template-columns: 1fr; }
  .hero-stats .container { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 760px) {
  nav.main-nav {
    position: fixed;
    inset-inline-start: 0;
    top: 73px;
    width: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 10px 24px 20px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: all .2s ease;
  }
  nav.main-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  nav.main-nav a { width: 100%; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-toggle { display: inline-flex; }
  section { padding: 56px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
