/**
 * Skulltag — images in the body text (0.9.44, inc/templates/content-media.php).
 *
 * 1. Figures never wider than the column (the inline caption width is gone).
 * 2. Screenshots of 560 px and wider fill the column, caption included.
 * 3. Every body image is a zoom link (lightbox.js); it does not look like a text link.
 * 4. Own captures carry the Skulltag mark bottom-right: the hexagon emblem from
 *    the header plus the wordmark. Pure CSS on top of the image, the files are
 *    untouched; third-party images never get it (no .is-own-capture).
 */

/* ----- 1 + 2: fit the column ----- */
figure.wp-caption,
figure.wp-block-image {
	max-width: 100%;
	margin: 26px 0;
}
figure.wp-caption { width: fit-content; }
figure.wp-caption.st-wide-fig,
figure.wp-block-image.st-wide-fig { width: 100%; }
figure.wp-caption img,
figure.wp-block-image img,
a.st-zoom img { max-width: 100%; height: auto; }
img.st-wide { display: block; width: 100%; height: auto; }

figure.wp-caption figcaption,
figure.wp-block-image figcaption {
	margin: 8px 0 0;
	max-width: 72ch;
	font-size: 13.5px;
	line-height: 1.45;
	color: var(--ink-3);
	text-align: left;
}
figure.wp-caption figcaption strong,
figure.wp-block-image figcaption strong { color: var(--ink-2); font-weight: 600; }

/* ----- 3: zoom link, not a text link ----- */
a.st-zoom {
	position: relative;
	display: inline-block;
	max-width: 100%;
	vertical-align: top;
	line-height: 0;
	border-radius: var(--r);
	cursor: zoom-in;
}
a.st-zoom.is-wide { display: block; }
.sp-article .sp-body a.st-zoom,
.content #what-it-is a.st-zoom,
.sp-article .sp-body a.st-zoom:hover,
.content #what-it-is a.st-zoom:hover { border-bottom: 0; }
a.st-zoom img { border-radius: var(--r); transition: filter .15s; }
a.st-zoom:hover img { filter: brightness(1.06); }
.sp-article a.st-zoom:focus-visible,
a.st-zoom:focus-visible { outline: 2px solid var(--rust-hi); outline-offset: 3px; border-radius: var(--r); }

/* ----- 4: Skulltag mark on own captures ----- */
/* The emblem is the header's hexagon (rust gradient, dark "S") as an SVG, so it
   renders the same on every image; the wordmark is live text in the display face. */
figure.is-own-capture a.st-zoom::after,
figure.shot[data-provenance="own-capture"] a.shot-zoom::after,
.shot-lightbox.is-own-capture .shot-lightbox-frame::after {
	content: "SKULLTAG";
	position: absolute;
	right: 10px;
	bottom: 10px;
	padding: 5px 9px 5px 27px;
	font-family: var(--font-d);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .14em;
	line-height: 1;
	color: oklch(0.93 0.012 80 / .92);
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 22'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23dd5f13'/%3E%3Cstop offset='1' stop-color='%23973e16'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M10 0 20 5.94v10.12L10 22 0 16.06V5.94z' fill='url(%23g)'/%3E%3Cpath d='M13.6 7.2H7.4v3.7h5.2v3.9H6.4' fill='none' stroke='%231a1411' stroke-width='2.1'/%3E%3C/svg%3E") no-repeat 8px 50% / 13px 14px,
		oklch(0.155 0.012 55 / .74);
	border: 1px solid oklch(0.635 0.175 45 / .35);
	border-radius: 3px;
	pointer-events: none;
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}
figure.shot[data-provenance="own-capture"] a.shot-zoom { position: relative; }

@media (max-width: 720px) {
	figure.wp-caption,
	figure.wp-block-image { margin: 20px 0; }
	figure.is-own-capture a.st-zoom::after,
	figure.shot[data-provenance="own-capture"] a.shot-zoom::after {
		right: 6px;
		bottom: 6px;
		padding: 4px 7px 4px 22px;
		font-size: 9.5px;
		background-position: 6px 50%, 0 0;
		background-size: 11px 12px, auto;
	}
}

/* Lightbox: the image sits in a frame so the mark can follow its corner */
.shot-lightbox-frame { position: relative; display: inline-block; line-height: 0; max-width: 92vw; }
