/* ============================================================
   Stages & Opportunités: /opportunities (listing) and /opportunites/<slug> (detail).
   Scoped under .op-page so it cannot touch the other pages (it does not use, and does not change, beyond.css which /events and /evenements-etudiants share).
   Tokens fall back from the shared design system (--rmd-*) to literal values. Visual reference: the owner's mockup (cream page, deep-green actions, orange accents).
   ============================================================ */
.op-page {
  --op-bg: var(--rmd-bg, #fdfaf6);
  --op-surface: var(--rmd-surface, #ffffff);
  --op-border: var(--rmd-border, #ece5db);
  --op-ink: #0b2a20;               /* very dark green for headings */
  --op-text: var(--rmd-text, #0f172a);
  --op-muted: #5b6678;             /* >= 4.5:1 on the cream background */
  --op-green: #0d5c3c;             /* deep green: primary actions */
  --op-green-hover: #0a4a30;
  --op-green-soft: #e3f1e6;
  --op-green-ink: #11623f;
  --op-orange: #d9601f;
  --op-orange-soft: #fdebd9;
  --op-orange-ink: #9a4309;
  --op-purple-soft: #ece7fb;
  --op-purple-ink: #5336a8;
  --op-radius: 20px;
  --op-shadow: 0 6px 22px rgba(15, 23, 42, 0.07);
  --op-font-h: var(--rmd-font-heading, 'Poppins', sans-serif);
  --op-font-b: var(--rmd-font-body, 'Inter', sans-serif);
  background: var(--op-bg); color: var(--op-text); font-family: var(--op-font-b); margin: 0;
}
.op-page *, .op-page *::before, .op-page *::after { box-sizing: border-box; }
.op-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.op-page :focus-visible { outline: 3px solid var(--op-green); outline-offset: 2px; border-radius: 6px; }
.op-wrap { max-width: 1200px; margin: 0 auto; padding: 18px 24px 56px; }

/* ---------- breadcrumb ---------- */
.op-crumbs ol { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.93rem; color: var(--op-muted); }
.op-crumbs li { display: flex; align-items: center; gap: 10px; }
.op-crumbs li + li::before { content: '\203A'; color: #9aa4b2; font-size: 1.1rem; line-height: 1; }
.op-crumbs a { color: var(--op-muted); text-decoration: none; } .op-crumbs a:hover { color: var(--op-green); text-decoration: underline; }
.op-crumbs [aria-current] { color: var(--op-text); font-weight: 500; overflow-wrap: anywhere; }

/* ---------- hero ---------- */
.op-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.75fr); gap: 32px; align-items: center; margin-bottom: 28px; }
.op-pill { display: inline-block; padding: 8px 18px; border-radius: 999px; background: var(--op-green-soft); color: var(--op-green-ink); font: 700 1rem/1 var(--op-font-b); }
.op-hero h1 { font: 800 clamp(2.1rem, 4.4vw, 3.4rem)/1.06 var(--op-font-h); color: var(--op-ink); margin: 18px 0 14px; letter-spacing: -0.02em; text-wrap: balance; }
.op-sparks { width: 0.7em; height: 0.58em; color: var(--op-orange); vertical-align: top; margin-left: 4px; }
.op-sparks--sm { width: 30px; height: 25px; vertical-align: -4px; margin-left: 6px; }
.op-lead { font-size: clamp(1.02rem, 1.7vw, 1.28rem); line-height: 1.5; color: #3b4658; margin: 0 0 24px; max-width: 34em; }
.op-groups { display: flex; flex-wrap: wrap; gap: 14px 4px; }
.op-group { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; background: none; border: 0; border-right: 1px solid var(--op-border); border-radius: 14px; cursor: pointer; font: 600 1rem/1.25 var(--op-font-b); color: var(--op-ink); text-align: left; min-height: 48px; }
.op-group:last-child { border-right: 0; }
.op-group > span:last-child { max-width: 7.6em; } /* long labels wrap on two lines, like the mockup, so the four shortcuts stay on one row */
.op-group-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; font-size: 1.25rem; flex: none; }
.op-group--green .op-group-ic { background: var(--op-green-soft); color: var(--op-green); }
.op-group--orange .op-group-ic { background: var(--op-orange-soft); color: var(--op-orange); }
.op-group:hover .op-group-ic { filter: brightness(0.96); }
.op-group[aria-pressed="true"] { background: var(--op-surface); box-shadow: inset 0 0 0 2px var(--op-green); }
.op-hero-media { position: relative; }
.op-hero-media::before { content: ''; position: absolute; inset: -4% 18% 26% -6%; background: #cfe5d3; border-radius: 52% 48% 60% 40% / 50% 45% 55% 50%; z-index: 0; }
.op-hero-media img { position: relative; z-index: 1; display: block; width: 100%; height: auto; aspect-ratio: 4 / 3.2; object-fit: cover; object-position: 55% 25%; border-radius: 58% 42% 52% 48% / 46% 56% 44% 54%; box-shadow: 0 14px 40px rgba(15, 23, 42, 0.15); }

/* ---------- search ---------- */
.op-search { background: var(--op-surface); border: 1px solid var(--op-border); border-radius: 18px; box-shadow: var(--op-shadow); padding: 10px; margin-bottom: 8px; }
.op-search-row { display: grid; grid-template-columns: 1.3fr 1.4fr 1.1fr auto; gap: 0; align-items: center; }
.op-field { position: relative; display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 16px; border-right: 1px solid var(--op-border); color: var(--op-muted); }
.op-field i { flex: none; color: #6b7686; width: 1.1em; text-align: center; }
.op-field input, .op-field select { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font: 400 1rem var(--op-font-b); color: var(--op-text); padding: 14px 0; outline: none; appearance: none; -webkit-appearance: none; text-overflow: ellipsis; }
.op-field select { cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, #5b6678 50%), linear-gradient(135deg, #5b6678 50%, transparent 50%); background-position: calc(100% - 9px) 52%, calc(100% - 4px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 22px; } /* pure-CSS chevron: no inline data: image (it would be blocked by a strict CSP and counted as an outside request by the older recette harnesses) */
.op-field:focus-within { box-shadow: inset 0 0 0 2px var(--op-green); border-radius: 12px; }
.op-field--plain { flex-direction: column; align-items: stretch; gap: 4px; border: 1px solid var(--op-border); border-radius: 12px; min-height: 0; padding: 8px 12px; background: var(--op-bg); }
.op-field--plain label { font-size: 0.78rem; font-weight: 600; color: var(--op-muted); }
.op-field--plain select { padding: 4px 22px 4px 0; }
.op-search-btn { margin-left: 10px; min-width: 150px; }
.op-more { margin: 6px 6px 0; } .op-more summary { cursor: pointer; padding: 10px 6px; font-weight: 600; font-size: 0.93rem; color: var(--op-green); list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.op-more summary::-webkit-details-marker { display: none; } .op-more summary::after { content: '\25BE'; font-size: 0.85rem; } .op-more[open] summary::after { content: '\25B4'; }
.op-more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; padding: 4px 0 8px; }
.op-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 0.95rem; cursor: pointer; padding: 0 6px; }
.op-check input { width: 20px; height: 20px; accent-color: var(--op-green); }
.op-link-btn { background: none; border: 0; color: var(--op-green); font: 600 0.93rem var(--op-font-b); text-decoration: underline; cursor: pointer; padding: 10px 8px; min-height: 44px; }

/* ---------- buttons ---------- */
.op-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1.5px solid transparent; font: 700 1rem var(--op-font-b); text-decoration: none; cursor: pointer; transition: background 0.15s, color 0.15s; }
.op-btn--primary { background: var(--op-green); color: #fff; } .op-btn--primary:hover { background: var(--op-green-hover); }
.op-btn--ghost { background: var(--op-surface); color: var(--op-green); border-color: #bcd7c6; } .op-btn--ghost:hover { background: var(--op-green-soft); }
.op-btn--disabled, .op-btn[disabled] { background: #e8e6e1; color: #6b6f78; cursor: not-allowed; }
.op-btn--block { width: 100%; }

/* ---------- sections and cards ---------- */
.op-section { margin-top: 38px; }
.op-section[hidden] { display: none; }
.op-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.op-section-head h2 { font: 800 clamp(1.5rem, 3vw, 2rem)/1.15 var(--op-font-h); color: var(--op-ink); margin: 0; }
.op-more-link { color: var(--op-green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; } .op-more-link i { margin-left: 6px; font-size: 0.85em; }
.op-count { margin: 0; color: var(--op-muted); font-size: 0.95rem; }
.op-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.op-card { display: flex; flex-direction: column; background: var(--op-surface); border: 1px solid var(--op-border); border-radius: var(--op-radius); box-shadow: var(--op-shadow); padding: 22px 22px 0; min-width: 0; transition: box-shadow 0.15s, transform 0.15s; }
.op-card:hover { box-shadow: 0 12px 30px rgba(15, 23, 42, 0.11); transform: translateY(-2px); }
.op-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; min-width: 0; }
.op-logo { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 12px; background: var(--op-green-soft); color: var(--op-green); font: 800 1.1rem var(--op-font-h); overflow: hidden; border: 1px solid var(--op-border); }
.op-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
.op-logo--lg { width: 84px; height: 84px; border-radius: 18px; font-size: 1.5rem; }
.op-org { flex: 1; min-width: 0; font: 700 1.08rem/1.25 var(--op-font-h); color: var(--op-ink); overflow-wrap: anywhere; margin: 0; }
.op-badge { flex: none; padding: 6px 14px; border-radius: 999px; font: 700 0.9rem/1 var(--op-font-b); white-space: nowrap; background: #eceff3; color: #364152; }
.op-badge--green { background: var(--op-green-soft); color: var(--op-green-ink); } .op-badge--orange { background: var(--op-orange-soft); color: var(--op-orange-ink); }
.op-badge--purple { background: var(--op-purple-soft); color: var(--op-purple-ink); } .op-badge--partner { background: #fff4cf; color: #7a5600; }
.op-card-title { margin: 0 0 12px; font: 700 1.2rem/1.3 var(--op-font-b); color: var(--op-ink); }
.op-card-title a { color: inherit; text-decoration: none; } .op-card-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.op-meta { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: #3b4658; font-size: 0.95rem; }
.op-meta li { display: flex; align-items: center; gap: 8px; } .op-meta i { color: #5b6678; font-size: 0.95em; }
.op-summary { color: #3b4658; line-height: 1.55; font-size: 0.98rem; margin: 0 0 18px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.op-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: auto -22px 0; padding: 14px 22px; border-top: 1px solid var(--op-border); }
.op-muted { color: var(--op-muted); font-size: 0.9rem; }
.op-card--soon .op-card-foot .op-muted { color: var(--op-orange-ink); font-weight: 600; }
.op-card-link { color: var(--op-green); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; } .op-card-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.op-card-link i { font-size: 0.85em; }

/* ---------- states ---------- */
.op-skel { min-height: 280px; border-radius: var(--op-radius); background: linear-gradient(100deg, #f1ece4 30%, #f8f4ed 50%, #f1ece4 70%); background-size: 200% 100%; animation: op-shimmer 1.3s linear infinite; }
.op-skel--detail { min-height: 360px; }
@keyframes op-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .op-skel { animation: none; } .op-card, .op-card:hover { transition: none; transform: none; } }
.op-empty { grid-column: 1 / -1; background: var(--op-surface); border: 1px dashed #d5ccbe; border-radius: var(--op-radius); padding: 40px 24px; text-align: center; }
.op-empty h2, .op-empty h3 { font: 700 1.25rem var(--op-font-h); color: var(--op-ink); margin: 0 0 8px; } .op-empty p { color: var(--op-muted); margin: 0 0 18px; }
.op-empty--page { max-width: 640px; margin: 40px auto; }
.op-empty h1 { font: 800 1.7rem var(--op-font-h); color: var(--op-ink); margin: 0 0 10px; }
.op-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.op-page-btn { min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid var(--op-border); background: var(--op-surface); color: var(--op-ink); font: 600 1rem var(--op-font-b); cursor: pointer; }
.op-page-btn:hover:not(:disabled) { background: var(--op-green-soft); } .op-page-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.op-page-btn.is-current { background: var(--op-green); color: #fff; border-color: var(--op-green); opacity: 1; cursor: default; }

/* ---------- partners ---------- */
.op-partners { margin-top: 48px; padding: 28px; background: var(--op-green-soft); border-radius: var(--op-radius); }
.op-partners h2 { font: 700 1.2rem var(--op-font-h); color: var(--op-ink); margin: 0 0 8px; } .op-partners p { margin: 0; color: #2f3e4d; line-height: 1.6; max-width: 62em; }
.op-partner-logos { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; } .op-partner-logos[hidden] { display: none; }
.op-partner-logos li { background: #fff; border-radius: 12px; padding: 10px 16px; display: grid; place-items: center; } .op-partner-logos img { max-height: 40px; width: auto; max-width: 140px; object-fit: contain; }

/* ---------- detail page ---------- */
.op-detail { min-height: 300px; }
.op-d-head { display: flex; gap: 22px; align-items: center; margin-bottom: 22px; }
.op-d-id { min-width: 0; } .op-d-id .op-org { font-size: 1.05rem; color: var(--op-muted); font-weight: 600; margin-bottom: 4px; }
.op-d-id h1 { font: 800 clamp(1.6rem, 3.6vw, 2.5rem)/1.15 var(--op-font-h); color: var(--op-ink); margin: 0 0 12px; overflow-wrap: anywhere; text-wrap: balance; }
.op-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.op-closed { display: flex; gap: 12px; align-items: flex-start; background: #fff3e0; border: 1px solid #f2c789; color: #6b3a05; border-radius: 14px; padding: 14px 18px; margin-bottom: 22px; } .op-closed p { margin: 0; font-weight: 600; } .op-closed i { margin-top: 3px; }
.op-d-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.op-d-main { background: var(--op-surface); border: 1px solid var(--op-border); border-radius: var(--op-radius); padding: 8px 28px 12px; box-shadow: var(--op-shadow); }
.op-sec { padding: 20px 0; border-bottom: 1px solid var(--op-border); } .op-sec:last-child { border-bottom: 0; }
.op-sec h2 { font: 700 1.2rem var(--op-font-h); color: var(--op-ink); margin: 0 0 10px; }
.op-desc { white-space: pre-line; line-height: 1.7; color: #2b3647; overflow-wrap: anywhere; }
.op-list { margin: 0; padding-left: 1.2em; line-height: 1.7; color: #2b3647; } .op-list li { margin-bottom: 4px; overflow-wrap: anywhere; }
.op-d-aside { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 18px; background: var(--op-surface); border: 1px solid var(--op-border); border-radius: var(--op-radius); padding: 22px; box-shadow: var(--op-shadow); }
.op-note { margin: 10px 0 0; font-size: 0.88rem; color: var(--op-muted); line-height: 1.5; }
.op-facts { margin: 0; display: grid; gap: 12px; }
.op-fact { display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; align-items: baseline; } .op-fact i { color: var(--op-green); grid-row: span 2; align-self: start; margin-top: 3px; }
.op-fact dt { font-size: 0.8rem; color: var(--op-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; } .op-fact dd { margin: 0; font-weight: 600; color: var(--op-ink); overflow-wrap: anywhere; }
.op-source { border-top: 1px solid var(--op-border); padding-top: 14px; display: grid; gap: 8px; } .op-pub { margin: 0; display: flex; gap: 10px; align-items: baseline; font-size: 0.93rem; color: #3b4658; overflow-wrap: anywhere; } .op-pub i { color: var(--op-muted); } .op-pub a { color: var(--op-green); font-weight: 600; }
.op-similar { margin-top: 44px; } .op-similar h2 { font: 800 1.5rem var(--op-font-h); color: var(--op-ink); margin: 0 0 16px; }

/* ---------- footer (same look as the main pages) ---------- */
.op-page footer { background: #1e293b; color: #fff; padding: 3rem 2rem 1rem; margin-top: 3rem; width: 100%; }
.op-page .footer-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.op-page .footer-section h4 { font-weight: 700; margin: 0 0 1rem; color: #fff; }
.op-page .footer-section a { display: block; color: #cbd5e1; text-decoration: none; font-size: 0.9rem; margin-bottom: 0.5rem; padding: 2px 0; transition: color 0.3s ease; } .op-page .footer-section a:hover { color: #10b981; }
.op-page .footer-bottom { text-align: center; color: #94a3b8; font-size: 0.85rem; } .op-page .footer-bottom p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .op-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .op-search-row { grid-template-columns: 1fr 1fr; row-gap: 6px; } .op-field--q { grid-column: 1 / -1; } .op-field { border-right: 0; border-bottom: 1px solid var(--op-border); } .op-search-btn { grid-column: 1 / -1; margin: 8px 0 0; }
  .op-more-grid { grid-template-columns: 1fr 1fr; }
  .op-d-grid { grid-template-columns: 1fr; } .op-d-aside { position: static; border: 2px solid var(--op-green); background: #f4faf5; padding: 22px 20px; scroll-margin-top: 80px; } /* below the content, full width, prominent */
  .op-jump { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; min-height: 44px; font-weight: 700; color: var(--op-green); }
}
@media (max-width: 820px) {
  .op-hero { grid-template-columns: 1fr; gap: 20px; } .op-hero-media { max-width: 520px; margin: 0 auto; width: 100%; }
  .op-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .op-group { border: 1px solid var(--op-border); background: var(--op-surface); padding: 8px 12px 8px 8px; } .op-group:last-child { border: 1px solid var(--op-border); }
}
@media (max-width: 640px) {
  .op-wrap { padding: 14px 16px 40px; }
  .op-grid { grid-template-columns: 1fr; }
  .op-search-row { grid-template-columns: 1fr; } .op-more-grid { grid-template-columns: 1fr; }
  .op-group { font-size: 0.93rem; } .op-group-ic { width: 42px; height: 42px; font-size: 1.05rem; }
  .op-d-head { flex-direction: column; align-items: flex-start; gap: 14px; } .op-d-main { padding: 4px 18px 8px; }
  .op-page footer { padding: 2rem 1rem 1rem; } .op-page .footer-content { gap: 1.5rem; }
}

/* The shared design system sets ".rmd-body a { color: inherit }" (specificity 0,1,1): links styled as buttons or accents need a higher one. */
.op-page a.op-btn--primary { color: #fff; }
.op-page a.op-btn--ghost, .op-page a.op-card-link, .op-page a.op-more-link, .op-page .op-pub a { color: var(--op-green); }
.op-page a.op-btn { text-decoration: none; }
.op-hero-text { min-width: 0; }
.op-apply { display: block; }
/* touch targets: the selects of "Plus de filtres" must be at least 40px high on their own (found by the browser recette) */
.op-field--plain select { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.op-field--plain { padding-top: 6px; padding-bottom: 6px; }

/* long titles and names never break a card; the mobile jump link only exists on phones and tablets */
.op-card-title, .op-card-title a, .op-org, .op-meta span { overflow-wrap: anywhere; }
.op-jump { display: none; }
@media (max-width: 1000px) { .op-page a.op-jump { display: inline-flex; color: var(--op-green); } }
