/* ==========================================================================
   Agrivie Website — Hero Section Styles (Day 4 Scope: Full-Width Overlay)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base Reset & Design Variables
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

:root {
  --color-primary: #1b4332;
  --color-primary-hover: #143527;
  --color-accent: #2d6a4f;
  --color-accent-light: #52b788;
  
  --color-badge-bg: rgba(236, 253, 245, 0.95);
  --color-badge-border: #a7f3d0;
  --color-badge-text: #065f46;
  --color-badge-star: #dc2626;

  --color-text-main: #143527;
  --color-text-body: #2d3748;
  --color-text-muted: #4a5568;

  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  --shadow-panel: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-btn-primary: 0 4px 14px rgba(27, 67, 50, 0.28);
  --shadow-btn-hover: 0 6px 20px rgba(27, 67, 50, 0.38);
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: var(--font-family-base);
  color: var(--color-text-main);
  background-color: #f8fafc;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   2. Full-Width Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background-image: url('assets/images/hero-bg.png');
  background-position: right center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
  padding: 2.5rem 32px 2rem 32px;
}

/* Gradient Overlay: Provides crisp contrast on the text side while preserving the hardware, laptop, and Moroccan flag */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg, 
    rgba(255, 255, 255, 0.96) 0%, 
    rgba(255, 255, 255, 0.90) 34%, 
    rgba(255, 255, 255, 0.55) 54%, 
    rgba(255, 255, 255, 0.12) 70%, 
    rgba(255, 255, 255, 0) 80%
  );
  z-index: 1;
  pointer-events: none;
}

.hero-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  min-height: calc(100vh - 4.5rem);
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* --------------------------------------------------------------------------
   3. Hero Text Content
   -------------------------------------------------------------------------- */
.hero-content {
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: auto;
  margin-bottom: auto;
  margin-left: 0;
  margin-right: auto;
  padding: 1.5rem 0;
}

/* Status Eyebrow Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.95rem;
  background-color: var(--color-badge-bg);
  border: 1px solid var(--color-badge-border);
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.badge-icon {
  color: var(--color-badge-star);
  font-size: 0.875rem;
  line-height: 1;
}

.badge-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-badge-text);
  letter-spacing: 0.02em;
}

/* Main Headline */
.hero-title {
  font-size: clamp(2.35rem, 3.8vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--color-text-main);
  letter-spacing: -0.03em;
  margin-bottom: 1.35rem;
}

/* Subheadline */
.hero-subtitle {
  font-size: clamp(1.05rem, 1.25vw, 1.15rem);
  line-height: 1.65;
  color: var(--color-text-body);
  margin-bottom: 2.25rem;
  max-width: 560px;
}

/* CTA Action Buttons */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.15rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.22s ease-in-out;
  cursor: pointer;
}

.btn-arrow {
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

/* Primary CTA: Dark Green Solid Pill */
.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  border: 1.5px solid var(--color-primary);
  box-shadow: var(--shadow-btn-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

/* Secondary CTA: Translucent White Pill with Dark Border */
.btn-secondary {
  background-color: rgba(255, 255, 255, 0.92);
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background-color: #ffffff;
  color: var(--color-accent);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover .btn-arrow {
  transform: translateY(2px);
}

/* --------------------------------------------------------------------------
   4. Prototype Highlights
   -------------------------------------------------------------------------- */
.hero-highlights-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: auto;
  max-width: 580px;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0.5rem 0;
  margin-top: 1.5rem;
  margin-right: auto;
  margin-left: 0;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 0 1 auto;
  justify-content: flex-start;
  padding: 0.25rem 0;
}

.highlight-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.95));
}

.highlight-info {
  display: flex;
  flex-direction: column;
}

.highlight-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.95), 0 0 8px rgba(255, 255, 255, 0.7);
}

.highlight-divider {
  width: 1px;
  height: 22px;
  background-color: rgba(20, 53, 39, 0.25);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   5. Bidirectional RTL Support (Arabic)
   Strict Requirement:
   - Position text & gradient carefully so they do NOT hide the sensor,
     laptop, dashboard, or Moroccan flag.
   - NEVER mirror or flip the greenhouse background image.
   -------------------------------------------------------------------------- */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .hero-section {
  /* Strict: background image remains untransformed and un-mirrored */
  background-position: right center;
}

[dir="rtl"] .hero-overlay {
  /* Gradient remains focused on the left/center-left area where foliage is,
     leaving the right-side hardware (sensor, laptop, flag) completely unmasked */
  background: linear-gradient(
    90deg, 
    rgba(255, 255, 255, 0.96) 0%, 
    rgba(255, 255, 255, 0.90) 34%, 
    rgba(255, 255, 255, 0.55) 54%, 
    rgba(255, 255, 255, 0.12) 70%, 
    rgba(255, 255, 255, 0) 80%
  );
}

[dir="rtl"] .hero-content {
  /* Keep text container anchored on the left side of the viewport so the 
     hardware, laptop screen, and Moroccan flag on the right remain 100% visible */
  margin-left: 0;
  margin-right: auto;
  align-items: flex-start;
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .hero-badge {
  flex-direction: row;
}

[dir="rtl"] .hero-actions {
  flex-direction: row;
}

[dir="rtl"] .btn-arrow {
  display: inline-block;
  transform: scaleX(-1);
}

[dir="rtl"] .btn-primary:hover .btn-arrow {
  transform: scaleX(-1) translateX(3px);
}

[dir="rtl"] .hero-highlights-bar {
  direction: rtl;
  margin-left: 0;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
   6. Responsive Adaptability
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .hero-section {
    padding: 3rem 1.5rem 2rem 1.5rem;
    min-height: auto;
  }

  .hero-overlay,
  [dir="rtl"] .hero-overlay {
    background: linear-gradient(
      180deg, 
      rgba(255, 255, 255, 0.95) 0%, 
      rgba(255, 255, 255, 0.88) 55%, 
      rgba(255, 255, 255, 0.75) 100%
    );
  }

  .hero-container {
    min-height: auto;
    gap: 2.5rem;
  }

  .hero-content {
    max-width: 100%;
    margin: 0;
    padding: 1.5rem 0;
  }

  .hero-highlights-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
  }

  .highlight-item {
    justify-content: flex-start;
    padding: 0.25rem 0;
  }

  .highlight-divider {
    display: none;
  }
}

@media (max-width: 600px) {
  .hero-section {
    padding: 2.5rem 1rem 1.75rem 1rem;
  }

  .hero-title {
    font-size: 2.1rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-actions,
  [dir="rtl"] .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .btn {
    width: 100%;
  }


  .highlight-label {
    font-size: 0.875rem;
    white-space: normal;
  }
}

/* ==========================================================================
   7. The Challenge Section Styles (Day 5 Scope)
   ========================================================================== */

/* Multilingual Display Control */
:root:not([lang="fr"]):not([lang="ar"]) .lang-fr,
:root:not([lang="fr"]):not([lang="ar"]) .lang-ar {
  display: none !important;
}

[lang="en"] .lang-fr,
[lang="en"] .lang-ar {
  display: none !important;
}

[lang="fr"] .lang-en,
[lang="fr"] .lang-ar {
  display: none !important;
}

[lang="ar"] .lang-en,
[lang="ar"] .lang-fr {
  display: none !important;
}

/* Global Language Selector (Minimal Unobtrusive Floating Pill) */
.global-lang-control {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  z-index: 1000;
}

.global-lang-control .lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(27, 67, 50, 0.15);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.7rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.global-lang-control .lang-btn {
  background: none;
  border: none;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
  font-family: inherit;
  line-height: 1.2;
}

.global-lang-control .lang-btn:hover {
  color: var(--color-primary);
}

.global-lang-control .lang-btn.active {
  color: var(--color-primary);
  font-weight: 800;
  background-color: rgba(236, 253, 245, 0.95);
}

.global-lang-control .lang-sep {
  color: #d1d5db;
  font-size: 0.75rem;
  user-select: none;
}

/* RTL Placement for Global Language Selector */
[dir="rtl"] .global-lang-control {
  right: auto;
  left: 2rem;
}

@media (max-width: 600px) {
  .global-lang-control {
    top: 1rem;
    right: 1rem;
  }

  [dir="rtl"] .global-lang-control {
    right: auto;
    left: 1rem;
  }
}

/* Section Container */
.challenge-section {
  position: relative;
  width: 100%;
  background-color: #fbfdfc;
  border-top: 1px solid rgba(27, 67, 50, 0.08);
  padding: 5.5rem 32px;
}

.challenge-container {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

/* Section Header */
.challenge-header {
  max-width: 840px;
  margin-bottom: 3.5rem;
}

.challenge-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background-color: var(--color-badge-bg);
  border: 1px solid var(--color-badge-border);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-badge-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.badge-dot {
  width: 0.45rem;
  height: 0.45rem;
  background-color: var(--color-accent);
  border-radius: 50%;
  display: inline-block;
}

/* Typography */
.challenge-title {
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-primary);
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}

.challenge-description {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text-body);
}

/* Three Visual Cards Grid (Desktop: 3 in one row) */
.challenge-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.challenge-card {
  background-color: #ffffff;
  border: 1px solid rgba(27, 67, 50, 0.1);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.challenge-card:hover {
  transform: translateY(-6px);
  border-color: #a7f3d0;
  box-shadow: 0 16px 32px -4px rgba(27, 67, 50, 0.12);
}

/* Photographic / Illustrative Visual Component (approx 55–65% of card) */
.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: #f1f5f9;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.challenge-card:hover .card-image {
  transform: scale(1.04);
}

.card-body {
  padding: 1.75rem 1.6rem 2rem 1.6rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.35;
  margin-bottom: 0.75rem;
  letter-spacing: -0.015em;
}

.card-description {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

/* Arabic RTL Layout */
[dir="rtl"] .challenge-header {
  text-align: right;
  margin-left: auto;
  margin-right: 0;
}

[dir="rtl"] .challenge-card {
  text-align: right;
}

[dir="rtl"] .challenge-badge {
  margin-left: auto;
  margin-right: 0;
}

/* Responsive Adaptability */
@media (max-width: 992px) {
  .challenge-cards {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .challenge-section {
    padding: 4rem 1.5rem;
  }

  .challenge-header {
    margin-bottom: 2.5rem;
  }
}

@media (max-width: 600px) {
  .challenge-section {
    padding: 3rem 1rem;
  }

  .challenge-title {
    font-size: 1.85rem;
  }

  .challenge-description {
    font-size: 1rem;
  }

  .challenge-card {
    padding: 1.75rem 1.25rem;
  }
}

/* ==========================================================================
   8. Why Agrivie? Section Styles (Editorial / Product Showcase)
   ========================================================================== */

.why-agrivie-section {
  position: relative;
  width: 100%;
  background-color: #ffffff;
  border-top: 1px solid rgba(27, 67, 50, 0.08);
  padding: 5.5rem 32px;
}

.why-agrivie-container {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

.why-agrivie-header {
  max-width: 860px;
  margin-bottom: 3.5rem;
}

.why-agrivie-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background-color: var(--color-badge-bg);
  border: 1px solid var(--color-badge-border);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-badge-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.why-agrivie-title {
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-primary);
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}

.why-agrivie-description {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text-body);
}

/* Editorial Showcase: Asymmetric Two-Column Composition */
.why-showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 3.5rem;
  align-items: start;
}

/* Prominent Landscape Showcase Visual */
.why-showcase-visual {
  position: relative;
}

.showcase-frame {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(27, 67, 50, 0.12);
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.09);
  background-color: #f1f5f9;
}

.showcase-img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.showcase-frame:hover .showcase-img {
  transform: scale(1.025);
}

.showcase-overlay-tag {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(27, 67, 50, 0.15);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.showcase-caption {
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-top: 0.9rem;
  padding: 0 0.25rem;
  font-style: italic;
}

/* Numbered Editorial Rows (01, 02, 03) */
.why-editorial-rows {
  display: flex;
  flex-direction: column;
}

.editorial-row {
  border-top: 1px solid rgba(27, 67, 50, 0.12);
  padding: 1.75rem 0.5rem;
  transition: background-color 0.25s ease;
  border-radius: 6px;
}

.editorial-row:last-child {
  border-bottom: 1px solid rgba(27, 67, 50, 0.12);
}

.editorial-row:hover {
  background-color: rgba(236, 253, 245, 0.45);
}

.editorial-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.editorial-num {
  font-family: inherit;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
  line-height: 1;
}

.editorial-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  background-color: rgba(45, 106, 79, 0.08);
  border: 1px solid rgba(45, 106, 79, 0.16);
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
}

.editorial-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.35;
  margin-bottom: 0.6rem;
  letter-spacing: -0.015em;
}

.editorial-desc {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text-body);
  margin: 0;
}

/* RTL Layout Support */
[dir="rtl"] .why-agrivie-header {
  text-align: right;
  margin-left: auto;
  margin-right: 0;
}

[dir="rtl"] .why-agrivie-badge {
  margin-left: auto;
  margin-right: 0;
}

[dir="rtl"] .showcase-overlay-tag {
  left: auto;
  right: 1.25rem;
}

[dir="rtl"] .showcase-caption {
  text-align: right;
}

[dir="rtl"] .editorial-row {
  text-align: right;
}

[dir="rtl"] .editorial-row-content {
  text-align: right;
}

/* Responsive Adaptability */
@media (max-width: 992px) {
  .why-showcase-grid {
    grid-template-columns: 1fr;
    gap: 2.75rem;
  }

  .why-agrivie-section {
    padding: 4rem 1.5rem;
  }

  .why-agrivie-header {
    margin-bottom: 2.5rem;
  }
}

@media (max-width: 600px) {
  .why-agrivie-section {
    padding: 3rem 1rem;
  }

  .why-agrivie-title {
    font-size: 1.85rem;
  }

  .why-agrivie-description {
    font-size: 1rem;
  }

  .editorial-row {
    padding: 1.5rem 0.25rem;
  }

  .editorial-num {
    font-size: 1.35rem;
  }

  .editorial-title {
    font-size: 1.15rem;
  }
}

