@import url("skeleton.css");
@import url("accents.css");

:root {
    --article-bg: #f7f7fb;
    --article-surface: #fff;
    --article-text: #171721;
    --article-dim: #5d5d70;
    --article-border: rgba(20, 20, 35, .11);
    --article-accent: var(--accent-1, #7c5cff);
    --article-accent-2: var(--accent-2, #00dfd8);
    --article-muted: rgba(20, 20, 24, 0.65);
    --article-shadow: 0 20px 55px rgba(15, 23, 42, .08);
    --gradient-brand: linear-gradient(135deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3));
    color-scheme: light dark
}

html[data-theme="dark"] {
    --article-bg: #09090f;
    --article-surface: #12121b;
    --article-text: #f4f4f7;
    --article-dim: #aaaabd;
    --article-border: rgba(255, 255, 255, .11);
    --article-muted: rgba(255, 255, 255, 0.68);
    --article-shadow: 0 24px 70px rgba(0, 0, 0, .32)
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body.articles-page {
    margin: 0;
    background: var(--article-bg);
    color: var(--article-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
    transition: background .2s, color .2s
}

a {
    color: inherit
}

.articles-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

.articles-main {
    flex: 1
}

.articles-container {
    width: min(100% - 32px, 980px);
    margin-inline: auto
}

.articles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding-block: 24px
}

.articles-brand {
    text-decoration: none
}

.articles-brand strong {
    display: block;
    font-size: 1.2rem;
    color: var(--article-accent)
}

.articles-brand span {
    font-size: .76rem;
    color: var(--article-dim)
}

.theme-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid var(--article-border);
    border-radius: 50%;
    background: var(--article-surface);
    color: var(--article-text);
    cursor: pointer
}

.articles-index {
    padding: 42px 0 84px
}

.back-link {
    font-weight: 750;
    color: var(--article-accent);
    text-decoration: none
}

.index-hero {
    text-align: center;
    margin: 28px 0 48px
}

.index-hero h1 {
    font-size: clamp(2rem, 6vw, 3.4rem);
    line-height: 1.08;
    margin: 0;
    color: var(--article-accent)
}

.index-hero p {
    color: var(--article-dim)
}

.article-list {
    display: grid;
    gap: 20px
}

.article-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 22px;
    padding: 22px;
    border: 1px solid var(--article-border);
    border-radius: 22px;
    background: var(--article-surface);
    box-shadow: var(--article-shadow);
    text-decoration: none;
    transition: transform .18s, box-shadow .18s
}

.article-card:hover {
    transform: translateY(-3px)
}

.article-card img {
    width: 100%;
    height: 122px;
    object-fit: cover;
    border-radius: 14px
}

.article-card time,
.article-date {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--article-dim)
}

.article-card h2 {
    margin: .4rem 0 .35rem;
    font-size: 1.25rem
}

.article-card p {
    margin: 0;
    color: var(--article-dim)
}

.article-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 1rem;
}

.article-card-meta span {
    display: inline-flex;
    align-items: center;

    padding: .35rem .85rem;

    border-radius: 999px;

    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;

    color: var(--article-accent);

    background:
        color-mix(
            in srgb,
            var(--article-accent) 14%,
            transparent
        );

    border:
        1px solid
        color-mix(
            in srgb,
            var(--article-accent) 28%,
            transparent
        );
}

.article-card-meta time {
    margin-left: auto;

    font-size: .85rem;
    color: var(--article-muted);

    white-space: nowrap;
}

.reading-progress {
    position: fixed;
    inset: 0 0 auto;
    height: 4px;
    z-index: 1000
}

.reading-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--article-accent), var(--article-accent-2))
}

.article-layout {
    width: min(100% - 32px, 1100px);
    margin: 0 auto;
    padding: 42px 0 90px;
    display: grid;
    grid-template-columns: 220px minmax(0, 720px);
    gap: 50px;
    align-items: start;
    justify-content: center
}

.toc {
    position: sticky;
    top: 28px
}

.reading-time {
    display: inline-block;
    margin-bottom: 24px;
    padding: 6px 11px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--article-accent) 12%, transparent);
    color: var(--article-accent);
    font-size: .75rem;
    font-weight: 800
}

.toc-title {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--article-dim);
    font-weight: 800
}

.toc ul {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    border-left: 1px solid var(--article-border)
}

.toc a {
    display: block;
    padding: 6px 0 6px 16px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    text-decoration: none;
    color: var(--article-dim);
    font-size: .88rem
}

.toc a.active {
    color: var(--article-accent);
    border-color: var(--article-accent);
    font-weight: 700
}

.article-content {
    min-width: 0
}

.article-cover {
    width: 100%;
    aspect-ratio: 16/8.4;
    object-fit: cover;
    border-radius: 22px;
    border: 1px solid var(--article-border);
    box-shadow: var(--article-shadow);
    cursor: zoom-in
}

.article-header {
    margin: 26px 0 38px
}

.article-header h1 {
    font-size: clamp(2rem, 5vw, 3.35rem);
    line-height: 1.1;
    margin: .45rem 0 0
}

.article-description {
    font-size: 1.12rem;
    color: var(--article-dim)
}

.article-body {
    font-size: 1.08rem
}

.article-body h2,
.article-body h3 {
    scroll-margin-top: 30px;
    line-height: 1.25
}

.article-body h2 {
    margin: 2.8rem 0 1rem;
    font-size: 1.75rem
}

.article-body h3 {
    margin: 2rem 0 .7rem;
    font-size: 1.28rem
}

.article-body p {
    margin: 0 0 1.2rem;
    text-align: justify
}

.article-body ul,
.article-body ol {
    padding-left: 1.4rem
}

.article-body a {
    color: var(--article-accent)
}

.article-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 28px auto 8px;
    border-radius: 18px;
    border: 1px solid var(--article-border);
    cursor: zoom-in
}

.article-body em {
    display: block;
    text-align: center;
    color: var(--article-dim);
    font-size: .88rem
}

.article-body pre {
    overflow: auto;
    padding: 18px;
    border-radius: 15px;
    background: #0d1117;
    color: #e6edf3
}

.article-body code:not(pre code) {
    padding: .15em .35em;
    border-radius: .35em;
    background: color-mix(in srgb, var(--article-text) 8%, transparent)
}

.share-box {
    margin-top: 48px;
    padding-top: 26px;
    border-top: 1px solid var(--article-border)
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px
}

.share-actions a,
.copy-link {
    padding: 9px 13px;
    border: 1px solid var(--article-border);
    border-radius: 999px;
    background: var(--article-surface);
    color: var(--article-text);
    text-decoration: none;
    cursor: pointer
}


.articles-footer {
    border-top: 1px solid var(--article-border);
    padding: 40px 0;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-copy {
    color: #6b6b7c;
    font-size: .85rem;
}




.back-to-top {
    position: relative;

    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;
    padding: 0;

    border: 1px solid color-mix(in srgb,
            var(--article-accent) 70%,
            white);
    border-radius: 50%;

    background: var(--article-accent);
    color: #fff;

    box-shadow: var(--article-shadow);
    cursor: pointer;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(10px) scale(0.94);

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow:
        0 14px 34px color-mix(in srgb,
            var(--article-accent) 28%,
            transparent);
}

.back-to-top:focus-visible {
    outline: 3px solid color-mix(in srgb,
            var(--article-accent) 38%,
            transparent);
    outline-offset: 4px;
}

.image-lightbox[hidden] {
    display: none;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: grid;
    place-items: center;

    padding: clamp(20px, 4vw, 56px);

    background:
        color-mix(in srgb,
            #050507 88%,
            transparent);

    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.22s ease,
        visibility 0.22s ease;
}

.image-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.image-lightbox img {
    display: block;

    max-width: min(1500px, 94vw);
    max-height: 88vh;

    object-fit: contain;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;

    box-shadow:
        0 30px 100px rgba(0, 0, 0, 0.65);

    cursor: default;

    opacity: 0;
    transform: scale(0.94) translateY(8px);

    transition:
        opacity 0.25s ease,
        transform 0.25s cubic-bezier(0.2,
            0.8,
            0.2,
            1);
}

.image-lightbox.is-open img {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.lightbox-close {
    position: absolute;
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));

    z-index: 1;

    display: grid;
    place-items: center;
    vertical-align: middle;

    width: 46px;
    height: 46px;
    padding: 0;

    border:
        1px solid rgba(255, 255, 255, 0.2);

    border-radius: 50%;

    background:
        rgba(20, 20, 24, 0.68);

    color: #fff;

    font: inherit;
    font-size: 1.65rem;
    line-height: 1;

    cursor: pointer;

    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.3);

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.lightbox-close:hover {
    background:
        color-mix(in srgb,
            var(--article-accent) 70%,
            #15151a);

    border-color:
        color-mix(in srgb,
            var(--article-accent) 70%,
            white);

    transform: rotate(180deg) scale(1.2);
}

.lightbox-close:focus-visible {
    outline:
        3px solid color-mix(in srgb,
            var(--article-accent) 55%,
            transparent);

    outline-offset: 4px;
}

body.lightbox-open {
    overflow: hidden;
}

.zoomable-image {
    cursor: zoom-in;

    transition:
        transform 0.25s cubic-bezier(0.2,
            0.8,
            0.2,
            1),
        box-shadow 0.25s ease,
        filter 0.25s ease;
}

.zoomable-figure {
    width: 100%;
    margin: 2rem 0;
}

.zoomable-image:hover {
    transform: translateY(-3px) scale(1.008);

    filter:
        brightness(1.035) saturate(1.025);

    box-shadow:
        0 22px 55px color-mix(in srgb,
            var(--article-accent) 12%,
            rgba(0, 0, 0, 0.32));
}

.zoomable-image:focus-visible {
    outline:
        3px solid color-mix(in srgb,
            var(--article-accent) 50%,
            transparent);

    outline-offset: 5px;
}

.zoomable-image::after {
    content: "Agrandir";

    position: absolute;
    right: 14px;
    bottom: 48px;

    padding: 7px 11px;

    border:
        1px solid color-mix(in srgb,
            white 22%,
            transparent);

    border-radius: 999px;

    background:
        color-mix(in srgb,
            var(--article-bg) 76%,
            transparent);

    color: var(--article-text);

    font-size: 0.76rem;
    font-weight: 650;
    letter-spacing: 0.02em;

    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.22);

    opacity: 0;
    pointer-events: none;

    transform: translateY(6px);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}
.zoomable-image:hover::after,
.zoomable-image:focus-within::after {
  opacity: 1;
  transform: translateY(0);
}



.not-found {
    text-align: center;
    padding: 100px 20px
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px
}

.article-tags span {
    font-size: .75rem;
    padding: 5px 9px;
    border: 1px solid var(--article-border);
    border-radius: 999px;
    color: var(--article-dim)
}

@media(max-width:850px) {
    .article-layout {
        display: block;
        width: min(100% - 32px, 720px)
    }

    .toc {
        position: static;
        margin: 0 0 30px
    }

    .toc ul {
        display: flex;
        overflow: auto;
        gap: 8px;
        border: 0;
        padding-bottom: 5px
    }

    .toc li {
        flex: 0 0 auto
    }

    .toc a {
        border: 1px solid var(--article-border);
        border-radius: 999px;
        padding: 6px 10px;
        margin: 0
    }

    .toc a.active {
        border-color: var(--article-accent)
    }
}

@media(max-width:640px) {
    .articles-header {
        padding-block: 18px
    }

    .article-card {
        grid-template-columns: 1fr
    }

    .article-card img {
        height: 190px
    }

    .articles-index {
        padding-top: 24px
    }

    .article-body p {
        text-align: left
    }

    .article-layout {
        padding-top: 24px
    }

    .article-header {
        margin-bottom: 28px
    }
}

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }

    *,
    *::before,
    *::after {
        transition: none !important
    }
}

/* Palette d'accent : voir assets/css/accents.css (partagé avec la landing page) */

.theme-toggle {
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    line-height: 1
}

.theme-dock {
    position: relative;
    /* right: 18px;
    bottom: 18px; */
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--article-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--article-bg) 82%, transparent);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .18)
}

.theme-dock button {
    position: relative;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--article-dim);
    cursor: pointer
}

.theme-dock button:hover,
.theme-dock button[aria-pressed="true"] {
    color: var(--article-text);
    background: color-mix(in srgb, var(--article-text) 8%, transparent)
}

.theme-dock .accent-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--dot);
    box-shadow: 0 0 0 1px var(--article-border)
}

.theme-separator {
    width: 1px;
    height: 24px;
    background: var(--article-border)
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    margin-left: auto;
    border: 1px solid var(--article-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--article-text) 4%, transparent);
    flex-shrink: 0;
}

.language-switcher button {
    min-width: 34px;
    padding: 5px 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--article-dim);
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
}

.language-switcher button[aria-pressed="true"] {
    background: var(--gradient-brand);
    color: #08080d;
}

.language-switcher button:hover:not([aria-pressed="true"]) {
    color: var(--article-text);
}

@media(max-width:640px) {
    .flotting_actions {
        right: 12px;
        bottom: 12px;
    }
}

.share-box {
    text-align: center;
    align-items: center;
    justify-content: center;
}

.social-links {
    text-align: center;
    align-items: center;
    justify-content: center;
}

.social-links a {
    text-align: center;
    align-items: center;
    justify-content: center;
}

.social-btn {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    transition: all .3s var(--ease);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

.social-btn:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}


.container {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: 24px;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
}

.logo-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--gradient-brand);
    color: #08080d;
    font-size: .8rem;
    font-weight: 700;
}

.flotting_actions {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 90;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;

    transition: transform 0.2s ease;
}

.article-body table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--article-border);
    border-radius: 16px;
    background: var(--article-surface);
    box-shadow: var(--article-shadow);
}

.article-body thead {
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--article-accent) 16%, transparent),
            color-mix(in srgb, var(--article-accent) 6%, transparent));
}

.article-body th,
.article-body td {
    padding: 1rem 1.15rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--article-border);
}

.article-body th {
    color: var(--article-text);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.article-body td {
    color: var(--article-muted);
    line-height: 1.6;
}

.article-body tbody tr:last-child td {
    border-bottom: 0;
}

.article-body tbody tr {
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.article-body tbody tr:hover {
    background:
        color-mix(in srgb,
            var(--article-accent) 7%,
            transparent);
}

.article-body td+td,
.article-body th+th {
    border-left: 1px solid var(--article-border);
}

.article-table-wrapper {
    width: 100%;
    margin: 2rem 0;
    overflow-x: auto;
    border-radius: 16px;
    scrollbar-width: thin;
    scrollbar-color:
        var(--article-accent) transparent;
}

.article-table-wrapper table {
    margin: 0;
    min-width: 640px;
}

.article-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.article-table-wrapper::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--article-accent);
}

.article-table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

/**
 * Article list skeleton loader
 * Primitives génériques (.sr-only, .skeleton, .skeleton-line...)
 * mutualisées dans assets/css/skeleton.css
 */

.article-card-skeleton {
  pointer-events: none;
  cursor: default;
}

.article-card-skeleton .skeleton-image {
  min-height: 190px;
}

.articles-loaded .article-card {
  animation: card-reveal 450ms ease both;
}

.articles-loaded .article-card:nth-child(2) {
  animation-delay: 60ms;
}

.articles-loaded .article-card:nth-child(3) {
  animation-delay: 120ms;
}

.articles-loaded .article-card:nth-child(4) {
  animation-delay: 180ms;
}

.articles-loaded .article-card:nth-child(5) {
  animation-delay: 240ms;
}

@media (prefers-reduced-motion: reduce) {
  .articles-loaded .article-card {
    animation: none;
  }
}