/* ==========================================================
   بلدية رفح — الصفحة الرئيسية (تصميم v2)
   كل القواعد محصورة داخل .rm-home حتى لا تتأثر باقي الصفحات
   ========================================================== */
.rm-home {
    --rm-green-900: #04351f;
    --rm-green-800: #054a2c;
    --rm-green-700: #06623b;
    --rm-green-600: #0a7a4b;
    --rm-green-50: #eef6f1;
    --rm-gold: #c9a227;
    --rm-gold-soft: #f6efd7;
    --rm-ink: #12241b;
    --rm-text: #44524b;
    --rm-muted: #6f7d76;
    --rm-line: #e3e9e5;
    --rm-bg: #f5f7f6;
    --rm-card: #ffffff;
    --rm-radius: 18px;
    --rm-shadow: 0 1px 2px rgba(16, 40, 28, .05), 0 10px 30px -12px rgba(16, 40, 28, .18);
    --rm-shadow-lg: 0 2px 4px rgba(16, 40, 28, .06), 0 24px 48px -18px rgba(16, 40, 28, .28);
    display: block;
    direction: rtl;
    text-align: right;
    background: var(--rm-bg);
    color: var(--rm-text);
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    overflow-x: clip;
}
.rm-home *, .rm-home *::before, .rm-home *::after { box-sizing: border-box; }
.rm-home h1, .rm-home h2, .rm-home h3, .rm-home h4, .rm-home p { margin: 0; font-family: inherit; }
.rm-home h1, .rm-home h2, .rm-home h3, .rm-home h4 { color: var(--rm-ink); font-weight: 700; line-height: 1.45; letter-spacing: 0; }
.rm-home a { color: inherit; text-decoration: none; }
.rm-home img { max-width: 100%; display: block; }
.rm-home ul { list-style: none; margin: 0; padding: 0; }
.rm-home button { font-family: inherit; cursor: pointer; }
.rm-home a:focus-visible, .rm-home button:focus-visible { outline: 3px solid var(--rm-gold); outline-offset: 3px; border-radius: 8px; }

.rm-wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 20px; }
.rm-section { padding-block: 72px; }
.rm-section--white { background: #fff; }

/* ---------- عناوين الأقسام ---------- */
.rm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 32px; }
.rm-eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--rm-green-700); margin-bottom: 6px; }
.rm-eyebrow::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: var(--rm-gold); }
.rm-head h2 { font-size: clamp(24px, 2.6vw, 32px); }
.rm-more { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--rm-green-700) !important; padding: 9px 18px; border: 1.5px solid var(--rm-line); border-radius: 999px; background: #fff; transition: border-color .2s, background .2s, color .2s; white-space: nowrap; }
.rm-more i { font-size: 12px; transition: transform .2s; }
.rm-more:hover { border-color: var(--rm-green-700); background: var(--rm-green-700); color: #fff !important; }
.rm-more:hover i { transform: translateX(-4px); }

.rm-btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px; border-radius: 12px; border: 0; font-size: 15px; font-weight: 700; line-height: 1.4; transition: transform .2s, background .2s, box-shadow .2s; }
.rm-btn i { font-size: 12px; transition: transform .2s; }
.rm-btn:hover i { transform: translateX(-4px); }
.rm-btn--gold { background: var(--rm-gold); color: #1d1a08 !important; }
.rm-btn--gold:hover { background: #d8b23a; }
.rm-btn--green { background: var(--rm-green-700); color: #fff !important; box-shadow: 0 8px 20px -8px rgba(6, 98, 59, .6); }
.rm-btn--green:hover { background: var(--rm-green-800); }

/* ---------- الواجهة (Hero) ---------- */
.rm-hero { position: relative; padding: 36px 0 108px; background:
    radial-gradient(900px 420px at 85% -10%, rgba(201, 162, 39, .16), transparent 60%),
    linear-gradient(160deg, var(--rm-green-900) 0%, var(--rm-green-700) 100%); }
.rm-hero__grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; height: clamp(380px, 38vw, 500px); }
.rm-stage { position: relative; height: 100%; border-radius: 22px; overflow: hidden; background: var(--rm-green-900); box-shadow: var(--rm-shadow-lg); isolation: isolate; }
.rm-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility .7s; }
.rm-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.rm-slide__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 7s ease-out; }
.rm-slide.is-active .rm-slide__img { transform: scale(1); }
.rm-slide__ph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--rm-green-800), var(--rm-green-600)); }
.rm-slide__ph img { width: 130px; opacity: .35; }
.rm-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(3, 26, 15, .92) 0%, rgba(3, 26, 15, .55) 38%, rgba(3, 26, 15, 0) 68%); }
.rm-slide__body { position: absolute; inset-inline: 0; bottom: 0; z-index: 2; padding: 28px 32px 30px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.rm-slide__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: rgba(255, 255, 255, .85); }
.rm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; background: var(--rm-gold); color: #1d1a08; font-weight: 700; font-size: 12.5px; }
.rm-home .rm-slide__title { color: #fff; font-size: clamp(20px, 2.3vw, 30px); max-width: 26ch; text-wrap: balance; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rm-slide__title a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.rm-stage__nav { position: absolute; z-index: 3; top: 18px; inset-inline-end: 18px; display: flex; gap: 8px; }
.rm-stage__nav button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(3, 26, 15, .45); color: #fff; font-size: 14px; backdrop-filter: blur(6px); transition: background .2s, border-color .2s; }
.rm-stage__nav button:hover { background: var(--rm-gold); border-color: var(--rm-gold); color: #1d1a08; }
.rm-dots { position: absolute; z-index: 3; bottom: 18px; inset-inline-end: 24px; display: none; gap: 6px; }
.rm-dots button { width: 8px; height: 8px; padding: 0; border-radius: 99px; border: 0; background: rgba(255, 255, 255, .45); transition: width .3s, background .3s; }
.rm-dots button.is-active { width: 24px; background: var(--rm-gold); }

.rm-side { height: 100%; min-height: 0; display: flex; flex-direction: column; border-radius: 22px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); padding: 16px; }
.rm-side__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 6px 12px; }
.rm-home .rm-side__head h2 { color: #fff; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.rm-side__head h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rm-gold); box-shadow: 0 0 0 4px rgba(201, 162, 39, .25); }
.rm-side__head a { font-size: 13px; font-weight: 700; color: var(--rm-gold); }
.rm-side__head a:hover { text-decoration: underline; }
.rm-side__list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; padding-inline-end: 2px; }
.rm-side__item { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; padding: 8px; text-align: right; border-radius: 14px; border: 1px solid transparent; background: transparent; color: #fff; transition: background .2s, border-color .2s; }
.rm-side__item:hover { background: rgba(255, 255, 255, .08); }
.rm-side__item.is-active { background: rgba(255, 255, 255, .13); border-color: rgba(201, 162, 39, .7); }
.rm-side__thumb { width: 76px; height: 58px; border-radius: 10px; object-fit: cover; background: var(--rm-green-800); }
.rm-side__thumb--ph { display: grid; place-items: center; color: rgba(255, 255, 255, .5); font-size: 18px; }
.rm-side__t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.55; }
.rm-side__d { display: block; margin-top: 2px; font-size: 12px; color: rgba(255, 255, 255, .65); }

/* ---------- الخدمات السريعة ---------- */
.rm-services { position: relative; z-index: 2; margin-top: -68px; }
.rm-services__card { background: #fff; border-radius: 22px; box-shadow: var(--rm-shadow-lg); padding: 22px; }
.rm-services__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 6px 16px; }
.rm-home .rm-services__top h2 { font-size: 18px; }
.rm-services__top span { font-size: 13.5px; color: var(--rm-muted); }
.rm-services__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.rm-svc { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-height: 132px; padding: 18px 16px 16px; border-radius: 16px; background: var(--rm-bg); border: 1px solid var(--rm-line); transition: background .25s, border-color .25s, transform .25s, box-shadow .25s; }
.rm-svc__ic { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; background: #fff; border: 1px solid var(--rm-line); color: var(--rm-green-700); font-size: 19px; transition: background .25s, color .25s, border-color .25s; }
.rm-svc__t { font-size: 15px; font-weight: 700; color: var(--rm-ink); line-height: 1.5; transition: color .25s; }
.rm-svc__go { position: absolute; top: 18px; inset-inline-end: 16px; font-size: 12px; color: var(--rm-muted); opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .25s, color .25s; }
.rm-svc:hover { background: var(--rm-green-700); border-color: var(--rm-green-700); transform: translateY(-4px); box-shadow: 0 16px 28px -16px rgba(6, 98, 59, .7); }
.rm-svc:hover .rm-svc__t { color: #fff; }
.rm-svc:hover .rm-svc__ic { background: var(--rm-gold); border-color: var(--rm-gold); color: #1d1a08; }
.rm-svc:hover .rm-svc__go { opacity: 1; transform: none; color: #fff; }

/* ---------- الإعلانات ---------- */
.rm-ads__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.rm-ads__grid--single { grid-template-columns: minmax(0, 1fr); }
.rm-ad { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; padding: 22px; background: #fff; border: 1px solid var(--rm-line); border-radius: var(--rm-radius); border-inline-start: 4px solid var(--rm-gold); transition: box-shadow .25s, transform .25s; }
.rm-ad:hover { box-shadow: var(--rm-shadow); transform: translateY(-2px); }
.rm-ad__date { width: 74px; padding: 10px 6px; border-radius: 14px; background: var(--rm-green-50); color: var(--rm-green-700); text-align: center; line-height: 1.3; }
.rm-ad__date b { display: block; font-size: 26px; font-weight: 700; }
.rm-ad__date span { display: block; font-size: 12.5px; font-weight: 600; }
.rm-ad__tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: #8a6d0f; background: var(--rm-gold-soft); padding: 2px 10px; border-radius: 999px; margin-bottom: 8px; }
.rm-home .rm-ad__title { font-size: 18px; }
.rm-ad__title a:hover { color: var(--rm-green-700); }
.rm-ad__text { margin-top: 8px !important; font-size: 14.5px; color: var(--rm-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rm-ad__link { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14.5px; font-weight: 700; color: var(--rm-green-700) !important; }
.rm-ad__link i { font-size: 11px; transition: transform .2s; }
.rm-ad__link:hover i { transform: translateX(-4px); }
.rm-empty { padding: 36px 20px; text-align: center; color: var(--rm-muted); background: #fff; border: 1px dashed var(--rm-line); border-radius: var(--rm-radius); }

/* ---------- الأخبار ---------- */
.rm-news__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.rm-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--rm-line); border-radius: var(--rm-radius); overflow: hidden; transition: box-shadow .25s, transform .25s; }
.rm-card:hover { box-shadow: var(--rm-shadow); transform: translateY(-4px); }
.rm-card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, var(--rm-green-800), var(--rm-green-600)); display: grid; place-items: center; }
.rm-card__media img.rm-card__img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.rm-card:hover .rm-card__img { transform: scale(1.05); }
.rm-card__media img.rm-card__ph { width: 84px; opacity: .4; }
.rm-card__body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 18px 20px 20px; }
.rm-card__date { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--rm-muted); }
.rm-card__date i { color: var(--rm-gold); }
.rm-home .rm-card__title { font-size: 17px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rm-card__title a::after { content: ""; position: absolute; inset: 0; }
.rm-card { position: relative; }
.rm-card:hover .rm-card__title { color: var(--rm-green-700); }
.rm-card__more { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--rm-green-700); }
.rm-card__more i { font-size: 11px; transition: transform .2s; }
.rm-card:hover .rm-card__more i { transform: translateX(-4px); }

/* ---------- عن البلدية + الأرقام ---------- */
.rm-about__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.rm-about__media { position: relative; }
.rm-about__media::before { content: ""; position: absolute; inset: 22px -18px -18px 22px; border-radius: 24px; background: var(--rm-green-50); border: 1px solid #d7e8de; }
.rm-about__media img { position: relative; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 22px; box-shadow: var(--rm-shadow-lg); }
.rm-about__badge { position: absolute; bottom: 22px; inset-inline-start: -14px; display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-radius: 16px; background: var(--rm-green-700); color: #fff; box-shadow: var(--rm-shadow-lg); }
.rm-about__badge b { font-size: 28px; font-weight: 700; color: var(--rm-gold); line-height: 1; }
.rm-about__badge span { font-size: 13.5px; line-height: 1.5; }
.rm-about__text h2 { font-size: clamp(24px, 2.6vw, 32px); margin-bottom: 16px; }
.rm-about__text p { font-size: 16px; line-height: 2; color: var(--rm-text); max-width: 60ch; }
.rm-pillars { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 28px !important; }
.rm-pillars li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; background: var(--rm-green-50); color: var(--rm-green-800); font-size: 14.5px; font-weight: 700; }
.rm-pillars i { font-size: 12px; color: var(--rm-green-600); }

.rm-stats { background: linear-gradient(160deg, var(--rm-green-900), var(--rm-green-700)); padding-block: 44px; }
.rm-stats__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rm-stat { display: flex; align-items: center; gap: 16px; padding: 8px 24px; border-inline-start: 1px solid rgba(255, 255, 255, .14); }
.rm-stat:first-child { border-inline-start: 0; padding-inline-start: 0; }
.rm-stat__ic { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; background: rgba(255, 255, 255, .09); color: var(--rm-gold); font-size: 21px; }
.rm-stat__n { display: block; font-size: clamp(24px, 2.6vw, 34px); font-weight: 700; color: #fff; line-height: 1.2; font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
.rm-stat__l { display: block; font-size: 14.5px; color: rgba(255, 255, 255, .78); }

/* ---------- المشاريع ---------- */
.rm-projects__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.rm-progress { height: 6px; border-radius: 99px; background: var(--rm-green-50); overflow: hidden; }
.rm-progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--rm-gold), var(--rm-green-600)); }
.rm-progress__row { display: flex; justify-content: space-between; font-size: 13px; color: var(--rm-muted); font-weight: 600; }

/* ---------- الفيديو ---------- */
.rm-video__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.rm-video__frame { position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: #000; box-shadow: var(--rm-shadow-lg); }
.rm-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rm-video__text h2 { font-size: clamp(22px, 2.4vw, 30px); margin-bottom: 20px; }
.rm-feat { display: grid; gap: 12px; }
.rm-feat li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--rm-bg); border: 1px solid var(--rm-line); font-size: 16px; font-weight: 700; color: var(--rm-ink); }
.rm-feat i { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--rm-green-700); color: #fff; font-size: 16px; }

/* ---------- الشركاء ---------- */
.rm-partners { padding-block: 56px; }
.rm-partners__head { text-align: center; margin-bottom: 28px; }
.rm-partners__head .rm-eyebrow::after { content: ""; width: 28px; height: 3px; border-radius: 3px; background: var(--rm-gold); }
.rm-home .rm-partners__head h2 { font-size: clamp(22px, 2.4vw, 28px); }
.rm-partners__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.rm-partner { height: 108px; display: grid; place-items: center; padding: 18px; background: #fff; border: 1px solid var(--rm-line); border-radius: 16px; transition: box-shadow .25s, border-color .25s; }
.rm-partner img { max-height: 68px; width: auto; max-width: 100%; object-fit: contain; filter: grayscale(1); opacity: .75; transition: filter .25s, opacity .25s; }
.rm-partner:hover { box-shadow: var(--rm-shadow); border-color: #cfe0d6; }
.rm-partner:hover img { filter: none; opacity: 1; }

/* ---------- ظهور تدريجي ---------- */
.rm-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.rm-reveal.is-in { opacity: 1; transform: none; }

/* ---------- تجاوب ---------- */
@media (max-width: 1100px) {
    .rm-services__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rm-projects__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rm-about__grid { gap: 40px; }
}
@media (max-width: 900px) {
    .rm-section { padding-block: 52px; }
    .rm-hero { padding: 20px 0 92px; }
    .rm-hero__grid { grid-template-columns: minmax(0, 1fr); height: auto; }
    .rm-stage { height: clamp(320px, 62vw, 440px); }
    .rm-side { display: none; }
    .rm-dots { display: flex; }
    .rm-stage__nav { display: none; }
    .rm-slide__body { padding: 22px 20px 44px; }
    .rm-news__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .rm-ads__grid { grid-template-columns: minmax(0, 1fr); }
    .rm-about__grid, .rm-video__grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .rm-about__media { margin-inline: 14px; }
    .rm-stats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 0; }
    .rm-stat:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
    .rm-partners__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .rm-wrap { padding-inline: 16px; }
    .rm-services__card { padding: 16px; }
    .rm-services__top span { display: none; }
    .rm-services__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .rm-svc { min-height: 116px; padding: 14px 12px; gap: 10px; }
    .rm-svc__t { font-size: 14px; }
    .rm-news__grid { grid-template-columns: minmax(0, 1fr); }
    .rm-projects__grid { grid-template-columns: minmax(0, 1fr); }
    .rm-ad { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px; }
    .rm-ad__date { width: auto; display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 14px; justify-self: start; }
    .rm-ad__date b { font-size: 18px; }
    .rm-stat { padding-inline: 12px; gap: 12px; }
    .rm-stat__ic { width: 42px; height: 42px; font-size: 17px; border-radius: 12px; }
    .rm-partners__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rm-head { margin-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .rm-home *, .rm-home *::before, .rm-home *::after { transition: none !important; animation: none !important; }
    .rm-reveal { opacity: 1; transform: none; }
}
