:root {
    --black: #000;
    --white: #fff;
    --border: #d6d6d6;
    --latest: #f2f2f2;
    --hover: #f7f7f7;
    --latest-hover: #e9e9e9;
    --content: 680px;
    --header-height: 128px;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    overflow: hidden;
    background: var(--white);
    color: var(--black);
    font: 17px/1.55 Arial, Helvetica, sans-serif;
}

button,
input,
select {
    font: inherit;
}

/* Accessibilité */

.filters label span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Header */

.site-header {
    position: relative;
    z-index: 20;
    width: min(calc(100% - 48px), var(--content));
    height: var(--header-height);
    margin: 0 auto;
    padding: 8px 0;
    background: var(--white);
}

.header-inner {
    position: relative;
    width: 100%;
    max-width: var(--content);
    height: 112px;
    margin: 0 auto;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 48px;
    grid-template-rows: 66px 46px;
    gap: 0;
    align-items: stretch;
    overflow: hidden;
    background:
        linear-gradient(var(--border), var(--border)) 0 66px / 100% 1px no-repeat,
        var(--white);
}

.brand {
    position: relative;
    grid-column: 1 / 3;
    grid-row: 1;
    padding: 0 22px 0 0;
    display: flex;
    align-items: center;
    color: var(--black);
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.075em;
    text-decoration: underline;
}

.brand:hover,
.brand:focus-visible {
    text-decoration: none;
}

/* Filtres */

.filters,
.filters-inner {
    display: contents;
}

.filters label {
    min-width: 0;
    margin: 0;
}

.filters-inner > label:nth-of-type(1) {
    position: relative;
    grid-column: 2 / 5;
    grid-row: 1;
    width: 420px;
    height: 34px;
    margin-right: 6px;
    align-self: center;
    justify-self: end;
}

.filters-inner > label:nth-of-type(1)::after {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    width: 50px;
    height: 34px;
    background-color: var(--black);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 15px;
    content: "";
    pointer-events: none;
}

.filters input,
.filters select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    background-color: var(--white);
    color: var(--black);
    border: 0;
    border-radius: 0;
    text-transform: uppercase;
}

.filters input {
    height: 34px;
    padding: 0 58px 0 16px;
    border: 1px solid var(--border);
    font-size: 16px;
    font-weight: 500;
}

.filters input::placeholder {
    color: #666;
    opacity: 1;
}

.filters select {
    height: 32px;
    padding: 0 14px 0 5px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
    background-size: 7px auto;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.filters-inner > label:nth-of-type(2) {
    grid-column: 1;
    grid-row: 2;
}

.filters-inner > label:nth-of-type(3) {
    grid-column: 2;
    grid-row: 2;
}

.filters-inner > label:nth-of-type(4) {
    grid-column: 3;
    grid-row: 2;
}

#filters-reset {
    grid-column: 4;
    grid-row: 2;
    width: 30px;
    height: 32px;
    margin: 0;
    padding: 0 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    background: var(--white);
    color: var(--black);
    border: 0;
    border-radius: 0;
    font-size: 18px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
}

#filters-reset:hover,
#filters-reset:focus-visible {
    background: var(--black);
    color: var(--white);
}

/* Flux */

.feed {
    position: relative;
    width: min(calc(100% - 48px), var(--content));
    height: calc(100dvh - var(--header-height));
    min-height: 0;
    margin: 0 auto;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.feed::-webkit-scrollbar,
.story.is-active::-webkit-scrollbar {
    display: none;
}

/* Cartes */

.story {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    padding: 22px 22px 21px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 25px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .07), 0 2px 8px rgba(0, 0, 0, .04);
    transition: opacity .36s ease, transform .36s ease, background-color .2s ease, border-color .2s ease, max-height .36s ease;
}

.story.is-hidden {
    display: none;
}

.story.is-active {
    z-index: 3;
    max-height: calc(100dvh - var(--header-height) - 42px);
    padding: 12px 13px 16px;
    overflow-x: hidden;
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
    background: var(--latest);
    border-color: #c7c7c7;
    border-radius: 15px;
    -webkit-mask-image: none;
    mask-image: none;
    pointer-events: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
}

.story.is-active:hover {
    background: var(--latest-hover);
}

.story.is-before,
.story.is-after {
    z-index: 1;
    opacity: .62;
    pointer-events: none;
}

.story.is-before {
    max-height: 105px;
    margin-bottom: -2px;
    transform: translateY(-2px);
    -webkit-mask-image: linear-gradient(to top, transparent 0, rgba(0, 0, 0, .12) 18px, rgba(0, 0, 0, .35) 42px, rgba(0, 0, 0, .68) 72px, #000 100%);
    mask-image: linear-gradient(to top, transparent 0, rgba(0, 0, 0, .12) 18px, rgba(0, 0, 0, .35) 42px, rgba(0, 0, 0, .68) 72px, #000 100%);
}

.story.is-after {
    max-height: 130px;
    margin-top: -2px;
    transform: translateY(2px);
    -webkit-mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, .72) 38px, rgba(0, 0, 0, .42) 76px, rgba(0, 0, 0, .15) 108px, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, .72) 38px, rgba(0, 0, 0, .42) 76px, rgba(0, 0, 0, .15) 108px, transparent 100%);
}

.story:first-child {
    scroll-margin-top: 8px;
}

/* Contenu */

.story-meta {
    margin-bottom: 7px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    color: var(--black);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.story-meta span:empty {
    display: none;
}

.story-meta span + span::before {
    margin-right: 5px;
    content: "·";
}

.story-meta .story-meta-break {
    display: block !important;
    flex: 0 0 100%;
    width: 100%;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.story-meta .story-meta-break::before,
.story-meta .story-meta-break + .story-time::before {
    display: none;
    content: none;
}

.story-category-link,
.story-trend a {
    color: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.story-category-link:hover,
.story-category-link:focus-visible,
.story-trend a:hover,
.story-trend a:focus-visible {
    opacity: .55;
}

.story-title {
    margin: 0 0 10px;
    color: var(--black);
    font-size: clamp(23px, 2.4vw, 30px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.045em;
}

.story-summary {
    margin: 0;
    color: var(--black);
    font-size: 16px;
    line-height: 1.45;
}

.story-why {
    margin: 12px 0 0;
    padding-left: 11px;
    color: var(--black);
    border-left: 2px solid var(--border);
    font-size: 15px;
    line-height: 1.42;
}

.story-sources {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.story-sources a {
    padding: 4px 8px;
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--border);
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none;
    text-transform: uppercase;
}

.story-sources a:hover,
.story-sources a:focus-visible {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.story-google-news {
    margin-top: 15px;
    padding-top: 13px;
    border-top: 1px solid var(--border);
}

.story-google-news a {
    display: inline-block;
    color: var(--black);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: underline;
}

.story-google-news a::after {
    margin-left: 10px;
    content: "↗";
}

/* Progression */

.story-progress {
    position: absolute;
    z-index: 6;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    overflow: hidden;
    background: transparent;
    border-radius: 0 0 15px 15px;
    pointer-events: none;
}

.story-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--black);
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

.story:not(.is-active) .story-progress {
    display: none;
}

/* Navigation */

.story-navigation {
    position: fixed;
    z-index: 40;
    left: 50%;
    bottom: 5px;
    display: none;
    align-items: center;
    gap: 12px;
    transform: translateX(-50%);
}

.story-navigation.is-visible {
    display: flex;
}

.story-arrow {
    position: relative;
    width: 27px;
    height: 27px;
    padding: 0;
    background: rgba(255, 255, 255, .92);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .13);
    cursor: pointer;
}

.story-arrow::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    content: "";
    transform: translate(-50%, -50%);
}

.story-arrow:hover,
.story-arrow:focus-visible {
    background: var(--latest);
}

.story-arrow:active {
    transform: scale(.9);
}

.story-arrow[hidden] {
    display: none;
}

.story-arrow-up::before {
    border-right: 8px solid transparent;
    border-bottom: 12px solid var(--black);
    border-left: 8px solid transparent;
}

.story-arrow-down::before {
    border-top: 12px solid var(--black);
    border-right: 8px solid transparent;
    border-left: 8px solid transparent;
}

.story-play-pause {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--black);
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.story-play-pause::before {
    display: none;
}

.story-arrow-start::before {
    top: 64%;
    border-right: 6px solid transparent;
    border-bottom: 9px solid var(--black);
    border-left: 6px solid transparent;
}

.story-arrow-start::after {
    position: absolute;
    z-index: 3;
    top: 4px;
    left: 50%;
    display: block;
    width: 13px;
    height: 2px;
    background: var(--black);
    content: "";
    transform: translateX(-50%);
}

/* Statut */

.feed-status {
    position: fixed;
    z-index: 10;
    top: 50%;
    left: 50%;
    width: min(calc(100% - 30px), var(--content));
    max-width: var(--content);
    margin: 0;
    padding: 22px;
    background: var(--white);
    color: var(--black);
    text-align: center;
    transform: translate(-50%, -50%);
}

.feed-status[hidden] {
    display: none;
}

.noscript {
    width: min(100%, var(--content));
    max-width: var(--content);
    margin: 0 auto;
    padding: 22px;
    text-align: center;
}

/* Smartphone */

@media (max-width: 760px) {
    :root {
        --header-height: 76px;
        --mobile-margin: 16px;
    }

    body {
        font-size: 15px;
    }

    .site-header {
        width: 100%;
        height: var(--header-height);
        margin: 0;
        padding: 3px 0;
    }

    .header-inner {
        width: calc(100% - (var(--mobile-margin) * 2));
        height: 70px;
        margin: 0 auto;
        grid-template-columns: repeat(3, minmax(0, 1fr)) 30px;
        grid-template-rows: 38px 32px;
        background:
            linear-gradient(var(--border), var(--border)) 0 38px / 100% 1px no-repeat,
            var(--white);
        border-radius: 12px;
    }

    .brand {
        grid-column: 1;
        grid-row: 1;
        padding: 0;
        justify-content: flex-start;
        font-size: 22px;
        font-weight: 900;
        line-height: 1;
        white-space: nowrap;
    }

    .filters-inner > label:nth-of-type(1) {
        grid-column: 2 / 5;
        grid-row: 1;
        width: min(185px, calc(100% - 6px));
        height: 28px;
        margin-right: 6px;
    }

    .filters input {
        height: 28px;
        padding: 0 35px 0 8px;
        font-size: 12px;
        font-weight: 600;
    }

    .filters-inner > label:nth-of-type(1)::after {
        width: 32px;
        height: 28px;
        background-size: 15px;
    }

    .filters select {
        height: 32px;
        padding-right: 15px;
        padding-left: 7px;
        font-size: 11px;
        font-weight: 700;
    }

    #filters-reset {
        width: 30px;
        height: 32px;
        font-size: 20px;
    }

    .feed {
        width: calc(100% - (var(--mobile-margin) * 2));
    }

    .story {
        padding: 28px 25px 27px;
    }

    .story.is-active {
        padding: 12px 13px 16px;
    }

    .story-meta {
        margin-bottom: 4px;
        gap: 3px;
        font-size: 9px;
        line-height: 1.15;
    }

    .story-meta span + span::before {
        margin-right: 3px;
    }

    .story-title {
        margin-bottom: 6px;
        font-size: clamp(18px, 5.6vw, 25px);
        line-height: 1.02;
    }

    .story-summary {
        font-size: 13px;
        line-height: 1.28;
    }

    .story-why {
        margin-top: 7px;
        padding-left: 8px;
        font-size: 12px;
        line-height: 1.27;
    }

    .story-sources {
        margin-top: 7px;
        gap: 4px;
    }

    .story-sources a {
        padding: 3px 6px;
        font-size: 8px;
        line-height: 1.1;
    }

    .story-google-news {
        margin-top: 7px;
        padding-top: 6px;
    }

    .story-google-news a {
        font-size: 10px;
        line-height: 1.15;
    }

    .feed-status,
    .noscript {
        width: calc(100% - (var(--mobile-margin) * 2));
    }
}

@media (prefers-reduced-motion: reduce) {
    .feed {
        scroll-behavior: auto;
    }

    .story {
        transition: none;
    }
}