/* Page /recueils — catalogue et lecture des recueils */

.recueils-page {
    max-width: min(78rem, 96vw);
    padding-bottom: clamp(3rem, 8vh, 5rem);
}

.recueils-page .carnet-header {
    width: 100%;
    max-width: min(44rem, 94vw);
    margin: 0 auto clamp(2rem, 4vh, 2.75rem);
    text-align: center;
}

.recueils-page .carnet-title {
    font-family: 'Crimson Pro', 'Lora', serif;
    font-size: clamp(1.45rem, 3.8vw, 2.65rem);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 clamp(0.85rem, 2vh, 1.15rem);
    line-height: 1.28;
    color: var(--text-primary);
}

html:not(.day-mode) .recueils-page .carnet-title {
    color: rgba(231, 231, 231, 0.98);
}

.recueils-page .carnet-intro {
    font-family: 'Lora', serif;
    font-size: clamp(0.98rem, 1.85vw, 1.125rem);
    line-height: 1.65;
    letter-spacing: 0.02em;
    margin: 0;
    color: rgba(43, 43, 43, 0.72);
}

html:not(.day-mode) .recueils-page .carnet-intro {
    color: rgba(231, 231, 231, 0.62);
}

.recueils-page .carnet-kicker {
    font-family: 'Lora', serif;
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 0.75rem;
    color: rgba(43, 43, 43, 0.5);
}

html:not(.day-mode) .recueils-page .carnet-kicker {
    color: rgba(231, 231, 231, 0.45);
}

.recueils-show-back {
    color: inherit;
    text-decoration: none;
}

.recueils-show-back:hover {
    text-decoration: underline;
}

/* --- Toolbar ------------------------------------------------------- */

.recueils-toolbar {
    max-width: 56rem;
    margin: 0 auto clamp(2rem, 4vh, 2.5rem);
}

.recueils-search-container {
    margin-bottom: 0;
}

.recueils-search-form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.recueils-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    font-family: 'Lora', serif;
    font-size: 1rem;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border-button);
    border-radius: 0;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.recueils-search-input:focus {
    border-color: var(--text-secondary);
    background: var(--bg-button-hover);
}

html:not(.day-mode) .recueils-search-input {
    border-color: rgba(231, 231, 231, 0.2);
    color: var(--text-night);
}

html:not(.day-mode) .recueils-search-input:focus {
    border-color: rgba(231, 231, 231, 0.4);
    background: rgba(231, 231, 231, 0.05);
}

.recueils-search-input::placeholder {
    color: var(--text-placeholder);
    font-style: italic;
}

.recueils-search-clear {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.recueils-search-clear:hover {
    color: var(--text-primary);
    opacity: 0.8;
}

/* --- Grid catalogue ------------------------------------------------ */

.recueils-meta {
    text-align: center;
    font-family: 'Lora', serif;
    font-size: 0.92rem;
    color: rgba(43, 43, 43, 0.55);
    margin: 0 0 1.5rem;
}

html:not(.day-mode) .recueils-meta {
    color: rgba(231, 231, 231, 0.48);
}

.recueils-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr));
    gap: clamp(2rem, 4.5vw, 3.25rem) clamp(1.25rem, 3vw, 2.25rem);
    max-width: 64rem;
    margin: 0 auto;
}

.recueils-card {
    min-height: 100%;
}

.recueils-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* --- Cover as hero ------------------------------------------------- */

.recueils-card__cover-frame {
    position: relative;
    margin: 0 auto 1.15rem;
    width: 100%;
    border-radius: 3px;
    overflow: hidden;
    isolation: isolate;
    background: rgba(43, 43, 43, 0.06);
    box-shadow:
        0 1px 2px rgba(43, 43, 43, 0.08),
        0 10px 26px -14px rgba(43, 43, 43, 0.32);
    transform: translateY(0);
    transition:
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

html:not(.day-mode) .recueils-card__cover-frame {
    background: rgba(231, 231, 231, 0.05);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.45),
        0 12px 30px -14px rgba(0, 0, 0, 0.7);
}

/* Subtle sheen sweeping across the cover on hover */
.recueils-card__cover-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
        115deg,
        transparent 40%,
        rgba(255, 255, 255, 0.18) 50%,
        transparent 60%
    );
    transform: translateX(-120%);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.recueils-card__link:hover .recueils-card__cover-frame,
.recueils-card__link:focus-visible .recueils-card__cover-frame {
    transform: translateY(-8px);
    box-shadow:
        0 3px 6px rgba(43, 43, 43, 0.1),
        0 24px 44px -16px rgba(43, 43, 43, 0.45);
}

html:not(.day-mode) .recueils-card__link:hover .recueils-card__cover-frame,
html:not(.day-mode) .recueils-card__link:focus-visible .recueils-card__cover-frame {
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.55),
        0 28px 52px -18px rgba(0, 0, 0, 0.85);
}

.recueils-card__link:hover .recueils-card__cover-frame::before,
.recueils-card__link:focus-visible .recueils-card__cover-frame::before {
    transform: translateX(120%);
}

.recueils-card__cover {
    display: block;
    width: 100%;
}

.recueils-card__cover-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 7;
    object-fit: cover;
    transform: scale(1);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.recueils-card__link:hover .recueils-card__cover-image,
.recueils-card__link:focus-visible .recueils-card__cover-image {
    transform: scale(1.06);
}

.recueils-card__cover--placeholder {
    aspect-ratio: 5 / 7;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(
            120% 120% at 50% 0%,
            rgba(43, 43, 43, 0.1) 0%,
            rgba(43, 43, 43, 0.04) 60%,
            transparent 100%
        );
}

html:not(.day-mode) .recueils-card__cover--placeholder {
    background:
        radial-gradient(
            120% 120% at 50% 0%,
            rgba(231, 231, 231, 0.12) 0%,
            rgba(231, 231, 231, 0.04) 60%,
            transparent 100%
        );
}

.recueils-card__cover-initial {
    font-family: 'Crimson Pro', serif;
    font-size: clamp(2.5rem, 7vw, 3.5rem);
    font-weight: 500;
    color: rgba(43, 43, 43, 0.32);
}

html:not(.day-mode) .recueils-card__cover-initial {
    color: rgba(231, 231, 231, 0.32);
}

/* "Lire le recueil" reveal at the foot of the cover */
.recueils-card__cta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 2.5rem 0.75rem 0.9rem;
    background: linear-gradient(
        to top,
        rgba(18, 18, 18, 0.78) 0%,
        rgba(18, 18, 18, 0.4) 45%,
        rgba(18, 18, 18, 0) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.recueils-card__link:hover .recueils-card__cta,
.recueils-card__link:focus-visible .recueils-card__cta {
    opacity: 1;
}

.recueils-card__cta-label {
    font-family: 'Lora', serif;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.94);
    transform: translateY(0.5rem);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.recueils-card__link:hover .recueils-card__cta-label,
.recueils-card__link:focus-visible .recueils-card__cta-label {
    transform: translateY(0);
}

/* --- Info below the cover ------------------------------------------ */

.recueils-card__body {
    flex: 1;
    text-align: center;
    padding: 0 0.15rem;
}

.recueils-card__title {
    font-family: 'Crimson Pro', 'Lora', serif;
    font-size: clamp(1.02rem, 1.6vw, 1.2rem);
    font-weight: 500;
    margin: 0 0 0.32rem;
    line-height: 1.32;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

html:not(.day-mode) .recueils-card__title {
    color: rgba(231, 231, 231, 0.96);
}

.recueils-card__meta {
    font-family: 'Lora', serif;
    font-size: 0.86rem;
    font-style: italic;
    margin: 0 0 0.5rem;
    color: rgba(43, 43, 43, 0.6);
}

html:not(.day-mode) .recueils-card__meta {
    color: rgba(231, 231, 231, 0.55);
}

.recueils-card__sep {
    margin: 0 0.3rem;
    opacity: 0.6;
}

.recueils-card__count {
    font-family: 'Lora', serif;
    font-size: 0.7rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    margin: 0;
    color: rgba(43, 43, 43, 0.42);
}

html:not(.day-mode) .recueils-card__count {
    color: rgba(231, 231, 231, 0.4);
}

@media (prefers-reduced-motion: reduce) {
    .recueils-card__cover-frame,
    .recueils-card__cover-frame::before,
    .recueils-card__cover-image,
    .recueils-card__cta,
    .recueils-card__cta-label {
        transition: none;
    }

    .recueils-card__link:hover .recueils-card__cover-frame,
    .recueils-card__link:focus-visible .recueils-card__cover-frame {
        transform: none;
    }

    .recueils-card__link:hover .recueils-card__cover-image,
    .recueils-card__link:focus-visible .recueils-card__cover-image {
        transform: none;
    }
}

.recueils-empty {
    max-width: min(36rem, 94vw);
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
    text-align: center;
    font-family: 'Lora', serif;
    line-height: 1.65;
    color: rgba(43, 43, 43, 0.65);
}

html:not(.day-mode) .recueils-empty {
    color: rgba(231, 231, 231, 0.58);
}

.recueils-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    font-family: 'Lora', serif;
    font-size: 0.92rem;
}

.recueils-pagination__link {
    color: inherit;
}

/* --- Page lecture -------------------------------------------------- */

.recueils-show-page {
    max-width: min(48rem, 94vw);
}

.recueils-show-author,
.recueils-show-sep {
    color: inherit;
}

.recueils-show-author {
    text-decoration: none;
}

.recueils-show-author:hover {
    text-decoration: underline;
}

.recueils-show-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    margin: 0 auto clamp(2.5rem, 6vh, 3.5rem);
    max-width: 40rem;
    text-align: center;
}

@media (min-width: 640px) {
    .recueils-show-intro:has(.recueils-show-cover) {
        grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr);
        align-items: start;
        text-align: left;
    }

    .recueils-show-intro:has(.recueils-show-cover) .recueils-show-gallica {
        justify-content: flex-start;
    }
}

.recueils-show-cover {
    border-radius: 2px;
    overflow: hidden;
    background: rgba(43, 43, 43, 0.06);
}

html:not(.day-mode) .recueils-show-cover {
    background: rgba(231, 231, 231, 0.06);
}

.recueils-show-cover img {
    display: block;
    width: 100%;
    height: auto;
}

.recueils-show-gallica {
    display: flex;
    justify-content: center;
    margin: 1rem 0 0;
    padding: 0;
}

.recueils-gallica-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    border: none;
    background: none;
    color: rgba(43, 43, 43, 0.52);
    font-family: 'Lora', serif;
    font-size: 0.84rem;
    font-style: italic;
    letter-spacing: 0.02em;
    text-decoration: none;
    text-underline-offset: 0.18em;
    transition: color 0.2s ease, opacity 0.2s ease;
}

html:not(.day-mode) .recueils-gallica-btn {
    color: rgba(231, 231, 231, 0.46);
}

.recueils-gallica-btn:hover,
.recueils-gallica-btn:focus-visible {
    color: rgba(43, 43, 43, 0.72);
    text-decoration: underline;
    text-decoration-color: rgba(43, 43, 43, 0.28);
}

html:not(.day-mode) .recueils-gallica-btn:hover,
html:not(.day-mode) .recueils-gallica-btn:focus-visible {
    color: rgba(231, 231, 231, 0.68);
    text-decoration-color: rgba(231, 231, 231, 0.28);
}

.recueils-gallica-btn__icon {
    flex-shrink: 0;
    width: 0.72rem;
    height: 0.72rem;
    opacity: 0.45;
    transition: opacity 0.2s ease;
}

.recueils-gallica-btn:hover .recueils-gallica-btn__icon,
.recueils-gallica-btn:focus-visible .recueils-gallica-btn__icon {
    opacity: 0.65;
}

.recueils-show-intro-text {
    font-family: 'Lora', serif;
    font-size: 0.98rem;
    line-height: 1.7;
    color: rgba(43, 43, 43, 0.72);
}

html:not(.day-mode) .recueils-show-intro-text {
    color: rgba(231, 231, 231, 0.62);
}

.recueils-show-intro-text p {
    margin: 0 0 0.85rem;
}

.recueils-show-intro-text p:last-child {
    margin-bottom: 0;
}

/* --- Lecture continue ---------------------------------------------- */

.recueils-reading {
    max-width: min(38rem, 92vw);
    margin: 0 auto;
    padding-bottom: clamp(3rem, 8vh, 5rem);
}

.recueils-reading__stream {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.recueils-poem {
    scroll-margin-top: 5rem;
}

.recueils-poem__header {
    text-align: center;
    margin-bottom: clamp(1rem, 3vh, 1.5rem);
}

.recueils-poem__title {
    font-family: 'Crimson Pro', 'Lora', serif;
    font-size: clamp(1.15rem, 2.8vw, 1.45rem);
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.35;
    margin: 0;
}

.recueils-poem__title-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.recueils-poem__title-link:hover,
.recueils-poem__title-link:focus-visible {
    border-bottom-color: currentColor;
}

.recueils-poem__text {
    margin: 0;
}

.recueils-poem__body {
    display: block;
    margin: 0;
    padding: 0;
    font-family: 'Lora', 'Georgia', 'Times New Roman', serif;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    white-space: pre-wrap;
    font-size: clamp(1rem, 2.2vw, 1.125rem);
    line-height: 1.85;
    font-weight: 450;
    text-align: left;
    color: rgba(43, 43, 43, 0.88);
    word-break: break-word;
    background: transparent;
    border: none;
}

html:not(.day-mode) .recueils-poem__body {
    color: rgba(231, 231, 231, 0.88);
}

.recueils-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    width: 100%;
    max-width: 14rem;
    margin: clamp(2rem, 5vh, 3rem) auto;
    color: rgba(43, 43, 43, 0.28);
}

.recueils-divider--intro {
    margin-top: 0;
}

html:not(.day-mode) .recueils-divider {
    color: rgba(231, 231, 231, 0.28);
}

.recueils-divider__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        currentColor 35%,
        currentColor 65%,
        transparent 100%
    );
    opacity: 0.85;
}

.recueils-divider__mark {
    flex-shrink: 0;
    font-size: 0.72rem;
    line-height: 1;
    letter-spacing: 0.08em;
    opacity: 0.9;
}

.recueils-divider--ornament {
    display: block;
    max-width: min(10rem, 42vw);
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.recueils-divider__ornament {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    opacity: 0.92;
}

@media (max-width: 640px) {
    .recueils-divider--ornament {
        max-width: min(7rem, 36vw);
    }
}
