/* ============================================================
   Cinematic homepage — 5 sections
   ============================================================ */

:root {
  --go-dark: #1b2614;
  --go-dark-2: #24331c;
  --go-dark-3: #10180b;
  --go-gold: #c9a227;
  --go-gold-l: #e6c76a;
  --go-bg: #f4f6f1;
  --go-bg-2: #e9ede6;
  --go-border: #dfe4da;
  --go-text: #2c362a;
  --cin-gap: 24px;
  --font-serif: "Amiri", "Tajawal", serif;
}

/* ============================================================
   Shared headers
   ============================================================ */
.cin-sec-head { text-align: center; margin: 0 auto 44px; max-width: 780px; }
.cin-sec-label {
  display: inline-block; font-family: var(--font-body, "Tajawal", sans-serif);
  font-size: 13px; font-weight: 600;
  color: var(--go-gold); margin-bottom: 10px;
}
.cin-sec-title {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(25px, 3vw, 36px); color: var(--go-dark-2);
  margin: 0; position: relative; padding-bottom: 16px;
}
.cin-sec-title::after {
  content: ""; position: absolute; bottom: 0; right: 50%; transform: translateX(50%);
  width: 74px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--go-gold), transparent);
}
.cin-sec-head-light .cin-sec-title { color: var(--go-gold-l); }
.cin-sec-head-light .cin-sec-title::after { background: linear-gradient(90deg, transparent, #e6c76a, transparent); }

/* ============================================================
   Section safety: no overlap, natural flow
   ============================================================ */
.cin-hero, .cin-commander, .cin-stories, .cin-news, .cin-features, .cin-events {
  position: relative;
  width: 100%;
  clear: both;
  overflow: hidden;
}

/* ============================================================
   Section 1 — Commander
   ============================================================ */
.cin-commander {
  background-color: var(--go-bg);
  background-image:
    radial-gradient(rgba(27, 38, 20, .07) 1px, transparent 1px),
    radial-gradient(rgba(201, 162, 39, .05) 1.4px, transparent 1.4px),
    radial-gradient(1200px 600px at 85% -10%, rgba(201, 162, 39, .08), transparent 60%);
  background-size: 26px 26px, 42px 42px, 100% 100%;
  padding: 90px 0 96px;
}
.cin-commander-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center;
}
.cin-cmd-media { display: flex; justify-content: center; }
.cin-cmd-photo {
  position: relative; width: min(400px, 100%);
  border-radius: 64px 64px 22px 22px; overflow: hidden;
  box-shadow: 0 34px 70px rgba(20, 32, 16, .28), 0 6px 18px rgba(20, 32, 16, .12);
  background: var(--go-dark);
}
.cin-cmd-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(16, 24, 11, .35));
  pointer-events: none;
}
.cin-cmd-photo img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.cin-cmd-body { text-align: center; }
.cin-stars { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.cin-stars span { color: var(--go-gold); font-size: 17px; text-shadow: 0 1px 3px rgba(0,0,0,.15); }
.cin-cmd-overline {
  display: inline-block; font-family: var(--font-body, "Tajawal", sans-serif);
  font-size: 13px; font-weight: 700;
  color: var(--go-dark); opacity: .75; margin-bottom: 12px;
}
.cin-cmd-name {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(34px, 5vw, 58px); line-height: 1.25;
  color: var(--go-dark-2); margin: 0 0 8px;
}
.cin-cmd-rank { font-size: 17px; font-weight: 700; color: var(--go-gold); margin: 0 0 18px; }
.cin-cmd-text { color: #55604f; font-size: 16px; max-width: 520px; margin: 0 auto 28px; line-height: 1.9; }

.cin-btn-dark {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--go-dark); color: #fff;
  padding: 14px 30px; border-radius: 8px;
  font-family: var(--font-head, "Cairo", sans-serif); font-weight: 700; font-size: 15px;
  transition: background .3s, transform .3s, box-shadow .3s;
}
.cin-btn-dark:hover { background: var(--go-gold); color: #241a00; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(27, 38, 20, .28); }
.cin-btn-arrow { display: inline-block; transition: transform .3s; }
.cin-btn-dark:hover .cin-btn-arrow { transform: translateX(-5px); }
.cin-btn-ghost:hover .cin-btn-arrow { transform: translateX(-5px); }
.cin-btn-black:hover .cin-btn-arrow { transform: translateX(-5px); }

/* ============================================================
   Section 2 — Photo stories
   ============================================================ */
.cin-stories { background: var(--go-bg-2); padding: 84px 0 70px; }
.cin-stories-grid {
  display: grid; grid-template-columns: 1.35fr 1fr 1fr; grid-template-rows: repeat(2, 1fr);
  gap: var(--cin-gap); height: 560px; direction: ltr;
}
.cin-stories-grid .cin-story { direction: rtl; }
.cin-story {
  position: relative; display: block; overflow: hidden;
  border-radius: 18px; background: var(--go-dark);
  box-shadow: var(--shadow, 0 6px 22px rgba(10,36,19,.12));
}
.cin-story-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transition: transform .8s ease;
}
.cin-story:hover .cin-story-bg { transform: scale(1.06); }
.cin-story::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(10, 16, 8, .82));
  opacity: 0; transition: opacity .5s ease;
}
.cin-story:hover::after { opacity: 1; }
.cin-story-badge {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  background: rgba(10, 16, 8, .72); color: #fff;
  font-size: 12px; font-family: var(--font-head, "Cairo", sans-serif);
  padding: 5px 13px; border-radius: 20px; border: 1px solid rgba(255,255,255,.25);
  opacity: .95;
}
.cin-story-overlay {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  padding: 24px;
  transform: translateY(18px); opacity: 0;
  transition: transform .5s ease, opacity .5s ease;
}
.cin-story:hover .cin-story-overlay { transform: translateY(0); opacity: 1; }
.cin-story-title {
  color: #fff; font-family: var(--font-head, "Cairo", sans-serif);
  font-weight: 800; font-size: 17px; line-height: 1.5;
}
.cin-story-feature { grid-column: 1; grid-row: 1 / -1; }
.cin-story-feature .cin-story-title { font-size: 24px; }
.cin-story-more { color: var(--go-gold-l); font-weight: 700; font-size: 13px; margin-top: 6px; }
.cin-more-row { text-align: left; margin-top: 30px; }
.cin-btn-ghost {
  display: inline-flex; align-items: center; gap: 10px;
  border: 2px solid var(--go-dark); color: var(--go-dark);
  padding: 12px 26px; border-radius: 8px;
  font-family: var(--font-head, "Cairo", sans-serif); font-weight: 700; font-size: 14px;
  transition: background .3s, color .3s;
}
.cin-btn-ghost:hover { background: var(--go-dark); color: #fff; }

/* ============================================================
   Carousels (shared)
   ============================================================ */
.cin-carousel { position: relative; display: flex; align-items: center; gap: 14px; }
.cin-car-viewport { overflow: hidden; width: 100%; }
.cin-track {
  display: flex; gap: var(--cin-gap); width: max-content;
  margin-inline: auto;
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}
.cin-slide { flex: 0 0 auto; }
.cin-nav-btn {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.28); background: var(--go-dark);
  color: #fff; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  transition: background .25s, border-color .25s, color .25s, opacity .25s;
}
.cin-nav-btn:hover { background: var(--go-gold); border-color: var(--go-gold); color: #241a00; }
.cin-nav-btn.disabled { opacity: .25; pointer-events: none; }

/* ============================================================
   Section 3 — News highlights
   ============================================================ */
.cin-news { background: var(--go-dark); padding: 84px 0 90px; }
.cin-news .cin-sec-label { color: var(--go-gold); }

.cin-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.cin-cards-grid .custom-news-card { height: 100%; }

.custom-news-card {
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
  height: 100% !important;
  position: relative;
  background-color: #ffffff !important;
  border-radius: 12px;
  overflow: hidden;
  z-index: 2;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  direction: rtl;
  text-align: right;
  transition: box-shadow .35s ease;
}
.custom-news-card:hover { box-shadow: 0 18px 38px rgba(0,0,0,.45); }
.custom-news-card .card-image-wrap { position: relative; display: block; overflow: hidden; flex: 0 0 auto; }
.custom-news-card .card-image-wrap img {
  width: 100%;
  height: 220px;
  min-height: 220px;
  object-fit: cover;
  display: block;
  border-bottom: 3px solid #1b2614;
  transition: transform .5s ease;
}
/* Media Center — identical 16/9 image proportions on every device */
.mc-carousel .custom-news-card .card-image-wrap img {
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.custom-news-card:hover .card-image-wrap img { transform: scale(1.06); }
.custom-news-card .card-cat-badge {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: var(--go-gold); color: #241a00;
  font-size: 11px; font-weight: 800; font-family: var(--font-head, "Cairo", sans-serif);
  padding: 4px 12px; border-radius: 20px;
  direction: rtl; text-align: right;
}
.custom-news-card .card-content-wrap {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  flex: 1 1 auto;
  background: #ffffff;
  word-break: break-word;
  white-space: normal;
  direction: rtl;
  text-align: right;
}
.custom-news-card .date-badge {
  background-color: #f0f0f0;
  color: #666666;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  width: fit-content;
  margin-bottom: 12px;
  font-weight: 500;
  font-family: var(--font-head, "Cairo", sans-serif);
}
.custom-news-card .card-title {
  font-size: 18px;
  font-weight: 700;
  color: #111111;
  margin-bottom: 10px;
  line-height: 1.5;
  font-family: var(--font-head, "Cairo", sans-serif);
}
.custom-news-card .card-title a { color: inherit; text-decoration: none; transition: color .25s; }
.custom-news-card .card-title a:hover { color: var(--go-gold); }
.custom-news-card .card-excerpt {
  font-size: 14px;
  color: #777777;
  line-height: 1.6;
  margin-bottom: 20px;
}
.custom-news-card .read-more-btn {
  margin-top: auto;
  background-color: #0d0d0d;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  align-self: flex-start;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head, "Cairo", sans-serif);
  transition: background-color 0.3s ease, transform .3s ease;
}
.custom-news-card .read-more-btn:hover { background-color: #2b3921; }
.custom-news-card .read-more-btn .card-btn-arrow { transition: transform .3s ease; }
.custom-news-card .read-more-btn:hover .card-btn-arrow { transform: translateX(-4px); }

/* ============================================================
   Section 4 — بيانات (statements news)
   ============================================================ */
.cin-features { position: relative; padding: 90px 0 96px; background: var(--go-dark); }
.cin-features-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: grayscale(1); opacity: .10;
}
.cin-features::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,24,11,.55) 0%, rgba(16,24,11,.85) 100%);
}
.cin-features-inner { position: relative; z-index: 2; }

/* ============================================================
   Section 5 — Events
   ============================================================ */
.cin-events { background: var(--go-dark); padding: 84px 0 70px; }
.cin-event {
  width: calc((100% - 4 * var(--cin-gap)) / 5);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.cin-event-poster {
  display: block; width: 100%; border-radius: 16px; overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
  border: 2px solid rgba(230,199,106,.18);
}
.cin-event-poster img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; transition: transform .5s; }
.cin-event:hover .cin-event-poster img { transform: scale(1.05); }
.cin-event-title { color: #fff; font-weight: 800; font-family: var(--font-head, "Cairo", sans-serif); font-size: 15px; margin-top: 14px; line-height: 1.5; }
.cin-event-date { color: var(--go-gold); font-size: 12px; margin-top: 4px; }
.cin-events-nav { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 30px; }
.cin-dots { display: flex; gap: 10px; align-items: center; }
.cin-dot {
  width: 10px; height: 10px; border-radius: 50%; border: none; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.4);
  transition: width .5s cubic-bezier(.4,0,.2,1), border-radius .5s cubic-bezier(.4,0,.2,1), background-color .5s ease;
}
.cin-dot.active { width: 38px; border-radius: 999px; background: #fff; }

/* Desktop/laptop: bigger events cards (3–4 per view) */
@media (min-width: 1180px) {
  .cin-event { min-width: 320px; }
}

/* ============================================================
   Media Center — one slider per category
   ============================================================ */
.mc-intro {
  background: var(--go-dark);
  color: #c3d2c5;
  text-align: center;
  padding: 40px 0 4px;
}
.mc-intro .goba-container p,
.mc-intro .goba-container {
  margin: 0 auto;
  max-width: 760px;
  line-height: 1.9;
  font-size: 15px;
}
.mc-intro h1, .mc-intro h2, .mc-intro h3, .mc-intro h4 { color: var(--go-gold-l); }

.mc-section {
  background: var(--go-dark);
  padding: 84px 0 90px;
  position: relative;
  width: 100%;
  clear: both;
  overflow: hidden;
  margin-bottom: 50px;
}
.mc-section.mc-alt { background: var(--go-dark-2); }

.mc-sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 38px;
}
.mc-sec-titles { text-align: right; }
.mc-sec-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 32px);
  color: var(--go-gold-l);
  margin: 0 0 10px;
  position: relative;
  padding-bottom: 14px;
}
.mc-sec-title::after {
  content: ""; position: absolute; right: 0; bottom: 0;
  width: 56px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--go-gold), transparent);
}
.mc-view-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid rgba(230, 199, 106, .45);
  border-radius: 999px;
  color: var(--go-gold-l);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .25s, color .25s, border-color .25s;
}
.mc-view-all span { transition: transform .25s; }
.mc-view-all:hover { background: var(--go-gold); border-color: var(--go-gold); color: #241a00; }
.mc-view-all:hover span { transform: translateX(-4px); }

.mc-cat-desc {
  color: #c3d2c5;
  font-size: 14px;
  line-height: 1.8;
  max-width: 640px;
  margin: 4px 0 0;
}
.mc-empty { color: #c3d2c5; padding: 30px 0; text-align: center; font-size: 15px; }

.cin-car-viewport { touch-action: pan-y; cursor: grab; }
.cin-car-viewport:active { cursor: grabbing; }

/* Carousel slides — hold their shape on every screen size and category.
   Never let a slide collapse or squish vertically. */
.cin-track .cin-slide {
  flex-shrink: 0;
  min-width: 0;
}

.mc-carousel .cin-slide.custom-news-card {
  width: calc((100% - 3 * var(--cin-gap)) / 4);
  flex-shrink: 0;
}

/* Third-party fallback (Swiper / Elementor Loop) — cards never collapse */
.swiper-slide, .elementor-loop-container .elementor-grid-item {
  width: 100% !important;
  min-width: 280px;
  flex-shrink: 0;
}

@media (max-width: 1180px) {
  .mc-carousel .cin-slide.custom-news-card { width: calc((100% - 2 * var(--cin-gap)) / 3); }
}
@media (max-width: 768px) {
  /* Strict mobile: exactly 1 card per view, full width, readable */
  .mc-carousel .cin-slide.custom-news-card {
    width: 100% !important;
    min-width: 280px;
    flex-shrink: 0;
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1180px) {
  .cin-event { width: calc((100% - 2 * var(--cin-gap)) / 3); }
}
@media (max-width: 1024px) {
  .cin-commander-grid { grid-template-columns: 1fr; gap: 44px; }
  .cin-commander { padding: 60px 0; }
  .cin-stories-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; height: auto; }
  .cin-story-feature { grid-column: 1 / -1; grid-row: auto; height: 340px; }
  .cin-story { height: 220px; }
}
@media (max-width: 768px) {
  .cin-commander { padding: 44px 0; }
  .cin-cmd-photo { width: min(300px, 100%); border-radius: 44px 44px 16px 16px; }
  .cin-stories-grid { grid-template-columns: 1fr; }
  .cin-cards-grid { grid-template-columns: 1fr; }
  .cin-event { width: 100%; }
  .cin-nav-btn { width: 40px; height: 40px; }
  .cin-carousel { gap: 8px; }
}

/* ============================================================
   HOMEPAGE — PHOTO STORY CARDS: MOBILE FIXES (MAX-WIDTH: 767PX)
   ============================================================ */
@media (max-width: 767px) {

  /* 1. Fixed card heights on mobile — no squish / cropped subjects */
  .cin-stories-grid .cin-story { min-height: 300px; height: 300px; }
  .cin-stories-grid .cin-story-feature { height: 360px; }

  /* 2. Cover image, subject kept in frame */
  .cin-story-bg { background-size: cover; background-position: center center; }

  /* 3. Title + dark gradient ALWAYS visible (touch devices have no hover) */
  .cin-story .cin-story-overlay { transform: translateY(0); opacity: 1; }
  .cin-story::after { opacity: 1; }
}

/* ============================================================
   MEDIA CENTER — CRITICAL MOBILE FIXES (RTL)
   ============================================================ */
@media (max-width: 768px) {

  /* 1. No horizontal scroll / screen bleed (scoped — keeps sticky header working) */
  .site-main, .mc-section, .mc-intro, .goba-page-hero { overflow-x: hidden; }
  .goba-container { padding: 0 16px; }

  /* 2. Section spacing so sliders breathe */
  .mc-section { padding: 56px 0 60px; margin-bottom: 30px; }
  .mc-sec-head { margin-bottom: 26px; }

  /* 3. Section head stacks cleanly, RTL (RTL start = right) */
  .mc-sec-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .mc-sec-titles { text-align: right; }
  .mc-sec-title { font-size: 22px; }
  .mc-view-all {
    align-self: flex-start;
    width: 100%;
    justify-content: center;
  }

  /* 4. Carousel: exactly 1 slide per view, full width, centered */
  .mc-carousel .cin-track { width: 100%; }
  .mc-carousel .cin-slide.custom-news-card {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  .mc-carousel .cin-car-viewport { width: 100%; }

  /* 5. Nav grouped neatly below the slider (no floating) */
  .mc-carousel + .cin-events-nav,
  .cin-events-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 26px;
    position: relative;
    width: 100%;
    z-index: 3;
  }
  .cin-dots { justify-content: center; }
  .cin-nav-btn { flex: 0 0 auto; }
}

/* ============================================================
   MEDIA CENTER — MOBILE: ALL POSTS VISIBLE AS A VERTICAL STACK
   (MAX-WIDTH: 767PX)
   Guarantees EVERY post is shown on mobile — no swipe/arrows
   needed. Desktop & tablet keep the carousel unchanged.
   ============================================================ */
@media (max-width: 767px) {
  .mc-carousel .cin-track {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100% !important;
    margin-inline: 0;
    transform: none !important;
  }
  .mc-carousel .cin-slide.custom-news-card {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  .mc-carousel .cin-car-viewport { width: 100%; overflow: visible; }
  .mc-carousel + .cin-events-nav { display: none; }
}
