/* TSD features. Loaded only on pages that use them. */

/* ---------- Slider + carousel (CSS scroll-snap; JS adds arrows, dots, autoplay) ---------- */
.is-style-tt-slider, .is-style-tt-carousel {
	display: flex !important; flex-wrap: nowrap !important; gap: var(--tt-gap, 1.25rem);
	overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	scrollbar-width: none; -webkit-overflow-scrolling: touch; position: relative;
}
.is-style-tt-slider::-webkit-scrollbar, .is-style-tt-carousel::-webkit-scrollbar { display: none; }
.is-style-tt-slider > *, .is-style-tt-carousel > * { margin: 0 !important; scroll-snap-align: start; max-width: none !important; }
.is-style-tt-slider { --tt-gap: 0px; }
.is-style-tt-slider > * { flex: 0 0 100%; }
.is-style-tt-carousel > * { flex: 0 0 calc((100% - 2 * var(--tt-gap, 1.25rem)) / 3); }
@media (max-width: 1000px) { .is-style-tt-carousel > * { flex-basis: calc((100% - var(--tt-gap, 1.25rem)) / 2); } }
@media (max-width: 640px) { .is-style-tt-carousel > * { flex-basis: 86%; } }
.is-style-tt-slider > .wp-block-cover:not(:has(img)) { background-color: var(--wp--preset--color--ink); }
@media (prefers-reduced-motion: reduce) { .is-style-tt-slider, .is-style-tt-carousel { scroll-behavior: auto; } }
.editor-styles-wrapper .is-style-tt-slider, .editor-styles-wrapper .is-style-tt-carousel { scroll-snap-type: none; overflow-x: auto; scrollbar-width: thin; }

.tt-slider-wrap { position: relative; }
.tt-slider-wrap.alignfull, .tt-slider-wrap.alignwide { margin-left: auto; margin-right: auto; }
.tt-slider-controls { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: 1rem; }
.tt-slider-wrap.is-slider .tt-slider-controls { position: absolute; left: 0; right: 0; bottom: 1.25rem; margin: 0; }
.tt-slider-btn {
	appearance: none; border: 2px solid currentColor; background: transparent; color: var(--wp--preset--color--ink);
	width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.tt-slider-btn:hover { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--white); border-color: var(--wp--preset--color--ink); }
.tt-slider-btn svg { width: 20px; height: 20px; }
.tt-slider-dots { display: flex; gap: .4rem; }
.tt-slider-dot { appearance: none; border: 0; padding: 7px; width: 24px; height: 24px; box-sizing: border-box; background-clip: content-box; border-radius: 12px; background-color: var(--wp--preset--color--steel); opacity: .5; cursor: pointer; } /* 1.0.23: 24px tap target, 10px dot */
.tt-slider-dot[aria-current="true"] { background-color: var(--wp--preset--color--red); opacity: 1; width: 40px; border-radius: 12px; }
.tt-slider-wrap.is-slider .tt-slider-btn { color: var(--wp--preset--color--white); background: rgba(19,31,49,.35); }
.tt-slider-wrap.is-slider .tt-slider-btn:hover { background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink); border-color: var(--wp--preset--color--white); }
.tt-slider-wrap.is-slider .tt-slider-dot { background-color: var(--wp--preset--color--white); }
.tt-slider-wrap.is-slider .tt-slider-dot[aria-current="true"] { background-color: var(--wp--preset--color--gold); }
.has-navy-background-color .tt-slider-btn { color: var(--wp--preset--color--white); }
.has-navy-background-color .tt-slider-dot { background: var(--wp--preset--color--mist); }
.has-navy-background-color .tt-slider-dot[aria-current="true"] { background: var(--wp--preset--color--gold); }

/* ---------- Filterable grid + masonry ---------- */
.is-style-tt-filter-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); gap: var(--wp--preset--spacing--30); }
.is-style-tt-filter-grid > * { margin: 0 !important; max-width: none !important; }
.is-style-tt-filter-masonry { display: block !important; columns: 3 16rem; column-gap: var(--wp--preset--spacing--30); }
.is-style-tt-filter-masonry > * { break-inside: avoid; margin: 0 0 var(--wp--preset--spacing--30) !important; max-width: none !important; width: 100%; }
.tt-filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: var(--wp--preset--spacing--40); }
.tt-filter-bar.is-centered { justify-content: center; }
.tt-filter-btn {
	appearance: none; cursor: pointer; border: 2px solid var(--wp--preset--color--ink); background: transparent; color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1rem; letter-spacing: .06em; text-transform: uppercase;
	padding: .55rem 1rem; border-radius: var(--wp--custom--radius); line-height: 1;
}
.tt-filter-btn[aria-pressed="true"], .tt-filter-btn:hover { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--white); }
.has-navy-background-color .tt-filter-btn { border-color: var(--wp--preset--color--white); color: var(--wp--preset--color--white); }
.has-navy-background-color .tt-filter-btn[aria-pressed="true"], .has-navy-background-color .tt-filter-btn:hover { background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink); }
.tt-is-filtered-out { display: none !important; }
.tt-filter-in { animation: tt-pop .35s ease both; }
@keyframes tt-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* Gallery item: a Cover block. Overlay (title + category) shows on hover/focus when a photo is set. */
.tt-gallery-item { overflow: hidden; border-radius: var(--wp--custom--radius); padding: 0 !important; align-items: stretch !important; }
.tt-gallery-item:not(:has(img)) { background-color: #E6E2D8; background-image: repeating-linear-gradient(135deg, rgba(27,42,65,.06) 0 2px, transparent 2px 14px); }
.tt-gallery-item:not(:has(img)) .wp-block-cover__background { opacity: 0 !important; }
.tt-gallery-item .wp-block-cover__inner-container {
	align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; gap: .25rem;
	padding: 1.25rem; margin: 0 !important; width: 100% !important; color: var(--wp--preset--color--white);
	background: linear-gradient(to top, rgba(19,31,49,.94) 0, rgba(19,31,49,.6) 38%, transparent 72%);
	transition: opacity .25s ease, transform .25s ease;
}
.tt-gallery-item .wp-block-cover__inner-container > * { margin: 0; }
.tt-gallery-item .wp-block-cover__image-background { transition: transform .5s ease; }
@media (hover: hover) {
	.tt-gallery-item:has(img) .wp-block-cover__inner-container { opacity: 0; transform: translateY(8px); }
	.tt-gallery-item:has(img):hover .wp-block-cover__inner-container, .tt-gallery-item:has(img):focus-within .wp-block-cover__inner-container { opacity: 1; transform: none; }
	.tt-gallery-item:hover .wp-block-cover__image-background { transform: scale(1.05); }
}
.tt-gallery-item .is-style-tt-kicker { color: var(--wp--preset--color--gold); }
.tt-gallery-item a { color: inherit; }

/* ---------- Parallax (Cover) ---------- */
.is-style-tt-parallax { overflow: hidden; }
.is-style-tt-parallax:not(:has(img)) { background-color: var(--wp--preset--color--ink); background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 16px); background-size: 100% 140%; }
.tt-fx .is-style-tt-parallax.tt-parallax-on .wp-block-cover__image-background { transform: translate3d(0, var(--tt-py, 0px), 0) scale(1.18); will-change: transform; }
.tt-fx .is-style-tt-parallax.tt-parallax-on:not(:has(img)) { background-position: 0 var(--tt-py, 0px); }

/* ---------- Fade in on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
	.tt-fx :is(.is-style-tt-reveal, .tt-reveal):not(.tt-in) { opacity: 0; transform: translateY(28px); }
	.tt-fx :is(.is-style-tt-reveal, .tt-reveal) { transition: opacity .7s ease, transform .7s ease; }
	.tt-fx .tt-reveal-children > * { transition: opacity .6s ease, transform .6s ease; }
	.tt-fx .tt-reveal-children:not(.tt-in) > * { opacity: 0; transform: translateY(20px); }
	.tt-fx .tt-reveal-children > *:nth-child(2) { transition-delay: .08s; } .tt-fx .tt-reveal-children > *:nth-child(3) { transition-delay: .16s; }
	.tt-fx .tt-reveal-children > *:nth-child(4) { transition-delay: .24s; } .tt-fx .tt-reveal-children > *:nth-child(n+5) { transition-delay: .3s; }
}
.editor-styles-wrapper :is(.is-style-tt-reveal, .tt-reveal) { opacity: 1 !important; transform: none !important; }

/* ---------- Counters / stats ---------- */
.tt-counter { font-family: var(--wp--preset--font-family--heading); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; margin: 0; }
.tt-stat { border-top: 3px solid var(--wp--preset--color--red); padding-top: 1rem; }
.has-navy-background-color .tt-stat { border-top-color: var(--wp--preset--color--gold); }

/* ---------- Tabs (Group of Details blocks; without JS it stays an accordion) ---------- */
.tt-tablist { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 2px solid var(--wp--preset--color--line); margin-bottom: var(--wp--preset--spacing--40); scrollbar-width: thin; }
.tt-tab {
	appearance: none; border: 0; background: transparent; cursor: pointer; white-space: nowrap; color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1.125rem; letter-spacing: .06em; text-transform: uppercase;
	padding: .85rem 1.1rem; margin-bottom: -2px; border-bottom: 3px solid transparent;
}
.tt-tab[aria-selected="true"] { border-bottom-color: var(--wp--preset--color--red); }
.tt-tab:hover { background: var(--wp--preset--color--paper); }
.tt-tabs-on > .wp-block-details { border: 0 !important; padding: 0 !important; margin: 0 !important; }
.tt-tabs-on > .wp-block-details > summary { display: none; }
.tt-tabs-on > .wp-block-details[hidden] { display: none; }
.has-navy-background-color .tt-tab { color: var(--wp--preset--color--white); }
.has-navy-background-color .tt-tab:hover { background: rgba(255,255,255,.08); }
.has-navy-background-color .tt-tab[aria-selected="true"] { border-bottom-color: var(--wp--preset--color--gold); }

/* ---------- Video lightbox ---------- */
.tt-lightbox { border: 0; padding: 0; background: transparent; width: min(1100px, 94vw); max-width: none; overflow: visible; }
.tt-lightbox::backdrop { background: rgba(10,16,26,.88); }
.tt-lightbox__frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 4px; overflow: hidden; }
.tt-lightbox__frame iframe, .tt-lightbox__frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tt-lightbox__msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 2rem; color: #fff; font-size: 1.125rem; background: var(--wp--preset--color--ink); }
.tt-lightbox__close {
	position: absolute; top: -52px; right: 0; width: 44px; height: 44px; border-radius: 50%; border: 2px solid #fff; background: transparent; color: #fff; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
}
.tt-lightbox__close:hover { background: #fff; color: var(--wp--preset--color--ink); }
.is-style-tt-video-lightbox .wp-block-button__link::before {
	content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .55em; vertical-align: -0.05em;
	background: currentColor; clip-path: polygon(10% 0, 100% 50%, 10% 100%);
}
.is-style-tt-slider > .wp-block-cover { padding-left: max(var(--wp--preset--spacing--30), calc((100% - var(--wp--style--global--wide-size, 1200px)) / 2)); padding-right: max(var(--wp--preset--spacing--30), calc((100% - var(--wp--style--global--wide-size, 1200px)) / 2)); padding-bottom: 5rem; }
.is-style-tt-slider > .wp-block-cover > .wp-block-cover__inner-container > * { margin-left: 0 !important; }

/* ---------- Video series grid (About: Why listen to Stewart) ---------- */
.tt-video-series {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) !important;
	gap: var(--wp--preset--spacing--40);
	margin-top: var(--wp--preset--spacing--50);
}
@media (min-width: 600px) {
	.tt-video-series { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (min-width: 960px) {
	.tt-video-series { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
.tt-video-series > * { margin: 0 !important; max-width: none !important; }
.tt-video-card { height: 100%; }
.tt-video-card .tt-video-lightbox a {
	position: relative;
	display: block;
	border-radius: var(--wp--custom--radius, 4px);
	overflow: hidden;
}
.tt-video-card .tt-video-lightbox a:focus-visible { outline: 3px solid var(--wp--preset--color--gold); outline-offset: 3px; }
.tt-video-card .tt-video-lightbox a::before,
.tt-video-card .tt-video-lightbox a::after {
	content: "";
	position: absolute;
	pointer-events: none;
}
.tt-video-card .tt-video-lightbox a::before {
	left: 50%; top: 50%;
	width: 3.25rem; height: 3.25rem;
	margin: -1.625rem 0 0 -1.625rem;
	border-radius: 50%;
	background: rgba(19, 31, 49, .82);
	box-shadow: inset 0 0 0 2px #fff;
	z-index: 1;
}
.tt-video-card .tt-video-lightbox a::after {
	left: 50%; top: 50%;
	width: .85rem; height: .85rem;
	margin: -0.4rem 0 0 -0.3rem;
	background: #fff;
	clip-path: polygon(10% 0, 100% 50%, 10% 100%);
	z-index: 2;
}
.tt-video-card h3 { margin: .7rem 0 .15rem; }
.tt-video-card h3 a { color: inherit; text-decoration: none; }
.has-navy-background-color .tt-video-card h3 a:hover,
.has-navy-background-color .tt-video-card h3 a:focus-visible,
.has-navy-deep-background-color .tt-video-card h3 a:hover,
.has-navy-deep-background-color .tt-video-card h3 a:focus-visible { color: var(--wp--preset--color--gold); }
.tt-video-card .tt-video-time { margin: 0; font-size: .875rem; letter-spacing: .04em; }
@media (prefers-reduced-motion: no-preference) {
	.tt-video-card .tt-video-lightbox img { transition: transform .45s ease; }
	.tt-video-card:hover .tt-video-lightbox img,
	.tt-video-card:focus-within .tt-video-lightbox img { transform: scale(1.04); }
}
