:root {
    --ink: #172033;
    --ink-soft: #53606f;
    --ivory: #fbf8f1;
    --paper: #ffffff;
    --turquoise: #176b68;
    --turquoise-light: #d8efec;
    --border: #d8dde5;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--ivory);
    font-family: Inter, Arial, sans-serif;
}

a {
    color: var(--turquoise);
    text-underline-offset: 0.18em;
}

.reading-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.reading-header img {
    display: block;
    width: min(230px, 58vw);
    height: auto;
}


.work-overview,
.chapter-reading {
    width: min(760px, calc(100% - 40px));
    margin: 0 auto;
    padding: clamp(3rem, 8vw, 6rem) 0;
}

.reading-kicker {
    margin: 0 0 0.8rem;
    color: var(--turquoise);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.work-overview h1,
.chapter-reading h1 {
    margin: 0;
    font-family: Literata, Georgia, serif;
    font-size: clamp(2.6rem, 7vw, 5rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.work-author,
.chapter-reading header > p:last-child {
    color: var(--ink-soft);
}

.work-summary {
    margin: 2rem 0;
    color: #2f3c52;
    font-family: Literata, Georgia, serif;
    font-size: 1.15rem;
    line-height: 1.75;
}

.owner-preview {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    color: #144f4d;
    background: var(--turquoise-light);
    border-left: 4px solid var(--turquoise);
    border-radius: 8px;
    font-weight: 700;
}

.reading-chapters {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.reading-chapters h2 {
    font-family: Literata, Georgia, serif;
}

.reading-chapters ol {
    display: grid;
    gap: 0.8rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.reading-chapters li a {
    display: grid;
    gap: 0.3rem;
    padding: 1rem 1.1rem;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
}

.reading-chapters li a:hover {
    border-color: var(--turquoise);
}

.reading-chapters span,
.reading-chapters small {
    color: var(--ink-soft);
}

.empty-reading {
    padding: 1.2rem;
    color: var(--ink-soft);
    background: var(--paper);
    border: 1px dashed #aeb7c4;
    border-radius: 10px;
}

.reading-breadcrumb {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.chapter-reading header {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.reading-text {
    padding: 2.5rem 0;
    font-family: Literata, Georgia, serif;
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    line-height: 1.9;
}

.chapter-reading-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.reading-footer {
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto;
    padding: 2rem 0;
    color: var(--ink-soft);
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    text-align: center;
}

@media (max-width: 560px) {
    .reading-header,
    .work-overview,
    .chapter-reading,
    .reading-footer {
        width: min(100% - 28px, 760px);
    }

    .work-overview,
    .chapter-reading {
        padding-top: 2.5rem;
    }
}

/* Catalogue public et recherche */

.discovery-page {
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto;
    padding: clamp(3rem, 7vw, 5rem) 0;
}

.discovery-introduction {
    max-width: 760px;
}

.discovery-introduction h1 {
    margin: 0;
    font-family: Literata, Georgia, serif;
    font-size: clamp(2.8rem, 7vw, 5rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.discovery-introduction > p:last-child {
    color: var(--ink-soft);
    font-size: 1.1rem;
    line-height: 1.7;
}

.discovery-search {
    max-width: 760px;
    margin: 2.5rem 0;
}

.discovery-search label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.discovery-search > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
}

.discovery-search input {
    width: 100%;
    padding: 0.85rem 1rem;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid #aeb7c4;
    border-radius: 9px;
    font: inherit;
}

.discovery-search input:focus {
    border-color: var(--turquoise);
    outline: 3px solid rgba(23, 107, 104, 0.18);
}

.discovery-search button {
    padding: 0.85rem 1.2rem;
    color: var(--paper);
    background: var(--turquoise);
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-weight: 800;
}

.discovery-results-heading,
.discovery-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.discovery-results-heading {
    margin-bottom: 1.25rem;
}

.discovery-results-heading h2 {
    margin: 0;
    font-family: Literata, Georgia, serif;
}

.discovery-results-heading > span,
.discovery-card-heading > span {
    padding: 0.3rem 0.7rem;
    color: #176b68;
    background: #d8efec;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.discovery-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(min(100%, 280px), 1fr)
    );
    gap: 1rem;
}

.discovery-card {
    display: flex;
    min-width: 0;
    padding: 1.3rem;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.discovery-card-heading small,
.discovery-author,
.discovery-summary {
    color: var(--ink-soft);
}

.discovery-card h3 {
    margin: 1.1rem 0 0.35rem;
    font-family: Literata, Georgia, serif;
    font-size: 1.4rem;
}

.discovery-card h3 a {
    color: var(--ink);
}

.discovery-author {
    margin: 0;
    font-size: 0.9rem;
}

.discovery-summary {
    margin: 1rem 0;
    line-height: 1.6;
}

.discovery-read-link {
    margin-top: auto;
    padding-top: 0.5rem;
    font-weight: 800;
}

.empty-discovery {
    padding: 2rem;
    color: var(--ink-soft);
    background: var(--paper);
    border: 1px dashed #aeb7c4;
    border-radius: 12px;
    text-align: center;
}

.muted-reading {
    font-style: italic;
}

@media (max-width: 560px) {
    .discovery-page {
        width: min(100% - 28px, 1080px);
    }

    .discovery-search > div {
        grid-template-columns: 1fr;
    }

    .discovery-search button {
        width: 100%;
    }
}

/* Commentaires sur une publication */

.chapter-comments {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}

.comments-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.comments-heading h2,
.comments-heading p {
    margin: 0;
}

.comments-heading h2 {
    margin-top: 0.15rem;
    font-family: Literata, Georgia, serif;
}

.comments-heading > span {
    padding: 0.3rem 0.7rem;
    color: #176b68;
    background: #d8efec;
    border-radius: 999px;
    font-weight: 700;
}

.comment-form {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.comment-form label {
    font-weight: 700;
}

.comment-form textarea {
    width: 100%;
    padding: 0.85rem;
    color: var(--ink);
    background: #fffefb;
    border: 1px solid #aeb7c4;
    border-radius: 9px;
    font: inherit;
    line-height: 1.55;
    resize: vertical;
}

.comment-form textarea:focus {
    border-color: var(--turquoise);
    outline: 3px solid rgba(23, 107, 104, 0.18);
}

.comment-form button {
    justify-self: start;
    padding: 0.8rem 1rem;
    color: var(--paper);
    background: var(--turquoise);
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-weight: 800;
}

.comment-success,
.comment-error {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 9px;
}

.comment-success {
    color: #185c42;
    background: #ddf3e8;
}

.comment-error {
    color: #8d1930;
    background: #fbe4e8;
}

.comment-list {
    display: grid;
    gap: 0.9rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.comment-card {
    padding: 1rem 1.1rem;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.comment-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0;
    border: 0;
}

.comment-card time {
    color: var(--ink-soft);
    font-size: 0.8rem;
}

.comment-card p {
    margin: 0.8rem 0 0;
    line-height: 1.65;
}

.empty-comments,
.comment-login {
    padding: 1rem;
    color: var(--ink-soft);
    background: var(--paper);
    border: 1px dashed #aeb7c4;
    border-radius: 9px;
}

@media (max-width: 560px) {
    .comment-card header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    .comment-form button {
        width: 100%;
    }
}

/* Annotations sur les passages */

.reading-text {
    white-space: pre-wrap;
}

.chapter-annotations {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}

.annotation-form {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.selection-preview {
    max-height: 9rem;
    margin: 0 0 0.5rem;
    padding: 0.9rem 1rem;
    overflow: auto;
    color: #775012;
    background: #f8e8c8;
    border-left: 4px solid #d9952f;
    border-radius: 8px;
    font-family: Literata, Georgia, serif;
    line-height: 1.55;
}

.annotation-form label {
    font-weight: 700;
}

.annotation-form textarea {
    width: 100%;
    padding: 0.85rem;
    color: var(--ink);
    background: #fffefb;
    border: 1px solid #aeb7c4;
    border-radius: 9px;
    font: inherit;
    resize: vertical;
}

.annotation-form button {
    justify-self: start;
    padding: 0.8rem 1rem;
    color: var(--paper);
    background: var(--turquoise);
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-weight: 800;
}

.annotation-form button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.annotation-list {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.annotation-card {
    padding: 1rem 1.1rem;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.annotation-card blockquote {
    margin: 0;
    padding: 0.8rem 1rem;
    color: #2f3c52;
    background: #fbf8f1;
    border-left: 4px solid var(--turquoise);
    font-family: Literata, Georgia, serif;
    line-height: 1.55;
}

.annotation-card > p {
    margin: 1rem 0;
    line-height: 1.65;
}

.annotation-card footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--ink-soft);
    font-size: 0.82rem;
}

@media (max-width: 560px) {
    .annotation-form button {
        width: 100%;
    }

    .annotation-card footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Bulle contextuelle des annotations */

.annotation-form.annotation-bubble {
    position: fixed;
    z-index: 1000;
    display: none;
    width: min(410px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    margin: 0;
    padding: 1.1rem;
    overflow: auto;
    background: #ffffff;
    border: 1px solid #aeb7c4;
    border-radius: 14px;
    box-shadow:
        0 18px 50px rgba(23, 32, 51, 0.22),
        0 4px 12px rgba(23, 32, 51, 0.12);
}

.annotation-form.annotation-bubble.is-open {
    display: grid;
    animation: annotation-bubble-appearance 140ms ease-out;
}

.annotation-bubble::after {
    position: fixed;
    width: 14px;
    height: 14px;
    content: "";
    background: #ffffff;
    border-right: 1px solid #aeb7c4;
    border-bottom: 1px solid #aeb7c4;
    transform: translateX(-50%) rotate(45deg);
}

.annotation-bubble[data-placement="above"]::after {
    bottom: -8px;
    left: 50%;
}

.annotation-bubble[data-placement="below"]::after {
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(225deg);
}

.annotation-bubble-close {
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    display: grid;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: #53606f;
    background: transparent;
    border: 0;
    border-radius: 50%;
    place-items: center;
    font-size: 1.45rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
}

.annotation-bubble-close:hover {
    color: #172033;
    background: #f1f3f6;
}

.annotation-bubble-close:focus-visible {
    outline: 3px solid #0b6bcb;
    outline-offset: 2px;
}

.annotation-bubble .selection-preview {
    max-height: 5.5rem;
    margin-right: 2rem;
}

.annotation-bubble textarea {
    min-height: 6rem;
    max-height: 12rem;
}

@keyframes annotation-bubble-appearance {
    from {
        opacity: 0;
        transform: translateY(5px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 560px) {
    .annotation-form.annotation-bubble {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        padding: 1rem;
    }

    .annotation-bubble .selection-preview {
        max-height: 4.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .annotation-form.annotation-bubble.is-open {
        animation: none;
    }
}

/* Boutons de bibliothèque personnelle */

.reading-library-action {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 1.5rem 0 2rem;
}

.reading-library-action form {
    margin: 0;
}

.reading-library-action button {
    padding: 0.78rem 1rem;
    color: #ffffff;
    background: #176b68;
    border: 1px solid #176b68;
    border-radius: 9px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.reading-library-action button:hover {
    background: #105451;
}

.reading-library-message {
    margin-bottom: 1.25rem;
    padding: 0.9rem 1rem;
    color: #18583f;
    background: #ddf3e8;
    border-radius: 9px;
}

.reading-library-error {
    color: #8f1c31;
    background: #fbe4e8;
}

@media (max-width: 560px) {
    .reading-library-action,
    .reading-library-action form,
    .reading-library-action button {
        width: 100%;
    }
}

/* Page publique d’un auteur */

.author-page {
    width: min(100% - 40px, 1080px);
    margin: 3rem auto 5rem;
}

.author-profile,
.author-about,
.author-publications {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 16px 45px rgba(23, 32, 51, 0.08);
}

.author-profile {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
    padding: 2rem;
}

.author-profile__identity {
    min-width: 0;
}

.author-monogram {
    display: grid;
    width: 88px;
    height: 88px;
    color: var(--paper);
    background:
        linear-gradient(
            145deg,
            var(--turquoise),
            #172033
        );
    border-radius: 50%;
    place-items: center;
    font-family: Literata, Georgia, serif;
    font-size: 2.2rem;
    font-weight: 800;
}

.author-profile h1 {
    margin: 0.25rem 0 0.6rem;
    overflow-wrap: anywhere;
    font-family: Literata, Georgia, serif;
    font-size: clamp(2rem, 5vw, 3.4rem);
}

.author-member-since {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.88rem;
}

.author-edit-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--turquoise);
    font-weight: 800;
    text-underline-offset: 0.18em;
}

.author-section-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.author-section-navigation a {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.9rem;
    color: var(--ink);
    background: var(--paper-soft);
    border-radius: 10px;
    font-weight: 800;
    text-decoration: none;
}

.author-section-navigation a:hover,
.author-section-navigation a:focus-visible {
    color: var(--turquoise);
    background: #e8f5f4;
}

.author-section-navigation span {
    min-width: 1.7rem;
    padding: 0.15rem 0.4rem;
    color: var(--paper);
    background: var(--turquoise);
    border-radius: 999px;
    text-align: center;
    font-size: 0.78rem;
}

.author-about,
.author-publications {
    scroll-margin-top: 1rem;
    padding: 1.6rem;
}

.author-section-heading {
    margin-bottom: 1rem;
}

.author-section-heading h2,
.author-publications h2 {
    margin: 0.2rem 0 0;
    font-family: Literata, Georgia, serif;
}

.author-presentation {
    max-width: 72ch;
    color: var(--ink-soft);
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.author-publications {
    margin-top: 1.5rem;
}

.discovery-author a,
.work-author a {
    color: var(--turquoise);
    font-weight: 700;
    text-underline-offset: 0.18em;
}

/* Actions de suivi d’un auteur */

.author-follow-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.2rem;
}

.author-follow-actions form {
    margin: 0;
}

.author-follow-actions button {
    padding: 0.75rem 1rem;
    color: #ffffff;
    background: #176b68;
    border: 1px solid #176b68;
    border-radius: 9px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.author-follow-actions button:hover {
    background: #105451;
}

.author-follow-actions button.is-following {
    color: #176b68;
    background: #ffffff;
}

.author-follow-message {
    margin-top: 1rem;
    padding: 0.8rem 0.9rem;
    color: #18583f;
    background: #ddf3e8;
    border-radius: 9px;
}

.author-follow-error {
    color: #8f1c31;
    background: #fbe4e8;
}

@media (max-width: 620px) {
    .author-page {
        width: min(100% - 28px, 1080px);
        margin-top: 1.5rem;
    }

    .author-profile {
        grid-template-columns: 1fr;
        padding: 1.35rem;
    }

    .author-monogram {
        width: 68px;
        height: 68px;
        font-size: 1.7rem;
    }

    .author-section-navigation a {
        flex: 1 1 auto;
        justify-content: center;
    }

    .author-about,
    .author-publications {
        padding: 1.25rem;
    }
}

@media (max-width: 560px) {
    .author-follow-actions,
    .author-follow-actions form,
    .author-follow-actions button {
        width: 100%;
    }
}


/* Signalement d’un contenu publié */

.chapter-reading-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.report-content-link {
    color: #8c1d31;
    font-size: 0.9rem;
    font-weight: 700;
}

.report-content-link:hover {
    color: #b4233a;
}

.report-content-link:focus-visible {
    outline: 3px solid #0b6bcb;
    outline-offset: 3px;
}


/* Signalement des retours communautaires */

.report-feedback-link {
    display: inline-flex;
    margin-top: 0.75rem;
    color: #8c1d31;
    font-size: 0.84rem;
    font-weight: 700;
}

.report-feedback-link:hover {
    color: #b4233a;
}

.report-feedback-link:focus-visible {
    outline: 3px solid #0b6bcb;
    outline-offset: 3px;
}

/* Confort de lecture et progression */

.reading-primary-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem 1rem;
    margin: 2rem 0;
}

.reading-primary-action a {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.1rem;
    border-radius: 9px;
    color: #ffffff;
    background: var(--turquoise);
    font-weight: 800;
    text-decoration: none;
}

.reading-primary-action a:hover,
.reading-primary-action a:focus-visible {
    background: #105653;
}

.reading-primary-action small {
    color: var(--ink-soft);
    font-weight: 700;
}

.reading-progress-marker {
    color: #176b68;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 800;
}

.chapter-sequence-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 2rem 0 0;
}

.chapter-sequence-navigation a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--ink);
    background: var(--paper);
    font-weight: 750;
    text-decoration: none;
}

.chapter-sequence-navigation a:last-child {
    grid-column: 2;
    text-align: right;
}

.chapter-sequence-navigation a:hover,
.chapter-sequence-navigation a:focus-visible {
    color: var(--turquoise);
    border-color: var(--turquoise);
}

.reading-feedback {
    overflow: visible;
}

.reading-feedback-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--ink);
    background: var(--paper);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.reading-feedback-toggle::-webkit-details-marker {
    display: none;
}

.reading-feedback-toggle::after {
    content: "Masquer";
    color: var(--turquoise);
    font-size: 0.8rem;
}

.reading-feedback:not([open]) .reading-feedback-toggle::after {
    content: "Afficher";
}

.reading-feedback-toggle > span {
    margin-left: auto;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    color: #176b68;
    background: #d8efec;
}

@media (max-width: 560px) {
    .reading-primary-action,
    .reading-primary-action a {
        width: 100%;
    }

    .chapter-sequence-navigation {
        grid-template-columns: 1fr;
    }

    .chapter-sequence-navigation a,
    .chapter-sequence-navigation a:last-child {
        grid-column: 1;
    }

    .reading-feedback-toggle {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

/* Discussion générale d’une œuvre */

.work-discussion {
    margin-top: 2rem;
    padding: 1.6rem;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 16px 45px rgba(23, 32, 51, 0.08);
    scroll-margin-top: 1rem;
}

.work-discussion-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.work-discussion-heading h2 {
    margin: 0.2rem 0 0;
    font-family: Literata, Georgia, serif;
}

.work-discussion-heading > span {
    flex: 0 0 auto;
    padding: 0.35rem 0.65rem;
    color: var(--turquoise);
    background: #e8f5f4;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

.work-discussion-introduction {
    max-width: 72ch;
    color: var(--ink-soft);
    line-height: 1.65;
}

.work-discussion-form {
    display: grid;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.work-discussion-form label {
    font-weight: 800;
}

.work-discussion-form textarea {
    width: 100%;
    min-height: 8rem;
    padding: 0.85rem;
    color: var(--ink);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    resize: vertical;
    font: inherit;
    line-height: 1.6;
}

.work-discussion-form button {
    justify-self: start;
    padding: 0.75rem 1rem;
    color: #ffffff;
    background: var(--turquoise);
    border: 1px solid var(--turquoise);
    border-radius: 9px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.work-discussion-form button:hover {
    background: #105451;
}

.work-discussion-list {
    display: grid;
    gap: 1rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}

.work-discussion-list .comment-meta a {
    color: var(--turquoise);
    text-underline-offset: 0.18em;
}

@media (max-width: 620px) {
    .work-discussion {
        padding: 1.25rem;
    }

    .work-discussion-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .work-discussion-heading > span {
        align-self: flex-start;
    }

    .work-discussion-form button {
        width: 100%;
    }
}

/* Appréciation d’une publication */

.chapter-appreciation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem 1.5rem;
    margin: 2rem 0;
    padding: 1.25rem 1.4rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--paper);
    scroll-margin-top: 1rem;
}

.chapter-appreciation h2 {
    margin: 0.15rem 0 0;
    font-family: Literata, Georgia, serif;
    font-size: 1.15rem;
}

.chapter-appreciation p {
    margin: 0.35rem 0 0;
    color: var(--ink-soft);
}

.chapter-appreciation form {
    margin: 0;
}

.chapter-appreciation button,
.chapter-appreciation > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--turquoise);
    border-radius: 999px;
    color: #ffffff;
    background: var(--turquoise);
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.chapter-appreciation button:hover,
.chapter-appreciation button:focus-visible,
.chapter-appreciation > a:hover,
.chapter-appreciation > a:focus-visible {
    background: #105451;
}

.chapter-appreciation button.is-active {
    color: var(--turquoise);
    background: #e8f5f4;
}

.chapter-appreciation .appreciation-message {
    grid-column: 1 / -1;
    padding: 0.65rem 0.8rem;
    color: #176b68;
    background: #e8f5f4;
    border-radius: 8px;
}

@media (max-width: 620px) {
    .chapter-appreciation {
        grid-template-columns: 1fr;
    }

    .chapter-appreciation button,
    .chapter-appreciation > a {
        width: 100%;
    }
}

/* Recherche accessible et pagination */

.discovery-search-fields {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(12rem, 0.45fr)
        auto;
    align-items: end;
    gap: 0.75rem;
}

.discovery-search-field {
    min-width: 0;
    margin: 0 !important;
}

.discovery-search-field span {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.discovery-search select {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 2.5rem 0.75rem 0.9rem;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid #aeb7c4;
    border-radius: 9px;
    font: inherit;
}

.discovery-search select:focus {
    border-color: var(--turquoise);
    outline: 3px solid rgba(23, 107, 104, 0.18);
}

.discovery-search-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.discovery-search-actions a {
    color: var(--ink-soft);
    font-weight: 700;
}

.discovery-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
}

.discovery-pagination a {
    color: var(--turquoise);
    font-weight: 800;
}

.discovery-pagination a:first-child {
    justify-self: start;
}

.discovery-pagination a:last-child {
    justify-self: end;
}

@media (max-width: 700px) {
    .discovery-search-fields {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .discovery-search-actions {
        justify-content: space-between;
    }

    .discovery-search-actions button {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .discovery-pagination {
        grid-template-columns: 1fr;
    }

    .discovery-pagination a,
    .discovery-pagination a:first-child,
    .discovery-pagination a:last-child {
        justify-self: center;
    }

    .discovery-pagination > span:empty {
        display: none;
    }
}

/* Couvertures des œuvres accessibles */
.reading-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 1rem;
    background: #f5f0e7;
    box-shadow: 0 0.8rem 1.8rem rgb(49 39 29 / 13%);
}

.reading-cover__image,
.reading-cover__fallback {
    width: 100%;
    height: 100%;
}

.reading-cover__image {
    display: block;
    object-fit: cover;
}

.reading-cover__fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 1rem;
    text-align: center;
    color: #fffaf0;
    background:
        radial-gradient(
            circle at top,
            rgb(255 255 255 / 18%),
            transparent 42%
        ),
        linear-gradient(145deg, #665648, #302923);
}

.reading-cover__fallback > span {
    font-family: Georgia, serif;
    font-size: clamp(3rem, 8vw, 5.5rem);
    line-height: 0.9;
    opacity: 0.25;
}

.reading-cover__fallback strong {
    font-family: Georgia, serif;
    line-height: 1.2;
}

.reading-cover__fallback small {
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.discovery-cover-link {
    display: block;
    width: min(100%, 12rem);
    margin-inline: auto;
    color: inherit;
    text-decoration: none;
}

.discovery-cover-link:focus-visible {
    border-radius: 1rem;
    outline: 3px solid currentColor;
    outline-offset: 4px;
}

.discovery-card {
    align-content: start;
}

.work-overview-hero {
    display: grid;
    grid-template-columns: minmax(11rem, 16rem) minmax(0, 1fr);
    gap: clamp(1.5rem, 5vw, 3rem);
    align-items: start;
    margin-block: 1.5rem 2.5rem;
}

.work-overview-cover {
    width: 100%;
}

.work-overview-introduction > :first-child {
    margin-top: 0;
}

@media (max-width: 680px) {
    .work-overview-hero {
        grid-template-columns: 1fr;
    }

    .work-overview-cover {
        width: min(72vw, 17rem);
        margin-inline: auto;
    }

    .discovery-cover-link {
        width: min(58vw, 13rem);
    }
}

/* Enveloppe publique unifiée */

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 100;
    padding: 0.75rem 1rem;
    color: #ffffff;
    background: #172033;
    border-radius: 0.5rem;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: relative;
    z-index: 20;
    border-bottom: 1px solid var(--border);
    background: rgb(255 255 255 / 97%);
}

.header-inner,
.footer-inner {
    width: min(1180px, calc(100% - 2rem));
    margin-inline: auto;
}

.header-inner {
    min-height: 78px;
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
}

.brand img {
    display: block;
    width: 270px;
    max-width: 48vw;
    height: auto;
}

.site-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    background: var(--paper);
}

.footer-inner {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
}

.footer-inner p {
    margin: 0.25rem 0 0;
    color: var(--ink-soft);
}

.footer-inner nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-inner a {
    color: var(--ink);
    font-weight: 700;
}

/* Catalogue et recherche */

.discovery-page {
    width: min(1180px, calc(100% - 2rem));
    padding: clamp(2rem, 6vw, 4.5rem) 0;
}

.discovery-introduction {
    max-width: none;
    padding: clamp(1.6rem, 5vw, 3.5rem);
    overflow: hidden;
    border: 1px solid #cfe3e1;
    border-radius: 24px;
    background:
        radial-gradient(
            circle at 92% 12%,
            rgb(255 255 255 / 75%),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            #edf8f6,
            #f8f3ea
        );
}

.discovery-introduction h1 {
    max-width: 820px;
}

.discovery-introduction > p:last-child {
    max-width: 700px;
    margin-bottom: 0;
}

.discovery-search {
    max-width: none;
    margin: 1.5rem 0 3rem;
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 0 12px 32px rgb(23 32 51 / 7%);
}

.discovery-search input,
.discovery-search select,
.discovery-search button {
    min-height: 48px;
}

.discovery-search button {
    cursor: pointer;
    transition:
        background-color 160ms ease,
        transform 160ms ease;
}

.discovery-search button:hover {
    background: #105653;
    transform: translateY(-1px);
}

.discovery-results-heading {
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.discovery-grid {
    grid-template-columns: repeat(
        auto-fit,
        minmax(min(100%, 30rem), 1fr)
    );
    gap: 1.5rem;
}

.discovery-card {
    display: grid;
    grid-template-columns:
        minmax(9rem, 11.5rem)
        minmax(0, 1fr);
    grid-template-rows:
        auto
        auto
        auto
        1fr
        auto;
    column-gap: 1.35rem;
    row-gap: 0.65rem;
    padding: 1.25rem;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgb(23 32 51 / 7%);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.discovery-card:hover {
    border-color: #b8d8d5;
    box-shadow: 0 16px 38px rgb(23 32 51 / 11%);
    transform: translateY(-2px);
}

.discovery-cover-link {
    grid-column: 1;
    grid-row: 1 / span 5;
    width: 100%;
    margin: 0;
    align-self: start;
}

.discovery-card-heading,
.discovery-card h3,
.discovery-author,
.discovery-summary,
.discovery-read-link {
    grid-column: 2;
}

.discovery-card h3 {
    margin: 0.2rem 0 0;
    font-size: clamp(1.35rem, 3vw, 1.65rem);
}

.discovery-author,
.discovery-summary {
    margin: 0;
}

.discovery-summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.discovery-read-link {
    align-self: end;
    padding-top: 0.4rem;
}

.reading-cover {
    border-radius: 12px;
    box-shadow: 0 0.7rem 1.5rem rgb(49 39 29 / 14%);
}

@media (max-width: 760px) {
    .header-inner {
        padding: 0.8rem 0;
    }

    .brand img {
        max-width: 78vw;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .discovery-introduction {
        border-radius: 18px;
    }
}

@media (max-width: 560px) {
    .discovery-page {
        width: min(100% - 28px, 1180px);
    }

    .discovery-card {
        grid-template-columns: 1fr;
    }

    .discovery-cover-link {
        grid-column: 1;
        grid-row: auto;
        width: min(68vw, 14rem);
        margin-inline: auto;
    }

    .discovery-card-heading,
    .discovery-card h3,
    .discovery-author,
    .discovery-summary,
    .discovery-read-link {
        grid-column: 1;
    }
}

/* Interactions fermées par l’auteur */

.interaction-closed {
    margin: 1.25rem 0;
    padding: 1rem 1.1rem;
    color: #675126;
    line-height: 1.6;
    background: #fff8e9;
    border: 1px solid #e1bf7c;
    border-radius: 0.75rem;
}

/* Métadonnées et avertissement sensible */

.work-editorial-metadata {
    display: grid;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.work-metadata-list,
.work-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.work-metadata-list li,
.discovery-card-metadata span {
    padding: 0.35rem 0.65rem;
    color: #145451;
    background: var(--turquoise-light);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 750;
}

.work-tag-list li {
    color: #53606f;
    font-size: 0.9rem;
}

.work-sensitive-label,
.discovery-card-metadata strong {
    width: fit-content;
    margin: 0;
    padding: 0.4rem 0.7rem;
    color: #70450b;
    background: #fff0cf;
    border: 1px solid #e1bf7c;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

.work-license,
.work-interaction-status {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
    line-height: 1.55;
}

.discovery-card-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.discovery-card-metadata strong {
    display: inline-flex;
    align-items: center;
}

.sensitive-warning-page {
    width: min(760px, calc(100% - 2rem));
    min-height: 65vh;
    margin-inline: auto;
    padding: clamp(3rem, 8vw, 6rem) 0;
    display: grid;
    align-items: center;
}

.sensitive-warning-card {
    display: grid;
    gap: 1.2rem;
    padding: clamp(1.5rem, 5vw, 3rem);
    border: 1px solid #e1bf7c;
    border-radius: 1.25rem;
    background: #fffdf8;
    box-shadow: 0 1.2rem 3rem rgb(23 32 51 / 10%);
}

.sensitive-warning-card h1,
.sensitive-warning-card p {
    margin: 0;
}

.sensitive-warning-card h1 {
    font-family: Literata, Georgia, serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    line-height: 1.1;
}

.sensitive-warning-card p {
    max-width: 60ch;
    line-height: 1.7;
}

.primary-reading-action {
    padding: 0.85rem 1.1rem;
    color: #ffffff;
    background: var(--turquoise);
    border: 0;
    border-radius: 0.65rem;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.primary-reading-action:hover {
    background: #105451;
}

.primary-reading-action:focus-visible,
.secondary-reading-link:focus-visible {
    outline: 3px solid #0b6bcb;
    outline-offset: 3px;
}

.secondary-reading-link {
    width: fit-content;
    font-weight: 750;
}

@media (max-width: 600px) {
    .work-interaction-status span {
        display: none;
    }

    .work-interaction-status {
        display: grid;
        gap: 0.25rem;
    }

    .primary-reading-action {
        width: 100%;
    }
}

/* Export autorisé pour les lecteurs */

.reader-export-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.25rem 2rem;
    align-items: center;
    margin: 2rem 0;
    padding: 1.25rem;
    border: 1px solid #b8d8d5;
    border-radius: 1rem;
    background: #eef8f6;
}

.reader-export-action h2,
.reader-export-action p {
    margin-top: 0;
}

.reader-export-action h2 {
    margin-bottom: 0.5rem;
    font-family: Literata, Georgia, serif;
    font-size: 1.35rem;
}

.reader-export-action > div > p:last-child {
    margin-bottom: 0;
    color: var(--ink-soft);
    line-height: 1.55;
}

.reader-export-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

.reader-export-links a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.85rem;
    color: #ffffff;
    background: var(--turquoise);
    border-radius: 0.6rem;
    font-weight: 800;
    text-decoration: none;
}

.reader-export-links a:hover,
.reader-export-links a:focus-visible {
    background: #105451;
}

.reader-export-links a:focus-visible,
.reader-export-login a:focus-visible {
    outline: 3px solid #0b6bcb;
    outline-offset: 3px;
}

.reader-export-login {
    margin: 0;
    color: var(--ink-soft);
}

@media (max-width: 720px) {
    .reader-export-action {
        grid-template-columns: 1fr;
    }

    .reader-export-links {
        justify-content: stretch;
    }

    .reader-export-links a {
        flex: 1 1 12rem;
    }
}

/* Recherche avancée de l’étape 0031 */

.discovery-search-fields {
    grid-template-columns:
        minmax(15rem, 1.4fr)
        minmax(10rem, 0.65fr)
        minmax(12rem, 0.75fr)
        auto;
}

.discovery-advanced {
    margin-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.discovery-advanced summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0 0;
    color: var(--turquoise);
    cursor: pointer;
    font-weight: 800;
}

.discovery-advanced summary small {
    color: var(--ink-soft);
    font-weight: 500;
}

.discovery-advanced-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.35fr)
        minmax(14rem, 0.75fr);
    gap: 1rem;
    margin-top: 1rem;
}

.discovery-filter-group {
    min-width: 0;
    margin: 0;
    padding: 1rem;
    background: #fbfcfc;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.discovery-filter-group legend {
    padding: 0 0.35rem;
    font-weight: 800;
}

.discovery-filter-help {
    margin: 0 0 0.8rem;
    color: var(--ink-soft);
    font-size: 0.86rem;
}

.discovery-check-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 0.55rem 1rem;
}

.discovery-search .discovery-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    font-weight: 500;
}

.discovery-search .discovery-check input {
    width: 1.1rem;
    min-height: auto;
    height: 1.1rem;
    margin: 0.15rem 0 0;
    padding: 0;
    flex: 0 0 auto;
    accent-color: var(--turquoise);
}

.discovery-search .discovery-check span {
    margin: 0;
}

.discovery-tag-fields,
.discovery-capability-list {
    display: grid;
    gap: 0.75rem;
}

.discovery-tag-fields label {
    margin: 0;
}

.discovery-tag-fields label > span {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--ink-soft);
    font-size: 0.84rem;
}

.discovery-filter-group
    > .discovery-search-field
    + .discovery-search-field {
    margin-top: 0.85rem !important;
}

@media (max-width: 980px) {
    .discovery-search-fields {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .discovery-search-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .discovery-search-fields,
    .discovery-advanced-grid {
        grid-template-columns: 1fr;
    }

    .discovery-search-actions {
        grid-column: auto;
    }
}

@media (max-width: 480px) {
    .discovery-advanced summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    .discovery-check-grid {
        grid-template-columns: 1fr;
    }
}

/* Classement dans les listes de lecture */

.reading-library-action {
    display: grid;
    gap: 0.85rem;
}

.reading-default-list-action {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.reading-list-picker {
    width: min(560px, 100%);
    padding: 0.85rem 1rem;
    background: #fbf8f1;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.reading-list-picker summary {
    color: #172033;
    font-weight: 800;
    cursor: pointer;
}

.reading-list-picker ul {
    display: grid;
    gap: 0.6rem;
    margin: 0.9rem 0;
    padding: 0;
    list-style: none;
}

.reading-list-picker li {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.reading-list-picker li span {
    display: grid;
    gap: 0.15rem;
}

.reading-list-picker small {
    color: #53606f;
}

.public-reading-list-owner {
    color: #53606f;
}

@media (max-width: 620px) {
    .reading-list-picker li {
        align-items: stretch;
        flex-direction: column;
    }

    .reading-list-picker button {
        width: 100%;
    }
}


.work-completion-label {
    width: fit-content;
    margin: 0;
    padding: 0.4rem 0.7rem;
    color: #5d3a78;
    background: #eee4f5;
    border: 1px solid #cdb8dd;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}
