/* =====================================================================
   Social: follow cards, live Facebook feed, Instagram / Facebook embeds
   ===================================================================== */
.section-social {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(197,41,38,.18), transparent 55%),
    var(--surface);
  border-top: 3px solid var(--red);
}

/* Follow cards */
.follow-cards { display: grid; gap: 16px; margin-top: 2rem; }
@media (min-width: 700px) { .follow-cards { grid-template-columns: 1fr 1fr; } }
.follow-card {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  padding: 22px 24px; text-decoration: none; color: #fff;
  background: var(--bg); border: 1px solid var(--border);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.follow-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  transition: opacity .25s var(--ease);
}
.follow-ig::before { background: linear-gradient(115deg, #c52926 0%, #8a1c4a 55%, #5b2a86 100%); }
.follow-fb::before { background: linear-gradient(115deg, #c52926 0%, #6b1414 60%, #1c2f6b 100%); }
.follow-card:hover, .follow-card:focus-visible { border-color: var(--red); transform: translateY(-3px); }
.follow-card:hover::before, .follow-card:focus-visible::before { opacity: 1; }
.follow-icon {
  display: grid; place-items: center; width: 60px; height: 60px; color: #fff;
  background: var(--red); clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}
.follow-card:hover .follow-icon { background: rgba(0,0,0,.35); }
.follow-text { display: flex; flex-direction: column; min-width: 0; }
.follow-platform { font: italic 900 1.7rem/1 var(--font-display); text-transform: uppercase; }
.follow-handle { color: #d4d4d4; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-cta {
  font: italic 800 1rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .08em;
  padding: 12px 18px; border: 2px solid currentColor;
}
@media (max-width: 459px) {
  .follow-card { grid-template-columns: auto 1fr; padding: 18px; }
  .follow-cta { display: none; }
  .follow-icon { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) { .follow-card:hover { transform: none; } }

/* Feed + posts */
.social-grid { display: grid; gap: 24px; margin-top: 2.5rem; }
@media (min-width: 960px) { .social-grid.has-feed { grid-template-columns: minmax(320px, 500px) 1fr; align-items: start; } }
.social-feed { max-width: 500px; width: 100%; justify-self: center; }
@media (min-width: 960px) { .social-grid.has-feed .social-feed { position: sticky; top: 92px; } }

.embed {
  position: relative; width: 100%; background: #fff; overflow: hidden;
  border-bottom: 4px solid var(--red);
}
.embed-fb-page { height: 720px; }
.embed-fb { aspect-ratio: 9 / 12; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 24px; text-align: center;
  background: var(--ph); color: var(--fg); text-decoration: none; font-weight: 600;
}
.embed.is-loaded .embed-fallback { display: none; }

.social-posts {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.social-post { min-width: 0; }
.social-post .instagram-media {
  margin: 0 !important; min-width: 0 !important; width: 100% !important; max-width: 100% !important;
  background: #fff; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  min-height: 420px; position: relative; border-bottom: 4px solid var(--red) !important;
}
.social-post .instagram-media .embed-fallback { min-height: 420px; }
.social-post iframe.instagram-media-rendered { border-bottom: 4px solid var(--red) !important; }
.social-caption { margin: 10px 0 0; color: var(--muted); font-size: .95rem; }

/* Icons */
.icon { display: block; flex: none; }

/* Header social icons (desktop nav) */
.nav-social { list-style: none; margin: 0 0 0 10px; padding: 0 0 0 10px; display: flex; gap: 2px; border-left: 1px solid var(--border); }
.nav-social a { display: grid; place-items: center; width: 40px; height: 40px; padding: 0 !important; color: var(--muted); }
.nav-social a:hover { color: var(--red-hot); }
[dir="rtl"] .nav-social { margin: 0 10px 0 0; padding: 0 10px 0 0; border-left: 0; border-right: 1px solid var(--border); }
@media (max-width: 1023px) {
  .nav-social { margin: 16px 0 0; padding: 0; border: 0; justify-content: center; gap: 12px; }
  [dir="rtl"] .nav-social { margin: 16px 0 0; padding: 0; border: 0; }
  .nav-social a { width: 48px; height: 48px; border: 1px solid var(--border) !important; }
}

/* Footer / contact icon links */
.social a { gap: 8px; }
.social-lg { gap: 10px 24px; }
.social-lg a { color: var(--fg); font-size: 1.05rem; }

/* Showcase layout: intro + follow cards beside the featured Instagram post */
.social-hero { display: grid; gap: 32px; align-items: start; }
.social-hero .follow-cards { grid-template-columns: 1fr; margin-top: 1.5rem; }
@media (min-width: 700px) and (max-width: 959px) { .social-hero .follow-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) {
  .social-hero.has-featured { grid-template-columns: 1fr minmax(340px, 480px); gap: 56px; }
  .social-hero:not(.has-featured) .follow-cards { grid-template-columns: repeat(3, 1fr); }
}
.social-featured { margin: 0; width: 100%; max-width: 480px; justify-self: center; position: relative; isolation: isolate; }
.social-featured::before {
  content: ""; position: absolute; inset: 16px -16px -16px 16px; background: var(--red); z-index: -1;
  clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
}
[dir="rtl"] .social-featured::before { inset: 16px 16px -16px -16px; }
.social-featured .instagram-media { min-height: 560px; }
.follow-tt::before { background: linear-gradient(115deg, #c52926 0%, #111 55%, #0f6f73 100%); }
.social-posts { margin-top: 2.5rem; }
.section-social .social-feed { margin: 2.5rem auto 0; }


/* ---------- Phones & small screens: embeds always fit ----------
   Instagram's embed forces min-width: 326px inline, which made 320–359px
   phones scroll sideways. Override it for every embed in the section. */
.section-social .instagram-media,
.section-social iframe.instagram-media-rendered {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}
.section-social .social-featured,
.section-social .social-post { min-width: 0; overflow: hidden; }
.section-social .social-featured { overflow: visible; }

@media (max-width: 699px) {
  /* Clean full-width card instead of the offset red frame (it got clipped at the screen edge) */
  .social-featured { max-width: none; }
  .social-featured::before { display: none; }
  .social-featured .instagram-media,
  .social-featured iframe.instagram-media-rendered { border-bottom: 4px solid var(--red) !important; }
  .social-featured .instagram-media { min-height: 460px; }
  .social-hero { gap: 24px; }
  .social-posts { grid-template-columns: 1fr; gap: 16px; }
  .embed-fb-page { height: 600px; }
  .follow-card { gap: 14px; }
  .follow-platform { font-size: 1.45rem; }
}

/* Handles like @hemchracing are always left-to-right, even on Arabic pages */
.follow-ig .follow-handle, .follow-tt .follow-handle { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .follow-ig .follow-handle, [dir="rtl"] .follow-tt .follow-handle { text-align: right; }
