/* Arabic/RTL version of News page styles */

/* === Animations for News Section === */
.fade-in-left {
  opacity: 0;
  transform: translateX(60px);
  /* RTL flip from -60px */
  transition:
    opacity 0.7s cubic-bezier(0.77, 0, 0.18, 1),
    transform 0.7s cubic-bezier(0.77, 0, 0.18, 1);
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-bottom {
  opacity: 0;
  transform: translateY(60px);
  transition:
    opacity 0.7s cubic-bezier(0.77, 0, 0.18, 1),
    transform 0.7s cubic-bezier(0.77, 0, 0.18, 1);
}

.fade-in-bottom.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(-60px);
  /* RTL flip from 60px */
  transition:
    opacity 0.7s cubic-bezier(0.77, 0, 0.18, 1),
    transform 0.7s cubic-bezier(0.77, 0, 0.18, 1);
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Optional: Add a small gap between cards when animating */
.news-card {
  margin-bottom: 18px;
}

/* Move ideas dots lower */
.ideas-dots-lower {
  margin-top: 60px !important;
  gap: 2rem !important;
}

/* Social label under icon */
.social-label {
  font-size: 0.85rem;
  color: #222;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.hero-bs {
  height: 100vh;
  min-height: 320px;
}

.hero-bs__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transform: scale(1.05);
  animation: heroZoom 12s ease-out forwards;
}

.hero-bs__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top,
      rgba(0, 140, 27, 0.85) 0%,
      rgba(0, 140, 27, 0.65) 40%,
      rgba(137, 91, 0, 0.55) 80%);
}

.hero-bs__title {
  color: #ffb41e;
}

.hero-bs__title,
.hero-bs__text {
  opacity: 0;
  transform: translateY(18px);
  animation: fadeUp 0.9s ease-out forwards;
}

.hero-bs__text {
  animation-delay: 0.12s;
  color: #ffffff;
  font-weight: 400;
}

@keyframes heroZoom {
  to {
    transform: scale(1);
  }
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* SECTION BG */
.ideas-section {
  background: #eaf4e1;
}

/* Header text */
.ideas-title {
  line-height: 1.25;
}

.ideas-desc {
  font-size: 16px;
  line-height: 1.8;
  max-width: 720px;
}
/*من هاد السطر خد الكود*/
/* Ensure row items don't stretch to the same height */
.ideas-section .row {
  align-items: flex-start;
}

/* =========================
   IDEAS / CARDS
========================= */

/* Standardized Card */
.idea-card {
  height: auto;
  /* Changed from 100% to allow individual height growth */
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.5s ease;
  /* Added height transition */
}

/* Hover State */
.idea-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
}

/* Media Container */
.idea-media {
  position: relative;
  padding: 18px 18px 0;
  overflow: hidden;
}

/* Rounded Corner Overlay Logic (The "Cut") - RTL Flipped */
.idea-media::before,
.idea-media::after {
  content: "";
  position: absolute;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* Corner Background - RTL (Right corner) */
.idea-media::before {
  top: 18px;
  right: 18px;
  /* RTL flip from left */
  width: 76px;
  height: 76px;
  background: #fff;
  border-radius: 0 0 0 30px;
  /* RTL flip */
}

/* Inner Curve for the Button - RTL (Right corner) */
.idea-media::after {
  top: 28px;
  right: 28px;
  /* RTL flip from left */
  width: 58px;
  height: 58px;
  background: #fff;
  border-radius: 50%;
}

.idea-card:hover .idea-media::before,
.idea-card:hover .idea-media::after {
  opacity: 1;
}

/* Image Scaling */
.idea-media img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 18px;
  display: block;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.idea-card:hover .idea-media img {
  transform: scale(1);
}

/* Badge Transition - RTL */
.idea-badge {
  position: absolute;
  left: 17px;
  /* RTL flip from right */
  bottom: 0;
  background: #0b8f2a;
  color: #fff;
  font-size: 13px;
  padding: 8px 12px;
  border-bottom-left-radius: 20px;
  /* RTL flip */
  border-top-right-radius: 18px;
  /* RTL flip */
  white-space: nowrap;
  z-index: 5;
  transition: transform 0.5s ease;
}

.idea-card:hover .idea-badge {
  transform: translate(-5px, -5px);
  /* Subtle shift for better depth - RTL */
}

/* Float Button Transition - RTL */
.idea-float-btn {
  position: absolute;
  top: 36px;
  right: 36px;
  /* RTL flip from left */
  z-index: 10;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  text-decoration: none;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.5s ease;
}

.idea-card:hover .idea-float-btn {
  background: #0b8f2a;
}

.idea-float-btn img.arrow-icon {
  width: 18px;
  height: 18px;
  transition: filter 0.5s ease;
  filter: invert(33%) sepia(86%) saturate(1200%) hue-rotate(95deg) brightness(90%) contrast(95%);
}

.idea-card:hover .idea-float-btn img.arrow-icon {
  filter: brightness(0) invert(1);
}

/* Text Detail Reveal - Strictly Hidden by Default - RTL */
.idea-text,
.idea-meta {
  max-height: 0 !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: right;
  /* RTL alignment */
}

/* Explicit Reveal on Hover */
.idea-card:hover .idea-text {
  max-height: 200px !important;
  opacity: 1 !important;
  margin-top: 10px !important;
  margin-bottom: 1rem !important;
}

.idea-card:hover .idea-meta {
  max-height: 50px !important;
  opacity: 1 !important;
  margin-top: 15px !important;
}
/*لعند هنا استبدل الحالي بالقديم*/
/* Dots */
.ideas-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94c79a;
  opacity: 0.6;
}

.ideas-dots .dot.active {
  width: 12px;
  height: 12px;
  background: #0b8f2a;
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(11, 143, 42, 0.18);
}

:root {
  --ideas-bg: #ffffff;
}

.idea-card--cut .idea-media {
  position: relative;
}

.idea-card--cut .idea-media::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  /* RTL flip from left: 18px */
  width: 76px;
  height: 76px;
  background: var(--ideas-bg);
  border-radius: 0 0 0 30px;
  /* RTL flip */
  z-index: 2;
}

.idea-card--cut .idea-media::after {
  content: "";
  position: absolute;
  top: 28px;
  right: 28px;
  /* RTL flip from left: 28px */
  width: 58px;
  height: 58px;
  background: var(--ideas-bg);
  border-radius: 50%;
  z-index: 3;
}

.idea-card--cut .idea-float-btn {
  z-index: 5;
}

.news-wrap {
  background: #ffffff;
}

.news-box {
  background: #0b8f2a;
  border-radius: 18px;
  padding: 42px 24px;
  min-height: 220px;
  isolation: isolate;
  margin-bottom: -110px;
  direction: rtl;
  /* Explicitly set RTL for news-box container */
}

.news-box.news-animate {
  opacity: 0;
  transform: translateY(100px);
  /* Start further down */
  transition:
    transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, opacity;
}

.news-box.news-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.news-box.news-animate .news-anim {
  opacity: 0;
  transform: translateY(40px);
  /* Elements start lower */
  transition:
    transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition-delay: var(--delay, 0ms);
  will-change: transform, opacity;
}

.news-box.news-animate.is-visible .news-anim {
  opacity: 1;
  transform: translateY(0);
}

.news-title {
  font-weight: 800;
  font-size: clamp(20px, 2.2vw, 28px);
}

.word-highlight {
  position: relative;
  display: inline-block;
  padding-bottom: 14px;
  line-height: 1;
}

.title-curves {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: block;
  width: 100%;
  height: 14px;
  pointer-events: none;
}

.first-curve {
  bottom: -5px;
  width: 110px;
}

.second-curve {
  bottom: -10px;
  width: 90px;
}

.news-sub {
  color: rgba(255, 255, 255, 0.85);
  max-width: 680px;
  margin-inline: auto;
  line-height: 1.8;
}

.news-form {
  max-width: 650px;
}

.news-input {
  height: 44px;
  border-radius: 5px;
  border: 0;
  padding-inline: 14px;
  text-align: right;
  /* Applied from existing news-ar.css override */
}

.email-input {
  height: 40px;
  padding-right: 20px;
  padding-left: 20px;
  border-radius: 6px;
  font-size: 14px;
  border: 1px solid #e3e7ea;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.nl-decor {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  opacity: 1;
  width: clamp(70px, 8vw, 100px);
  height: auto;
}

/* RTL flipped sides for decorations */

/* Left side (mirrored English Right) */
.nl-left-top {
  width: clamp(40px, 8vw, 50px);
  top: 18px;
  left: -10px;
  /* English right was -10px */
}

.nl-left-mid {
  top: 100px;
  left: -20px;
  /* English right was -20px */
  transform: translateY(-50%);
}

.nl-left-bot-mid {
  width: clamp(40px, 8vw, 50px);
  top: 140px;
  left: -10px;
  /* English right was -10px */
}

.nl-left-bot {
  top: 220px;
  left: -20px;
  /* English right was -20px */
  transform: translateY(-50%);
}

/* Right side (mirrored English Left) */
.nl-right-top {
  top: 18px;
  right: -10px;
  /* English left was -10px */
  width: clamp(40px, 8vw, 50px);
}

.nl-right-mid {
  top: 100px;
  right: -20px;
  /* English left was -20px */
  transform: translateY(-50%);
}

.nl-right-bot-mid {
  top: 140px;
  right: -10px;
  /* English left was -10px */
  width: clamp(40px, 8vw, 50px);
}

.nl-right-bot {
  top: 220px;
  right: -20px;
  /* English left was -20px */
  transform: translateY(-50%);
}

.newsletter-box>*:not(img) {
  position: relative;
  z-index: 1;
}

.box-btn {
  position: relative;
  overflow: hidden;
  background: #e7b900;
  font-size: 14px;
  border: none;
  color: #fff;
  border-radius: 12px;
  transition:
    background-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

.box-btn::before {
  content: "";
  position: absolute;
  top: 0;
  right: -100%;
  /* RTL flip from left: -100% */
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg,
      transparent 0%,
      rgba(255, 255, 255, 0.35) 50%,
      transparent 100%);
  transition: right 0.2s ease;
  /* RTL flip */
}

.box-btn:hover {
  background: #d4a800;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
  color: #fff;
}

.box-btn:hover::before {
  right: 120%;
  /* RTL flip from left: 120% */
}

/* موبايل: صغّر/خبّي الديكور لتجنب الزحمة */
@media (max-width: 575.98px) {
  .nl-decor {
    width: 68px;
    opacity: 0.95;
  }

  .nl-right-mid,
  .nl-left-mid {
    display: none;
  }
}

.news-box .row {
  direction: rtl;
  /* Ensure flex elements row respect RTL order */
}

.news-box .d-flex {
  flex-direction: row;
  /* Default flex-direction in RTL context is what we want for English reverse */
}

/* Newsbox fade text: يظهر من العدم */
.newsbox-fade-text {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.77, 0, 0.18, 1);
}

.newsbox-fade-text.visible {
  opacity: 1;
}

/* Newsbox fade bottom: يظهر من الأسفل */
.newsbox-fade-bottom {
  opacity: 0;
  transform: translateY(60px);
  transition:
    opacity 0.8s cubic-bezier(0.77, 0, 0.18, 1),
    transform 0.8s cubic-bezier(0.77, 0, 0.18, 1);
}

.newsbox-fade-bottom.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .news-form .row.g-2>div {
    width: auto;
    max-width: none;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
  }

  .news-form .box-btn {
    font-size: 0.89rem;
    padding: 0.5rem 1.1rem;
    white-space: nowrap;
    min-width: 120px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .news-form .search-box {
    margin-top: 0;
    width: 250px;
  }
}

@media (max-width: 767.98px) {

  /* إخفاء الفوانيس */
  .news-box .nl-decor {
    display: none !important;
  }

  .news-form .row.g-2 {
    flex-direction: column;
    align-items: center;
  }

  .news-form .row.g-2>div {
    width: 100%;
    max-width: 350px;
    flex: unset;
    display: block;
    margin-bottom: 0.3rem;
  }

  .news-form .search-box {
    margin-top: 0.5rem;
    margin-bottom: 0.2rem;
  }

  .news-form .box-btn {
    width: 100%;
    min-width: 0;
    font-size: 0.97rem;
    padding: 0.5rem 0.5rem;
    height: 40px;
    display: block;
    margin: 0 auto;
  }

  .news-form .email-input {
    height: 40px;
    font-size: 1.08rem;
    padding-right: 22px;
    padding-left: 22px;
  }

  .news-form .search-box,
  .news-form .email-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

@media (min-width: 992px) {
  .news-form .row.g-2 {
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }

  .news-form .row.g-2>div {
    width: auto;
    max-width: none;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
  }

  .news-form .search-box {
    margin-top: 0;
    margin-bottom: 0;
    width: 320px;
  }

  .news-form .box-btn {
    width: auto;
    min-width: 120px;
    font-size: 1rem;
    padding: 0.6rem 1.5rem;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.5rem 0 0;
    /* RTL adjusted from 0 0 0 0.5rem */
  }
}
