/* Fiche détaillée d'une annonce « Concours & opportunités » */

.opp-detail-hero {
  background: linear-gradient(135deg, #0f2b46 0%, #091b2e 100%);
  color: #fff;
  padding: var(--space-8) 0 var(--space-10);
}
.opp-breadcrumb { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: 0.85rem; margin-bottom: 1.25rem; color: rgba(255, 255, 255, 0.65); }
.opp-breadcrumb a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.opp-breadcrumb a:hover { text-decoration: underline; }
.opp-detail-hero h1 { color: #fff; margin: 0.75rem 0 0.6rem; font-size: clamp(1.6rem, 3.6vw, 2.5rem); line-height: 1.2; max-width: 900px; }
.opp-detail-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; color: rgba(255, 255, 255, 0.85); font-size: 0.95rem; font-weight: 500; }
.opp-detail-lead { margin: 1rem 0 0; max-width: 820px; color: rgba(255, 255, 255, 0.9); font-size: 1.08rem; line-height: 1.65; }
.opp-detail-check { display: inline-block; margin: 1rem 0 0; padding: 0.35rem 0.8rem; border-radius: var(--radius-full); background: rgba(16, 185, 129, 0.16); color: #a7f3d0; font-size: 0.85rem; font-weight: 600; }
.opp-detail-check.is-stale { background: rgba(245, 158, 11, 0.18); color: #fde68a; }
.opp-detail-hero .opp-badge { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.25); color: #fff; }
.opp-detail-hero .opp-phase--OPEN { background: #047857; border-color: #047857; }
.opp-detail-hero .opp-phase--UPCOMING { background: #0369a1; border-color: #0369a1; }
.opp-detail-hero .opp-phase--NEXT { background: rgba(234, 88, 12, 0.25); border-color: #fdba74; color: #fed7aa; }
.opp-preview-banner { margin-bottom: 1rem; padding: 0.6rem 0.9rem; border-radius: var(--radius-md); background: #fef3c7; color: #78350f; font-weight: 600; font-size: 0.9rem; }

.opp-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: var(--space-8); align-items: start; padding-top: var(--space-8); padding-bottom: var(--space-12); }
.opp-detail-main { grid-column: 1; grid-row: 1; min-width: 0; }
.opp-detail-aside { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header-height) + var(--nav-height) + 16px); }

/* Encadré « L'essentiel » */
.opp-aside-card { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); overflow: hidden; }
.opp-aside-status { padding: 1rem 1.1rem; background: rgba(4, 120, 87, 0.1); border-bottom: 1px solid var(--border-subtle); }
.opp-aside-status strong { display: block; font-size: 1.15rem; color: #047857; }
.opp-aside-status span { display: block; margin-top: 0.15rem; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.45; }
.opp-aside-status.is-urgent { background: rgba(220, 38, 38, 0.1); }
.opp-aside-status.is-urgent strong { color: #b91c1c; }
.opp-aside-status.is-next { background: rgba(234, 88, 12, 0.1); }
.opp-aside-status.is-next strong { color: #c2410c; }
.opp-aside-status.is-closed { background: var(--surface-soft); }
.opp-aside-status.is-closed strong { color: var(--text-secondary); }
[data-theme="dark"] .opp-aside-status strong { color: #6ee7b7; }
[data-theme="dark"] .opp-aside-status.is-urgent strong { color: #fca5a5; }
[data-theme="dark"] .opp-aside-status.is-next strong { color: #fdba74; }
[data-theme="dark"] .opp-aside-status.is-closed strong { color: var(--text-secondary); }
.opp-aside-facts { margin: 0; padding: 0.4rem 1.1rem; }
.opp-aside-facts div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--border-subtle); }
.opp-aside-facts div:last-child { border-bottom: 0; }
.opp-aside-facts dt { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.opp-aside-facts dd { margin: 0; font-size: 0.88rem; font-weight: 700; color: var(--text-primary); text-align: right; overflow-wrap: anywhere; }
.opp-aside-actions { display: grid; gap: 0.5rem; padding: 0.4rem 1.1rem 1rem; }
.opp-aside-actions .btn { justify-content: center; text-align: center; width: 100%; }
.opp-aside-actions .btn[aria-pressed="true"] { border-color: rgba(245, 166, 35, 0.7); color: #b45309; }
[data-theme="dark"] .opp-aside-actions .btn[aria-pressed="true"] { color: #fcd34d; }
.opp-share { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem; }
.opp-share .btn { padding-inline: 0.4rem; font-size: 0.8rem; }
.opp-report-link { display: block; width: 100%; padding: 0.7rem; border: 0; border-top: 1px solid var(--border-subtle); background: var(--surface-soft); color: var(--text-muted); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.opp-report-link:hover { color: #b91c1c; }

/* Sommaire */
.opp-toc { position: sticky; top: calc(var(--header-height) + var(--nav-height)); z-index: 5; display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.6rem 0; margin-bottom: 0.5rem; background: var(--color-white, #fff); border-bottom: 1px solid var(--border-subtle); scrollbar-width: thin; }
.opp-toc a { flex-shrink: 0; padding: 0.3rem 0.75rem; border-radius: var(--radius-full); background: var(--surface-soft); border: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.opp-toc a:hover { color: var(--text-primary); border-color: var(--color-secondary); }
[data-theme="dark"] .opp-toc { background: var(--color-white); }

/* Sections */
.opp-dsec { padding: var(--space-6) 0; border-bottom: 1px solid var(--border-subtle); scroll-margin-top: calc(var(--header-height) + var(--nav-height) + 64px); }
.opp-dsec:last-child { border-bottom: 0; }
.opp-dsec h2 { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem; font-size: 1.3rem; font-family: var(--font-sans); }
.opp-dsec p, .opp-dsec li { color: var(--text-secondary); line-height: 1.7; font-size: 0.98rem; }
.opp-dsec p { margin: 0 0 0.6rem; }
.opp-muted { font-size: 0.85rem !important; color: var(--text-muted) !important; }
.opp-note { margin: 0 0 1rem; padding: 0.75rem 0.9rem; border-radius: var(--radius-md); background: rgba(234, 88, 12, 0.08); border: 1px solid rgba(234, 88, 12, 0.3); color: var(--text-primary); font-size: 0.92rem; line-height: 1.55; }
.opp-note--warn { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.45); }

/* Parcours */
.opp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: none; }
.opp-steps li { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 0.9rem; padding-bottom: 1.1rem; }
.opp-steps li:not(:last-child)::before { content: ''; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--border-subtle); }
.opp-step-n { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--color-primary); color: #fff; font-weight: 800; font-size: 0.95rem; }
[data-theme="dark"] .opp-step-n { background: var(--color-secondary); color: #0f172a; }
.opp-steps strong { display: block; padding-top: 0.4rem; color: var(--text-primary); font-size: 1rem; }
.opp-steps strong a { color: inherit; }
.opp-steps p { margin: 0.15rem 0 0 !important; font-size: 0.9rem !important; }

/* Qui peut candidater */
.opp-who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.opp-who { padding: 0.75rem 0.9rem; border-radius: var(--radius-md); background: var(--surface-soft); border: 1px solid var(--border-subtle); }
.opp-who > span { display: block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.25rem; }
.opp-who strong { color: var(--text-primary); font-size: 0.92rem; line-height: 1.45; }

/* Calendrier */
.opp-timeline2 { list-style: none; margin: 0 0 0.75rem; padding: 0; border-left: 2px solid var(--border-subtle); }
.opp-timeline2 li { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.9rem; padding: 0.45rem 0 0.45rem 1.1rem; }
.opp-timeline2 li::before { content: ''; position: absolute; left: -7px; top: 0.85rem; width: 12px; height: 12px; border-radius: 50%; background: var(--color-secondary); border: 2px solid var(--surface-raised); }
.opp-timeline2 li.is-past { opacity: 0.55; }
.opp-timeline2 li.is-past::before { background: var(--color-gray-400); }
.opp-timeline2 li.is-deadline::before { background: #dc2626; }
.opp-timeline2 time { min-width: 150px; font-weight: 800; color: var(--text-primary); font-size: 0.92rem; }
.opp-timeline2 span { color: var(--text-secondary); font-size: 0.95rem; }
.opp-timeline2 em { font-style: normal; font-size: 0.75rem; font-weight: 700; padding: 0.05rem 0.5rem; border-radius: var(--radius-full); background: var(--surface-soft); border: 1px solid var(--border-subtle); color: var(--text-muted); }

/* Dossier */
.opp-docs-progress { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.opp-docs-bar { flex: 1; height: 8px; border-radius: var(--radius-full); background: var(--surface-soft); border: 1px solid var(--border-subtle); overflow: hidden; }
.opp-docs-bar span { display: block; height: 100%; background: linear-gradient(90deg, #10b981, #047857); transition: width var(--transition-base); }
.opp-docs-progress small { font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.opp-docs { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; gap: 0.4rem; }
.opp-docs label { display: flex; gap: 0.65rem; align-items: flex-start; padding: 0.6rem 0.75rem; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--surface-raised); cursor: pointer; line-height: 1.5; color: var(--text-secondary); font-size: 0.94rem; }
.opp-docs input { margin-top: 0.25rem; width: 17px; height: 17px; accent-color: #047857; flex-shrink: 0; }
.opp-docs label:has(input:checked) { background: rgba(16, 185, 129, 0.07); border-color: rgba(16, 185, 129, 0.4); }
.opp-docs label:has(input:checked) span { text-decoration: line-through; text-decoration-color: rgba(4, 120, 87, 0.5); }

.opp-contact { margin-top: 0.75rem; padding: 0.75rem 0.9rem; border-radius: var(--radius-md); background: var(--surface-soft); border: 1px solid var(--border-subtle); }
.opp-contact > span { display: block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.2rem; }
.opp-contact p { margin: 0 !important; color: var(--text-primary) !important; font-weight: 600; }
.opp-links, .opp-source { margin: 0 0 1rem; padding-left: 1.2rem; }
.opp-links a, .opp-source a { color: var(--accent-text); font-weight: 600; overflow-wrap: anywhere; }
.opp-tips { margin: 0 0 0.75rem; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.opp-tips li { position: relative; padding: 0.6rem 0.8rem 0.6rem 2.1rem; border-radius: var(--radius-md); background: rgba(245, 166, 35, 0.08); border: 1px solid rgba(245, 166, 35, 0.3); }
.opp-tips li::before { content: '✓'; position: absolute; left: 0.8rem; top: 0.6rem; font-weight: 800; color: #b45309; }
[data-theme="dark"] .opp-tips li::before { color: #fcd34d; }
.opp-faq { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); margin-bottom: 0.5rem; background: var(--surface-raised); }
.opp-faq summary { padding: 0.75rem 0.9rem; font-weight: 700; cursor: pointer; color: var(--text-primary); }
.opp-faq > p { padding: 0 0.9rem; }

/* Signalement */
.opp-report-body { display: grid; gap: 0.9rem; }
.opp-report-body label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.opp-report-body select, .opp-report-body textarea, .opp-report-body input { font: inherit; font-size: 0.95rem; padding: 0.6rem 0.7rem; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--surface-soft); color: var(--text-primary); }
.opp-report-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.opp-report-status { margin: 0; font-size: 0.9rem; min-height: 1.2em; }
.opp-report-status.is-ok { color: var(--success-text); font-weight: 600; }
.opp-report-status.is-error { color: #dc2626; font-weight: 600; }

.opp-similar-section { background: var(--surface-soft); }
.opp-similar-section h2 { margin: 0 0 1.25rem; }

@media (max-width: 960px) {
  .opp-detail-layout { grid-template-columns: minmax(0, 1fr); }
  .opp-detail-aside { grid-column: 1; grid-row: 1; position: static; }
  .opp-detail-main { grid-row: 2; }
  .opp-toc { top: var(--header-height); }
}
@media (max-width: 480px) {
  .opp-timeline2 time { min-width: 0; width: 100%; }
}

/* Impression : une fiche propre à emporter */
@media print {
  .site-header, .site-footer, .opp-toc, .opp-aside-actions, .opp-report-link, .opp-similar-section, [data-action="report"], .skip-to-content { display: none !important; }
  .opp-detail-hero { background: none; color: #000; padding: 0; }
  .opp-detail-hero h1, .opp-detail-meta, .opp-detail-lead, .opp-breadcrumb, .opp-breadcrumb a { color: #000 !important; }
  .opp-detail-layout { display: block; padding: 0; }
  .opp-detail-aside { position: static; margin: 1rem 0; }
  .opp-dsec { break-inside: avoid-page; }
}
[data-theme="dark"] .opp-aside-actions .btn-outline,
[data-theme="dark"] .opp-share .btn { background: transparent; color: var(--text-primary); border-color: var(--border-subtle); }
