/* ==========================================================================
   Basketball plays library + single play (Figma 63:546, 64:548)
   ========================================================================== */

:root { --court: #f7f3ec; --orange-tint: #fff6f0; }

/* Shared ---------------------------------------------------------------- */
.play-tag {
	padding: 4px 10px;
	border-radius: 6px;
	background: var(--orange-soft);
	font-size: 12px;
	font-weight: 600;
	line-height: normal;
	color: var(--orange);
	transition: background-color .4s, color .4s;
}

/* ==========================================================================
   Archive: hero (63:561)
   ========================================================================== */
.plays-hero { padding: 56px 0 40px; }
.plays-hero__inner { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.plays-hero__title { max-width: 1000px; font-size: 56px; font-weight: 800; line-height: 1.08; letter-spacing: -.02em; text-wrap: wrap; }
.plays-hero__lead { max-width: 760px; font-size: 19px; line-height: 1.5; color: var(--text); }

.plays-search {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	max-width: 640px;
	padding: 0 8px 0 20px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--white);
	transition: border-color .3s, box-shadow .35s var(--ease);
}
.plays-search:focus-within { border-color: #f3c3ad; box-shadow: 0 12px 28px -16px rgba(21, 39, 59, .3); }
.plays-search__icon { flex: none; font-size: 18px; line-height: 1; color: var(--muted); }
.plays-search__input {
	flex: 1;
	min-width: 0;
	height: 54px;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 16px;
	color: var(--ink);
	-webkit-appearance: none;
	appearance: none;
}
.plays-search__input::placeholder { color: var(--muted); opacity: 1; }
.plays-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.plays-search__submit {
	display: grid;
	place-items: center;
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 8px;
	color: var(--muted);
	transition: background-color .3s, color .3s;
}
.plays-search__submit:hover,
.plays-search:focus-within .plays-search__submit { background: var(--orange); color: var(--white); }

.plays-chips { max-width: 100%; }
.plays-chips__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chip {
	display: inline-flex;
	padding: 9px 16px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--white);
	font-size: 14px;
	font-weight: 500;
	line-height: normal;
	color: var(--text);
	white-space: nowrap;
	transition: background-color .3s, border-color .3s, color .3s, transform .35s var(--ease);
}
.chip:hover { border-color: #f3c3ad; color: var(--orange); transform: translateY(-2px); }
.chip.is-active { border-color: var(--navy); background: var(--navy); color: var(--white); }

/* ==========================================================================
   Archive: grid (63:583)
   ========================================================================== */
.plays-grid-sec { padding: 24px 0 96px; }
.plays-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

.play-card { display: flex; }
.play-card__link {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	width: 100%;
	padding: 16px 16px 20px;
	border: 1px solid var(--border);
	border-radius: 18px;
	background: var(--white);
	transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .4s;
}
.play-card__link:hover { transform: translateY(-6px); border-color: #f3c3ad; box-shadow: 0 20px 40px -20px rgba(21, 39, 59, .22); }
.play-card__link:hover .play-tag { background: var(--orange); color: var(--white); }
.play-card__link:hover .i--arrow { transform: translateX(3px); }

.play-card__diagram,
.frame-card__diagram {
	width: 100%;
	aspect-ratio: 352 / 330.88;
	overflow: hidden;
	border-radius: 6px;
	background: var(--court);
}
.play-card__diagram img,
.frame-card__diagram img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.play-card__link:hover .play-card__diagram img { transform: scale(1.03); }

.play-card__meta { display: flex; align-items: center; gap: 8px; }
.play-card__frames { font-size: 13px; line-height: normal; color: var(--muted); }
.play-card__title { font-size: 20px; font-weight: 700; line-height: 1.2; }
.play-card__text { font-size: 15px; line-height: 1.5; color: var(--text); }
.play-card__more,
.pcat__more,
.rel-card__more { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; font-size: 14px; font-weight: 600; line-height: normal; color: var(--orange); }

/* Pagination */
.plays-pager { margin-top: 24px; }
.plays-pager ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.plays-pager a,
.plays-pager span {
	display: inline-flex;
	padding: 8px 14px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--white);
	font-size: 14px;
	font-weight: 500;
	line-height: normal;
	color: var(--text);
	transition: border-color .3s, color .3s;
}
.plays-pager a:hover { border-color: #f3c3ad; color: var(--orange); }
.plays-pager .current { border-color: var(--navy); background: var(--navy); color: var(--white); }
.plays-pager .dots { border-color: transparent; background: none; }

/* Empty state */
.plays-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	max-width: 640px;
	margin: 24px auto 0;
	padding: 48px 32px;
	border: 1px dashed var(--light-1);
	border-radius: 18px;
	text-align: center;
}
.plays-empty__title { font-size: 22px; font-weight: 700; line-height: 1.25; }
.plays-empty__text { font-size: 16px; color: var(--text); }
.plays-empty .btn { margin-top: 6px; }

/* ==========================================================================
   Archive: categories (63:765)
   ========================================================================== */
.plays-cats__head { gap: 14px; max-width: 860px; }
.plays-cats__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.pcat { gap: 8px; }
.pcat__title { font-size: 20px; font-weight: 700; line-height: 1.2; }
.pcat__text { font-size: 15px; line-height: 1.5; color: var(--muted); }
.pcat:hover .i--arrow { transform: translateX(3px); }

/* ==========================================================================
   Archive: submit a play (63:796)
   ========================================================================== */
.plays-submit {
	display: flex;
	align-items: center;
	gap: 48px;
	padding: 56px 64px;
	border-radius: 24px;
	background: var(--orange-tint);
}
.plays-submit__text { display: flex; flex: 1; flex-direction: column; gap: 12px; min-width: 0; }
.plays-submit__title { font-size: 32px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.plays-submit__lead { font-size: 17px; line-height: 1.55; color: var(--text); }
.plays-submit .btn { flex: none; }

/* ==========================================================================
   Single: header (64:563)
   ========================================================================== */
.play-head { padding: 40px 0 32px; }
.play-head__inner { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.play-head__title { max-width: 900px; font-size: 48px; font-weight: 800; line-height: 1.08; letter-spacing: -.02em; }
.play-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.play-pills li {
	padding: 5px 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--bg-alt);
	font-size: 13px;
	font-weight: 500;
	line-height: normal;
	color: var(--text);
}

/* ==========================================================================
   Single: viewer + sidebar (64:577)
   ========================================================================== */
.play-main { padding: 16px 0 72px; }
.play-main__inner { display: flex; align-items: flex-start; gap: 48px; }

.play-viewer {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
	padding: 20px;
	border: 1px solid var(--border);
	border-radius: 20px;
	background: var(--white);
}
.play-viewer__tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.play-viewer__tab {
	padding: 8px 14px;
	border-radius: 8px;
	background: var(--bg-alt);
	font-size: 14px;
	font-weight: 600;
	line-height: normal;
	color: var(--text);
	transition: background-color .3s, color .3s;
}
.play-viewer__tab:hover { background: var(--panel); color: var(--ink); }
.play-viewer__tab.is-active { background: var(--navy); color: var(--white); }

.play-viewer__stage {
	display: grid;
	width: 100%;
	aspect-ratio: 724 / 680.56;
	overflow: hidden;
	border-radius: 6px;
	background: var(--court);
}
.play-viewer__frame {
	grid-area: 1 / 1;
	opacity: 0;
	transition: opacity .7s var(--ease), transform 1s var(--ease-out);
	transform: scale(1.015);
}
.play-viewer__frame.is-active { opacity: 1; transform: none; }
.play-viewer__frame img { width: 100%; height: 100%; object-fit: cover; }

.play-viewer__controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; line-height: normal; }
.play-viewer__play { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--orange); transition: color .3s; }
.play-viewer__play:hover { color: var(--orange-dark); }
.play-viewer__icon { display: grid; }
.play-viewer__icon svg { grid-area: 1 / 1; transition: opacity .25s, transform .35s var(--ease); }
.play-viewer__play .i-pause { opacity: 0; transform: scale(.6); }
.play-viewer__play.is-playing .i-play { opacity: 0; transform: scale(.6); }
.play-viewer__play.is-playing .i-pause { opacity: 1; transform: none; }
.play-viewer__count { color: var(--muted); font-variant-numeric: tabular-nums; }

.play-side {
	position: sticky;
	top: calc(var(--hh) + 24px);
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 20px;
	width: 380px;
	padding: 28px;
	border-radius: 20px;
	background: var(--bg-alt);
}
.play-side__actions,
.play-side__info { display: flex; flex-direction: column; gap: 20px; }
.play-side__title { font-size: 20px; font-weight: 700; line-height: 1.2; }
.play-facts { display: flex; flex-direction: column; gap: 12px; margin: 0; font-size: 14px; line-height: normal; }
.play-facts__row { display: flex; justify-content: space-between; gap: 16px; }
.play-facts dt { flex: none; color: var(--muted); }
.play-facts dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }
.play-side__note { font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ==========================================================================
   Single: step by step (64:635)
   ========================================================================== */
.play-steps { padding: 72px 0; background: var(--bg-alt); }
.play-steps__title { margin-bottom: 32px; font-size: 40px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.play-steps__intro { max-width: 820px; margin: -12px 0 32px; }
.play-steps__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 24px; }
/* One frame only: diagram and text side by side */
.play-steps__grid--single { grid-template-columns: minmax(0, 1fr); }
.play-steps__grid--single > .frame-card { display: grid; grid-template-columns: minmax(0, 352px) minmax(0, 1fr); align-items: center; gap: 32px; padding: 16px 32px 16px 16px; }
.play-steps__grid--single .frame-card__body { max-width: 640px; }
.frame-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 16px 16px 24px;
	border: 1px solid var(--border);
	border-radius: 18px;
	background: var(--white);
	scroll-margin-top: calc(var(--hh) + 24px);
	transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .4s;
}
.frame-card:hover { transform: translateY(-6px); border-color: #f3c3ad; box-shadow: 0 20px 40px -20px rgba(21, 39, 59, .22); }
.js .frame-card.is-in { transition: opacity .9s var(--ease-out), transform .5s var(--ease), box-shadow .5s var(--ease), border-color .4s; transition-delay: 0s; }
.frame-card__body { display: flex; flex-direction: column; gap: 14px; }
.frame-card__title { font-size: 19px; font-weight: 700; line-height: 1.25; }
.frame-card__text { font-size: 15px; line-height: 1.55; color: var(--text); }

/* ==========================================================================
   Single: coaching points (64:708)
   ========================================================================== */
.play-points { padding: 72px 0; }
.play-points__inner { display: flex; align-items: flex-start; gap: 64px; }
.play-points__text { display: flex; flex: 1; flex-direction: column; gap: 16px; min-width: 0; }
.play-points__title { font-size: 32px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.play-bullets { display: flex; flex-direction: column; gap: 16px; }
.play-bullets li { position: relative; padding-left: 20px; font-size: 16px; line-height: 1.55; color: var(--text); }
.play-bullets li::before { content: ''; position: absolute; left: 4px; top: .68em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.play-bullets--sm li { font-size: 15px; }
.play-counters {
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 16px;
	width: 420px;
	padding: 28px;
	border-radius: 20px;
	background: var(--orange-tint);
}
.play-counters__title { font-size: 20px; font-weight: 700; line-height: 1.2; }

/* ==========================================================================
   Single: related plays (64:719)
   ========================================================================== */
.play-related { padding: 72px 0 96px; background: var(--bg-alt); }
.play-related__title { margin-bottom: 24px; font-size: 32px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.play-related__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.rel-card { gap: 6px; padding: 24px; }
.rel-card__cat { font-size: 12px; font-weight: 600; line-height: normal; color: var(--orange); }
.rel-card__title { font-size: 19px; font-weight: 700; line-height: 1.25; }
.rel-card__more { margin-top: 0; }
.rel-card:hover .i--arrow { transform: translateX(3px); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
	.plays-grid,
	.plays-cats__grid,
	.play-related__grid,
	.play-steps__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	/* Odd last card spans the full row (3 -> 2 + 1) */
	.play-related__grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
	.play-steps__grid > .frame-card:last-child:nth-child(odd) {
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: center;
		gap: 24px;
	}

	.play-main__inner { gap: 32px; }
	.play-side { width: 340px; padding: 24px; }
	.play-counters { width: 360px; }
	.play-points__inner { gap: 40px; }
	.plays-submit { gap: 32px; padding: 48px; }
}

@media (max-width: 900px) {
	.plays-hero__title,
	.play-head__title { font-size: 42px; }

	/* Viewer full width, sidebar below it (actions | facts side by side on tablet) */
	.play-main__inner { flex-direction: column; align-items: stretch; }
	.play-counters { width: 300px; padding: 24px; }
	.play-points__inner { gap: 32px; }
	.play-side {
		position: static;
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 32px;
		width: auto;
	}
}

@media (max-width: 767px) {
	.plays-hero { padding: 32px 0 24px; }
	.plays-hero__inner { gap: 16px; }
	.plays-hero__title { font-size: 32px; line-height: 1.12; }
	.plays-hero__lead { font-size: 16px; }
	.plays-search__input { height: 50px; }

	/* Chips scroll sideways inside their own row */
	.plays-chips { width: calc(100% + var(--gutter) * 2); margin-inline: calc(var(--gutter) * -1); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.plays-chips::-webkit-scrollbar { display: none; }
	.plays-chips__list { flex-wrap: nowrap; justify-content: flex-start; width: max-content; padding: 2px var(--gutter) 4px; }

	.plays-grid-sec { padding: 16px 0 60px; }
	.plays-grid,
	.plays-cats__grid,
	.play-related__grid,
	.play-steps__grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
	.play-card__link { padding: 16px 16px 20px; }
	.plays-empty { padding: 36px 20px; }

	.plays-cats__head { margin-bottom: 25px; }
	.pcat { padding: 24px 20px; }

	.plays-submit-sec { padding-bottom: 60px; }
	.plays-submit { flex-direction: column; align-items: flex-start; gap: 20px; padding: 36px 20px; border-radius: 20px; }
	.plays-submit__title { font-size: 26px; }
	.plays-submit__lead { font-size: 16px; }
	.plays-submit .btn { width: 100%; }

	.play-head { padding: 24px 0 20px; }
	.play-head__inner { gap: 14px; }
	.play-head__title { font-size: 30px; line-height: 1.12; }
	.play-pills li { font-size: 12px; padding: 5px 10px; }

	.play-main { padding: 0 0 60px; }
	.play-main__inner { gap: 20px; }
	.play-viewer { gap: 14px; padding: 12px; border-radius: 16px; }
	.play-viewer__tab { padding: 8px 12px; font-size: 13px; }
	.play-viewer__controls { font-size: 13px; }
	.play-side { display: flex; gap: 20px; padding: 24px 20px; }

	.play-steps { padding: 60px 0; }
	.play-steps__title { margin-bottom: 25px; font-size: 28px; }
	.play-steps__grid > .frame-card:last-child:nth-child(odd),
	.play-steps__grid--single > .frame-card { display: flex; padding: 12px 12px 20px; }
	.frame-card { padding: 12px 12px 20px; }
	.frame-card__body { gap: 10px; padding-inline: 8px; }
	.frame-card__text { font-size: 16px; }

	.play-points { padding: 60px 0; }
	.play-points__inner { flex-direction: column; align-items: stretch; gap: 32px; }
	.play-points__title { font-size: 28px; }
	.play-bullets { gap: 12px; }
	.play-bullets--sm li { font-size: 16px; }
	.play-counters { width: auto; padding: 24px 20px; }

	.play-related { padding: 60px 0; }
	.play-related__title { margin-bottom: 20px; font-size: 28px; }
	.rel-card { padding: 20px; }
}

@media (max-width: 420px) {
	.plays-hero__title { font-size: 28px; }
	.play-head__title { font-size: 27px; }
}

/* Reduced motion: frames switch without the crossfade */
@media (prefers-reduced-motion: reduce) {
	.play-viewer__frame { transform: none; }
}

/* Print (fallback for "Download PDF" when no bundled PDF exists) */
@media print {
	.site-header,
	.site-footer,
	.cta-sec,
	.play-related,
	.play-viewer,
	.play-side__actions,
	.play-side__note { display: none !important; }
	.play-main { padding: 0; }
	.play-side { position: static; width: auto; padding: 0; background: none; }
	.play-steps,
	.play-points { padding: 16px 0; background: none; }
	.play-steps__grid { grid-template-columns: repeat(2, 1fr); }
	.frame-card { break-inside: avoid; box-shadow: none; transform: none; }
	.js [data-reveal],
	.js [data-split] .w > span { opacity: 1 !important; transform: none !important; }
}

/* ==========================================================================
   Library: "How to choose the right basketball play" text
   ========================================================================== */
.plays-guide__inner { display: flex; flex-direction: column; gap: 16px; }
.plays-guide__title { font-size: 32px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.plays-guide__body { max-width: 1000px; }
.plays-guide__body li + li { margin-top: 10px; }

/* ==========================================================================
   Single: short answer under the H1, common mistakes, FAQ
   ========================================================================== */
.play-head__answer { max-width: 1040px; font-size: 16px; line-height: 1.6; color: var(--text); }
.play-mistakes { padding: 72px 0; }
.play-points + .play-mistakes { padding-top: 24px; }
.play-mistakes__inner { display: flex; flex-direction: column; gap: 16px; }
.play-mistakes .play-bullets { max-width: 820px; }
.play-points + .faq,
.play-mistakes + .faq { padding-top: 24px; }

@media (max-width: 767px) {
	.plays-guide__title { font-size: 28px; }
	.play-mistakes { padding: 60px 0; }
	.play-points + .play-mistakes { padding-top: 0; }
	.play-points + .faq,
	.play-mistakes + .faq { padding-top: 0; }
	.play-mistakes .play-points__title { font-size: 28px; }
}
