﻿/* Cafe Sati - News Bar | Frontend styles */

:root {
  --csn-bg: #f5eadf;
  --csn-color: #b4773a;
  --csn-badge-bg: #b4773a;
  --csn-badge-color: #ffffff;
  --csn-font-size: 14px;
  --csn-height: 32px;
  --csn-speed: 350ms;
}

.csn-news-bar {
  width: 100%;
  background-color: var(--csn-bg);
  overflow: hidden;
  min-height: var(--csn-height);
  display: flex;
  align-items: stretch;
  /* Fixed en haut, au-dessus du header (z-index: 4) */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
}

.csn-ticker {
  width: 100%;
  height: var(--csn-height);
  overflow: hidden;
  position: relative;
}

.csn-ticker__inner {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Items hidden by default - is-active reveals them */
.csn-ticker__item {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  gap: 8px;
  box-sizing: border-box;
  background-color: var(--csn-bg);
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--csn-speed) ease,
    transform var(--csn-speed) ease;
}

.csn-ticker__item.is-active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.csn-ticker__item.is-leaving {
  display: flex;
  opacity: 0;
  transform: translateY(-12px);
}

/* When the item itself is an <a> (link mode) */
a.csn-ticker__item {
  text-decoration: none;
  cursor: pointer;
}

a.csn-ticker__item:hover .csn-ticker__text {
  text-decoration: underline;
  text-decoration-color: var(--csn-color);
  text-underline-offset: 3px;
}

.csn-ticker__text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--csn-font-size);
  line-height: 1.3;
  color: var(--csn-color);
  font-weight: 500;
}

/* Badge inline - partie du texte mise en avant */
.csn-badge {
  display: inline-flex;
  align-items: center;
  background-color: var(--csn-badge-bg);
  color: var(--csn-badge-color);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* RESPONSIVE */
@media (max-width: 767px) {
  /* Le ticker vertical fonctionne de la même façon sur mobile */
  .csn-ticker__text {
    white-space: normal;
    word-break: break-word;
    text-align: center;
    flex-wrap: wrap;
    justify-content: center;
  }
}
