@charset "UTF-8";

/**
 * Story tabs
 * Breakpoint-dependent rules use .tw-story--mobile class toggled by story.js.
 * To change the breakpoint, update STORY_BREAKPOINT in story.js only.
 */

.tw-story-tabs > p {
	color: var(--wp--preset--color--tw-primary-3);
	cursor: pointer;
	font-weight: 700;
	position: relative;
}
.tw-story-tabs p a {
	color: inherit;
	text-decoration: none;
	transition: color 0.5s ease;
}
.tw-story-tabs p.is-active a {
	color: var(--wp--preset--color--tw-primary-1);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--tw-1);
}
/* Yellow underline on active tab */
.tw-story-tabs p.is-active::after {
	background-color: var(--wp--preset--color--tw-primary-1);
	border-radius: 2px;
	bottom: -23px;
	content: '';
	height: 7px;
	left: 50%;
	position: absolute;
	transform: translateX(-50%);
	width: 122px;
}

/* Desktop: pill shape */
.tw-story:not(.tw-story--mobile) .tw-story-tabs {
	background-color: var(--wp--preset--color--tw-light);
	border-radius: 100px;
	justify-content: space-evenly !important;
	margin-bottom: var(--wp--preset--spacing--tw-normal);
	padding: var(--wp--preset--spacing--tw-small) var(--wp--preset--spacing--tw-medium);
}
.tw-story:not(.tw-story--mobile) .tw-story-tabs > p {
	text-align: center;
}

/* Desktop compact: center tabs with fixed gap below 1400px */
@media (max-width: 1555px) {

	.tw-story:not(.tw-story--mobile) .tw-story-tabs {
		gap: var(--wp--preset--spacing--tw-intermediate) !important;
		justify-content: center !important;
	}

}

/**
 * Story content panels
 * Hidden by default, shown when is-active class is added by JS.
 * Selector targets .tw-story to work in both desktop (.tw-story-contents)
 * and mobile (.tw-story-tabs) contexts after DOM rearrangement.
 * In the block editor: all panels are visible (no JS running).
 */

.tw-story .tw-story-content {
	display: none;
}
.tw-story .tw-story-content.is-active {
	animation: twStoryFadeIn 0.3s ease;
	display: grid;
}

@keyframes twStoryFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}
/* Block editor: show all panels so they can be edited */
.editor-styles-wrapper .tw-story .tw-story-content {
	display: grid;
}

/**
 * Story content card
 * Text + fill image card with shadow and border-radius.
 * Mobile: text first, image second.
 */

.tw-story-content {
	border-radius: var(--wp--custom--border-radius--medium);
	box-shadow: var(--wp--preset--shadow--tw-medium);
	gap: 0 !important;
	overflow: hidden;
}
.tw-story-content .tw-grid-2-col-content {
	order: 1;
	padding: var(--wp--preset--spacing--tw-normal);
}
.tw-story-content .tw-grid-2-col-visual {
	min-height: 250px;
	order: 2;
	overflow: hidden;
	padding: 0 !important;
}
.tw-story-content .tw-grid-2-col-visual .wp-block-image {
	height: 100%;
	margin: 0;
}
.tw-story-content .tw-grid-2-col-visual .wp-block-image img {
	display: block;
	height: 100%;
	object-fit: cover;
	object-position: center;
	width: 100%;
}

/* Desktop: two-column card */
.tw-story:not(.tw-story--mobile) .tw-story-content.tw-grid-2-col {
	grid-template-columns: 1fr 1fr;
}
.tw-story:not(.tw-story--mobile) .tw-story-content .tw-grid-2-col-content,
.tw-story:not(.tw-story--mobile) .tw-story-content .tw-grid-2-col-visual {
	order: initial;
}

/* Mobile: single-column card */
.tw-story--mobile .tw-story-content.tw-grid-2-col {
	grid-template-columns: 1fr;
	margin-left: auto;
	margin-right: auto;
	max-width: 900px;
}

/* Mobile: tabs stack vertically */
.tw-story--mobile .tw-story-tabs {
	align-items: center !important;
	flex-direction: column !important;
	gap: var(--wp--preset--spacing--tw-extra-small) !important;
}

/* Vertical breathing room for each tab */
.tw-story--mobile .tw-story-tabs > p {
	padding-bottom: var(--wp--preset--spacing--tw-small);
	padding-top: var(--wp--preset--spacing--tw-small);
}
.tw-story--mobile .tw-story-tabs > p.is-active {
	padding-bottom: var(--wp--preset--spacing--tw-normal);
}

/* Revert underline to flow-based on mobile */
.tw-story--mobile .tw-story-tabs p.is-active::after {
	display: block;
	margin: 6px auto 0;
	position: static;
	transform: none;
}

/* Remove overflow + swap box-shadow for filter so shadow covers the triangle too */
.tw-story--mobile .tw-story-content {
	box-shadow: none;
	filter: drop-shadow(0 0 10px var(--wp--custom--shadow-color--neutral));
	margin-bottom: var(--wp--preset--spacing--tw-small);
	margin-top: 20px;
	overflow: visible;
	position: relative;
}

/* Upward-pointing white triangle at the top of the active content panel */
.tw-story--mobile .tw-story-content::before {
	border-bottom: 14px solid var(--wp--preset--color--tw-light);
	border-left: 14px solid transparent;
	border-right: 14px solid transparent;
	content: '';
	display: block;
	height: 0;
	left: 50%;
	position: absolute;
	top: -14px;
	transform: translateX(-50%);
	width: 0;
}

/* Re-apply bottom radius on image column since parent overflow is now visible */
.tw-story--mobile .tw-story-content .tw-grid-2-col-visual {
	border-bottom-left-radius: var(--wp--custom--border-radius--medium);
	border-bottom-right-radius: var(--wp--custom--border-radius--medium);
}
