/**
 * PHARAON-POST-GALLERY
 *
 * Every rule is scoped under `.ph-gallery` or `.ph-figure`, both of which only
 * exist inside post content that opts in. Nothing here can reach the theme.
 *
 * The grid is deliberately not square-cropped: press photographs are 3:2 and
 * cropping them to a tile throws away the composition the photographer framed.
 * Cells keep the ratio and the row heights stay equal because every frame from
 * this shoot shares it.
 */

/* ==================================================================
   1. GRID
   ================================================================== */

.ph-gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin: 2.5rem 0;
	padding: 0;
	list-style: none;
}

.ph-gallery--wide {
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 782px) {
	.ph-gallery {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 18px;
	}

	.ph-gallery--wide {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ==================================================================
   2. ITEM
   ================================================================== */

.ph-gallery__item {
	margin: 0;
	min-width: 0;
}

.ph-gallery__link {
	display: block;
	position: relative;
	overflow: hidden;
	background: #eef1f7;
	border-radius: 3px;
	line-height: 0;
	transition: transform 320ms cubic-bezier(0.16, 1, 0.30, 1),
		box-shadow 320ms cubic-bezier(0.16, 1, 0.30, 1);
}

.ph-gallery__link img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	transition: transform 520ms cubic-bezier(0.16, 1, 0.30, 1);
}

.ph-gallery__link:hover,
.ph-gallery__link:focus-visible {
	transform: translateY(-4px);
	box-shadow: 0 16px 32px -18px rgba(12, 18, 40, 0.55);
}

.ph-gallery__link:hover img,
.ph-gallery__link:focus-visible img {
	transform: scale(1.035);
}

.ph-gallery__link:focus-visible {
	outline: 2px solid var(--themeht-primary-color, #e3ad0b);
	outline-offset: 3px;
}

/* The magnifier hint sits over the corner rather than the middle, so it never
   covers a face. */
.ph-gallery__link::after {
	content: "";
	position: absolute;
	right: 10px;
	bottom: 10px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(10, 17, 48, 0.72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4M11 8v6M8 11h6'/%3E%3C/svg%3E") center / 16px no-repeat;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 260ms ease, transform 260ms ease;
	pointer-events: none;
}

.ph-gallery__link:hover::after,
.ph-gallery__link:focus-visible::after {
	opacity: 1;
	transform: none;
}

.ph-gallery__cap {
	display: block;
	margin-top: 0.6rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: #6b7386;
}

/* ==================================================================
   3. SINGLE FIGURE (outside the grid)
   ================================================================== */

.ph-figure {
	margin: 2.25rem 0;
}

.ph-figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 3px;
}

.ph-figure figcaption {
	margin-top: 0.7rem;
	font-size: 0.8125rem;
	line-height: 1.55;
	color: #6b7386;
}

/* ==================================================================
   4. PRESS-RELEASE FURNITURE
   ================================================================== */

.ph-dateline {
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--themeht-text-color, #200043);
}

.ph-note {
	margin: 2.5rem 0 0;
	padding: 1.25rem 1.4rem;
	background: #f4f6fa;
	border-left: 3px solid var(--themeht-primary-color, #e3ad0b);
	font-size: 0.9375rem;
	line-height: 1.65;
}

.ph-note p {
	margin: 0 0 0.6rem;
}

.ph-note p:last-child {
	margin-bottom: 0;
}

/* ==================================================================
   5. LIGHTBOX SKIN
   ==================================================================
   Magnific Popup ships its own stylesheet theme-wide; these few rules only
   restyle the caption block so it matches the site rather than the plugin. */

/* The caption sits directly on the photograph, so it needs its own ground -
   a pale sky or a white marquee roof left the default grey unreadable. */
.mfp-wrap .mfp-bottom-bar {
	margin-top: -42px;
	padding: 10px 14px 12px;
	background: linear-gradient(to top, rgba(8, 12, 28, 0.88), rgba(8, 12, 28, 0));
}

.mfp-wrap .mfp-title {
	padding-right: 40px;
	font-size: 0.875rem;
	line-height: 1.5;
	color: #f2f5fb;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.mfp-wrap .mfp-counter {
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	color: #98a0b5;
}

/* ==================================================================
   6. REDUCED MOTION
   ================================================================== */

@media (prefers-reduced-motion: reduce) {
	.ph-gallery__link,
	.ph-gallery__link img,
	.ph-gallery__link::after {
		transition: none;
	}

	.ph-gallery__link:hover,
	.ph-gallery__link:focus-visible {
		transform: none;
	}

	.ph-gallery__link:hover img,
	.ph-gallery__link:focus-visible img {
		transform: none;
	}
}
