/* APH TV portal — mobile alignment (hub, watch, show archive) */

@media (max-width: 767px) {
	/* —— Portal: icon rail on mobile (same nav on all pages) —— */
	.aph-tv-app {
		grid-template-columns: 72px minmax(0, 1fr) !important;
	}

	.aph-tv-sidebar {
		display: flex !important;
	}

	.aph-tv-side-nav__label {
		display: none;
	}

	.aph-tv-side-nav__link {
		justify-content: center;
		padding: 11px 8px;
	}

	.aph-tv-side-nav {
		padding: 56px 8px 20px;
	}

	.aph-tv-home-hero__overlay {
		padding: 32px 16px 28px !important;
	}

	.aph-tv-home-hero__overlay h1 {
		font-size: 28px !important;
	}

	.aph-tv-home-row,
	.aph-tv-home-topics {
		padding: 20px 16px 8px !important;
	}

	.aph-tv-home-shows.aph-tv-home-seasons,
	.aph-tv-home-seasons {
		padding: 20px 16px 24px !important;
	}

	.aph-tv-home-row .row-head,
	.aph-tv-home-topics .row-head,
	.aph-tv-home-seasons__head {
		margin-bottom: 14px;
	}

	.aph-tv-home-row .row-head h2,
	.aph-tv-home-topics .row-head h2,
	.aph-tv-home-seasons h2 {
		font-size: 16px;
	}

	/* Horizontal carousels — Continue Watching & Trending */
	.aph-tv-home-row--continue .card-row,
	.aph-tv-home-row--trending .card-row {
		display: flex !important;
		grid-template-columns: unset !important;
		gap: 12px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		-ms-overflow-style: none;
		padding-bottom: 4px;
		margin: 0 -2px;
	}

	.aph-tv-home-row--continue .card-row::-webkit-scrollbar,
	.aph-tv-home-row--trending .card-row::-webkit-scrollbar {
		display: none;
	}

	.aph-tv-home-row--continue .card {
		flex: 0 0 min(82vw, 300px);
		scroll-snap-align: start;
	}

	.aph-tv-home-row--trending .card {
		flex: 0 0 min(58vw, 220px);
		scroll-snap-align: start;
	}

	.aph-tv-home-row .meta {
		padding: 10px 0 0;
	}

	.aph-tv-home-row .meta-row {
		align-items: center;
	}

	/* Topics → neat vertical list (icon | title + count) */
	.aph-tv-home-topics .topic-grid {
		display: flex !important;
		flex-direction: column;
		gap: 0 !important;
		grid-template-columns: unset !important;
	}

	.aph-tv-home-topics .topic-card {
		display: grid !important;
		grid-template-columns: 48px minmax(0, 1fr);
		grid-template-rows: auto auto;
		column-gap: 14px;
		row-gap: 2px;
		align-items: center;
		text-align: left;
		min-height: 0;
		padding: 14px 0;
		border: 0;
		border-bottom: 1px solid #ece8e1;
		border-radius: 0;
		background: transparent;
	}

	.aph-tv-home-topics .topic-card__icon {
		grid-row: 1 / 3;
		width: 48px;
		height: 48px;
		margin: 0;
		flex-shrink: 0;
		border-radius: 10px;
		background: #f5f5f5;
	}

	.aph-tv-home-topics .topic-card__name {
		grid-column: 2;
		grid-row: 1;
		font-size: 14px;
		line-height: 1.3;
	}

	.aph-tv-home-topics .topic-card__count {
		grid-column: 2;
		grid-row: 2;
		margin: 0;
		font-size: 12px;
		color: #6f6a63;
	}

	.season-card {
		flex: 0 0 148px;
		height: 220px;
	}

	/* —— Watch episode —— */
	.aph-ep-main {
		padding: 0 0 24px !important;
	}

	.aph-ep-player-wrap {
		margin-bottom: 0;
	}

	.aph-ep-head {
		padding: 16px 16px 0;
		margin-bottom: 12px;
	}

	.aph-ep-title {
		font-size: 22px !important;
		line-height: 1.15;
	}

	.aph-ep-subtitle {
		font-size: 14px;
		margin-bottom: 12px;
	}

	.aph-ep-stats-row {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.aph-ep-actions {
		display: grid !important;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		width: 100%;
		gap: 8px;
	}

	.aph-ep-action {
		justify-content: center;
		padding: 11px 8px;
		border-radius: 8px;
	}

	.aph-ep-tabs-wrap {
		padding: 0 16px;
	}

	.aph-ep-main > .aph-ep-head,
	.aph-ep-main > .aph-ep-tabs,
	.aph-ep-main > .aph-ep-panels,
	.aph-ep-main > .aph-ep-admin {
		padding-left: 16px;
		padding-right: 16px;
	}

	.aph-ep-tabs {
		gap: 20px;
		overflow-x: auto;
		scrollbar-width: none;
		-ms-overflow-style: none;
		margin-bottom: 18px;
	}

	.aph-ep-tabs::-webkit-scrollbar {
		display: none;
	}

	.aph-ep-tab {
		flex-shrink: 0;
		font-size: 13px;
		padding-bottom: 10px;
	}

	.aph-ep-aside {
		padding: 20px 16px 32px !important;
		background: #fff !important;
	}

	.aph-ep-aside-title {
		font-size: 16px;
		margin-bottom: 12px;
	}

	.aph-ep-side-card {
		grid-template-columns: 88px minmax(0, 1fr) auto;
		gap: 12px;
		align-items: center;
		padding: 12px 0;
		border-bottom: 1px solid #ece8e1;
		border-radius: 0;
		background: transparent;
	}

	.aph-ep-side-card__thumb {
		width: 88px;
		aspect-ratio: 16 / 10;
		border-radius: 8px;
	}

	.aph-ep-side-card__title {
		font-size: 14px;
		line-height: 1.35;
		margin: 0;
	}

	.aph-ep-side-card__dur {
		font-size: 12px;
		white-space: nowrap;
		align-self: center;
	}

	/* —— Show archive —— */
	.aph-sa-series-hero__copy {
		padding: 24px 16px 20px !important;
	}

	.aph-sa-series-hero h1 {
		font-size: 26px !important;
	}

	.aph-sa-series-hero__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.aph-sa-series-hero__actions .aph-sa-btn {
		justify-content: center;
		width: 100%;
	}

	.aph-sa-shell {
		padding: 0 16px 32px !important;
	}

	.aph-sa-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 16px;
	}

	.aph-sa-tabs {
		gap: 18px;
		overflow-x: auto;
		scrollbar-width: none;
		-ms-overflow-style: none;
		flex-wrap: nowrap;
	}

	.aph-sa-tabs::-webkit-scrollbar {
		display: none;
	}

	.aph-sa-tab {
		flex-shrink: 0;
	}

	.aph-sa-video-grid {
		grid-template-columns: 1fr !important;
		gap: 16px;
	}

	.aph-sa-ep-row {
		grid-template-columns: 24px minmax(0, 1fr) auto;
		padding: 14px 0;
	}

	.aph-sa-season-nav {
		overflow-x: auto;
		flex-wrap: nowrap;
		scrollbar-width: none;
		padding-bottom: 4px;
	}

	.aph-sa-season-pill {
		flex-shrink: 0;
	}
}

/* ── Submenu text + chevron: always hidden in icon-only rail ── */
@media (max-width: 767px) {
	.aph-tv-side-nav__submenu,
	.aph-tv-side-nav__chevron {
		display: none !important;
	}

	/* ── Overlay sidebar: slides in when is-mobile-open is set ── */
	.aph-tv-sidebar.is-mobile-open {
		position: fixed !important;
		top: 0;
		left: 0;
		bottom: 0;
		width: 240px !important;
		z-index: 9999;
		overflow-y: auto;
		box-shadow: 4px 0 32px rgba(0, 0, 0, 0.2);
	}

	.aph-tv-sidebar.is-mobile-open .aph-tv-side-nav__label {
		display: block !important;
	}

	.aph-tv-sidebar.is-mobile-open .aph-tv-side-nav__link {
		justify-content: flex-start !important;
		padding: 11px 16px !important;
	}

	.aph-tv-sidebar.is-mobile-open .aph-tv-side-nav {
		padding: 56px 8px 20px !important;
	}

	.aph-tv-sidebar.is-mobile-open .aph-tv-side-nav__submenu {
		display: block !important;
	}

	.aph-tv-sidebar.is-mobile-open .aph-tv-side-nav__chevron {
		display: flex !important;
	}

	/* Backdrop */
	#aph-tv-sidebar-backdrop {
		display: none;
		position: fixed;
		inset: 0;
		z-index: 9998;
		background: rgba(0, 0, 0, 0.45);
	}

	#aph-tv-sidebar-backdrop.is-visible {
		display: block;
	}
}
