/* =====================================================================
   gallery-look.css — photo gallery pages (media, media_sub, media_sub_sub).
   Loaded only on those pages (see _head.php). Selectors start with "html"
   so they win over the styles written inside the views.

   Accessibility: decoration is CSS only (box-shadows, pseudo-elements);
   no text or ARIA change. Movement only under html.motion-on and short;
   cards waiting to appear (.gl-wait) show at once on keyboard focus.
   Brand colours only: green #2a6806, gold #f0c300.
   ===================================================================== */

/* page title (was screen-reader only) */
html .gl-title {
	font-size: 1.8rem;
	font-weight: 700;
	color: #2a6806;
	margin: 6px 0 28px;
	display: flex;
	align-items: center;
	gap: 12px;
}
html .gl-title::after {
	content: "";
	flex: 0 0 64px;
	height: 4px;
	border-radius: 4px;
	background: linear-gradient(90deg, #f0c300, #fff2a8, #f0c300);
}

/* cards: same-size thumbnails so the grid lines up */
html .media-card {
	border-radius: 18px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
	transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), box-shadow .4s ease;
}
html .media-thumb-wrapper {
	aspect-ratio: 4 / 3;
	overflow: hidden;
}
html .media-thumb-wrapper img {
	width: 100%;
	height: 100%;
	max-height: none;
	object-fit: cover;
	transition: transform .7s ease;
}

/* album cards (they link to an album) look like a small stack of photos */
html .media-card:has(.media-btn-link) {
	box-shadow:
		0 6px 18px rgba(0, 0, 0, .08),
		-7px -7px 0 -2px #fff,
		-7px -7px 0 -1px rgba(42, 104, 6, .18),
		-14px -14px 0 -4px #fdf6dc,
		-14px -14px 0 -3px rgba(240, 195, 0, .55);
}
[dir="ltr"] .media-card:has(.media-btn-link) {
	box-shadow:
		0 6px 18px rgba(0, 0, 0, .08),
		7px -7px 0 -2px #fff,
		7px -7px 0 -1px rgba(42, 104, 6, .18),
		14px -14px 0 -4px #fdf6dc,
		14px -14px 0 -3px rgba(240, 195, 0, .55);
}
html .row.g-4 > [class*="col-"] { padding-top: 14px; }   /* room for the stack above each card */

/* title under the thumbnail */
html .media-title {
	font-size: 1rem;
	line-height: 1.6;
	padding: 14px 14px 16px;
	color: #2a6806;
}
html .media-title a { transition: color .3s ease; }
html .media-title small.text-muted { color: #5f5f5f !important; font-weight: 500; }

/* overlay: gold round buttons */
html .media-overlay { background: linear-gradient(to bottom, rgba(31, 61, 12, .05), rgba(31, 61, 12, .6)); }
html .media-btn {
	width: 50px;
	height: 50px;
	background: #f0c300;
	color: #2a6806;
	border: 0;
	box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
	backdrop-filter: none;
}
html .media-btn:hover,
html .media-btn:focus-visible { background: #fff2a8; color: #1f3d0c; transform: scale(1.1); }
html .media-btn i { font-size: 20px; }
/* the gold focus ring would vanish on a gold button: white ring */
html .media-btn:focus-visible {
	outline: 3px solid #fff !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 2px #2a6806 !important;
}

/* light sweep across the thumbnail on hover / keyboard focus */
html .media-thumb-wrapper::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: -60%;
	width: 40%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
	transform: skewX(-18deg);
	opacity: 0;
	pointer-events: none;
	z-index: 1;
}

/* ----- the gallery's own lightbox: same look as the site lightbox ----- */
html .media-lightbox-backdrop {
	background: radial-gradient(circle at 50% 40%, rgba(31, 61, 12, .94), rgba(6, 14, 3, .97));
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}
html .media-lightbox-inner {
	background: #0e1d07;
	border: 3px solid #f0c300;
	border-radius: 20px;
	padding: 12px 12px 8px;
	box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
}
html .media-lightbox-main img { border-radius: 12px; }
html .media-lightbox-close,
html .media-lightbox-prev,
html .media-lightbox-next {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: #f0c300;
	color: #2a6806;
	font-size: 22px;
	font-weight: 700;
	box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
	transition: transform .3s ease, background-color .3s ease;
}
html .media-lightbox-close { font-size: 30px; top: 14px; left: 14px; }
html .media-lightbox-prev { left: 14px; }
html .media-lightbox-next { right: 14px; }
html .media-lightbox-close:hover,
html .media-lightbox-close:focus-visible { transform: scale(1.1) rotate(90deg); background: #fff2a8; }
html .media-lightbox-prev:hover,
html .media-lightbox-next:hover,
html .media-lightbox-prev:focus-visible,
html .media-lightbox-next:focus-visible { transform: translateY(-50%) scale(1.1); background: #fff2a8; }
html .media-lightbox-close:focus-visible,
html .media-lightbox-prev:focus-visible,
html .media-lightbox-next:focus-visible {
	outline: 3px solid #fff !important;
	outline-offset: 3px !important;
}
html .media-lightbox-thumbs { background: transparent; padding: 8px 4px 4px; }
html .media-lightbox-thumbs { scrollbar-width: thin; scrollbar-color: #f0c300 transparent; }
html .media-lightbox-thumbs::-webkit-scrollbar { height: 6px; }
html .media-lightbox-thumbs::-webkit-scrollbar-track { background: transparent; }
html .media-lightbox-thumbs::-webkit-scrollbar-thumb { background: #f0c300; border-radius: 6px; }
html .media-thumb-item { border-radius: 10px; opacity: .65; transition: opacity .3s ease, transform .3s ease; }
html .media-thumb-item:hover,
html .media-thumb-item:focus-visible { opacity: 1; transform: translateY(-3px); }
html .media-thumb-item.image-thumb.active,
html .media-thumb-item.video-thumb.active { border-color: #f0c300; box-shadow: 0 0 10px rgba(240, 195, 0, .7); opacity: 1; }

/* ----- movement (only when animations are on) ----- */
@keyframes gl-rise { from { opacity: 0; transform: translateY(30px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes gl-sweep { 0% { opacity: 1; transform: translateX(0) skewX(-18deg); } 100% { opacity: 1; transform: translateX(450%) skewX(-18deg); } }
@keyframes gl-zoom { 0% { opacity: 0; transform: scale(.85); } 70% { opacity: 1; transform: scale(1.02); } 100% { opacity: 1; transform: none; } }
@keyframes gl-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

html.motion-on .gl-title { animation: gl-rise .6s cubic-bezier(.22, .61, .36, 1) both; }
html.motion-on .gl-title::after { animation: gl-bar .8s cubic-bezier(.34, 1.56, .64, 1) .5s both; transform-origin: 100% 50%; }
html.motion-on[dir="ltr"] .gl-title::after { transform-origin: 0 50%; }
/* first cards (on screen at load) rise one after another, from the first paint.
   "of [class*=col-]": hidden lightbox helpers sit between the card columns */
html.motion-on .row.g-4 > [class*="col-"]:nth-child(-n+6 of [class*="col-"]) > .media-card { animation: gl-rise .7s cubic-bezier(.22, .61, .36, 1) both; }
html.motion-on .row.g-4 > [class*="col-"]:nth-child(2 of [class*="col-"]) > .media-card { animation-delay: .1s; }
html.motion-on .row.g-4 > [class*="col-"]:nth-child(3 of [class*="col-"]) > .media-card { animation-delay: .2s; }
html.motion-on .row.g-4 > [class*="col-"]:nth-child(4 of [class*="col-"]) > .media-card { animation-delay: .3s; }
html.motion-on .row.g-4 > [class*="col-"]:nth-child(5 of [class*="col-"]) > .media-card { animation-delay: .4s; }
html.motion-on .row.g-4 > [class*="col-"]:nth-child(6 of [class*="col-"]) > .media-card { animation-delay: .5s; }
/* further down: appear when scrolled to (gallery-look.js); keyboard focus shows them at once */
html.motion-on .media-card.gl-wait { opacity: 0; transform: translateY(30px) scale(.97); animation: none; }
html.motion-on .media-card.gl-in { animation: gl-rise .7s cubic-bezier(.22, .61, .36, 1) both; }
html.motion-on .media-card.gl-instant { animation: none !important; opacity: 1 !important; transform: none !important; }

html.motion-on .media-card:hover,
html.motion-on .media-card:focus-within { transform: translateY(-6px); }
html.motion-on .media-card:hover .media-thumb-wrapper img,
html.motion-on .media-card:focus-within .media-thumb-wrapper img { transform: scale(1.07); }
html.motion-on .media-card:hover .media-thumb-wrapper::after,
html.motion-on .media-card:focus-within .media-thumb-wrapper::after { animation: gl-sweep 1s ease-in-out; }
html.motion-on .media-card:has(.media-btn-link):hover,
html.motion-on .media-card:has(.media-btn-link):focus-within {
	box-shadow:
		0 14px 30px rgba(0, 0, 0, .14),
		-10px -10px 0 -2px #fff,
		-10px -10px 0 -1px rgba(42, 104, 6, .25),
		-20px -20px 0 -4px #fdf6dc,
		-20px -20px 0 -3px rgba(240, 195, 0, .7);
}
html.motion-on #mediaLightbox[aria-hidden="false"] .media-lightbox-inner { animation: gl-zoom .5s cubic-bezier(.34, 1.56, .64, 1) both; }

html.motion-paused .media-card,
html.motion-paused .gl-title,
html.motion-paused .gl-title::after,
html.motion-paused .media-thumb-wrapper::after,
html.motion-paused .media-lightbox-inner { animation: none !important; }
html.motion-paused .media-card.gl-wait { opacity: 1 !important; transform: none !important; }

/* contrast modes / print: plain cards */
html.high-contrast .gl-title::after,
html.high-contrast .media-thumb-wrapper::after { display: none; }
html.high-contrast .media-card { box-shadow: none !important; border: 2px solid currentColor; }
@media (forced-colors: active), print {
	.gl-title::after, .media-thumb-wrapper::after { display: none; }
	html .media-card { box-shadow: none !important; border: 2px solid CanvasText; }
	html .media-card.gl-wait { opacity: 1 !important; transform: none !important; }
}
