/* WeddingResources Ads – zone styles. Uses the Storypath presets with WeddingResources.ca fallbacks. */
.wr-ad {
	--wra-primary: var(--wp--preset--color--primary, #9e3b55);
	--wra-primary-dark: var(--wp--preset--color--accent, #7a2d42);
	--wra-surface: var(--wp--preset--color--surface, #fbf7f5);
	--wra-border: var(--wp--preset--color--neutral-light, #e6dadb);
	--wra-ink: var(--wp--preset--color--text, #373737);
	--wra-muted: var(--wp--preset--color--text-muted, #5c5c5c);
	--wra-on-primary: var(--wp--preset--color--on-primary, #ffffff);
	display: block;
	box-sizing: border-box;
	margin: 2rem auto;
	padding: 0.75rem 0.75rem 0.9rem;
	max-width: 100%;
	background: var(--wra-surface);
	border: 1px solid var(--wra-border);
	border-radius: 12px;
	text-align: center;
	clear: both;
	font-family: var(--wp--preset--font-family--body, system-ui, sans-serif);
}
.wr-ad *,
.wr-ad *::before,
.wr-ad *::after { box-sizing: border-box; }

.wr-ad__label {
	margin: 0 0 0.55rem !important;
	padding: 0;
	font-size: 0.72rem !important;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wra-muted);
	text-align: left;
}
.wr-ad__note {
	margin: 0.55rem 0 0 !important;
	font-size: 0.8rem !important;
	line-height: 1.35;
	color: var(--wra-muted);
	text-align: left;
}
.wr-ad__unit {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: var(--wr-ad-min-m, 0px);
	width: 100%;
	overflow: hidden;
}
@media (min-width: 768px) {
	.wr-ad__unit { min-height: var(--wr-ad-min, 0px); }
}
.wr-ad__unit > ins { display: block; width: 100%; }
.wr-ad__unit img { max-width: 100%; height: auto; display: block; margin: 0 auto; border: 0; }
.wr-ad__unit a { text-decoration: none; }
.wr-creative { display: block; width: 100%; line-height: 0; }
.wr-creative:focus-visible,
.wr-btn:focus-visible,
.wr-house:focus-visible { outline: 3px solid var(--wra-primary-dark); outline-offset: 3px; }

/* Formats. Banners reserve space by shape, so a 970×250 creative scaled
   into a narrow column does not leave an empty band. */
.wr-ad--billboard .wr-ad__unit,
.wr-ad--leader .wr-ad__unit { min-height: 0; aspect-ratio: var(--wr-ad-ratio-m); }
@media (min-width: 768px) {
	.wr-ad--billboard .wr-ad__unit,
	.wr-ad--leader .wr-ad__unit { min-height: 0; aspect-ratio: var(--wr-ad-ratio); }
}
.wr-ad--preview .wr-ad__unit { aspect-ratio: auto; min-height: var(--wr-ad-min-m, 0px); }
@media (min-width: 768px) {
	.wr-ad--preview .wr-ad__unit { aspect-ratio: auto; min-height: var(--wr-ad-min, 0px); }
}
.wr-ad--billboard { max-width: 1000px; }
.wr-ad--leader { max-width: 760px; }
.wr-ad--rect { max-width: 330px; }
.wr-ad--buttons { max-width: 620px; }

/* Wrappers inserted by the placement engine */
.wr-ad-wrap { padding: 0 var(--wp--style--root--padding-right, 1rem) 0 var(--wp--style--root--padding-left, 1rem); }
.wr-ad-wrap--hb .wr-ad { margin: 2.25rem auto; }
.wr-ad-wrap--hs { padding-top: 2.5rem; }
.wr-ad-wrap--hs .wr-ad { margin: 0 auto 2.5rem; }
.wr-ad-wrap--cb .wr-ad { margin: 1.25rem auto 1.75rem; }
.wpbdp-page .wr-ad-wrap,
.wpbdp-listing-single + .wr-ad-wrap,
.entry-content .wr-ad-wrap { padding: 0; }
.wpbdp-page .wr-ad-wrap--hs,
.entry-content .wr-ad-wrap--hs { padding-top: 2.5rem; }

/* Sponsor button rows */
.wr-btns {
	display: grid;
	grid-template-columns: repeat(4, 125px);
	gap: 12px;
	justify-content: center;
	width: 100%;
}
@media (max-width: 600px) {
	.wr-btns { grid-template-columns: repeat(2, 125px); }
}
.wr-btn {
	display: block;
	width: 125px;
	height: 125px;
	overflow: hidden;
	border-radius: 8px;
	background: #fff;
}
.wr-btn img { width: 125px; height: 125px; object-fit: cover; }
.wr-btn--revive ins { display: block; width: 125px; height: 125px; }
.wr-btn--house {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.2rem;
	padding: 0.5rem;
	border: 2px dashed var(--wra-primary);
	background: #fff;
	color: var(--wra-primary-dark) !important;
	text-decoration: none !important;
	line-height: 1.2;
}
.wr-btn--house:hover { background: #f6e9ec; }
.wr-btn__h { font-weight: 700; font-size: 0.9rem; }
.wr-btn__s { font-size: 0.72rem; color: var(--wra-muted); }
.wr-btn__cta { margin-top: 0.2rem; font-size: 0.78rem; font-weight: 600; text-decoration: underline; }

/* Empty units collapse */
.wr-ad--empty,
.wr-ad:has(> .wr-ad__unit:empty):not(.wr-ad--preview) { display: none !important; }
.wr-ad-wrap:has(> .wr-ad--empty) { display: none !important; }

/* House banners */
.wr-house {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 0.35rem;
	width: 100%;
	height: 100%;
	min-height: inherit;
	padding: 1.1rem 1.4rem;
	border-radius: 8px;
	background: var(--wra-primary);
	color: var(--wra-on-primary) !important;
	text-align: left;
	text-decoration: none !important;
}
.wr-house:hover { background: var(--wra-primary-dark); }
.wr-house__eb {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.wr-house__h {
	font-family: var(--wp--preset--font-family--heading, Georgia, serif);
	font-size: clamp(1.3rem, 1rem + 1.4vw, 2.1rem);
	line-height: 1.15;
}
.wr-house__s { font-size: 0.98rem; line-height: 1.45; }
.wr-house__cta {
	margin-top: 0.45rem;
	padding: 0.55rem 1.05rem;
	border-radius: 999px;
	background: #fff;
	color: var(--wra-primary-dark);
	font-weight: 600;
	font-size: 0.95rem;
}
.wr-house--billboard,
.wr-house--leader {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas: "eb cta" "h cta" "s cta";
	column-gap: 1.5rem;
	align-content: center;
	align-items: center;
}
.wr-house--billboard { padding: 1.5rem 2.25rem; }
.wr-house--billboard .wr-house__eb,
.wr-house--leader .wr-house__eb { grid-area: eb; }
.wr-house--billboard .wr-house__h,
.wr-house--leader .wr-house__h { grid-area: h; }
.wr-house--billboard .wr-house__s,
.wr-house--leader .wr-house__s { grid-area: s; }
.wr-house--billboard .wr-house__cta,
.wr-house--leader .wr-house__cta { grid-area: cta; margin: 0; white-space: nowrap; }
.wr-house--leader { padding: 0.75rem 1.25rem; }
.wr-house--leader .wr-house__s { display: none; }
.wr-house--leader .wr-house__h { font-size: 1.25rem; }
.wr-house--rect { min-height: 250px; }
@media (max-width: 767px) {
	.wr-house--billboard,
	.wr-house--leader { display: flex; padding: 1rem 1.1rem; }
	.wr-house--billboard .wr-house__cta,
	.wr-house--leader .wr-house__cta { margin-top: 0.45rem; }
}

/* Preview placeholders (administrators only) */
.wr-ad--preview { background: repeating-linear-gradient(45deg, #fbf7f5, #fbf7f5 10px, #f6e9ec 10px, #f6e9ec 20px); border: 2px dashed var(--wra-primary); }
.wr-ad__preview {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.2rem;
	width: 100%;
	min-height: inherit;
	padding: 1rem;
	font-family: var(--wp--preset--font-family--monospace, ui-monospace, monospace);
	font-size: 0.85rem;
	color: var(--wra-primary-dark);
}
.wr-ad__preview strong { font-size: 1rem; }

@media print {
	.wr-ad, .wr-ad-wrap { display: none !important; }
}

/* House ads are live text, so they size to their content instead of a shape. */
.wr-ad.wr-ad--house .wr-ad__unit,
.wr-ad[data-wr-state="house"] .wr-ad__unit { aspect-ratio: auto; }

/* Device copies (for block visibility plugins). Each copy keeps its own shape
   at every width, so it doesn't matter which breakpoints the plugin uses. */
.wr-ad--billboard.wr-ad--only-desktop .wr-ad__unit,
.wr-ad--leader.wr-ad--only-desktop .wr-ad__unit { aspect-ratio: var(--wr-ad-ratio); }
.wr-ad--billboard.wr-ad--only-mobile .wr-ad__unit,
.wr-ad--leader.wr-ad--only-mobile .wr-ad__unit { aspect-ratio: var(--wr-ad-ratio-m); }
.wr-ad--house.wr-ad--only-desktop .wr-ad__unit,
.wr-ad--house.wr-ad--only-mobile .wr-ad__unit { aspect-ratio: auto; }

/* Right-hand sidebar (SR and SB). The plugin wraps the template's <main>
   group: .wr-sidebar-main holds the page content, .wr-sidebar holds the ads.
   Two columns only above 1024 px, the Responsive Visibility tablet limit. */
.wr-has-sidebar {
	--wr-sb-w: 326px; /* 300 px creative + ad box padding and border */
	--wr-sb-gap: clamp(2rem, 3vw, 3.5rem);
}
.wr-has-sidebar.wr-has-sidebar > .wr-sidebar-main,
.wr-has-sidebar.wr-has-sidebar > .wr-sidebar {
	max-width: none;
}
.wr-sidebar-main > :first-child { margin-block-start: 0; }
.wr-sidebar .wr-ad-wrap { padding: 0; }
.wr-sidebar__inner { display: flex; flex-direction: column; gap: 1.5rem; }
.wr-sidebar .wr-ad { margin: 0 auto; max-width: var(--wr-sb-w, 326px); }
/* One "ads don't change the order" note is enough: keep it on the last sidebar unit. */
.wr-sidebar .wr-ad-wrap:not(:last-child) .wr-ad__note { display: none; }
.wr-sidebar .wr-ad--rect .wr-ad__unit { min-height: 250px; }
.wr-sidebar .wr-btns { grid-template-columns: repeat(2, 125px); }
.wr-sidebar .wr-ad--buttons .wr-ad__unit { min-height: 262px; }

@media (max-width: 1024px) {
	.wr-has-sidebar--small-hide > .wr-sidebar { display: none !important; }
	.wr-has-sidebar--small-below > .wr-sidebar { margin-block-start: 2.5rem; }
}

@media (min-width: 1025px) {
	.wr-has-sidebar {
		display: grid !important;
		grid-template-columns: minmax(0, var(--wp--style--global--content-size, 45rem)) var(--wr-sb-w);
		column-gap: var(--wr-sb-gap);
		justify-content: center;
		align-items: stretch;
	}
	.wr-has-sidebar.wr-has-sidebar > .wr-sidebar-main,
	.wr-has-sidebar.wr-has-sidebar > .wr-sidebar {
		margin-left: 0 !important;
		margin-right: 0 !important;
		margin-block-start: 0;
		width: auto;
		min-width: 0;
	}
	.wr-has-sidebar > .wr-sidebar-main { grid-column: 1; }
	.wr-has-sidebar > .wr-sidebar { grid-column: 2; grid-row: 1; }
	/* Content inside the main column uses the full column, which is already the reading width. */
	.wr-sidebar-main > :where(:not(.alignfull)) { max-width: 100%; }
	.wr-sidebar__inner {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + 1.5rem);
	}
	.storypath-sticky-header .wr-sidebar__inner {
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--storypath-header-height, var(--storypath-header-fallback, 6rem)) + 1.5rem);
	}
}

@media print {
	.wr-sidebar { display: none !important; }
	.wr-has-sidebar { display: block !important; }
}
