/* =========================================================================
   FICHE MÉMOIRE
   ========================================================================= */

.memory-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.memory-aside {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.memory-cover .cover { width: 100%; font-size: 19px; }
.memory-facts { padding: 20px; }
.memory-facts .panel-title { font-size: 1rem; }

.memory-main { min-width: 0; max-width: 780px; }

.memory-header { padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }

.memory-header h1 {
    margin: 16px 0 20px;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(2rem, 1.4rem + 2.2vw, 3.1rem);
    line-height: 1.06;
    letter-spacing: -.025em;
    text-wrap: balance;
}

.memory-author { margin-bottom: 24px; }

.memory-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.memory-actions .btn-chip.btn-lg { min-height: 54px; padding: 12px 18px; font-size: .95rem; border-radius: 14px; background: var(--paper); }
.memory-actions .btn-chip.is-saved { background: var(--green-50); }

.memory-share { margin-top: 16px; }
.memory-share-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.memory-qr { margin: 0; text-align: center; }
.memory-qr img { width: 132px; height: 132px; border-radius: 12px; background: #fff; border: 1px solid var(--line); padding: 6px; }
.memory-qr figcaption { margin-top: 8px; font-size: .82rem; }
.memory-qr figcaption a { display: inline-flex; align-items: center; gap: 4px; }

.memory-section { padding: 32px 0; border-bottom: 1px solid var(--line); }
.memory-section:last-of-type { border-bottom: 0; }
.memory-section h2 { font-size: 1.3rem; margin-bottom: 14px; }

.memory-text {
    font-size: 1.06rem;
    line-height: 1.75;
    color: #2A2E4E;
    max-width: 70ch;
}

.memory-abstract {
    font-family: var(--font-serif);
    font-size: 1.22rem;
    line-height: 1.6;
    color: var(--ink);
}

.memory-question {
    margin: 0;
    padding: 18px 22px;
    border-left: 4px solid var(--marker);
    background: var(--marker-50);
    border-radius: 0 var(--r-md) var(--r-md) 0;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    line-height: 1.5;
}

.memory-tags-section { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.memory-tags-section h2 { font-size: 1.05rem; }

.memory-reader-head { margin-bottom: 16px; }

.person .memory-pdf-icon,
.memory-pdf-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 48px;
    border-radius: 6px;
    background: var(--danger);
    color: #fff !important;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    flex-shrink: 0;
}

.memory-pdf-viewer {
    height: min(82vh, 900px);
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: #525659;
    overflow: hidden;
    box-shadow: var(--shadow-2);
}

.memory-pdf-viewer iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Recommandations */
.memory-reco-form { margin: 16px 0 20px; }
.memory-reco-form h3 { margin: 12px 0 4px; }

.reco-list { display: grid; gap: 16px; margin-top: 16px; }

.reco {
    margin: 0;
    padding: 24px;
    border-radius: var(--r-lg);
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
    position: relative;
}

.reco::before {
    content: "";
    position: absolute;
    left: 0;
    top: 24px;
    bottom: 24px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--marker);
}

.reco blockquote {
    margin: 0 0 16px;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    line-height: 1.45;
}

/* Avis */
.memory-score { display: flex; align-items: center; gap: 12px; }
.memory-score strong { font-size: 2.4rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.memory-score div { display: flex; flex-direction: column; font-size: .85rem; }

.memory-review-form, .memory-own-review { margin: 16px 0 8px; }
.memory-review-form h3 { margin-bottom: 4px; }
.memory-own-review .review-text { margin: 12px 0; }
.memory-edit-review { margin: 6px 0 12px; }
.memory-edit-review > summary { list-style: none; display: inline-block; margin-bottom: 12px; }
.memory-edit-review > summary::-webkit-details-marker { display: none; }

/* Les étoiles du formulaire Symfony (select) restent des selects : on les garde étroits */
.memory-review-form .field-row > div, .memory-own-review .field-row > div { grid-column: 1; }

.memory-report { margin: 24px 0 0; font-size: .88rem; }
.memory-report a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); }
.memory-report a:hover { color: var(--danger); }

@media (max-width: 1000px) {
    /* Sur petit écran : couverture, puis le texte, puis la fiche technique */
    .memory-layout { display: flex; flex-direction: column; gap: 24px; }
    .memory-aside { display: contents; }
    .memory-cover { order: 0; width: 200px; }
    .memory-cover .cover { font-size: 13px; }
    .memory-main { order: 1; }
    .memory-facts { order: 2; }
}

@media (max-width: 620px) {
    .memory-cover { width: 150px; }
    .memory-cover .cover { font-size: 10px; }
    .memory-actions .btn { flex: 1 1 auto; }
    .memory-share-grid { grid-template-columns: 1fr; }
    .memory-pdf-viewer { height: 70vh; }
}
