/* ==========================================================================
   ebg pricing - ebg h02: Layout H02 "Our Pricing Plan" (.pricing-box).
   Tinted band with hairline texture; centred head (dashed chip, heading with
   one accent phrase); three plan boxes 24px apart. A box: name, one-line
   description, large price (currency, number, period on the baseline), a
   full-width outline pill and the inclusions with accent bullets. The middle
   box (--active) is accent with white text and a white button. The boxes rise
   in as the row scrolls into view (ebg wow fadeInUp), done with
   .ebg-reveal-children. Bullets are a CSS mask (two small triangles) instead
   of the ebg-icons tji-list glyph. Variant ebg-prc--panel: Layout H10
   (see its block below).
   ========================================================================== */

@layer components {

	.ebg-prc {
		--ebg-prc-band: var(--ebg-surface-3);
		--ebg-prc-bullet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 16'%3E%3Cpath d='M1 2.5 8 8l-7 5.5zM9 2.5 16 8l-7 5.5z'/%3E%3C/svg%3E");

		position: relative;
		inline-size: 100%;
		margin-block: 0;
		padding-block: var(--section-py);
		background-color: var(--ebg-prc-band);

		& > .ebg-shell {
			position: relative; /* above the texture */
			margin-block: 0; /* Blocksy flow spacing */
		}

		& :where(p, h2, h3, ul) { margin: 0; }
	}

	/* Lighter band, for pages where the section next to it uses surface-3. */
	.ebg-prc.ebg-prc--base { --ebg-prc-band: var(--ebg-surface-0); }

	.ebg-prc__head {
		display: flex;
		flex-direction: column;
		align-items: center;
		max-inline-size: 640px;
		margin-inline: auto;
		margin-block-end: 52px;
		text-align: center;

		& > * { margin-block: 0; }
	}

	.ebg-prc .ebg-prc__sub {
		--ebg-glyph: "\e90d"; /* ebg tji-box */

		margin-block-end: 25px;
		padding: 2px 10px;
		color: var(--ebg-accent);
	}

	.ebg-prc .ebg-prc__title {
		color: var(--ebg-heading-ink);
		font-family: var(--font-display);
		font-size: 3rem;
		font-weight: 500;
		line-height: 1.125;
	}

	.ebg-prc__boxes {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 24px;

		& > * { margin-block: 0; }

		/* Four plans (e.g. tiers by size): four columns, two from 1200 down. */
		&.ebg-prc__boxes--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	}

	.ebg-prc .ebg-prc__box {
		--ebg-prc-ink: var(--ebg-heading-ink);
		--ebg-prc-ink-2: var(--ebg-ink-2);
		--ebg-prc-dot: var(--ebg-accent);

		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		padding: 46px 30px 40px;
		border-radius: 12px;
		background-color: #FFFFFF;

		& > * { margin-block: 0; }
	}

	.ebg-prc .ebg-prc__box--active {
		--ebg-prc-ink: var(--ebg-on-accent);
		--ebg-prc-ink-2: var(--ebg-on-accent);
		--ebg-prc-dot: var(--ebg-on-accent);

		background-color: var(--ebg-accent);
	}

	.ebg-prc .ebg-prc__name {
		margin-block-end: 11px;
		color: var(--ebg-prc-ink);
		font-family: var(--font-display);
		font-size: 1.5rem;
		font-weight: 600;
		line-height: 1;
	}

	.ebg-prc .ebg-prc__desc {
		color: var(--ebg-prc-ink-2);
		font-size: var(--text-base);
		line-height: 1.5;
	}

	/* Price: currency and number top-aligned, period on the number's foot. */
	.ebg-prc .ebg-prc__price {
		display: flex;
		align-items: flex-start;
		margin-block: 30px 40px;
		color: var(--ebg-prc-ink);
		font-family: var(--font-display);
		font-weight: 600;

		& > * { margin: 0; }
	}

	.ebg-prc .ebg-prc__cur {
		font-size: 1.5rem;
		line-height: 0.8;
	}

	.ebg-prc .ebg-prc__num {
		font-size: 4rem;
		line-height: 0.8;
	}

	.ebg-prc .ebg-prc__per {
		align-self: flex-end;
		color: var(--ebg-prc-ink-2);
		font-size: var(--text-base);
		font-weight: 400;
		line-height: 0.8;
	}

	/* Full-width outline pill, label centred, 30px disc (ebg .text-btn). */
	.ebg-prc .ebg-prc__actions {
		display: flex;
		margin-block-end: 38px;

		& .wp-block-button { flex: 1; }

		& .wp-block-button__link {
			--ebg-btn-disc-size: 30px;

			justify-content: center;
			inline-size: 100%;
			box-sizing: border-box;
			padding: 12px;
			border-color: var(--ebg-accent);
		}
	}

	.ebg-prc .ebg-prc__box--active .ebg-prc__actions .wp-block-button__link {
		--ebg-btn-bg: #FFFFFF;
		--ebg-btn-ink: var(--ebg-ink);

		border-color: #FFFFFF;
	}

	.ebg-prc .ebg-prc__list {
		display: flex;
		flex-direction: column;
		gap: 16px;
		padding: 0;
		list-style: none;

		& li {
			display: flex;
			gap: 12px;
			margin: 0;
			color: var(--ebg-prc-ink-2);
			font-size: var(--text-base);
			line-height: 1.5;

			&::before {
				content: "";
				flex: none;
				inline-size: 13px;
				block-size: 12px;
				margin-block-start: 6px;
				background-color: var(--ebg-prc-dot);
				mask: var(--ebg-prc-bullet) center / contain no-repeat;
			}
		}
	}

	.ebg-prc .ebg-prc__note {
		max-inline-size: 760px;
		margin: 40px auto 0;
		color: var(--ebg-ink-2);
		font-size: var(--text-base);
		line-height: 1.5;
		text-align: center;
	}

	/* Variant ebg-prc--panel (pattern-panel.php, Layout H10 .h10-pricing-box): a
	   white card with 15px padding; its top is a tinted panel (radius 12, padding
	   36 / 22 / 40) holding name, description and price; below it a "features"
	   title (20 / 600 / 28) with a short line, the list, and the pill at the foot.
	   The accent card keeps a white body: its panel turns accent, a "popular"
	   badge sits in the panel corner and the button is filled. */
	.ebg-prc.ebg-prc--panel .ebg-prc__box {
		padding: 15px;
		background-color: var(--ebg-surface-1);
	}

	.ebg-prc.ebg-prc--panel .ebg-prc__box--active {
		--ebg-prc-ink: var(--ebg-heading-ink);
		--ebg-prc-ink-2: var(--ebg-ink-2);
		--ebg-prc-dot: var(--ebg-accent);
	}

	.ebg-prc--panel .ebg-prc__top {
		position: relative;
		margin: 0;
		padding: 36px 22px 40px;
		border-radius: 12px;
		background-color: var(--ebg-surface-3);

		& > * { margin-block: 0; }
	}

	.ebg-prc--panel .ebg-prc__box--active .ebg-prc__top {
		--ebg-prc-ink: var(--ebg-on-accent);
		--ebg-prc-ink-2: var(--ebg-on-accent);

		background-color: var(--ebg-accent);
	}

	.ebg-prc.ebg-prc--panel .ebg-prc__price { margin-block: 30px 0; }

	/* Badge: dark tag with a star (CSS mask, not the ebg-icons tji-star-2 glyph). */
	.ebg-prc .ebg-prc__badge {
		position: absolute;
		inset-block-start: 20px;
		inset-inline-end: 20px;
		display: flex;
		align-items: center;
		gap: 4px;
		margin: 0;
		padding: 4px 7px 4px 5px;
		border-radius: 4px;
		background-color: var(--ebg-surface-anchor);
		color: #FFFFFF;
		font-size: 0.875rem;
		font-weight: 600;
		line-height: 1;
		letter-spacing: -0.03em;

		&::before {
			content: "";
			inline-size: 15px;
			aspect-ratio: 1;
			background-color: currentColor;
			mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2 2.9 6.6 7.1.6-5.4 4.7 1.6 7L12 17.2 5.8 20.9l1.6-7L2 9.2l7.1-.6z'/%3E%3C/svg%3E") center / contain no-repeat;
		}
	}

	/* Four narrow cards: the name runs under a corner badge, so the badge
	   straddles the panel's top edge instead (above the 36px top padding). */
	.ebg-prc .ebg-prc__boxes--4 .ebg-prc__badge { inset-block-start: -11px; }

	.ebg-prc--panel .ebg-prc__body {
		display: flex;
		flex: 1;
		flex-direction: column;
		margin: 0;
		padding: 24px 20px 20px;

		& > * { margin-block: 0; }
	}

	.ebg-prc .ebg-prc__feat {
		margin-block-end: 2px;
		color: var(--ebg-heading-ink);
		font-family: var(--font-display);
		font-size: 1.25rem;
		font-weight: 600;
		line-height: 1.4;
	}

	.ebg-prc .ebg-prc__feat-desc {
		margin-block-end: 20px;
		color: var(--ebg-ink-2);
		font-size: var(--text-base);
		line-height: 1.5;
	}

	/* The short line is optional: without it the list keeps the same 20px gap. */
	.ebg-prc .ebg-prc__feat + .ebg-prc__list { margin-block-start: 18px; }

	.ebg-prc--panel .ebg-prc__list li { color: var(--ebg-ink); }

	/* The pill sits at the card foot, 26px under the list at least. */
	.ebg-prc.ebg-prc--panel .ebg-prc__actions {
		margin-block: auto 0;
		padding-block-start: 26px;
	}

	.ebg-prc.ebg-prc--panel .ebg-prc__box--active .ebg-prc__actions .wp-block-button__link {
		--ebg-btn-bg: var(--ebg-accent);
		--ebg-btn-ink: var(--ebg-on-accent);

		border-color: var(--ebg-accent);
	}

	/* ebg breakpoints: 1200 / 1024 / 767. */
	@media (max-width: 1200px) {
		.ebg-prc .ebg-prc__name { font-size: 1.375rem; }

		.ebg-prc__boxes.ebg-prc__boxes--4 {
			grid-template-columns: repeat(2, minmax(0, 1fr));
			max-inline-size: 720px;
			margin-inline: auto;
		}
	}

	@media (max-width: 1024px) {
		.ebg-prc__head { margin-block-end: 35px; }
		.ebg-prc .ebg-prc__sub { margin-block-end: 15px; font-size: 0.8125rem; }
		.ebg-prc .ebg-prc__title { font-size: 2.5rem; }

		.ebg-prc__boxes {
			grid-template-columns: repeat(2, minmax(0, 1fr));
			max-inline-size: 720px;
			margin-inline: auto;
		}
	}

	/* home-10 keeps the two columns at full width (home-02 caps them at 720);
	   four plans go to two full-width columns from 1200 down. */
	@media (max-width: 1200px) {
		.ebg-prc--panel .ebg-prc__boxes.ebg-prc__boxes--4 { max-inline-size: none; }
	}

	@media (max-width: 1024px) {
		.ebg-prc--panel .ebg-prc__boxes { max-inline-size: none; }
	}

	@media (max-width: 767px) {
		.ebg-prc .ebg-prc__title { font-size: 1.875rem; }
		.ebg-prc .ebg-prc__name { font-size: 1.25rem; }
		.ebg-prc__boxes,
		.ebg-prc__boxes.ebg-prc__boxes--4 { grid-template-columns: minmax(0, 1fr); }
	}
}
