/* =========================================================================
   Canal Bica Galo — responsive tweaks.
   The mockup layout is inherently fluid (flex-wrap + clamp), so only a few
   small-screen refinements are needed here.
   ========================================================================= */

/* Guarantee the external menu (Unbox Menu) header never exceeds the screen
   width on mobile. As a fixed element it can resist the root's overflow clip
   in some mobile browsers and drift right on inner pages, creating horizontal
   scroll — bounding it here (no scrollbar on mobile, so 100vw == the screen)
   plus clipping its own overflow stops that for good. */
@media (max-width: 992px) {
	.ubxl-header,
	.ubxl-header .ubxl-bar { max-width: 100vw; overflow-x: clip; }
}

/* Content-page side columns (home agenda/tabela, single-video "próximos",
   football agenda) fill the full screen width once stacked on phones/tablets,
   instead of staying capped at their desktop max-width and looking narrow. */
@media (max-width: 760px) {
	.ubnf-sidecol { flex: 1 1 100% !important; max-width: none !important; min-width: 0 !important; }
}

/* Football competition header: on phones the "Galo Stats" + status pills drop
   to their own line so the competition name (e.g. "Brasileirão Série A") keeps
   the full width instead of being squeezed into 3 cramped lines. */
@media (max-width: 640px) {
	.ubnf-comp-head { flex-wrap: wrap; }
	.ubnf-comp-head > div:last-child { flex: 1 1 100%; margin-left: 0 !important; justify-content: flex-start; }
}

/* Hero "Em destaque" on phones/small tablets:
   1) the cards stack in POST order — the latest (big lead) first — regardless of
      the desktop layout (var2/var3 place the lead mid/right in the DOM). We use
      `order` (NOT flex-direction) so the wrap-based widths stay correct;
   2) the overlay side column (var1/var3) flows as full-size cards, the same size
      as the lead, instead of two small cards crammed into a fixed 300px block. */
@media (max-width: 640px) {
	.ubnf-hero__lead { order: -1 !important; }
	.ubnf-hero__aside { position: static !important; min-height: 0 !important; }
	.ubnf-hero__aside > div { position: static !important; gap: 16px !important; }
	.ubnf-hero__aside > div > article { flex: none !important; min-height: 0 !important; aspect-ratio: 16 / 10; }
}

@media (max-width: 600px) {
	.ubnf-hide-sm { display: none !important; }

	/* Share buttons stretch to fill the screen width on phones: the icon buttons
	   split the row equally and "Copiar link" spans its own full-width line. */
	.ubnf-share-row { flex: 1 1 100% !important; }
	.ubnf-share-btn { flex: 1 1 0 !important; width: auto !important; height: 48px !important; }
	.ubnf-share-copy { flex: 1 1 100% !important; height: 48px !important; }

	/* "list" cards (image left, text right) — shared by the news list and the
	   colunas editorial cards — become full-width stacked cards on phones, with
	   the image on top, because the side-by-side thumbnail is too small to read. */
	.ubnf-list {
		flex-direction: column !important;
		align-items: stretch !important;
		gap: 11px !important;
	}
	.ubnf-list__media {
		width: 100% !important;
		aspect-ratio: 16 / 10 !important;
	}
	.ubnf-list__body {
		flex: 1 1 auto !important;
		min-width: 0 !important;
	}
}

/* =========================================================================
   Archive filter sidebar (Playlists / Categorias / Colunistas).
   Desktop: classic left column, options always visible. Phones: the card
   fills the screen width and its black header becomes a sticky bar pinned
   under the site menu, with a hamburger that expands/collapses the options.
   ========================================================================= */
.ubnf-side__toggle { display: none; } /* desktop: no toggle, list stays open */

/* Dark glass overlay behind the expanded filter dropdown (sits below the
   sticky card at z-index 30, above the page content). */
.ubnf-side-scrim {
	position: fixed;
	inset: 0;
	z-index: 25;
	background: rgba(22, 19, 15, .5);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s ease;
}
.ubnf-side-scrim.is-open { opacity: 1; visibility: visible; }

@media (max-width: 760px) {
	/* Stack the sidebar above the feed; both span the full width. `display:
	   contents` lifts the card (and the ad/canal extras) into the flex row so
	   the sticky card can pin against the tall column while the feed scrolls. */
	.ubnf-arch-row { flex-direction: column !important; align-items: stretch !important; gap: 18px !important; }
	.ubnf-side { display: contents; }
	.ubnf-side__card { order: 0; }
	.ubnf-arch-main { order: 1; min-width: 0 !important; }
	.ubnf-side__extra { order: 2; }

	/* The filter card sticks under the menu while the feed scrolls. */
	.ubnf-side__card {
		position: sticky;
		top: 90px; /* site header (~70px) + 20px gap */
		z-index: 30;
		box-shadow: 0 8px 22px rgba(22, 19, 15, .12);
	}
	.ubnf-main--offset .ubnf-side__card { top: 120px; } /* external fixed menu (~100px) + 20px gap */

	/* When open we lock the page (overflow:hidden), which cancels position:
	   sticky — so pin the open card with position:fixed at the same offset,
	   keeping the dropdown in view no matter how far the page was scrolled. */
	.ubnf-side__card.is-open { position: fixed; left: 22px; right: 22px; }

	/* Header row gains a right-aligned hamburger toggle. */
	.ubnf-side__toggle {
		display: inline-flex; align-items: center; justify-content: center;
		margin-left: auto; flex: none; width: 32px; height: 32px;
		border-radius: 8px; background: rgba(255, 255, 255, .14); color: #fff;
		transition: background .15s;
	}
	.ubnf-side__toggle:hover { background: rgba(255, 255, 255, .26); }
	.ubnf-side__toggle svg { display: block; width: 18px; height: 18px; }
	.ubnf-side__toggle .ubnf-side__x { display: none; }
	.ubnf-side__card.is-open .ubnf-side__toggle .ubnf-side__bars { display: none; }
	.ubnf-side__card.is-open .ubnf-side__toggle .ubnf-side__x { display: inline-flex; }

	/* Options collapsed by default; the toggle reveals them. */
	.ubnf-side__list { display: none; max-height: 60vh; overflow-y: auto; }
	.ubnf-side__card.is-open .ubnf-side__list { display: block; }
}
