/*
Theme Name:  SMDDR Mauritanie
Theme URI:   https://smddr.mr
Author:      SMDDR
Author URI:  https://smddr.mr
Description: Thème agricole premium pour SMDDR — Agriculture Mauritanienne d'Excellence. Cultivant le riz, les tomates, la pastèque et plus encore dans la Vallée du Fleuve Sénégal.
Version:     1.2.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License:     GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: smddr
Tags:        agriculture, one-page, dark, gold, french, mauritania
*/

/* =============================================
   ROOT & RESET
============================================= */
:root {
  --bg:          #0b1a0d;
  --bg-mid:      #121f14;
  --bg-card:     #182119;
  --bg-card2:    #1e2a1f;
  --cream:       #f3e9d0;
  --cream-dim:   rgba(243,233,208,.68);
  --cream-muted: rgba(243,233,208,.28);
  --gold:        #c79420;
  --gold-lt:     #e0aa35;
  --gold-pale:   rgba(199,148,32,.14);
  --terra:       #c4572b;
  --green-mid:   #2c5a3c;
  --green-acc:   #4d9966;
  --border:      rgba(243,233,208,.09);
  --border-g:    rgba(199,148,32,.28);
  --ff-display:  'Playfair Display', Georgia, serif;
  --ff-accent:   'Cormorant Garamond', Georgia, serif;
  --ff-body:     'DM Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--ff-body);
  font-weight: 300;
  line-height: 1.75;
  overflow-x: hidden;
}

/* Subtle grain overlay */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 9999; opacity: .45;
}

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

/* =============================================
   SHARED HELPERS
============================================= */
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.section-eyebrow-line {
  width: 32px; height: 1px; background: var(--gold); flex-shrink: 0;
}
.section-eyebrow-text {
  font-size: 10px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold); font-weight: 500;
}

.section-title {
  font-family: var(--ff-display);
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 700; line-height: 1.08; margin-bottom: 22px;
}
.section-title em { font-style: italic; color: var(--gold); font-weight: 400; }

.section-body {
  font-size: 15px; color: var(--cream-dim); line-height: 1.95;
  margin-bottom: 18px;
}

.btn-gold {
  display: inline-block;
  padding: 15px 38px;
  background: var(--gold); color: var(--bg);
  font-family: var(--ff-body); font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  border: none; cursor: pointer; border-radius: 2px;
  transition: background .25s, transform .25s, box-shadow .25s;
}
.btn-gold:hover {
  background: var(--gold-lt);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(199,148,32,.28);
}

.btn-outline {
  display: inline-block;
  padding: 15px 38px;
  background: transparent; color: var(--cream);
  font-family: var(--ff-body); font-size: 11px; font-weight: 400;
  letter-spacing: .16em; text-transform: uppercase;
  border: 1px solid var(--border); cursor: pointer; border-radius: 2px;
  transition: border-color .25s, transform .25s;
}
.btn-outline:hover { border-color: var(--cream-dim); transform: translateY(-2px); }

/* Reveal animation */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in { opacity: 1; transform: none; }
.rv2 { transition-delay: .12s; }
.rv3 { transition-delay: .24s; }
.rv4 { transition-delay: .36s; }

/* =============================================
   NAVIGATION
============================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 64px;
  transition: background .4s, padding .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.stuck {
  background: rgba(11,26,13,.94); backdrop-filter: blur(20px);
  padding: 16px 64px;
  border-bottom-color: var(--border);
}

.nav-logo { display: flex; align-items: center; gap: 16px; }
.nav-logo img { width: 130px; height: 130px; object-fit: contain; }
.nav-logo-name {
  font-family: var(--ff-display); font-size: 21px; font-weight: 700;
  letter-spacing: .04em;
}
.nav-logo-name b { color: var(--gold); font-weight: 700; }

.nav-links { display: flex; gap: 38px; list-style: none; }
.nav-links a {
  font-size: 12px; font-weight: 400; letter-spacing: .13em;
  text-transform: uppercase; color: var(--cream-dim);
  position: relative; transition: color .25s;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -5px; left: 0;
  width: 0; height: 1px; background: var(--gold);
  transition: width .3s ease;
}
.nav-links a:hover { color: var(--cream); }
.nav-links a:hover::after { width: 100%; }

/* Nav right: lang switcher + hamburger */
.nav-right {
  display: flex; align-items: center; gap: 18px;
}

/* Language switcher */
.lang-switcher {
  display: flex; align-items: center; gap: 3px;
}
.lang-btn {
  display: inline-block;
  cursor: pointer;
  font-family: var(--ff-body); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(243,233,208,.5);
  padding: 5px 9px;
  line-height: 1;
  border-radius: 3px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
  border: 1px solid transparent;
  transition: color .18s, background .18s, border-color .18s, transform .1s;
}
.lang-btn:hover {
  color: var(--cream);
  background: rgba(243,233,208,.1);
  border-color: rgba(243,233,208,.2);
}
.lang-btn--active {
  color: #0b1a0d !important;
  background: var(--gold) !important;
  border-color: var(--gold) !important;
}
.lang-btn:active {
  transform: scale(.88);
}
.lang-sep {
  font-size: 10px; color: rgba(243,233,208,.15);
  user-select: none; padding: 0 2px;
}

/* Hide extra about paragraphs when empty (FR/EN only show 2 paragraphs) */
.about-extra:empty { display: none; }

.nav-cta {
  padding: 9px 22px;
  border: 1px solid var(--gold); color: var(--gold) !important;
  font-size: 11px !important; letter-spacing: .16em !important;
  transition: background .25s, color .25s !important;
  border-radius: 2px;
}
.nav-cta:hover { background: var(--gold) !important; color: var(--bg) !important; }
.nav-cta::after { display: none !important; }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.hamburger span { display: block; width: 22px; height: 1.5px; background: var(--cream); transition: .3s; }

/* =============================================
   HERO
============================================= */
.hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* YouTube hero background */
.hero-yt-wrap {
  position: absolute; inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.hero-yt-wrap iframe {
  position: absolute;
  top: 50%; left: 50%;
  /* Cover the full hero at 16:9 — whichever dimension is tighter wins */
  width: 100vw;
  height: 56.25vw;   /* 100vw ÷ 16 × 9 */
  min-height: 100vh;
  min-width: 177.78vh; /* 100vh × 16 ÷ 9 */
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}

.hero-overlay {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(
    105deg,
    rgba(8,18,9,.82) 0%,
    rgba(8,18,9,.55) 55%,
    rgba(8,18,9,.30) 100%
  );
}

.hero-center {
  position: relative; z-index: 3;
  text-align: center;
  padding: 0 40px;
}

.hero-h1 {
  font-family: var(--ff-display);
  font-size: clamp(60px, 9vw, 130px);
  font-weight: 900; line-height: .95;
  margin-bottom: 10px;
  text-shadow: 0 2px 40px rgba(0,0,0,.4);
  opacity: 0; animation: fadeUp .9s ease .3s forwards;
}

.hero-h1-italic {
  font-family: var(--ff-display);
  font-size: clamp(48px, 7vw, 108px);
  font-weight: 400; font-style: italic;
  color: var(--gold); line-height: 1.0;
  text-shadow: 0 2px 40px rgba(0,0,0,.35);
  opacity: 0; animation: fadeUp .9s ease .5s forwards;
}

/* =============================================
   ABOUT
============================================= */
.about {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 90px; align-items: center;
  padding: 120px 64px;
  max-width: 1440px; margin: 0 auto;
}

.about-img-wrap { position: relative; }
.about-img-wrap::before {
  content: ''; position: absolute;
  top: -18px; left: -18px; right: 18px; bottom: 18px;
  border: 1px solid var(--border-g); border-radius: 4px;
  pointer-events: none;
}
.about-ph {
  width: 100%; aspect-ratio: 4/5;
}

.about-signature {
  font-family: var(--ff-accent);
  font-size: 30px; font-style: italic;
  color: var(--green-acc); margin-top: 34px;
}

.about-divider {
  width: 64px; height: 2px;
  background: linear-gradient(to right, var(--gold), transparent);
  margin: 28px 0;
}

/* =============================================
   VALUES / WHY US
============================================= */
.values {
  padding: 120px 64px;
  max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.1fr;
  gap: 90px; align-items: start;
}

.values-features { display: grid; gap: 0; }

.vf-item {
  display: grid; grid-template-columns: 50px 1fr;
  gap: 20px; align-items: start;
  padding: 32px 0; border-bottom: 1px solid var(--border);
  opacity: 0; transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.vf-item.in { opacity: 1; transform: none; }
.vf-item:first-child { padding-top: 0; }
.vf-item:last-child { border-bottom: none; padding-bottom: 0; }

.vf-icon {
  width: 50px; height: 50px; border-radius: 4px;
  border: 1px solid var(--border-g);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.vf-title {
  font-family: var(--ff-display); font-size: 20px; font-weight: 600;
  margin-bottom: 7px;
}
.vf-desc { font-size: 14px; color: var(--cream-dim); line-height: 1.85; }

.values-right { position: sticky; top: 100px; }

.values-quote {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 56px 48px;
  border-radius: 4px;
  margin-bottom: 20px;
}
.quote-mark {
  font-family: var(--ff-display); font-size: 72px;
  color: var(--gold); line-height: .5;
  margin-bottom: 28px; opacity: .6;
}
.quote-body {
  font-family: var(--ff-accent); font-size: 23px;
  font-style: italic; line-height: 1.65;
  color: var(--cream); margin-bottom: 28px;
}
.quote-attr {
  font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold);
}

.values-ph {
  width: 100%; aspect-ratio: 16/9;
}

/* =============================================
   YOUTUBE VIDEO SECTION
============================================= */
.smddr-video {
  background: var(--bg);
  padding: 100px 64px 110px;
  border-top: 1px solid var(--border);
}

.video-inner {
  max-width: 1100px; margin: 0 auto;
}

.video-head {
  text-align: center;
  margin-bottom: 48px;
}
.video-head .section-eyebrow {
  justify-content: center;
}

/* 16:9 responsive wrapper */
.video-embed-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--border-g);
  box-shadow: 0 32px 80px rgba(0,0,0,.55);
}
.video-embed-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* =============================================
   GALLERY
============================================= */
.gallery {
  background: var(--bg-mid);
  padding: 100px 64px 120px;
}

.gallery-head {
  display: flex; align-items: flex-end;
  justify-content: space-between; margin-bottom: 40px;
  flex-wrap: wrap; gap: 20px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  grid-template-rows: auto auto;
  gap: 8px;
  max-width: 1440px; margin: 0 auto;
}

.g-item {
  position: relative; overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .3s;
}
.g-item:hover { border-color: var(--border-g); }
.g-item:nth-child(1) { grid-column: span 2; aspect-ratio: 2/1.1; }
.g-item:nth-child(2) { aspect-ratio: 1/1; }
.g-item:nth-child(3) { aspect-ratio: 1/1; }
.g-item:nth-child(4) { aspect-ratio: 1/1; }
.g-item:nth-child(5) { aspect-ratio: 1/1; }
.g-item:nth-child(6) { grid-column: span 2; aspect-ratio: 2/1.1; }

.g-corner-tag {
  position: absolute; top: 11px; right: 11px;
  font-size: 8px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--border-g);
  padding: 3px 7px; background: rgba(11,26,13,.82);
}

/* =============================================
   FOOTER
============================================= */
.footer {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  padding: 64px 64px 36px;
}

.footer-grid {
  display: grid; grid-template-columns: 1.6fr repeat(3,1fr);
  gap: 60px; margin-bottom: 56px;
}

.footer-logo-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.footer-logo-row img { width: 90px; height: 90px; object-fit: contain; }
.footer-brand-name {
  font-family: var(--ff-display); font-size: 20px; font-weight: 700;
}
.footer-brand-name b { color: var(--gold); }
.footer-tagline {
  font-size: 13.5px; color: var(--cream-dim); line-height: 1.75;
  max-width: 230px; margin-bottom: 22px;
}
.footer-socials { display: flex; gap: 9px; }
.social-btn {
  width: 35px; height: 35px; border: 1px solid var(--border);
  border-radius: 4px; display: flex; align-items: center;
  justify-content: center; font-size: 13px; cursor: pointer;
  transition: border-color .25s, color .25s;
}
.social-btn:hover { border-color: var(--gold); color: var(--gold); }

.footer-col-title {
  font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 18px;
}
.footer-col-links { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.footer-col-links a {
  font-size: 13.5px; color: var(--cream-dim); transition: color .25s;
}
.footer-col-links a:hover { color: var(--cream); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.footer-copy { font-size: 12px; color: var(--cream-muted); }
.footer-wp { font-size: 12px; color: var(--cream-muted); }
.footer-wp a { color: var(--gold); }

/* =============================================
   KEYFRAMES
============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 1100px) {
  .nav, .nav.stuck { padding-left: 32px; padding-right: 32px; }
  .about { grid-template-columns: 1fr; padding: 80px 32px; gap: 50px; }
  .values { grid-template-columns: 1fr; padding: 80px 32px; gap: 60px; }
  .values-right { position: static; }
  .smddr-video { padding: 80px 32px 90px; }
  .gallery { padding: 80px 32px 100px; }
  .gallery-grid { grid-template-columns: repeat(2,1fr); }
  .g-item:nth-child(1), .g-item:nth-child(6) { grid-column: span 1; aspect-ratio: 1; }
  .footer { padding: 50px 32px 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}

@media (max-width: 680px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* =============================================
   ARABIC RTL OVERRIDES  [dir="rtl"]
============================================= */
[dir="rtl"] body {
  font-family: 'Segoe UI', Tahoma, 'DM Sans', sans-serif;
}

/* Nav flips */
[dir="rtl"] .nav { flex-direction: row-reverse; }
[dir="rtl"] .nav-logo { flex-direction: row-reverse; }
[dir="rtl"] .nav-right { flex-direction: row-reverse; }
[dir="rtl"] .nav-links a::after { left: auto; right: 0; }

/* Section eyebrow */
[dir="rtl"] .section-eyebrow { flex-direction: row-reverse; }

/* About grid: image on right, text on left */
[dir="rtl"] .about { direction: rtl; }
[dir="rtl"] .about-img-wrap { order: 2; }
[dir="rtl"] .about-content  { order: 1; }

/* Values */
[dir="rtl"] .values { direction: rtl; }
[dir="rtl"] .vf-item { direction: rtl; }
[dir="rtl"] .about-divider {
  background: linear-gradient(to left, var(--gold), transparent);
}

/* Quote */
[dir="rtl"] .quote-mark { text-align: right; }
[dir="rtl"] .quote-attr { text-align: right; }

/* Gallery head */
[dir="rtl"] .gallery-head { flex-direction: row-reverse; }

/* Footer */
[dir="rtl"] .footer-grid   { direction: rtl; }
[dir="rtl"] .footer-logo-row { flex-direction: row-reverse; }
[dir="rtl"] .footer-socials  { flex-direction: row-reverse; }
[dir="rtl"] .footer-bottom   { flex-direction: row-reverse; }
[dir="rtl"] .footer-col-links { text-align: right; }

/* Arabic font size adjustments */
[dir="rtl"] .hero-h1       { font-size: clamp(46px, 7vw, 110px); font-family: 'Segoe UI', Tahoma, Georgia, serif; }
[dir="rtl"] .hero-h1-italic { font-size: clamp(38px, 6vw, 90px);  font-family: 'Segoe UI', Tahoma, Georgia, serif; font-style: normal; }
[dir="rtl"] .section-title  { font-family: 'Segoe UI', Tahoma, Georgia, serif; }
[dir="rtl"] .vf-title       { font-family: 'Segoe UI', Tahoma, Georgia, serif; }
[dir="rtl"] .about-signature { font-style: normal; font-family: 'Segoe UI', Tahoma, Georgia, serif; }
[dir="rtl"] .quote-body      { font-style: normal; font-family: 'Segoe UI', Tahoma, Georgia, serif; font-size: 19px; }
