/*
 * Homepage announcements slider. Scoped under .tms-ann; uses logical properties so the same
 * rules serve RTL and LTR. Colours follow the portal tokens with fallbacks (event themes re-skin it).
 */
.tms-ann {
    --a-primary: var(--color-primary, #00b8c3);
    --a-navy: var(--color-secondary, #002e4a);
    --a-ink: #fff;
    --a-ease: cubic-bezier(.22, .61, .36, 1);
    padding-block: 32px 8px;
    background: #fff;
}
.tms-ann * { box-sizing: border-box; }
.tms-ann .ann-wrap {
    /* Width and gutters come from the portal's own .container so the slider lines up with every other section. */
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px;
}

/* ---------- Stage ---------- */
.tms-ann .ann-stage { position: relative; border-radius: 14px; overflow: hidden; background: var(--a-navy); aspect-ratio: 21 / 9; min-height: 460px; box-shadow: 0 10px 30px rgba(0, 46, 74, .18); }
.tms-ann .ann-slides, .tms-ann .ann-slide { position: absolute; inset: 0; }
.tms-ann .ann-slide { opacity: 0; visibility: hidden; transition: opacity .7s var(--a-ease), visibility 0s .7s; }
.tms-ann .ann-slide.is-active { opacity: 1; visibility: visible; transition: opacity .7s var(--a-ease); }
.tms-ann .ann-img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 8s linear; }
.tms-ann .ann-slide.is-active .ann-img { transform: scale(1); }
.tms-ann .ann-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 30, 48, 0) 25%, rgba(0, 30, 48, .55) 60%, rgba(0, 30, 48, .92) 100%); }
.tms-ann .ann-copy { position: absolute; inset-inline: 0; bottom: 0; padding: 32px 44px 48px; color: var(--a-ink); max-width: 860px; }
.tms-ann .ann-slide.is-active .ann-copy > * { animation: ann-rise .7s var(--a-ease) both; }
.tms-ann .ann-slide.is-active .ann-copy > :nth-child(2) { animation-delay: .08s; }
.tms-ann .ann-slide.is-active .ann-copy > :nth-child(3) { animation-delay: .16s; }
.tms-ann .ann-slide.is-active .ann-copy > :nth-child(4) { animation-delay: .24s; }
@keyframes ann-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tms-ann .ann-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13px; }
.tms-ann .ann-badge { background: var(--a-primary); color: #fff; padding: 2px 12px; border-radius: 999px; font-weight: 600; }
.tms-ann .ann-date { color: rgba(255, 255, 255, .8); }
.tms-ann .ann-title { margin: 0; font-size: clamp(22px, 3vw, 38px); line-height: 1.5; text-wrap: balance; }
.tms-ann .ann-title a { color: #fff; text-decoration: none; }
.tms-ann .ann-title a:hover { text-decoration: underline; text-underline-offset: 6px; }
.tms-ann .ann-sum { margin: 10px 0 0; color: rgba(255, 255, 255, .85); font-size: 15px; line-height: 1.8; max-width: 60ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tms-ann .ann-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 9px 22px; border-radius: 999px; background: #fff; color: var(--a-navy); font-weight: 700; font-size: 14px; text-decoration: none; transition: background .2s, color .2s; }
.tms-ann .ann-cta:hover { background: var(--a-primary); color: #fff; }
.tms-ann .ann-arrow::before { content: "\2190"; }
html[dir="ltr"] .tms-ann .ann-arrow::before { content: "\2192"; }

/* ---------- Controls ---------- */
.tms-ann .ann-controls { position: absolute; inset-block-start: 16px; inset-inline-end: 16px; display: flex; gap: 8px; z-index: 2; }
.tms-ann .ann-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .45); background: rgba(0, 30, 48, .45); backdrop-filter: blur(6px); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .2s; padding: 0; }
.tms-ann .ann-btn:hover { background: var(--a-primary); }
.tms-ann .ann-prev span::before { content: "\2039"; font-size: 24px; line-height: 1; }
.tms-ann .ann-next span::before { content: "\203A"; font-size: 24px; line-height: 1; }
html[dir="ltr"] .tms-ann .ann-prev span::before { content: "\203A"; }
html[dir="ltr"] .tms-ann .ann-next span::before { content: "\2039"; }
.tms-ann .ann-pause span::before { content: "\275A\275A"; font-size: 9px; letter-spacing: 1px; }
.tms-ann .ann-pause[aria-pressed="true"] span::before { content: "\25B6"; font-size: 11px; letter-spacing: 0; }

/* ---------- Rail ---------- */
.tms-ann .ann-rail { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; }
.tms-ann .ann-rail li { flex: 1; display: flex; }
.tms-ann .ann-tab { position: relative; flex: 1; text-align: start; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 18px; border: 1px solid #dde6ea; border-radius: 12px; background: #f4f7f8; color: #0f2233; font: inherit; cursor: pointer; overflow: hidden; transition: background .25s, border-color .25s, transform .25s; }
.tms-ann .ann-tab:hover { background: #fff; border-color: var(--a-primary); }
.tms-ann .ann-tab.is-active { background: #fff; border-color: var(--a-primary); box-shadow: 0 6px 18px rgba(0, 46, 74, .1); }
.tms-ann .ann-num { font-weight: 800; font-size: 18px; color: #9db1bd; font-variant-numeric: tabular-nums; line-height: 1.5; }
.tms-ann .ann-tab.is-active .ann-num { color: var(--a-primary); }
.tms-ann .ann-tab-title { font-size: 14px; line-height: 1.7; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tms-ann .ann-bar { position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: transparent; }
.tms-ann .ann-bar i { display: block; height: 100%; width: 0; background: var(--a-primary); transform-origin: left; }
html[dir="rtl"] .tms-ann .ann-bar i { margin-inline-start: auto; }
.tms-ann .ann-tab.is-active .ann-bar i { animation: ann-fill var(--ann-interval, 6000ms) linear forwards; }
.tms-ann.is-paused .ann-tab.is-active .ann-bar i { animation-play-state: paused; }
@keyframes ann-fill { from { width: 0; } to { width: 100%; } }

.tms-ann :focus-visible { outline: 2px solid var(--a-primary); outline-offset: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .tms-ann .ann-stage { aspect-ratio: 16 / 9; min-height: 380px; }
    .tms-ann .ann-copy { padding: 24px 24px 32px; }
    .tms-ann .ann-rail { grid-auto-flow: unset; grid-auto-columns: unset; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
    .tms-ann .ann-rail li { flex: 0 0 72%; scroll-snap-align: start; }
}
@media (max-width: 575px) {
    .tms-ann .ann-stage { aspect-ratio: 4 / 5; min-height: 0; }
    .tms-ann .ann-copy { padding: 20px 18px 26px; }
    .tms-ann .ann-sum { -webkit-line-clamp: 3; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .tms-ann .ann-slide, .tms-ann .ann-img { transition: none; }
    .tms-ann .ann-slide.is-active .ann-copy > *, .tms-ann .ann-tab.is-active .ann-bar i { animation: none; }
    .tms-ann .ann-tab.is-active .ann-bar i { width: 100%; }
}

/* ---------- Banner (no announcement) ----------
 * The site banner in the same frame when nothing is announced: the event theme hero image with the
 * slogan where the old hero had it. */
.tms-ann-banner .ann-img { transform: none; }
.tms-ann-banner .ann-slogan { position: absolute; inset-inline-start: 44px; bottom: 40px; width: min(420px, 42%); height: auto; }
@media (max-width: 767px) {
    .tms-ann-banner .ann-slogan { inset-inline-start: 16px; bottom: 16px; width: 62%; }
}
