/* ═══════════════ Services hub — four tall columns ═══════════════
   Loaded after style.css, by the two hub pages only (/services, /ar/services),
   so no other page downloads it. Bump its ?v= in both hubs on any change.

   Each service is ONE dark card: the photo on top melts into navy through a
   short gradient, with the title and text below — the sub-page hero look
   («أسلوب الدمج», owner, 27 Sep 2026). Each card is as tall as the old
   image-card + text-card pair was. On a phone the cards stack one per row. */

/* Header: the title, then the page's one-line intro in a solid orange bar under it —
   same colour and shape as the contact bar at the foot of the page (owner, 30 Sep 2026,
   «ج٢»). It replaced a full-width pale tag above the title that read like an alert. */
.hub-lead {
  background: var(--orange);
  color: var(--on-dark);
  border-radius: var(--radius);
  padding: 18px 28px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.7;
  text-wrap: balance;       /* even lines when it wraps; older browsers just wrap normally */
}
@media (max-width: 900px) { .hub-lead { padding: 16px 20px; font-size: 1rem; } }

.svc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 24px;
  row-gap: 48px;           /* only used once the grid wraps to 2 or 1 columns */
  margin-top: 40px;
}

.svc {
  display: flex;
  flex-direction: column;
  position: relative;       /* anchors the stretched link: the whole card, photo included */
  isolation: isolate;       /* own layer, so the photo's z-index:-1 stays above the card's navy */
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-dark);
  box-shadow: var(--shadow);
  transition: transform var(--trans), box-shadow var(--trans);
}
/* Hover effects only where there is a real pointer: on a phone a tap left the card "stuck" lifted */
@media (hover: hover) {
  .svc:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.14); }
  .svc:hover .svc-media img { transform: scale(1.04); }
  .svc:hover .svc-more { color: var(--orange2); }
}

/* ── Photo: square plus 28px, so it reaches down close to the title ── */
.svc-media {
  flex: none;
  position: relative;
  z-index: -1;              /* under the text block, so its gradient paints over the photo */
  aspect-ratio: 1 / 1;
  box-sizing: content-box;  /* the ratio sizes the square; the padding adds 28px under it */
  padding-bottom: 28px;
  background: var(--bg-card);
}
/* Old browsers without aspect-ratio (Safari < 15, e.g. iPhone 6 on iOS 12): the box would
   shrink to its 28px padding and hide the photo. The same square via the padding trick
   (padding % is measured on the width). Modern browsers never read this block. */
@supports not (aspect-ratio: 1 / 1) {
  .svc-media { height: 0; padding-top: 100%; }
}
.svc-media img {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;   /* longhand, not inset: old browsers too */
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}

/* ── Text: rises 90px over the photo; the gradient reaches solid navy exactly at the photo's last pixel ── */
/* Not positioned on purpose: the title link's overlay must reach past it to .svc */
.svc-body {
  flex: 1;
  margin-top: -90px;
  padding: 106px 22px 24px;
  background: linear-gradient(to bottom, rgba(13,27,42,0) 0, rgba(13,27,42,.2) 35px, rgba(13,27,42,.55) 60px, rgba(13,27,42,.85) 78px, var(--bg-dark) 90px);
  display: flex;
  flex-direction: column;
}

.svc-body h2 {
  font-size: 1.1rem;
  color: var(--orange);
  margin-bottom: 12px;
  line-height: 1.5;
  min-height: 3em; /* reserve two lines so the four card texts start level */
}
.svc-body p {
  color: var(--silver);
  font-size: .92rem;
  line-height: 1.75;
  margin-bottom: 20px;
}

/* The title IS the link, so each sub-page gets its keywords as anchor text
   (not four identical «اعرف المزيد»). Its overlay makes the whole column clickable. */
.svc-body h2 a { color: inherit; text-decoration: none; }
.svc-body h2 a::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;   /* longhand, not inset: old browsers too */
}

/* «اعرف المزيد ←» stays as a visual cue only (plain text, not a second link) */
.svc-more {
  margin-top: auto;         /* pins the cue to the card's bottom edge */
  color: var(--orange);
  font-weight: 700;
  font-size: .9rem;
}

[dir="rtl"] .svc-body h2 { font-size: 1.2rem; }

/* ── Strengths strip: four points under the cards ── */
.edge-strip {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 40px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 8px;
}
.edge-strip li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 18px;
}
.edge-strip li + li { border-inline-start: 1px solid var(--border-input); }
/* Point titles are bold text, not <h3>: with no <h2> over the strip, headings here
   read to Google as sub-sections of the last card (rental). Same look as the old h3. */
.edge-strip .edge-title {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.25;
  color: var(--heading);
  margin-bottom: 6px;
}
[dir="rtl"] .edge-strip .edge-title { font-family: 'Tajawal', 'Montserrat', sans-serif; }
.edge-strip p { font-size: .86rem; color: var(--muted); line-height: 1.7; }
.edge-strip svg { width: 46px; height: 46px; flex-shrink: 0; color: var(--orange); }

/* ── Responsive ── */
/* Cards go four-up only from 1200px: below that a title (AR civil to 1160px, EN to 1185px) wraps
   to three lines in a four-up row and its text drops ~26px below its neighbours (measured 28 Sep 2026) */
@media (max-width: 1199px) {
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .edge-strip { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .edge-strip li:nth-child(3) { border-inline-start: none; }
}
/* Cards go one-up below 615px, not 601: at 601–614px two English titles (telecom, civil) wrap to
   three lines in a two-up row and their text drops ~27px (measured 28 Sep 2026) */
@media (max-width: 614px) {
  .svc-grid { grid-template-columns: 1fr; row-gap: 36px; }
  .svc-body h2 { min-height: 0; }
  .svc-media { aspect-ratio: 4 / 3; }
  @supports not (aspect-ratio: 1 / 1) { .svc-media { padding-top: 75%; } }
}
@media (max-width: 600px) {
  .edge-strip { grid-template-columns: 1fr; padding: 6px 4px; row-gap: 0; }
  .edge-strip li { padding: 16px 18px; }
  .edge-strip li + li { border-inline-start: none; border-top: 1px solid var(--border-input); }
}

/* ── Contact bar — a COPY of the block in service-page.css, so the hub no longer
      loads that whole 19 KB file for this one component. ⚠️ Any change to the bar
      is made in BOTH files. ── */
.cta-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
  background: var(--orange);
  border-radius: var(--radius);
  padding: 22px 28px;
  color: var(--on-dark);
}
.cta-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cta-icon svg { width: 36px; height: 36px; }
.cta-bar p {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
}
.cta-btn {
  flex-shrink: 0;
  background: var(--on-dark);
  color: var(--orange);
  font-weight: 700;
  font-size: .95rem;
  padding: 12px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform var(--trans), box-shadow var(--trans);
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.18); }
@media (max-width: 900px) {
  .cta-bar { flex-direction: column; text-align: center; gap: 14px; padding: 24px 20px; }
}

/* ── English twin (LTR): cards, strengths and contact bar keep their Arabic positions —
      only the text changes (owner rule, 28 Sep 2026; same lock as service-page.css) ── */
html[dir="ltr"] :is(.svc-grid, .edge-strip, .cta-bar) { direction: rtl; }
html[dir="ltr"] :is(.svc, .edge-strip li > div, .cta-bar p, .cta-btn) { direction: ltr; }

/* ── Hub page only: tighter gap between the orange contact bar and the footer ── */
#services { padding-bottom: 48px; }
@media (max-width: 768px) { #services { padding-bottom: 40px; } }

/* ── Dark mode: the card lifts to the dark card tone so it doesn't vanish into the navy page ── */
@media (prefers-color-scheme: dark) {
  .svc { background: var(--bg-card); box-shadow: 0 0 0 1px rgba(255,255,255,.07); }
  @media (hover: hover) { .svc:hover { box-shadow: 0 0 0 1px rgba(255,255,255,.16); } }
  .svc-body { background: linear-gradient(to bottom, rgba(26,46,68,0) 0, rgba(26,46,68,.2) 35px, rgba(26,46,68,.55) 60px, rgba(26,46,68,.85) 78px, var(--bg-card) 90px); }
  .svc-media img { filter: brightness(.9); }
}
