/* The marketplace card from the website design, shared by the website's About
   and Marketplace sections and the journal's curricula pages: a portrait card
   on the design's white face with walnut type, that lifts under the pointer while its title slides up
   and its description rises from below (the About cards show their title and text at rest instead); a grid that floats gently at rest; and
   the opened card that flies to the centre and turns over to show what is
   inside. Colours and timings are the design's own (figma_website/src/Marketplace.tsx). */

.lj-mgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px 32px; max-width: 300px; margin: 0 auto; }
@media (min-width: 40rem) { .lj-mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; } }
@media (min-width: 64rem) { .lj-mgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 80rem) { .lj-mgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

@keyframes lj-market-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.lj-mfloat { animation: lj-market-float 6.3s ease-in-out infinite; }
.lj-mfloat:hover, .lj-mfloat:focus-within { animation-play-state: paused; }

.lj-mcard { position: relative; display: block; width: 100%; aspect-ratio: 54 / 85.6; border-radius: 16px; text-align: left; cursor: pointer; outline: none; box-shadow: 0 10px 30px -12px rgba(61, 43, 26, 0.35); transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.lj-mcard:hover, .lj-mcard:focus-visible { transform: translateY(-16px) scale(1.04); box-shadow: 0 40px 60px -20px rgba(61, 43, 26, 0.55); }
.lj-mcard:focus-visible { box-shadow: 0 0 0 4px var(--lj-mcard-ring-offset, #E1CEBB), 0 0 0 6px #755D3B, 0 40px 60px -20px rgba(61, 43, 26, 0.55); }
.lj-mcard.is-static { cursor: default; }
.lj-mcard.is-hidden { opacity: 0; pointer-events: none; }

.lj-mface { position: relative; height: 100%; width: 100%; border-radius: 16px; overflow: hidden; font-family: var(--font-body, 'Lora', Georgia, serif); background: #FBF7F1; color: #3D2B1A; --m-meta: var(--muted, #816A4E); --m-body: #5A4529; --m-rule: rgba(196, 168, 130, 0.5); --m-ring: rgba(117, 93, 59, 0.15); --m-solid-bg: #755D3B; --m-solid-fg: #fff; --m-solid-hover: #5A4529; --m-ghost-border: rgba(117, 93, 59, 0.5); --m-ghost-fg: #755D3B; --m-ghost-hover: rgba(117, 93, 59, 0.1); }

.lj-mring { position: absolute; border-radius: 9999px; border: 1px solid var(--m-ring); transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1); }
.lj-mring--big { top: -64px; right: -64px; width: 192px; height: 192px; }
.lj-mring--small { top: -24px; right: -24px; width: 112px; height: 112px; }
.lj-mcard:hover .lj-mring--big, .lj-mcard:focus-visible .lj-mring--big { transform: scale(1.25); }
.lj-mcard:hover .lj-mring--small, .lj-mcard:focus-visible .lj-mring--small { transform: scale(1.1); }
.lj-mchip { flex: none; width: 36px; height: 28px; margin: 30px 0 -28px; border-radius: 6px; border: 1px solid var(--m-ring); opacity: 0.8; }

.lj-mface-inner { position: relative; height: 100%; display: flex; flex-direction: column; padding: 24px; }
.lj-mhead { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 1.25rem; }
.lj-mby { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lj-mauthor { font-family: var(--font-display, 'Playfair Display', Georgia, serif); font-style: italic; font-size: 0.875rem; line-height: 1.25; color: var(--m-meta); overflow-wrap: anywhere; }
.lj-mcat { font-size: 0.6rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--m-meta); }
.lj-mcat.is-glyph { font-size: 1rem; letter-spacing: 0; text-transform: none; }
.lj-mprice { font-family: var(--font-display, 'Playfair Display', Georgia, serif); font-style: italic; font-size: 0.875rem; color: var(--m-meta); }
.lj-mstatus { font-size: 0.55rem; letter-spacing: 0.2em; text-transform: uppercase; padding: 2px 8px; border-radius: 9999px; border: 1px solid currentColor; color: var(--m-meta); white-space: nowrap; }
.lj-mstatus.is-active { background: #755D3B; border-color: #755D3B; color: #fff; }
.lj-mstatus.is-paused { background: #A96522; border-color: #A96522; color: #fff; }
.lj-mstatuses { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.lj-mstatus.is-mandatory { color: #755D3B; }

.lj-mbottom { margin-top: auto; display: flex; flex-direction: column; min-height: 0; }
.lj-mrule { flex: none; width: 32px; height: 1px; margin-bottom: 16px; background: var(--m-rule); }
.lj-mtitle { flex: none; margin: 0; font-family: var(--font-display, 'Playfair Display', Georgia, serif); font-weight: 400; font-size: 1.45rem; line-height: 1.25; color: inherit; overflow-wrap: anywhere; }
.lj-mmeta { flex: none; margin: 12px 0 0; font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--m-meta); transition: opacity 0.3s ease; }
.lj-mcard:hover .lj-mbottom.is-interactive .lj-mmeta, .lj-mcard:focus-visible .lj-mbottom.is-interactive .lj-mmeta { opacity: 0; }

.lj-mreveal { display: grid; grid-template-rows: 0fr; min-height: 0; opacity: 0; transition: grid-template-rows 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.lj-mreveal-inner { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.lj-mcard:hover .lj-mreveal, .lj-mcard:focus-visible .lj-mreveal, .lj-mcard:focus-within .lj-mreveal { grid-template-rows: 1fr; opacity: 1; transition-delay: 75ms; }
.lj-mdesc { flex: 0 1 auto; min-height: 0; margin: 10px 0 0; font-size: 0.875rem; line-height: 1.625; color: var(--m-body); display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
#lj-marketplace-cards .lj-mdesc { -webkit-line-clamp: 9; }
.lj-mactions { flex: none; margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.lj-mactions:empty { display: none; }
.lj-mbtn { font-family: var(--font-body, 'Lora', Georgia, serif); font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; padding: 8px 14px; border-radius: 9999px; border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; line-height: 1; transition: background-color 0.2s ease, color 0.2s ease; }
.lj-mbtn.is-solid { background: var(--m-solid-bg); color: var(--m-solid-fg); }
.lj-mbtn.is-solid:not([disabled]):hover { background: var(--m-solid-hover); }
.lj-mbtn.is-ghost { background: transparent; border-color: var(--m-ghost-border); color: var(--m-ghost-fg); }
.lj-mbtn.is-ghost:not([disabled]):hover { background: var(--m-ghost-hover); }
.lj-mbtn[disabled] { color: var(--disabled-fg, #6A6763); background: var(--disabled-bg, #E9E7E4); border-color: var(--disabled-bg, #E9E7E4); cursor: default; }
.lj-mbtn .lj-mplus { font-size: 0.875rem; line-height: 1; }
.lj-mbtn svg { display: block; }

/* The opened card: fixed over the page, flying from the card's own place to the centre and turning over. */
.lj-flip { position: fixed; inset: 0; z-index: 1000; }
.lj-flip-shade { position: absolute; inset: 0; opacity: 0; transition: opacity 160ms ease; }
.lj-in-shell .lj-flip-shade { top: calc(var(--lj-nav-height, 72px) + 1px); }
.lj-flip-shade.show { opacity: 1; }
.lj-flip-stage { position: absolute; perspective: 2200px; transition: top 900ms cubic-bezier(0.65, 0, 0.25, 1), left 900ms cubic-bezier(0.65, 0, 0.25, 1), width 900ms cubic-bezier(0.65, 0, 0.25, 1), height 900ms cubic-bezier(0.65, 0, 0.25, 1); }
.lj-flip-card { position: relative; height: 100%; width: 100%; transform-style: preserve-3d; transform: rotateY(0deg); transition: transform 900ms cubic-bezier(0.65, 0, 0.25, 1); }
.lj-flip.is-open .lj-flip-card { transform: rotateY(180deg); }
.lj-flip-front, .lj-flip-back { position: absolute; inset: 0; border-radius: 16px; box-shadow: 0 40px 80px -20px rgba(30, 20, 16, 0.6); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.lj-flip-back { transform: rotateY(180deg); }

/* The back of the card: the curriculum as the design shows it. */
.lj-cv { height: 100%; width: 100%; border-radius: 16px; background: #FDFBF7; color: #3D2B1A; display: flex; flex-direction: column; overflow: hidden; font-family: var(--font-body, 'Lora', Georgia, serif); }
.lj-cv-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid #E1CEBB; }
@media (min-width: 48rem) { .lj-cv-head { padding: 20px 32px; } }
.lj-cv-head h2 { margin: 0; font-family: var(--font-display, 'Playfair Display', Georgia, serif); font-weight: 400; font-size: 1.5rem; line-height: 1.25; color: #3D2B1A; }
.lj-cv-figure { margin: 2px 0 0; font-size: 0.875rem; color: var(--muted, #816A4E); }
.lj-cv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lj-cv-pill { font-size: 0.75rem; padding: 4px 12px; border-radius: 9999px; background: #F0E6D8; color: #5A4529; white-space: nowrap; }
.lj-cv-pill.is-status { background: #755D3B; color: #fff; font-size: 0.65rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; }
.lj-cv-close { flex: none; margin-left: 8px; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid rgba(196, 168, 130, 0.4); background: #fff; color: #755D3B; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.3s, background-color 0.2s; }
.lj-cv-close svg { display: block; width: 16px; height: 16px; }
.lj-cv-close:hover { transform: rotate(90deg); background: #F7F0E8; }
.lj-cv-close:active { transform: rotate(90deg) scale(0.96); }
@media (prefers-reduced-motion: reduce) { .lj-cv-close:hover, .lj-cv-close:active { transform: none; } }
.lj-cv-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 24px; }
@media (min-width: 48rem) { .lj-cv-body { padding: 24px 32px; } }
.lj-cv-summary { margin: 0; font-size: 1.05rem; line-height: 1.625; color: #3D2B1A; max-width: 56rem; }
.lj-cv-owner { margin: 8px 0 0; font-size: 0.875rem; color: var(--muted, #816A4E); }
.lj-cv-mandatory { margin: 8px 0 0; font-size: 0.875rem; color: #755D3B; }
.lj-cv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.lj-cv-actions:empty { display: none; }
.lj-cv-actions .lj-mbtn.is-solid:not([disabled]) { background: #755D3B; color: #fff; }
.lj-cv-actions .lj-mbtn.is-solid:not([disabled]):hover { background: #5A4529; }
.lj-cv-actions .lj-mbtn.is-ghost:not([disabled]) { border-color: rgba(117, 93, 59, 0.5); color: #755D3B; }
.lj-cv-actions .lj-mbtn.is-ghost:not([disabled]):hover { background: rgba(117, 93, 59, 0.1); }
@keyframes lj-curriculum-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.lj-cv-section { margin-top: 36px; opacity: 0; animation: lj-curriculum-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.lj-cv-section-head { display: flex; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #E1CEBB; }
.lj-cv-section-no { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted, #816A4E); }
.lj-cv-section-title { font-size: 0.875rem; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 500; color: #3D2B1A; }
.lj-cv-chapters { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 40px; }
@media (min-width: 40rem) { .lj-cv-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .lj-cv-chapters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lj-cv-chapter { display: flex; gap: 16px; }
.lj-cv-chapter-no { flex: none; width: 1.25rem; padding-top: 4px; font-size: 0.75rem; color: var(--muted, #816A4E); font-variant-numeric: tabular-nums; }
.lj-cv-chapter-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.lj-cv-chapter-title h4 { margin: 0; font-family: var(--font-body, 'Lora', Georgia, serif); font-size: 0.875rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; color: #3D2B1A; }
.lj-cv-here { font-size: 0.6rem; letter-spacing: 0.15em; text-transform: uppercase; background: #755D3B; color: #fff; padding: 2px 8px; border-radius: 9999px; }
.lj-cv-done { font-size: 0.75rem; color: var(--muted, #816A4E); }
.lj-cv-chapter p { margin: 2px 0 0; font-size: 0.875rem; line-height: 1.625; color: #755D3B; }
.lj-cv-chapter p.lj-cv-chapter-theme { margin-top: 4px; color: #3D2B1A; text-transform: none; }
.lj-cv-chapter p.lj-cv-chapter-theme::first-letter { text-transform: uppercase; }
.lj-cv-tail { height: 24px; }

@media (prefers-reduced-motion: reduce) {
  .lj-mfloat { animation: none; }
  .lj-mcard, .lj-mring, .lj-mbottom, .lj-mreveal, .lj-flip-shade, .lj-flip-stage, .lj-flip-card { transition-duration: 1ms; }
  .lj-cv-section { animation: none; opacity: 1; }
}
