/* InnoNews: the homepage panel that replaces the countdown once the event has
   started (templates/editions/hooks/home_hero.html, static/js/innonews.js).
   A news broadcast in the arcade skin: channel badge top right, the next
   event as the headline, the ones after it in a carousel below. */

/* Countdown and panel share one cell, so one can slide out as the other
   slides in. The stage runs the full width of the screen, out of the hero's
   container; the hero clips it so a vertical scrollbar adds no sideways
   scroll. */
.hero--edition { overflow-x: clip; }
.innonews-stage {
    display: grid;
    overflow: hidden;
    width: 100vw;
    margin: 1.75rem calc(50% - 50vw);
    padding-block: 4px 12px;
    box-sizing: border-box;
    transition: height .8s cubic-bezier(.65, 0, .35, 1);
}
.innonews-stage > * { grid-area: 1 / 1; min-width: 0; }
/* align-self: the shared row grows to the panel's height as it comes in;
   stretched, the countdown's boxes would grow with it. */
.innonews-stage .countdown { margin: 0; align-self: start; }
.innonews-stage [hidden] { display: none !important; }
.innonews-stage .countdown,
.innonews {
    transition: transform .8s cubic-bezier(.65, 0, .35, 1), opacity .8s;
}
.innonews-stage .countdown.is-leaving { transform: translateX(-110%); opacity: 0; }

.innonews {
    position: relative;
    text-align: left;
    background: #fff;
    border-block: 3px solid #0B1320;
    box-shadow: 0 6px 0 #1E63BD;
    padding-block: 1.25rem 1rem;
    transform: translateX(110%);
    opacity: 0;
}
.innonews.is-on { transform: none; opacity: 1; }

/* Headline and carousel heading line up with the page's content; the
   carousel itself runs edge to edge. */
.innonews__inner {
    position: relative;
    max-width: var(--brand-container);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* Channel badge: the site name's pixel font and colours, small. */
.innonews__badge {
    position: absolute;
    top: -.4rem;
    right: 1.25rem;
    margin: 0;
    font-family: 'Pixelify Sans', var(--brand-font-display), system-ui, cursive !important;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .5px;
    color: #1E63BD;
    text-shadow: 2px 2px 0 #EAA903;
}

.innonews__when {
    display: inline-block;
    margin: 0 0 .5rem;
    padding: .15rem .55rem;
    background: #EAA903;
    color: #0B1320;
    border: 2px solid #0B1320;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.innonews__when--lead { font-size: .9rem; margin-right: 7rem; }
/* How soon: red the same day, yellow tomorrow, green in a few days. */
.innonews__when--soon { background: #C62828; color: #fff; }
.innonews__when--tomorrow { background: #EAA903; color: #0B1320; }
.innonews__when--later { background: #1B7F3B; color: #fff; }

.innonews__lead { padding-bottom: 1rem; border-bottom: 3px solid #0B1320; }
.innonews__headline {
    margin: .1rem 0 .35rem;
    font-size: clamp(1.4rem, 3.4vw, 2.2rem);
    line-height: 1.15;
}
.innonews__headline a,
.innonews__title a { color: #0B1320; text-decoration: none; }
.innonews__headline a:hover,
.innonews__title a:hover,
.innonews__headline a:focus-visible,
.innonews__title a:focus-visible { color: #1E63BD; text-decoration: underline; }
.innonews__meta { margin: 0; color: #3A4654; font-size: .9rem; }
.innonews__empty { margin: 1.5rem 7rem 1rem 0; font-weight: 700; color: #0B1320; }

.innonews__rail { padding-top: .85rem; }
.innonews__arrow[hidden] { display: none; }
.innonews__rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .6rem;
}
.innonews__rail-title {
    margin: 0;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #3A4654;
}
.innonews__arrows { display: flex; gap: .4rem; }
.innonews__arrow {
    min-width: 2.25rem;
    min-height: 2.25rem;
    border: 2px solid #0B1320;
    background: #FAFCE6;
    color: #0B1320;
    font-weight: 700;
    box-shadow: 2px 2px 0 #0B1320;
    cursor: pointer;
}
.innonews__arrow:hover { background: #EAA903; }
.innonews__arrow:active { transform: translate(2px, 2px); box-shadow: none; }

.innonews__track {
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0 1.25rem .6rem;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
}
.innonews__track::-webkit-scrollbar { display: none; }
.innonews__track:focus-visible { outline: 3px solid #1E63BD; outline-offset: -3px; }
.innonews__item {
    flex: 0 0 min(16rem, 78vw);
    padding: .75rem;
    border: 2px solid #0B1320;
    background: #FAFCE6;
}
.innonews__title {
    margin: 0 0 .3rem;
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .innonews-stage,
    .innonews-stage .countdown,
    .innonews { transition: none; }
}

/* No events left: the message alone, without the rule over the carousel. */
.innonews__lead:has(+ .innonews__rail[hidden]) { border-bottom: 0; padding-bottom: 0; }
