/* ==========================================================================
   responsive-fixes.css  —  2027 GM Brands Contest (all brands)
   --------------------------------------------------------------------------
   Layout and font-scaling fixes, loaded AFTER style_global.css and
   style_<brand>.css so they win. Everything is in this one file:

     • To turn the fixes off on a page for comparison, add ?nofix=1 to the URL.
     • To remove them for good, delete the <link> to this file in
       Default.aspx (search for "responsive-fixes") and delete this file.

   Each block says what it fixes and at which widths. Remove a single block
   to undo just that fix. Brand-specific rules are scoped by the body class
   (body.chev / body.buick / body.gmc / body.cad).
   ========================================================================== */

#P2 #UpdatePanel4 #EVTestDrive .bonus-entry-box {
	margin-left: 15px;
}

/* --------------------------------------------------------------------------
   1. Header at phone widths (≤ 575px, all brands)
   The logo is up to 250px wide and the menu button didn't fit beside it,
   so the button dropped onto its own row. On Cadillac and GMC the header
   overlays the page, so the taller header covered the first line of the
   landing heading at 320px. Let the logo shrink so both share one row.
   -------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
	#navbar a.navbar-brand {
		flex: 1 1 0;          /* start from 0 so it never forces a new row… */
		min-width: 0;
		max-width: 250px;     /* …and grow back up to the normal 250px */
		width: auto;
	}
	#navbar img.navbar-brand {
		width: 100%;
		max-width: 100%;
		height: auto;
	}
	#navbar .container-fluid > div.d-lg-none {   /* left spacer that centres the logo */
		flex: 0 0 48px;
		width: 48px !important;
	}
	#navbar .navbar-toggler {
		flex: 0 0 auto;
	}
}


/* --------------------------------------------------------------------------
   2. 992px–1024px: one layout, not two (all brands, landing page)
   The menu and big logo switched to "desktop" at 992px (Bootstrap) but the
   page layout stays "tablet" until 1025px. In between, the car photo was a
   thin strip, the logo was oversized and Enter Now fell below the fold.
   Keep the tablet header (logo + menu button) until 1025px, matching 991px.
   -------------------------------------------------------------------------- */
@media (min-width: 992px) and (max-width: 1024.98px) {
	#navbar.navbar-expand-lg,
	#navbar.navbar-expand-lg > .container-fluid {
		flex-wrap: wrap;
		justify-content: space-between;
	}
	#navbar.navbar-expand-lg .navbar-toggler {
		display: block;
	}
	#navbar.navbar-expand-lg .navbar-collapse:not(.show) {
		display: none !important;
	}
	#navbar.navbar-expand-lg .navbar-collapse.show {
		display: block !important;
		flex-basis: 100%;
	}
	#navbar.navbar-expand-lg .navbar-nav {
		flex-direction: column;
		margin-top: -6px !important;
	}
	#navbar .container-fluid > div.d-lg-none {
		display: block !important;
	}
	#navbar.page-1 a.navbar-brand {
		display: block !important;
	}
	#navbar.page-1 img.navbar-brand {
		display: inline !important;
	}
	#P1 .landing-logo {
		display: none !important;
	}
	/* header colours as they are at 991px */
	body.chev  #navbar.page-1 { background-color: #ffffff !important; }
	body.gmc   #navbar.page-1,
	body.cad   #navbar.page-1 { background-color: #000000 !important; }
	body.chev  #navbar.page-1 .navbar-nav,
	body.buick #navbar.page-1 .navbar-nav { background-color: #ffffff !important; }
	body.gmc   #navbar.page-1 .navbar-nav,
	body.cad   #navbar.page-1 .navbar-nav { background-color: #000000 !important; }
}


/* Push the landing page below the header, as each brand does below 991px.
   Starts at 990.5px because the brand rule doesn't take effect at exactly 991px. */
@media (min-width: 990.5px) and (max-width: 1024.98px) {
	body.chev  #P1.page-container { margin-top: 117px; }
	body.buick #P1.page-container,
	body.gmc   #P1.page-container,
	body.cad   #P1.page-container { margin-top: 94px; }
}


/* --------------------------------------------------------------------------
   3. Cloudflare check box clipped at 320px (all brands)
   The Turnstile box needs 300px, but its container is 90vw (288px at 320).
   -------------------------------------------------------------------------- */
@media (max-width: 359.98px) {
	#P1 .contest-accept {
		width: calc(100vw - 12px) !important;
	}
	#P1 .contest-accept-row {
		width: 100% !important;   /* GMC sets this row to 90vw */
		margin-left: 0;
		margin-right: 0;
	}
	#P1 .contest-accept-row > [class*="col-"]:first-child {   /* the Turnstile column only */
		padding-left: 0;
		padding-right: 0;
	}
}


/* --------------------------------------------------------------------------
   4. Buick thank-you heading cut off (Buick, ≤ 1024px; worst in French)
   The thank-you text column was a wrapping flex column with a fixed height.
   When the text didn't fit, it wrapped into a second column and pushed
   "Bonne chance!" / "Best of luck!" off the left edge of the screen.
   -------------------------------------------------------------------------- */
body.buick #P3 .sidebar {
	flex-wrap: nowrap;
}
@media (max-width: 1024.98px) {
	body.buick #P3 .sidebar {
		height: auto !important;
		min-height: 50vh;
		/* room for the "The Buick Contest" logo, which hangs below the photo */
		padding-top: calc(10% + 4.5rem) !important;
	}
}


/* --------------------------------------------------------------------------
   5. Cadillac thank-you image runs off the right edge (Cadillac, ≥ 1025px)
   The image was 54vw wide starting at 50%, so its right 4% was cut off.
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) {
	body.cad #P3 .image-container {
		width: 50vw;
	}
}


/* --------------------------------------------------------------------------
   6. Fluid font sizes on phones and tablets (all brands, ≤ 1024px)
   Below 1025px most headings used one fixed size from 320px to 1024px (or
   jumped at 480px), so they were too big on small phones and small on
   tablets, then jumped again at 1025px. clamp(min, preferred, max) now grows
   them smoothly with the screen width, and each brand's 1024px size lands
   close to its existing desktop size, so there's no visible jump at 1025px.
   Desktop sizes (≥ 1025px) are unchanged, except the cap in 6f.
   -------------------------------------------------------------------------- */
@media (max-width: 1024.98px) {

	/* 6a. Landing heading ("Enter for your chance to win…") */
	body.chev  #P1 .landing-heading { font-size: clamp(24px, 0.8vw + 20px, 28px) !important; }
	body.buick #P1 .landing-heading { font-size: clamp(20px, 1.5vw + 15px, 32px) !important; }
	body.gmc   #P1 .landing-heading { font-size: clamp(22px, 2.5vw + 14px, 40px) !important; }
	body.cad   #P1 .landing-heading { font-size: clamp(16px, 0.8vw + 13.5px, 22px) !important; }

	/* 6b. Form questions and section headings */
	body .question-text,
	body .section-header,
	body .bonus-title {
		font-size: clamp(18px, 0.6vw + 16px, 22px) !important;
	}

	body.chev #toastContent .bonus-title {
		font-size: 44px !important;
	}

	body.gmc #toastContent .bonus-title {
		font-size: 32px !important;
	}


	/* 6c. "Enter Now" / "Submit" buttons */
	body #btnAgree,
	body #btnSubmit {
		font-size: clamp(16px, 0.5vw + 14px, 19px) !important;
	}

	/* 6d. Thank-you heading ("Best of luck!" / "Bonne chance!") */
	body.chev  #P3 .sidebar h1 { font-size: clamp(48px, 5vw + 30px, 84px)  !important; }
	body.buick #P3 .sidebar h1 { font-size: clamp(44px, 5vw + 28px, 78px)  !important; }
	body.gmc   #P3 .sidebar h1 { font-size: clamp(52px, 7vw + 30px, 108px) !important; }
	body.cad   #P3 .sidebar h1 { font-size: clamp(36px, 3.5vw + 26px, 62px) !important; }

	/* 6e. Thank-you paragraph */
	body #P3 .sidebar p {
		font-size: clamp(16px, 0.4vw + 14.5px, 18px) !important;
	}
}

/* 6f. Cap the Chevrolet thank-you heading on very wide screens
   (it's 9vw on desktop: 173px at 1920px and still growing). */
@media (min-width: 1025px) {
	body.chev #P3 .sidebar h1 {
		font-size: min(9vw, 150px) !important;
	}
	
}

/* 6g. Official rules / fine print: never smaller than 13px on phones */
body #disclaimers {
	font-size: clamp(13px, 0.25vw + 12px, 16px);
}


/* Fix for CAD 4 bonus point popup on small screens*/
@media (max-width: 320px) {
	body.cad .btn {
		font-size: 12px !important;
	}
	body.cad .bonus-title {
		font-size: 14px !important;
	}
}

/* Fixes targetting Entry Form popup font scaling on devices between 1200px and 1440px*/
@media (min-width: 1200px) {
	
	/* Cadillac */
	body.cad #toastContent .bonus-title {
		font-size: 30px !important;
	}
	body.cad #toastContent .bonus-wrapper .btn-primary {
		font-size: 15px !important;
	}
	body.cad #toastContent .bonus-wrapper .question-text {
		font-size: 18px !important;
	}
	body.cad #toastContent .bonus-entry-box {
		font-size: 20px !important;
	}

	/* Chevrolet */
	body.chev #toastContent .bonus-title {
		font-size: 48px !important;
	}
	body.chev #toastContent .bonus-entry-box {
		font-size: 20px !important;
	}

	/* GMC */
	body.gmc #toastContent .bonus-wrapper .question-text {
		font-size: 24px !important;
	}
	body.gmc #toastContent .bonus-entry-box {
		font-size: 21px !important;
	}
	body.gmc #toastContent .bonus-title {
		font-size: 50px !important;
	}

	/* Buick */
	body.buick #toastContent .bonus-title {
		font-size: 44px !important;
	}
	body.buick #toastContent .bonus-entry-box {
		font-size: 21px !important;
	}
	body.buick #toastContent .bonus-wrapper .question-text {
		font-size: 16px !important;
	}
	body.buick #toastContent .bonus-wrapper .opt-in-now {
		font-size: 20px !important;
	}

}

/* Fix for CAD 10 bonus point popup title and button text overflowing */
@media (min-width: 1440px) {
	body.cad h1.bonus-title {
		font-size: 34px !important;
	}
	
}