/* mod-stories.css — сторіс "Новини дня" для Emirates
   Правило: усі margin/padding-правила всередині .ev2 мають 2+ класи в селекторі,
   бо .ev2 *{margin:0;padding:0} у home-v2.css має ту саму специфічність. */

.ev2 .em-stories { padding: 18px 0 4px; }

/* B1: вирівнюємо ряд по сітці сайта (та сама формула, що й .wrap у home-v2.css). */
.ev2 .em-stories__wrap {
  width: min(100% - 2rem, var(--max, 1280px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* B2: eyebrow ліворуч від кружечків (на мобільному — над рядом, див. медіа-запит). */
.ev2 .em-stories__eyebrow {
  flex: none;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #A8763F;
  white-space: nowrap;
}

.ev2 .em-stories__row {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 16px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ev2 .em-stories__row::-webkit-scrollbar { display: none; }

.ev2 .em-stories__item {
  flex: 0 0 auto;
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
}

/* B3: кружечки 84px (десктоп) / 68px (≤640px, див. медіа-запит нижче). */
.ev2 .em-stories__ring {
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent));
  transition: transform .15s var(--ease);
}
.ev2 .em-stories__item:hover .em-stories__ring { transform: scale(1.05); }
.ev2 .em-stories__item:active .em-stories__ring { transform: scale(.94); }
.ev2 .em-stories__item--seen .em-stories__ring { background: var(--line-soft); }

.ev2 .em-stories__img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--panel, #FBF8F2);
}

/* B3: підпис до двох рядків по центру, без трикрапки на першому рядку. */
.ev2 .em-stories__label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 96px;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: .01em;
  color: var(--ink-soft);
  text-align: center;
  white-space: normal;
}

@media (max-width: 640px) {
  .ev2 .em-stories__wrap { flex-direction: column; align-items: flex-start; }
  /* У колонці з align-items:flex-start дитина бере ширину ВМІСТУ (4×96px + проміжки = 436px)
     і розпирає сторінку вбік. Ряд мусить бути завширшки з контейнер і скролитись усередині себе. */
  .ev2 .em-stories__row { align-self: stretch; width: 100%; max-width: 100%; }
  .ev2 .em-stories__ring, .ev2 .em-stories__img { width: 68px; height: 68px; }
}

/* ===== В'ювер ===== */

.ev2 .em-stv,
.em-stv {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.96);
  transition: opacity .42s var(--stv-expo, cubic-bezier(.16,1,.3,1)), transform .42s var(--stv-expo, cubic-bezier(.16,1,.3,1));
}
.em-stv[hidden] { display: none !important; }

/* B5: відкриття — opacity 0→1 + scale .96→1, 420ms EXPO (клас додає JS). */
.ev2 .em-stv.em-stv--in,
.em-stv.em-stv--in {
  opacity: 1;
  transform: scale(1);
}

/* B5: закриття — 240ms SOFT (JS тримає hidden=false, доки йде цей перехід). */
.ev2 .em-stv.em-stv--closing,
.em-stv.em-stv--closing {
  opacity: 0;
  transform: scale(.96);
  transition: opacity .24s var(--stv-soft, cubic-bezier(.22,.7,.25,1)), transform .24s var(--stv-soft, cubic-bezier(.22,.7,.25,1));
}

.ev2 .em-stv__backdrop,
.em-stv__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 17, 10, .92);
}

.ev2 .em-stv__stage,
.em-stv__stage {
  position: relative;
  z-index: 1;
  width: min(440px, 100vw);
  height: min(90vh, 860px);
  background: #171309;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
@media (max-width: 600px) {
  .ev2 .em-stv__stage, .em-stv__stage { width: 100vw; height: 100vh; }
  /* 100vh рахує великий viewport і ховається під мобільним UI браузера;
     100dvh враховує реальну видиму висоту. Рядок вище лишається фолбеком
     для браузерів без підтримки dvh. */
  @supports (height: 100dvh) {
    .ev2 .em-stv__stage, .em-stv__stage { height: 100dvh; }
  }
}

.ev2 .em-stv__bars,
.em-stv__bars {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  gap: 4px;
}
.ev2 .em-stv__bar,
.em-stv__bar {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .32);
  overflow: hidden;
}
.ev2 .em-stv__bar i,
.em-stv__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
}
.ev2 .em-stv__bar--done i,
.em-stv__bar--done i { width: 100%; }

.ev2 .em-stv__head,
.em-stv__head {
  position: absolute;
  top: 22px;
  left: 14px;
  right: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ev2 .em-stv__title,
.em-stv__title {
  flex: 1;
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: .02em;
  text-shadow: 0 1px 4px rgba(0,0,0,.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev2 .em-stv__close,
.em-stv__close,
.ev2 .em-stv__pause,
.em-stv__pause {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.ev2 .em-stv__pause,
.em-stv__pause { font-size: 13px; }
.em-stv__pause[hidden] { display: none !important; }

.ev2 .em-stv__img,
.em-stv__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ev2 .em-stv__caption,
.em-stv__caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 88px;
  z-index: 3;
  color: #fff;
}
.ev2 .em-stv__caption .em-stv__kicker,
.em-stv__caption .em-stv__kicker {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 8px;
}
.ev2 .em-stv__caption .em-stv__stitle,
.em-stv__caption .em-stv__stitle {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 5vw, 26px);
  line-height: 1.15;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.ev2 .em-stv__caption .em-stv__stext,
.em-stv__caption .em-stv__stext {
  display: block;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255,255,255,.92);
  text-shadow: 0 1px 6px rgba(0,0,0,.45);
}

.ev2 .em-stv__cta,
.em-stv__cta {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 26px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.ev2 .em-stv__cta:hover,
.em-stv__cta:hover { background: var(--accent); color: #fff; }
.em-stv__cta[hidden] { display: none !important; }

.ev2 .em-stv__zone,
.em-stv__zone {
  position: absolute;
  top: 56px;
  bottom: 0;
  z-index: 2;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.ev2 .em-stv__zone--prev, .em-stv__zone--prev { left: 0; width: 33%; }
.ev2 .em-stv__zone--next, .em-stv__zone--next { right: 0; width: 67%; }

@media (prefers-reduced-motion: reduce) {
  .ev2 .em-stories__item, .em-stories__item,
  .ev2 .em-stories__ring, .em-stories__ring,
  .ev2 .em-stv__cta, .em-stv__cta {
    transition: none !important;
  }
  .ev2 .em-stv, .em-stv,
  .ev2 .em-stv.em-stv--in, .em-stv.em-stv--in,
  .ev2 .em-stv.em-stv--closing, .em-stv.em-stv--closing {
    transition: none !important;
    opacity: 1;
    transform: none;
  }
}
