/* Jagmag Projects — front end. Uses the theme's --jl2-* tokens only (no new tokens). */

.jlp, .jlp *, .jlp *::before, .jlp *::after { box-sizing: border-box; }
.jlp { color: var(--jl2-color-ink); font-family: var(--jl2-font-sans); background: var(--jl2-color-cream); }
/* The theme already offsets <body> for its fixed header; no extra top margin here. */

.jlp-shell { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .jlp-shell { padding: 0 24px; } }

.jlp a { color: var(--jl2-color-gold-deep); text-decoration: none; }
.jlp a:hover { color: var(--jl2-color-gold); }
.jlp-kicker { margin: 0 0 8px; font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--jl2-color-gold-deep); }
.jlp-kicker a { color: inherit; }
.jlp-dot { margin: 0 .5em; opacity: .5; }

/* Buttons — theme glass primary tokens */
.jlp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--jl2-btn-min-h); padding: 0 var(--jl2-btn-pad-x); border-radius: var(--jl2-btn-radius); font-family: var(--jl2-btn-font); font-size: var(--jl2-btn-size); font-weight: var(--jl2-btn-weight); letter-spacing: var(--jl2-btn-tracking); line-height: 1; color: var(--jl2-btn-primary-fg); background: var(--jl2-btn-primary-bg); border: 1px solid var(--jl2-btn-primary-border); box-shadow: var(--jl2-btn-primary-shadow); -webkit-backdrop-filter: var(--jl2-btn-backdrop); backdrop-filter: var(--jl2-btn-backdrop); transition: var(--jl2-btn-transition); }
.jlp-btn:hover { color: var(--jl2-btn-primary-fg); transform: translateY(var(--jl2-btn-hover-lift)); filter: brightness(1.04); }
.jlp-link { font-weight: 600; }

/* Hero */
.jlp-hero { position: relative; overflow: hidden; background: var(--jl2-color-cream-2); color: var(--jl2-color-ink); }
.jlp-hero__bg { position: absolute; inset: 0; }
.jlp-hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 84% 50%; display: block; }
.jlp-hero { min-height: 340px; }
/* No overlay on the artwork — text sits directly on the pale watercolour with a soft cream halo. */
.jlp-hero__inner > * { text-shadow: 0 0 2px rgba(var(--jl2-color-cream-rgb), .95), 0 1px 14px rgba(var(--jl2-color-cream-rgb), .85), 0 0 28px rgba(var(--jl2-color-cream-rgb), .7); }
.jlp-hero__inner { position: relative; z-index: 1; padding: 56px 16px 48px; text-align: left; }
.jlp-hero .jlp-kicker { color: var(--jl2-color-gold-deep); }
.jlp-hero__title { margin: 0 0 12px; font-family: var(--jl2-font-display); font-weight: 400; font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.1; color: var(--jl2-color-ink); }
.jlp-hero__sub { max-width: 19rem; margin: 0; font-size: 1.02rem; line-height: 1.6; color: var(--jl2-color-mute-soft); }
.jlp-hero__count { margin: 18px 0 0; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--jl2-color-gold-deep); }
@media (min-width: 768px) {
	/* Tablet + desktop: show the whole watercolour; copy sits on the pale left half, clear of the tree. */
	.jlp-hero { min-height: 0; }
	.jlp-hero__bg { position: relative; }
	.jlp-hero__bg img { height: auto; object-fit: fill; }
	.jlp-hero__inner { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; text-align: left; padding: 40px 24px; max-width: none; }
	.jlp-hero__inner > * { margin-left: 0; margin-right: 0; }
	.jlp-hero__title { font-size: clamp(2.6rem, 4.4vw, 4rem); }
	.jlp-hero__sub { max-width: 26rem; }
}
@media (min-width: 768px) and (max-width: 1023px) { .jlp-hero__title { font-size: 2.4rem; } .jlp-hero__sub { max-width: 21rem; font-size: .95rem; } }

/* Filters */
.jlp-filters { display: flex; gap: 8px; margin: 24px 0 8px; padding-bottom: 6px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.jlp-filters::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .jlp-filters { flex-wrap: wrap; overflow: visible; margin-top: 32px; } }
.jlp-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--jl2-radius-pill); border: 1px solid var(--jl2-color-line); background: #fff; color: var(--jl2-color-ink); font-size: .86rem; font-weight: 600; white-space: nowrap; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.jlp-chip:hover { border-color: var(--jl2-color-gold); color: var(--jl2-color-gold-deep); }
.jlp-chip.is-active { background: var(--jl2-color-gold-deep); border-color: var(--jl2-color-gold-deep); color: #fff; }
.jlp-chip__n { font-size: .74rem; font-weight: 600; opacity: .65; }
.jlp-chip--sm { padding: 5px 11px; font-size: .78rem; }

/* Grid + cards */
.jlp-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin: 20px 0 8px; }
@media (min-width: 640px) { .jlp-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; } }
@media (min-width: 1024px) { .jlp-grid { grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 28px; } }
.jlp-card { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--jl2-color-line); border-radius: var(--jl2-radius-md); overflow: hidden; box-shadow: var(--jl2-shadow-soft); transition: transform .2s ease, box-shadow .2s ease; }
.jlp-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(var(--jl2-color-ink-rgb, 20,20,15), .12); }
.jlp-card__media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--jl2-color-cream-2); overflow: hidden; }
.jlp-card__img, .jlp-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.jlp-card:hover .jlp-card__media img { transform: scale(1.04); }
.jlp-card__placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--jl2-color-cream-2), var(--jl2-color-gold-soft)); }
.jlp-card__badge { position: absolute; left: 12px; top: 12px; padding: 5px 10px; border-radius: var(--jl2-radius-pill); background: rgba(255,255,255,.92); color: var(--jl2-color-gold-deep); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.jlp-card__body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; }
.jlp-card__meta { font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--jl2-color-mute); }
.jlp-card__title { margin: 0; font-family: var(--jl2-font-sans) !important; font-size: 1.08rem; font-weight: 700; line-height: 1.35; }
.jlp-card__title a { color: var(--jl2-color-ink); }
.jlp-card__title a:hover { color: var(--jl2-color-gold-deep); }
.jlp-card__excerpt { margin: 0; font-size: .92rem; line-height: 1.55; color: var(--jl2-color-mute-soft); }
.jlp-card__more { margin-top: auto; padding-top: 6px; font-size: .88rem; font-weight: 700; }

/* Pagination */
.jlp-pagination { margin: 28px 0 8px; }
.jlp-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.jlp-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 14px; border-radius: var(--jl2-radius-pill); border: 1px solid var(--jl2-color-line); background: #fff; color: var(--jl2-color-ink); font-size: .9rem; font-weight: 600; }
.jlp-pagination .page-numbers.current { background: var(--jl2-color-gold-deep); border-color: var(--jl2-color-gold-deep); color: #fff; }
.jlp-pagination .page-numbers.dots { border: 0; background: none; }
.jlp-empty { padding: 40px 0; text-align: center; color: var(--jl2-color-mute); }

/* Archive CTA */
.jlp-cta { margin: 48px 0 56px; padding: 36px 20px; text-align: center; border-radius: var(--jl2-radius-lg); background: var(--jl2-color-cream-2); border: 1px solid var(--jl2-color-line-soft); }
.jlp-cta__title { margin: 0 0 8px; font-family: var(--jl2-font-display); font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.jlp-cta__text { max-width: 36rem; margin: 0 auto 20px; color: var(--jl2-color-mute-soft); line-height: 1.6; }

/* Single: header */
.jlp-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 18px; font-size: .82rem; color: var(--jl2-color-mute); }
.jlp-crumbs span { opacity: .5; }
.jlp-head { max-width: 52rem; margin: 0 0 24px; }
.jlp-head__title { margin: 0 0 14px; font-family: var(--jl2-font-display); font-weight: 400; font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.15; }
.jlp-head__answer { margin: 0; padding: 14px 18px; border-left: 3px solid var(--jl2-color-gold); background: #fff; border-radius: 0 var(--jl2-radius-sm) var(--jl2-radius-sm) 0; font-size: 1.02rem; line-height: 1.6; color: var(--jl2-color-mute-soft); }

/* Single: cover */
.jlp-cover { width: 100%; max-width: 1100px; margin: 0 auto 28px; padding: 0 16px; }
@media (min-width: 768px) { .jlp-cover { padding: 0 24px; } }
.jlp-cover__link { display: block; border-radius: var(--jl2-radius-md); overflow: hidden; background: var(--jl2-color-cream-2); box-shadow: var(--jl2-shadow-soft); cursor: zoom-in; }
.jlp-cover__img, .jlp-cover__link img { width: 100%; height: auto; max-height: 640px; object-fit: cover; display: block; }

/* Single: layout */
.jlp-layout { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; }
@media (min-width: 1024px) { .jlp-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; } }
.jlp-article { min-width: 0; }
.jlp-snapshot { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0 0 26px; padding: 16px 18px; border-radius: var(--jl2-radius-md); background: #fff; border: 1px solid var(--jl2-color-line); }
@media (min-width: 640px) { .jlp-snapshot { grid-template-columns: repeat(3, 1fr); } }
.jlp-snapshot dt { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--jl2-color-gold-deep); }
.jlp-snapshot dd { margin: 3px 0 0; font-size: .95rem; line-height: 1.45; }

/* Single: content typography */
.jlp-content { font-size: 1.02rem; line-height: 1.7; color: var(--jl2-color-ink); }
.jlp-content > * { max-width: 100%; }
.jlp-content p { margin: 0 0 1.15em; }
.jlp-content h2 { margin: 2em 0 .6em; font-family: var(--jl2-font-display); font-weight: 400; font-size: clamp(1.45rem, 2.6vw, 1.9rem); line-height: 1.25; scroll-margin-top: 120px; }
.jlp-content h3 { margin: 1.5em 0 .5em; font-family: var(--jl2-font-sans) !important; font-weight: 700; font-size: 1.12rem; }
.jlp-content ul, .jlp-content ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.jlp-content li { margin-bottom: .35em; }
.jlp-content img { max-width: 100%; height: auto; border-radius: var(--jl2-radius-sm); }
.jlp-content blockquote { margin: 1.4em 0; padding: 12px 20px; border-left: 3px solid var(--jl2-color-gold); background: #fff; color: var(--jl2-color-mute-soft); }
.jlp-content table { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-collapse: collapse; margin: 0 0 1.4em; font-size: .95rem; }
.jlp-content table > tbody, .jlp-content table > thead { display: table; width: 100%; min-width: 420px; }
.jlp-content td, .jlp-content th { padding: 10px 12px; border-bottom: 1px solid var(--jl2-color-line); text-align: left; vertical-align: top; }
.jlp-content .jagmag-project-summary { margin: 0 0 1.6em; padding: 16px 18px; border-radius: var(--jl2-radius-md); background: #fff; border: 1px solid var(--jl2-color-line); }
.jlp-content .jagmag-mini-kicker { display: block; margin-bottom: 6px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--jl2-color-gold-deep); }

/* TOC */
.jlp-toc { margin: 0 0 1.8em; padding: 16px 18px; border-radius: var(--jl2-radius-md); background: #fff; border: 1px solid var(--jl2-color-line); }
.jlp-toc__title { display: block; margin-bottom: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--jl2-color-gold-deep); }
.jlp-toc ol { margin: 0; padding-left: 1.2em; columns: 1; font-size: .95rem; }
@media (min-width: 640px) { .jlp-toc ol { columns: 2; column-gap: 24px; } }
.jlp-toc li { margin-bottom: 4px; break-inside: avoid; }

/* Facts */
.jlp-facts { margin: 0 0 1.6em; border-radius: var(--jl2-radius-md); background: #fff; border: 1px solid var(--jl2-color-line); overflow: hidden; }
.jlp-facts__table { width: 100%; border-collapse: collapse; margin: 0; font-size: .95rem; }
.jlp-facts__table th { width: 38%; padding: 11px 16px; font-weight: 700; color: var(--jl2-color-gold-deep); background: var(--jl2-color-cream-2); border-bottom: 1px solid var(--jl2-color-line); text-align: left; }
.jlp-facts__table td { padding: 11px 16px; border-bottom: 1px solid var(--jl2-color-line); }
.jlp-facts__table tr:last-child th, .jlp-facts__table tr:last-child td { border-bottom: 0; }

/* Gallery */
.jlp-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0 0 1.8em; }
@media (min-width: 768px) { .jlp-gallery { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
.jlp-gallery__item { margin: 0; min-width: 0; }
.jlp-gallery__link { display: block; aspect-ratio: 4 / 3; border-radius: var(--jl2-radius-sm); overflow: hidden; background: var(--jl2-color-cream-2); cursor: zoom-in; }
.jlp-gallery__img, .jlp-gallery__link img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; transition: transform .35s ease; }
.jlp-gallery__link:hover img { transform: scale(1.04); }
.jlp-gallery__cap { margin-top: 6px; font-size: .8rem; line-height: 1.4; color: var(--jl2-color-mute); }

/* FAQ */
.jlp-faq { margin: 0 0 1.8em; }
.jlp-faq__item { margin-bottom: 10px; border-radius: var(--jl2-radius-sm); background: #fff; border: 1px solid var(--jl2-color-line); }
.jlp-faq__q { padding: 14px 44px 14px 16px; cursor: pointer; font-weight: 700; font-size: 1rem; list-style: none; position: relative; }
.jlp-faq__q::-webkit-details-marker { display: none; }
.jlp-faq__q::after { content: ""; position: absolute; right: 16px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--jl2-color-gold-deep); border-bottom: 2px solid var(--jl2-color-gold-deep); transform: translateY(-70%) rotate(45deg); transition: transform .2s ease; }
.jlp-faq__item[open] > .jlp-faq__q::after { transform: translateY(-30%) rotate(-135deg); }
.jlp-faq__a { padding: 0 16px 14px; color: var(--jl2-color-mute-soft); line-height: 1.6; }
.jlp-faq__a p:last-child { margin-bottom: 0; }

/* Tags */
.jlp-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 28px 0 0; }
.jlp-tags__label { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--jl2-color-mute); }

/* Aside */
.jlp-aside { position: sticky; top: 124px; }
@media (max-width: 1023px) { .jlp-aside { position: static; } }
.jlp-aside__card { padding: 22px; border-radius: var(--jl2-radius-md); background: #fff; border: 1px solid var(--jl2-color-line); box-shadow: var(--jl2-shadow-soft); }
.jlp-aside__title { margin: 0 0 8px; font-family: var(--jl2-font-display); font-weight: 400; font-size: 1.5rem; }
.jlp-aside__card p { margin: 0 0 16px; color: var(--jl2-color-mute-soft); line-height: 1.55; }
.jlp-aside__card .jlp-btn { width: 100%; margin-bottom: 12px; }
.jlp-aside__card .jlp-link { display: block; text-align: center; font-size: .9rem; }

/* Related */
.jlp-related { margin: 56px auto 64px; }
.jlp-section__title { margin: 0 0 6px; font-family: var(--jl2-font-display); font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.jlp-related__all { margin: 18px 0 0; text-align: right; }

/* Lightbox (self-contained; same deterrents as the product gallery) */
.jlp-lb { position: fixed; inset: 0; z-index: 99999; display: none; background: rgba(10, 10, 8, .94); color: #fff; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.jlp-lb.is-open { display: block; }
.jlp-lb__stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 56px 12px 48px; cursor: zoom-in; }
.jlp-lb__stage.is-actual { align-items: flex-start; justify-content: flex-start; cursor: zoom-out; }
.jlp-lb__img { max-width: 100%; max-height: calc(100vh - 104px); width: auto; height: auto; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.jlp-lb__stage.is-actual .jlp-lb__img { max-width: none; max-height: none; }
.jlp-lb__btn { position: absolute; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 22px; line-height: 44px; text-align: center; cursor: pointer; backdrop-filter: blur(6px); }
.jlp-lb__btn:hover { background: rgba(255,255,255,.24); }
.jlp-lb__close { top: 10px; right: 10px; }
.jlp-lb__prev, .jlp-lb__next { top: 50%; transform: translateY(-50%); }
.jlp-lb__prev { left: 8px; }
.jlp-lb__next { right: 8px; }
.jlp-lb__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px; text-align: center; font-size: .86rem; color: rgba(255,255,255,.85); background: linear-gradient(0deg, rgba(0,0,0,.6), transparent); pointer-events: none; }
.jlp-lb__count { position: absolute; top: 20px; left: 16px; font-size: .82rem; letter-spacing: .08em; color: rgba(255,255,255,.7); }
body.jlp-lb-open { overflow: hidden; }

/* Legacy content wrappers carried over from the blog posts (inline styles stripped on migration) */
.jlp-content .jagmag-answer-block, .jlp-content .jagmag-answer-first { margin: 0 0 1.6em; padding: 14px 18px; border-left: 3px solid var(--jl2-color-gold); background: #fff; border-radius: 0 var(--jl2-radius-sm) var(--jl2-radius-sm) 0; color: var(--jl2-color-mute-soft); }
.jlp-content .jagmag-cta { margin: 2em 0 1em; padding: 22px 24px; border-radius: var(--jl2-radius-md); background: var(--jl2-color-cream-2); border: 1px solid var(--jl2-color-line); }
.jlp-content .jagmag-cta h2 { margin-top: 0; }
.jlp-content .jagmag-cta p:last-child { margin-bottom: 0; }
.jlp-content .jagmag-collage { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0 0 1.6em; }
.jlp-content .jagmag-collage figure { margin: 0; }
.jlp-content figure { margin: 0 0 1.6em; }
.jlp-content figcaption { margin-top: 6px; font-size: .82rem; color: var(--jl2-color-mute); }
.jlp-content .jagmag-faq h2 { margin-top: 2em; }
.jlp-content iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--jl2-radius-sm); background: var(--jl2-color-ink); }

/* Mobile hero: copy stays on the paper, left of the tree (must come after the base .jlp-hero__sub rule). */
@media (max-width: 767px) {
	.jlp-hero { min-height: 0; }
	.jlp-hero__inner { padding: 30px 16px 34px; }
	.jlp-hero .jlp-kicker { margin-bottom: 4px; font-size: .7rem; letter-spacing: .1em; }
	.jlp-hero__title { margin-bottom: 8px; font-size: 1.95rem; line-height: 1.12; }
	.jlp-hero__sub { max-width: 14rem; font-size: .88rem; line-height: 1.5; }
	.jlp-hero__count { margin-top: 12px; font-size: .74rem; }
}
@media (min-width: 768px) and (max-width: 1023px) {
	.jlp-hero__inner { justify-content: flex-start; padding-top: 34px; }
	.jlp-hero .jlp-kicker { font-size: .72rem; }
	.jlp-hero__sub { font-size: .9rem; line-height: 1.5; }
	.jlp-hero__count { margin-top: 12px; font-size: .76rem; }
}
