/*
Theme Name:        GP Circular Engine
Theme URI:         https://example.com/gp-circular-engine
Description:       Lightweight GeneratePress child theme for weekly retail catalogues. Styles ONLY the flyer viewer - the rest of the site keeps the default GeneratePress design (customise it in Appearance > Customize). Mobile-first publication viewer UI with a single numbered bottom pager, visual all-pages thumbnail grid, floating Pages / Share / Zoom rail, one unified Share dialog (native share sheet on phones; WhatsApp, Facebook, X, Telegram, Email, Copy Link on desktop), and 301 redirects from old /page/N/ URLs. Zero jQuery, zero external fonts or frameworks.
Author:            Your Name
Author URI:        https://example.com
Template:          generatepress
Version:           3.2.0
Requires at least: 6.0
Tested up to:      6.6
Requires PHP:      7.4
License:           GNU General Public License v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       gp-circular
Tags:              custom-colors, one-column, translation-ready, accessibility-ready
*/

/* ==========================================================================
   1. Design System Tokens
   Override any of these in Customizer > Additional CSS to rebrand.
   ========================================================================== */

:root {
	--gpc-accent:            #e01a22; /* Retail circular red (Coles/Grocery accent). */
	--gpc-accent-hover:      #b81219;
	--gpc-accent-soft:       rgba(224, 26, 34, 0.08);
	--gpc-accent-contrast:   #ffffff;

	--gpc-neutral-bg:        #f1f5f9;
	--gpc-neutral-bg-hover:  #e2e8f0;
	--gpc-neutral-border:    #cbd5e1;
	--gpc-neutral-text:      #0f172a;

	--gpc-stage-bg:          #f1f5f9;
	--gpc-surface:           #ffffff;
	--gpc-surface-alt:       #f8fafc;
	--gpc-surface-border:    #e2e8f0;
	--gpc-text-main:         #1e293b;
	--gpc-text-muted:        #475569;

	--gpc-pill-bg:           #f8fafc;
	--gpc-pill-border:       #cbd5e1;
	--gpc-pill-text:         #0f172a;

	--gpc-focus-ring:        #2563eb;

	--gpc-radius-sm:         8px;
	--gpc-radius:            10px;
	--gpc-card-radius:       16px;
	--gpc-nav-btn-height:    44px;    /* WCAG 2.2 AA 44px minimum touch target. */
	--gpc-nav-pill-height:   42px;
	--gpc-nav-padding:       8px 10px;
	--gpc-nav-gap:           8px;
	--gpc-section-gap:       1.75rem;

	/* Desktop flyer height limit: fits cleanly within a single viewport. */
	--gpc-flyer-max-height:  max(460px, calc(100vh - 120px));
}

/* ==========================================================================
   3. Circular Layout Wrapper & Persistent Copy
   ========================================================================== */

.circular-layout {
	display: block;
	width: 100%;
}

.circular-layout > *:last-child {
	margin-bottom: 0;
}

.circular-persistent-top {
	margin: 0 0 1.25rem;
}

.circular-persistent-top > *:last-child {
	margin-bottom: 0;
}

.circular-persistent-bottom {
	margin: var(--gpc-section-gap) 0 0;
}

.circular-persistent-bottom > *:last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   4. Unified Publication Viewer Card (.circular-slider)
   ========================================================================== */

.circular-slider {
	position: relative;
	margin: 1.25rem 0 var(--gpc-section-gap);
	background: var(--gpc-surface);
	border: 1px solid var(--gpc-surface-border);
	border-radius: var(--gpc-card-radius);
	box-shadow: 0 8px 28px -4px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
	overflow: clip;
}

@media (max-width: 639px) {
	/* Expand viewer slightly toward screen edges on mobile for larger flyer display */
	.circular-slider {
		margin-left: -6px;
		margin-right: -6px;
		border-radius: 12px;
	}
}

/* Reading progress bar between top nav and flyer stage */
.circular-progress {
	width: 100%;
	height: 3px;
	background: #e2e8f0;
	overflow: hidden;
}

.circular-progress-bar {
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--gpc-accent), #ff4d58);
	transition: width 0.2s ease-out;
}

/* ==========================================================================
   5. Flyer Stage (.circular-slide) & Side Arrow Overlays
   ========================================================================== */

.circular-slide {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 300px;
	padding: 8px 4px;
	box-sizing: border-box;
	background: var(--gpc-stage-bg);
	touch-action: pan-y pinch-zoom;
	user-select: none;
}

@media (min-width: 768px) {
	.circular-slide {
		padding: 20px 28px;
	}
}

.circular-slide-item {
	display: none;
	width: 100%;
}

.circular-slide-item.is-active {
	display: block;
	animation: gpc-fade 0.18s ease-out;
}

.circular-slide-item > *:last-child {
	margin-bottom: 0;
}

@keyframes gpc-fade {
	from { opacity: 0.45; transform: scale(0.996); }
	to   { opacity: 1;    transform: scale(1); }
}

.circular-slide img {
	display: block;
	max-width: 100%;
	height: auto;
	margin-left: auto;
	margin-right: auto;
	border-radius: 6px;
	background: #ffffff;
	box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1);
	cursor: zoom-in;
}

@media (min-width: 768px) {
	.circular-slide img {
		width: auto;
		max-width: 100%;
		max-height: var(--gpc-flyer-max-height);
		object-fit: contain;
	}
}

.circular-slide figure,
.circular-slide .wp-block-image {
	margin: 0;
}

/* --- Floating Side Prev / Next Overlay Arrows --- */

.circular-stage-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 4;
	display: none; /* v3.1: shown only on desktop hover — see below */
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	color: #0f172a;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid rgba(15, 23, 42, 0.14);
	border-radius: 999px;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
	cursor: pointer;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.circular-stage-arrow--prev {
	left: 8px;
}

.circular-stage-arrow--next {
	right: 8px;
}

@media (min-width: 768px) {
	.circular-stage-arrow {
		width: 48px;
		height: 48px;
	}
	.circular-stage-arrow--prev {
		left: 16px;
	}
	.circular-stage-arrow--next {
		right: 16px;
	}
}

.circular-stage-arrow:hover,
.circular-stage-arrow:focus {
	color: #ffffff;
	background: var(--gpc-accent);
	border-color: var(--gpc-accent);
	transform: translateY(-50%) scale(1.06);
}

.circular-stage-arrow:focus-visible {
	outline: 2px solid var(--gpc-focus-ring);
	outline-offset: 2px;
}

.circular-stage-arrow.is-disabled,
.circular-stage-arrow:disabled {
	opacity: 0;
	pointer-events: none;
}

/* Desktop (mouse) only: arrows fade in while hovering the flyer. */
@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
	.circular-stage-arrow {
		display: inline-flex;
		opacity: 0;
	}
	.circular-slide:hover .circular-stage-arrow,
	.circular-stage-arrow:focus-visible {
		opacity: 1;
	}
	.circular-slide:hover .circular-stage-arrow:disabled,
	.circular-stage-arrow:disabled {
		opacity: 0;
		pointer-events: none;
	}
}

.circular-stage-arrow svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.3;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* --- Floating Top-Right Tool Rail on Flyer (Pages Grid + Share + Zoom) --- */

.circular-stage-rail {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 6px;
}

.circular-rail-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 36px;
	padding: 0 12px;
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1;
	color: #ffffff;
	background: rgba(15, 23, 42, 0.82);
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: 999px;
	cursor: pointer;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.circular-rail-btn:hover,
.circular-rail-btn:focus,
.circular-rail-btn[aria-expanded="true"] {
	color: #ffffff;
	background: var(--gpc-accent);
	border-color: var(--gpc-accent);
	transform: translateY(-1px);
}

.circular-rail-btn:focus-visible {
	outline: 2px solid var(--gpc-focus-ring);
	outline-offset: 2px;
}

.circular-rail-btn svg {
	width: 15px;
	height: 15px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@media (max-width: 420px) {
	.circular-rail-btn {
		padding: 0 10px;
		height: 34px;
		font-size: 0.76rem;
	}
}

/* --- Collapsible All-Pages Thumbnail Grid Drawer --- */

.circular-thumbs-drawer {
	background: #0f172a;
	color: #f8fafc;
	border-bottom: 1px solid #334155;
	padding: 12px 14px;
}

.circular-thumbs-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
	font-size: 0.85rem;
	font-weight: 700;
	color: #cbd5e1;
}

.circular-thumbs-close {
	background: rgba(255, 255, 255, 0.1);
	color: #ffffff;
	border: none;
	border-radius: 6px;
	padding: 4px 10px;
	font-size: 0.78rem;
	font-weight: 600;
	cursor: pointer;
}

.circular-thumbs-close:hover {
	background: var(--gpc-accent);
}

.circular-thumbs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
	gap: 8px;
	max-height: 240px;
	overflow-y: auto;
	padding: 2px;
	-webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
	.circular-thumbs-grid {
		grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
		max-height: 290px;
		gap: 10px;
	}
}

.circular-thumb-btn {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 4px;
	background: #1e293b;
	border: 2px solid transparent;
	border-radius: 8px;
	color: #e2e8f0;
	cursor: pointer;
	transition: border-color 0.15s ease, transform 0.12s ease;
}

.circular-thumb-btn:hover {
	border-color: #64748b;
	transform: translateY(-1px);
}

.circular-thumb-btn.is-active {
	border-color: var(--gpc-accent);
	background: rgba(224, 26, 34, 0.18);
}

.circular-thumb-btn img {
	width: 100%;
	height: 86px;
	object-fit: cover;
	border-radius: 4px;
	background: #090d16;
}

.circular-thumb-num {
	margin-top: 4px;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1;
}

/* ==========================================================================
   6. Bottom Pager — [‹]  1 … 4 [5] 6 … 51  [›]   (single nav, v3.1)
   ========================================================================== */

.circular-slider-nav {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 10px;
	background: var(--gpc-surface);
	border-top: 1px solid var(--gpc-surface-border);
}

.circular-page-list {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

/* --- Numbered page buttons --- */

.circular-page-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 36px;
	height: 36px;
	padding: 0 6px;
	margin: 0;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--gpc-neutral-text);
	background: transparent;
	border: 1px solid transparent;
	border-radius: 10px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.circular-page-num:hover,
.circular-page-num:focus {
	color: var(--gpc-accent);
	background: var(--gpc-accent-soft);
	border-color: transparent;
}

.circular-page-num:active {
	transform: scale(0.94);
}

.circular-page-num:focus-visible {
	outline: 2px solid var(--gpc-focus-ring);
	outline-offset: 2px;
}

.circular-page-num.is-active,
.circular-page-num.is-active:hover,
.circular-page-num.is-active:focus {
	color: var(--gpc-accent-contrast);
	background: var(--gpc-accent);
	border-color: var(--gpc-accent);
	box-shadow: 0 3px 10px rgba(224, 26, 34, 0.3);
	cursor: default;
}

.circular-page-gap {
	display: inline-flex;
	align-items: flex-end;
	justify-content: center;
	min-width: 18px;
	height: 36px;
	padding-bottom: 10px;
	box-sizing: border-box;
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1;
	color: #94a3b8;
	user-select: none;
}

/* --- Prev / Next buttons (icon-only on phones, icon + label on wider screens) --- */

.circular-slider-nav .circular-nav-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	box-sizing: border-box;
	width: var(--gpc-nav-btn-height);
	height: var(--gpc-nav-btn-height);
	padding: 0;
	margin: 0;
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	border: 1px solid transparent;
	border-radius: 999px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.circular-nav-svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.circular-slider-nav .circular-nav-label {
	display: none;
}

.circular-slider-nav .circular-nav-btn:active:not(:disabled) {
	transform: scale(0.95);
}

.circular-slider-nav .circular-nav-btn:focus-visible {
	outline: 2px solid var(--gpc-focus-ring);
	outline-offset: 2px;
}

.circular-slider-nav .circular-nav-prev {
	color: var(--gpc-neutral-text);
	background-color: var(--gpc-neutral-bg);
	border-color: var(--gpc-neutral-border);
}

.circular-slider-nav .circular-nav-prev:hover:not(:disabled),
.circular-slider-nav .circular-nav-prev:focus:not(:disabled) {
	color: var(--gpc-neutral-text);
	background-color: var(--gpc-neutral-bg-hover);
	border-color: #94a3b8;
}

.circular-slider-nav .circular-nav-next {
	color: var(--gpc-accent-contrast);
	background-color: var(--gpc-accent);
	border-color: var(--gpc-accent);
	box-shadow: 0 3px 10px rgba(224, 26, 34, 0.28);
}

.circular-slider-nav .circular-nav-next:hover:not(:disabled),
.circular-slider-nav .circular-nav-next:focus:not(:disabled) {
	color: var(--gpc-accent-contrast);
	background-color: var(--gpc-accent-hover);
	border-color: var(--gpc-accent-hover);
}

.circular-slider-nav .circular-nav-btn.is-disabled,
.circular-slider-nav .circular-nav-btn:disabled {
	pointer-events: none;
	cursor: default;
	opacity: 0.35;
	box-shadow: none;
	filter: grayscale(0.5);
}

/* Very narrow phones: slightly tighter numbers so the bar never overflows. */
@media (max-width: 360px) {
	.circular-slider-nav {
		padding: 8px;
		gap: 6px;
	}
	.circular-page-list {
		gap: 2px;
	}
	.circular-page-num {
		min-width: 32px;
		height: 34px;
		font-size: 0.82rem;
	}
}

@media (min-width: 640px) {
	.circular-slider-nav {
		padding: 12px 16px;
	}
	.circular-slider-nav .circular-nav-btn {
		width: auto;
		padding: 0 16px;
		border-radius: var(--gpc-radius);
	}
	.circular-slider-nav .circular-nav-prev {
		padding-left: 10px;
	}
	.circular-slider-nav .circular-nav-next {
		padding-right: 10px;
	}
	.circular-slider-nav .circular-nav-label {
		display: inline;
	}
	.circular-page-list {
		gap: 6px;
	}
	.circular-page-num {
		min-width: 40px;
		height: 40px;
		font-size: 0.9rem;
	}
	.circular-page-gap {
		height: 40px;
		padding-bottom: 12px;
	}
}

/* Screen-reader-only live region ("Page 5 of 51"). */
.circular-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   7. Share Dialog (single entry point: the "Share" button on the flyer)
   ========================================================================== */

.circular-share-sub {
	margin: -6px 0 16px;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--gpc-text-muted);
}

.circular-share-sub:empty {
	display: none;
}

.circular-share-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin-bottom: 16px;
}

.circular-share-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 84px;
	padding: 12px 6px;
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	color: var(--gpc-neutral-text);
	background: var(--gpc-surface-alt);
	border: 1px solid var(--gpc-surface-border);
	border-radius: 14px;
	cursor: pointer;
	transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.circular-share-tile:hover,
.circular-share-tile:focus {
	color: var(--gpc-neutral-text);
	text-decoration: none;
	background: #ffffff;
	border-color: var(--gpc-neutral-border);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
	transform: translateY(-2px);
}

.circular-share-tile:focus-visible {
	outline: 2px solid var(--gpc-focus-ring);
	outline-offset: 2px;
}

.circular-share-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 999px;
	color: #ffffff;
	background: #475569;
}

.circular-share-ico svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.circular-share-tile--whatsapp .circular-share-ico { background: #25d366; }
.circular-share-tile--facebook .circular-share-ico { background: #1877f2; }
.circular-share-tile--x        .circular-share-ico { background: #0f172a; }
.circular-share-tile--telegram .circular-share-ico { background: #229ed9; }
.circular-share-tile--email    .circular-share-ico { background: #64748b; }
.circular-share-tile--copy     .circular-share-ico { background: var(--gpc-accent); }

@media (max-width: 360px) {
	.circular-share-grid {
		gap: 8px;
	}
	.circular-share-tile {
		min-height: 76px;
		font-size: 0.75rem;
	}
}

/* --- Share Ad Modal --- */

.circular-share-modal {
	position: fixed;
	inset: 0;
	z-index: 999998;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(15, 23, 42, 0.72);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.circular-share-modal.is-open {
	display: flex;
}

.circular-share-dialog {
	width: 100%;
	max-width: 460px;
	padding: 22px 24px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
	color: #0f172a;
	animation: gpc-fade 0.16s ease-out;
}

.circular-share-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.circular-share-title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 800;
	color: #0f172a;
}

.circular-share-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	border-radius: 999px;
	background: #f1f5f9;
	color: #475569;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
}

.circular-share-close:hover {
	background: #e2e8f0;
	color: #0f172a;
}

.circular-share-url-row {
	display: flex;
	gap: 8px;
	margin: 0;
}

.circular-share-url-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 42px;
	padding: 0 12px;
	font-size: 0.85rem;
	color: #0f172a;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
}

.circular-share-copy-btn {
	flex: 0 0 auto;
	height: 42px;
	padding: 0 16px;
	font-size: 0.875rem;
	font-weight: 700;
	color: #ffffff;
	background: var(--gpc-accent);
	border: none;
	border-radius: 8px;
	cursor: pointer;
}

.circular-share-copy-btn:hover {
	background: var(--gpc-accent-hover);
}

/* ==========================================================================
   8. Fullscreen Maximize / Zoom Modal
   ========================================================================== */

.circular-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	flex-direction: column;
	background: rgba(15, 23, 42, 0.96);
}

.circular-lightbox.is-open {
	display: flex;
}

body.circular-lightbox-open {
	overflow: hidden;
}

.circular-lightbox-bar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	padding: 10px 14px;
	background: rgba(0, 0, 0, 0.55);
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	flex-shrink: 0;
}

.circular-lightbox-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 38px;
	padding: 0 13px;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1;
	color: #ffffff;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: var(--gpc-radius-sm);
	cursor: pointer;
}

.circular-lightbox-btn:hover,
.circular-lightbox-btn:focus {
	color: #ffffff;
	background: var(--gpc-accent);
	border-color: var(--gpc-accent);
}

.circular-lightbox-btn:disabled {
	opacity: 0.35;
	pointer-events: none;
}

.circular-lightbox-count {
	min-width: 4.25rem;
	font-size: 0.85rem;
	font-weight: 700;
	text-align: center;
	color: #ffffff;
	font-variant-numeric: tabular-nums;
}

.circular-lightbox-spacer {
	flex: 1 1 auto;
}

.circular-lightbox-stage {
	flex: 1 1 auto;
	overflow: auto;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 12px;
	-webkit-overflow-scrolling: touch;
}

.circular-lightbox-stage img {
	display: block;
	width: auto;
	max-width: min(1100px, 96vw);
	height: auto;
	margin: auto;
	border-radius: 4px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	cursor: zoom-in;
	transition: max-width 0.15s ease;
}

.circular-lightbox.is-zoomed .circular-lightbox-stage {
	justify-content: flex-start;
}

.circular-lightbox.is-zoomed .circular-lightbox-stage img {
	max-width: none;
	width: 180vw;
	max-width: 2100px;
	cursor: zoom-out;
}

/* ==========================================================================
   9. Safety Nets, Accessibility & Print
   ========================================================================== */

.circular-layout ~ .page-links,
.circular-layout ~ .post-nav-links {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.circular-slider-nav .circular-nav-btn,
	.circular-progress-bar,
	.circular-stage-arrow {
		transition: none;
	}

	.circular-slide-item.is-active {
		animation: none;
	}
}

@media (forced-colors: active) {
	.circular-slider-nav .circular-nav-btn,
	.circular-page-num,
	.circular-stage-arrow {
		border: 1px solid CanvasText;
	}
}

@media print {
	.circular-slider-nav,
	.circular-stage-rail,
	.circular-stage-arrow,
	.circular-thumbs-drawer,
	.circular-share-modal,
	.circular-lightbox {
		display: none !important;
	}
}
