:root {
    --bg-color: #0a0a0a;
    --bg-secondary: #141414;
    --text-color: #f0f0f0;
    --text-light: #a0a0a0;
    --accent-color: #c41e3a;
    --accent-dark: #8b0000;
    --accent-light: #2a1414;
    --border-color: #333;
    --card-bg: #1a1a1a;
    --font-heading: 'Noto Serif', Georgia, 'Times New Roman', serif;
    --font-body: 'Noto Sans', Helvetica, Arial, sans-serif;
    --scroll-margin: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hidden by default, shown only when JS has loaded */
.js-only { display: none; }

html {
    background: #0a0a0a;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--text-color);
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    scrollbar-gutter: stable;
}

/* ── Main — bloc unique (F5) ─────────────────────────────────────────────── */
main {
    flex: 1;
    contain: layout style;
    max-width: 1100px;
    width: calc(100vw - 17px);
    margin: 0 auto;
    padding: 3rem 50px;
    padding-bottom: 3rem;
    min-height: 80vh;
    background: transparent;
    border-radius: 8px;
}

@media (max-width: 1117px) {
    main { width: 100%; }
}

@media (max-width: 700px) {
    main { padding: 2rem 20px; }
}

header {
    background: linear-gradient(180deg, #0a0a0a 0%, #141414 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

nav.nav-centered {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

nav.nav-centered .menu-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.logo-container {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-top: 5px;
    height: 50px;
    box-sizing: border-box;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 50px;
    height: 50px;
    box-sizing: border-box;
}

.logo .title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    letter-spacing: 0.05em;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 44px;
    height: 35px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 5px;
    gap: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--accent-color);
    transition: transform 0.3s;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-scroll-indicator {
    display: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

#content:empty {
min-height: 200px;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: normal;
    color: var(--text-color);
    line-height: 1.4;
}

h1 {
    font-size: 1.6rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

h1.post-title {
    font-size: 2.2rem;
    text-align: center;
    margin-top: -25px;
    margin-bottom: 1.5rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    color: var(--accent-color);
    border-bottom: none;
}

h2 {
    font-size: 1.2rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    font-weight: bold;
}

h3 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 4rem 20px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-color) 100%);
    margin: -3rem -20px 3rem;
    border-bottom: 2px solid var(--accent-color);
    contain: layout;
}

.hero .container {
    text-align: center;
}

.hero-logo {
    width: 100%;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.tagline {
    font-style: italic;
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background: var(--accent-dark);
    text-decoration: none;
}

/* ── Posts grid ───────────────────────────────────────────────────────────── */

.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 2rem;
    margin-top: 2rem;
    width: 100%;
    align-items: stretch;
    justify-items: center;
}

.posts-grid:has(.post-card) {
    justify-content: center;
}

@media (max-width: 700px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 440px;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
    justify-self: center;
}

/* Applied only to off-screen cards — avoids CLS on initially visible cards */
.post-card.cv-lazy {
    content-visibility: auto;
    contain-intrinsic-size: 0 380px;
}

.post-card:hover {
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.2);
    transform: translateY(-2px);
}

.post-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.post-card .post-image-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
}

.post-card .post-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card .post-image-container a {
    display: block;
    width: 100%;
    height: 100%;
}

.post-card .post-image-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    background: var(--card-bg);
}

.post-image-loading {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(90deg, var(--card-bg) 0%, #2a2a2a 50%, var(--card-bg) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.post-card .image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    padding: 2rem 1rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s;
}

.post-card .post-image-container:hover .image-overlay {
    opacity: 1;
}

.post-card .post-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.post-card .post-content > *:last-child {
    margin-top: auto;
}

.post-card .post-content h2,
.post-card .post-content h3 {
    margin: 0.5rem 0;
}

.post-card .post-content p {
    flex: 1;
    margin: 0.5rem 0;
}

.post-date {
    font-size: 0.85rem;
    color: #c0c0c0;
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.post-card h3 {
    margin: 0.5rem 0;
    font-size: 1.2rem;
}

.post-card h3 a,
.post-card h2 a {
    color: #fff !important;
    text-decoration: none;
}

.post-card h3 a:hover,
.post-card h2 a:hover {
    color: var(--accent-color) !important;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    color: #e8455f;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.read-more:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.post-card .post-content > p a {
    color: #fff;
    text-decoration: none;
}

.post-card .post-content > p a:hover {
    color: var(--accent-color);
}

/* ── Post full ────────────────────────────────────────────────────────────── */

.post-full > img:first-child {
    max-height: 400px;
    width: auto;
}

.post-full img {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 600px;
    border-radius: 6px;
    margin: 1.5rem auto;
    display: block;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.15);
}

.post-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.post-header h1 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.post-body {
    line-height: 1.9;
    font-size: 1.05rem;
    text-align: justify;
    overflow: visible;
}

.post-body p {
    margin-bottom: 1.2rem;
}

.post-body > * + * {
    margin-top: 1.5rem;
}

.post-body img {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 500px;
    border-radius: 6px;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.1);
}

.post-body > p:has(img) {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 1rem;
}

.post-body > p:has(img) img {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 250px;
    margin: 0;
    cursor: pointer;
    border-radius: 4px;
}

.post-body h2 {
    text-align: left;
    margin-top: 2.5rem;
}

.post-body h3 {
    text-align: left;
    margin-top: 2rem;
}

.post-body ul, .post-body ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.post-body li {
    margin-bottom: 0.5rem;
}

.post-body ul li {
    list-style-type: disc;
}

.post-body ol li {
    list-style-type: decimal;
}

.post-body ul ul, .post-body ol ol, .post-body ul ol, .post-body ol ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.post-body blockquote {
    border-left: 3px solid var(--accent-color);
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-light);
    background: var(--accent-light);
    padding: 1rem 1rem 1rem 1.5rem;
    border-radius: 0 4px 4px 0;
}

.post-body table,
.presentation .content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-body table th,
.post-body table td,
.presentation .content table th,
.presentation .content table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.post-body table th,
.presentation .content table th {
    background: var(--accent-light);
    font-weight: 600;
    color: #fff;
}

/* Image captions */
.post-body figure {
    margin: 2rem auto;
    text-align: center;
    max-width: 100%;
    display: block;
}

.post-body figure img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    max-height: 600px;
}

.post-body figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

/* Centered images */
.post-body figure.img-centered {
    max-width: 100%;
    margin: 1rem 0;
}

/* Side images */
.post-body figure.img-side-left,
.post-body figure.img-side-right {
    width: 45%;
    max-width: 400px;
    margin: 1rem 1rem;
}

.post-body figure.img-side-left {
    float: left;
    margin-right: 20px;
}

.post-body figure.img-side-right {
    float: right;
    margin-left: 20px;
}

.post-body .paragraph:has(> figure.img-side-right:last-child),
.post-body .paragraph:has(> p > figure.img-side-right:last-child) {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    justify-content: flex-start;
}

.post-body .paragraph:has(> figure.img-side-right:last-child) > figure.img-side-right,
.post-body .paragraph:has(> p > figure.img-side-right:last-child) > p > figure.img-side-right {
    margin-left: 20px;
    margin-right: 20px;
}

.post-body .paragraph .para-text {
    flex: 1;
}

.post-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.back-link {
    color: #e05570;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--accent-color);
    text-align: center;
    contain: content;
    flex-shrink: 0;
    padding: 0.5rem 0.25rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copyright {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1;
    margin: 0.5rem 0;
}

footer .address {
    color: var(--text-light);
    font-size: 0.8rem;
    line-height: 1.2;
    margin: 0 0 0.5rem 0;
    opacity: 0.8;
}

/* ── Events ───────────────────────────────────────────────────────────────── */

.events-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.event-card {
    display: flex;
    gap: 1.5rem;
    background: var(--card-bg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.3s;
}

.event-card:hover {
    border-color: var(--accent-color);
}

.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 0.75rem;
    background: var(--accent-color);
    color: white;
    border-radius: 4px;
    flex-shrink: 0;
}

.event-date .day {
    font-size: 1.8rem;
    font-weight: bold;
    line-height: 1;
}

.event-date .month {
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.event-details h3 {
    margin-top: 0;
    color: var(--text-color);
}

.event-details h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.event-details h3 a:hover {
    color: var(--accent-color);
}

/* ── Présentation ─────────────────────────────────────────────────────────── */

.presentation {
    text-align: center;
    padding: 2rem 0;
    contain: layout;
    scroll-margin-top: var(--scroll-margin);
}

.presentation .content {
    max-width: none;
    margin: 0 auto;
    text-align: left;
}

.presentation .content > p,
.presentation .content > h1,
.presentation .content > h2,
.presentation .content > h3,
.presentation .content > blockquote,
.presentation .content > ul,
.presentation .content > ol {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.presentation .content ul,
.presentation .content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.presentation .content li {
    margin-bottom: 0.5rem;
}

.presentation .content ul li {
    list-style-type: disc;
}

.presentation .content ol li {
    list-style-type: decimal;
}

.presentation .content ul ul,
.presentation .content ol ol,
.presentation .content ul ol,
.presentation .content ol ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.presentation .content blockquote {
    border-left: 3px solid var(--accent-color);
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-light);
    background: var(--accent-light);
    padding: 1rem 1rem 1rem 1.5rem;
    border-radius: 0 4px 4px 0;
}

.presentation .content > img {
    max-width: 100%;
    width: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 6px;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.15);
}

.no-posts, .no-events {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 2rem;
}

/* ── Responsive — bloc unique (F5) ───────────────────────────────────────── */

@media (max-width: 1100px) {
    /* — Header / Navigation — */
    header {
        padding: 0.5rem 0;
    }

    .logo-img {
        height: 35px;
    }

    nav.nav-centered {
        position: relative;
        flex-direction: column;
        align-items: center;
    }

    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        width: 44px;
        height: 35px;
        padding-top: 5px;
        gap: 5px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        gap: 0;
        padding: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        z-index: 999;
        max-height: 60vh;
        overflow-y: auto;
    }

    .nav-links.active {
        display: flex;
        margin-top: 8px;
    }

    .nav-links li {
        border-top: 1px solid var(--border-color);
    }

    .nav-links a {
        display: block;
        padding: 1rem 0;
        border-bottom: none;
    }

    /* — Scroll indicator — */
    .nav-scroll-indicator {
        display: none;
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        color: var(--accent-color);
        font-size: 16px;
        animation: scrollHint 1.5s infinite;
        z-index: 1000;
        pointer-events: auto;
        background: var(--bg-secondary);
        padding: 4px 10px;
        border-radius: 10px;
    }

    .nav-scroll-indicator.show {
        display: block;
    }

    .nav-scroll-indicator.top {
        top: 20%;
    }

    .nav-scroll-indicator.bottom {
        bottom: 40%;
    }

    /* — Hero — */
    .hero h1 {
        font-size: 2rem;
    }

    /* — Main — */
    main {
        padding: 2rem 15px;
    }

    /* — Events — */
    .event-card {
        flex-direction: column;
    }

    .event-date {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }

    .event-date .day {
        font-size: 1.4rem;
    }
}

@keyframes scrollHint {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* ── Photos ───────────────────────────────────────────────────────────────── */

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.photo-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-loading {
    background: var(--card-bg);
    cursor: default;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.photo-placeholder::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, var(--card-bg) 0%, #2a2a2a 50%, var(--card-bg) 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.photo-loaded img {
    animation: fadeIn 0.4s ease;
}

/* ── Lazy loading Markdown ────────────────────────────────────────────────── */

.markdown-loading {
    min-height: 200px;
}

.markdown-placeholder {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.markdown-placeholder::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, var(--card-bg) 0%, #2a2a2a 50%, var(--card-bg) 100%);
    animation: shimmer 1.5s infinite;
}

.content-loaded {
    animation: fadeIn 0.4s ease;
}

/* ── Lazy loading Posts ───────────────────────────────────────────────────── */

.post-loading {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: default;
    display: flex;
    flex-direction: column;
    min-height: 380px;
    contain: layout;
}

.post-loading img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: linear-gradient(90deg, var(--card-bg) 25%, #2a2a2a 50%, var(--card-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
}

.post-placeholder {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.post-placeholder::before {
    content: '';
    position: absolute;
    top: 1.5rem; left: 1.5rem; right: 1.5rem;
    height: 1rem;
    background: linear-gradient(90deg, var(--card-bg) 0%, #2a2a2a 50%, var(--card-bg) 100%);
    border-radius: 4px;
    animation: shimmer 1.5s infinite;
}

.post-placeholder::after {
    content: '';
    display: block;
    width: 60%;
    height: 1.2rem;
    margin-top: auto;
    position: relative;
    background: linear-gradient(90deg, var(--card-bg) 0%, #2a2a2a 50%, var(--card-bg) 100%);
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.post-loaded {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.photo-error {
    color: var(--text-light);
    font-size: 1.5rem;
}

/* ── Year filter ──────────────────────────────────────────────────────────── */

.year-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.year-filter a {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s;
}

.year-filter a:hover,
.year-filter a.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */

.lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.92);
}

.lightbox.active { display: block; }

body.lightbox-open { overflow: hidden; }

.lightbox-frame {
    position: absolute;
    top: 48px;
    bottom: 40px;
    left: 52px;
    right: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 8px; right: 8px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active .lightbox-close { display: flex; }

.lightbox-counter {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 40px;
    line-height: 40px;
    text-align: center;
    color: #fff;
    font-size: 14px;
    background: rgba(0,0,0,0.6);
    display: none;
}

.lightbox.active .lightbox-counter { display: block; }

.lightbox-nav {
    position: absolute;
    top: 48px; bottom: 40px;
    width: 52px;
    background: rgba(0,0,0,0.3);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active .lightbox-nav { display: flex; }
.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }

.lightbox-close:hover { background: var(--accent-color); }
.lightbox-nav:hover   { background: rgba(0,0,0,0.6); color: var(--accent-color); }

/* ── Formulaire de contact ────────────────────────────────────────────────── */

.contact-form {
    background: var(--card-bg);
    padding: 2.5rem;
    margin: 2rem 0;
    border: 5px solid #000000;
    border-radius: 15px;
    box-shadow: inset 0 0 25px rgba(196, 30, 58, 0.5);
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
}

.form-group:last-child {
    margin-bottom: 0;
}

.contact-form .form-group label {
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-color);
    font-size: 1rem;
    font-family: var(--font-body);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* ── Alertes ──────────────────────────────────────────────────────────────── */

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #1a3a1a;
    border: 1px solid #2a5a2a;
    color: #8f8;
    text-align: center;
}

.alert-success h3 {
    color: #8f8;
    margin-bottom: 0.5rem;
}

.alert-error {
    background: #3a1a1a;
    border: 1px solid #5a2a2a;
    color: #f88;
}

/* ── Messages d'erreur ────────────────────────────────────────────────────── */

.error-message {
    background: var(--card-bg);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.error-message h2 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    border: none;
}

.error-message p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.error-message .error-hint {
    font-size: 0.9rem;
    color: var(--text-light);
}

.error-message .error-detail {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-light);
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 4px;
    text-align: left;
    word-break: break-all;
}

/* ── Scroll progress & back to top ───────────────────────────────────────── */

.scroll-to-top-btn {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    right: 20px;
    bottom: 100px;
    z-index: 99999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: none;
    padding: 0;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: auto;
    cursor: pointer;
    display: flex;
}

.scroll-to-top-btn.visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.scroll-to-top-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.scroll-progress-circle {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
    display: block;
}

.scroll-progress-circle circle {
    fill: none;
    stroke-width: 3;
}

.scroll-progress-bg {
    stroke: rgba(51, 51, 51, 0.3);
}

.scroll-progress-fill {
    stroke: rgba(196, 30, 58, 0.6);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s ease-out;
}

@media (max-width: 768px) {
    .scroll-to-top-btn {
        right: 10px;
        width: 36px;
        height: 36px;
    }
    .scroll-progress-circle circle {
        stroke-width: 2.5;
    }
}

/* ── Bandeau d'annonces ───────────────────────────────────────────────────── */

@keyframes highlight-slidein {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

@keyframes highlight-fade {
    0%   { opacity: 0; transform: translateY(-4px); }
    100% { opacity: 1; transform: translateY(0);    }
}

.highlight-banner {
    display: none;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(90deg, var(--accent-dark) 0%, #1a0a0a 100%);
    padding: 0.45rem 1rem;
    font-size: 0.88rem;
    min-height: 36px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 8px;
}

.highlight-banner.highlight-visible {
    display: flex;
    animation: highlight-slidein 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.highlight-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.highlight-msg {
    flex: 1;
    text-align: center;
    color: #f0d0d0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.highlight-msg.is-fading {
    animation: highlight-fade 0.4s ease both;
}

.highlight-msg a {
    color: #f0d0d0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.highlight-msg a:hover {
    color: #fff;
}

.highlight-dots {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.h-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: background 0.3s;
    display: inline-block;
}

.h-dot-active {
    background: var(--accent-color);
}

.highlight-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0 0.25rem;
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.2s;
}

.highlight-close:hover {
    color: #fff;
}
