/* ANIMAL GYM — every breakpoint lives here.
   This file is enqueued last on purpose: same-specificity rules in
   sections.css would otherwise win and quietly undo the mobile layout. */

/* Between the desktop and tablet layouts the header runs out of room: logo,
   seven menu items, a phone number, a button and the colour switch. Tighten
   the menu first, then drop the phone, before the burger takes over at 900. */
@media (max-width: 1320px) {
	.agym-header__in { gap: 14px; }
	.agym-nav__list a { padding: 9px 9px; font-size: 12.5px; letter-spacing: .09em; }
	.agym-header__cta { padding: 11px 16px; font-size: 12px; }

	/* The floating map card is positioned from the viewport centre; below this
	   width there is no gutter left for it. */
	.agym-mapsec--full .agym-mapcard { left: 24px; }
}

@media (max-width: 1400px) {
	/* Five cards in a 1220px column leaves each one too narrow to read. */
	.agym-plans__grid[style*="--n:5"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
	/* The number no longer fits as text, but a tap-to-call target still does —
	   dropping it entirely used to leave a tablet with no way to phone the gym. */
	.agym-header__phone {
		width: 40px;
		height: 40px;
		justify-content: center;
		gap: 0;
		border: 1px solid var(--line-2);
		border-radius: var(--radius-pill);
	}

	.agym-header__phone span { display: none; }
	.agym-header__phone:hover { border-color: var(--gold-ink); }

	.agym-logo__name { white-space: nowrap; }

	.agym-gal__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.agym-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
	.agym-footer__col--brand { grid-column: 1 / -1; }

	.agym-hero--editorial .agym-hero__in { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); }
	.agym-hero__card { padding: 24px 22px 22px; }
}

@media (max-width: 1024px) {
	.agym-wrapin { width: min(1220px, 100% - 36px); }

	.agym-plans__grid,
	.agym-plans__grid[style*="--n:5"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.agym-cards--4,
	.agym-cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.agym-coach__grid,
	.agym-revs__grid,
	.agym-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	.agym-about__in,
	.agym-branch__in,
	.agym-inc__in,
	.agym-faq__in,
	.agym-tour__in { grid-template-columns: minmax(0, 1fr); }

	.agym-faq__side { position: static; }

	/* The photo arrangements need room for the overlapping inset; centre and
	   cap them once they are no longer beside a column of text. */
	.agym-about__stack,
	.agym-branch__media { max-width: 520px; margin-inline: auto; }
	.agym-about__inset { right: -18px; }
	.agym-about__badge { left: -12px; }

	.agym-hero--split .agym-hero__in { grid-template-columns: minmax(0, 1fr); }
	.agym-hero--split .agym-hero__media { display: none; }

	/* Editorial hero: the card drops under the headline rather than beside it. */
	.agym-hero--editorial .agym-hero__in { grid-template-columns: minmax(0, 1fr); }
	.agym-hero__card { justify-self: start; }

	.agym-amen__panel { grid-template-columns: minmax(0, 1fr); }
	.agym-amen__media { order: -1; aspect-ratio: 16 / 7; }
	.agym-amen__media img { min-height: 0; }
	.agym-amen--grid .agym-amen__panels { grid-template-columns: minmax(0, 1fr); }

	.agym-shell { grid-template-columns: minmax(0, 1fr); }

	/* The trainer page stacks: video first, then the words. A sticky column has
	   nothing to stick against once it is full width. */
	.agym-trainer__in { grid-template-columns: minmax(0, 1fr); }
	.agym-trainer__media { position: static; max-width: 420px; }
	.agym-trainer__photo.is-secondary { max-width: 100%; }

	/* Full-bleed map: the card sits under the map instead of floating on it.
	   It keeps position:relative because .agym-mapbox is positioned too, and a
	   positioned box always paints over a static one — the card's own first line
	   was disappearing behind the bottom of the map. */
	.agym-mapsec--full .agym-mapcard {
		position: relative;
		z-index: 2;
		left: auto;
		top: auto;
		transform: none;
		margin: -40px auto 0;
		width: min(560px, calc(100% - 36px));
	}

	.agym-mapsec--full { padding-bottom: var(--sec-y); }
}

/* ------------------------------------------------- mobile menu kicks in --- */

/* The close button belongs to the off-canvas panel and must never appear beside
   the desktop menu. Its base display:none also lives in layout.css — this is a
   deliberate second copy, not a duplicate: if one stylesheet goes live and the
   other is still cached, a bare unstyled <button> lands in the middle of the
   desktop header. Either file alone is now enough to prevent that. */
@media (min-width: 901px) {
	.agym-nav__close { display: none; }

	/* Same reasoning for the phone + join row: with layout.css stale it turns
	   into a line of raw "(856) 839-4536 JOIN NOW" text under the logo. */
	.agym-mbar { display: none; }
}

@media (max-width: 900px) {
	.agym-burger { display: block; }

	/* Both move into the bar below the logo, which has room for the number in
	   full — see .agym-mbar. */
	.agym-header__cta,
	.agym-header__phone { display: none; }

	.agym-mbar { display: block; }

	/* The header is two rows tall now, so an anchor jump — and a hero sitting
	   underneath a transparent header — has more to clear. */
	html { scroll-padding-top: 148px; }
	.agym-has-transparent-header .agym-hero { padding-top: 190px; }

	.agym-nav {
		position: fixed;
		inset: 0;
		z-index: 80;
		background: var(--bg);
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding: 90px 32px 40px;
		transform: translateX(100%);
		transition: transform .38s cubic-bezier(.4, 0, .2, 1);
		overflow-y: auto;
		margin-left: 0;
	}

	.agym-nav.is-open { transform: none; }

	/* The open panel covers the header, so the burger underneath it can no longer
	   be tapped — this button is the only way out and has to read as one at a
	   glance. Filled rather than outlined: an outline on the same background it
	   sits on is exactly the control people fail to find. */
	.agym-nav__close {
		position: absolute;
		top: 18px;
		right: 18px;
		z-index: 2;
		display: grid;
		place-items: center;
		width: 50px;
		height: 50px;
		padding: 0;
		background: var(--gold);
		border: 0;
		border-radius: var(--radius-pill);
		color: var(--on-gold);
		cursor: pointer;
		box-shadow: var(--shadow-md);
		transition: transform .25s ease, box-shadow .25s ease;
	}

	.agym-nav__close:active { transform: scale(.94); }

	.agym-nav__list {
		flex-direction: column;
		align-items: flex-start;
		gap: 2px;
		width: 100%;
	}

	.agym-nav__list li { width: 100%; }

	.agym-nav__list a {
		padding: 14px 0;
		font-size: clamp(21px, 5.5vw, 32px);
		letter-spacing: .08em;
		border-radius: 0;
		background: none;
		border-bottom: 1px solid var(--line);
	}

	/* The pill highlight makes no sense as a full-width row. */
	.agym-nav__list a:hover,
	.agym-nav__list .current-menu-item > a,
	.agym-nav__list .is-current > a { background: none; }

	.agym-nav__list .sub-menu {
		position: static;
		display: block;
		background: none;
		border: 0;
		box-shadow: none;
		padding: 0 0 8px 14px;
	}

	.agym-nav__list .sub-menu a { font-size: 17px; padding: 9px 0; }

	.agym-nav__foot {
		display: flex;
		flex-direction: column;
		gap: 18px;
		margin-top: 34px;
		padding-top: 26px;
		border-top: 1px solid var(--line);
	}

	.agym-nav__phone {
		display: inline-flex;
		align-items: center;
		gap: 10px;
		font-family: var(--font-display);
		font-size: 22px;
		letter-spacing: .08em;
		color: var(--gold-ink);
	}

	.agym-nav__social { display: flex; gap: 12px; }

	.agym-nav__social a {
		display: grid;
		place-items: center;
		width: 42px;
		height: 42px;
		border: 1px solid var(--line-2);
		border-radius: var(--radius-pill);
		color: var(--muted);
	}

	/* Stop the page scrolling behind the open menu. */
	body.agym-menu-open { overflow: hidden; }

	.agym-footer__badges ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
	.agym-hero { min-height: 0; padding: 44px 0 60px; }
	.agym-has-transparent-header .agym-hero { padding-top: 176px; }
	.agym-hero__scroll { display: none; }
	.agym-hero__card { width: 100%; }

	.agym-stats__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 10px; padding: 32px 18px; }
	.agym-stats__list li:nth-child(odd)::before { display: none; }

	.agym-about__points { grid-template-columns: minmax(0, 1fr); gap: 22px; }
	.agym-inc__list { grid-template-columns: minmax(0, 1fr); }

	.agym-gal__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 180px; }

	/* Run the tab rail out to the screen edges. Cut off at the content gutter a
	   half-shown tab looks like a layout bug; cut off at the edge of the screen
	   it reads as "keep swiping", which is what it is. */
	.agym-amen__tabs {
		justify-content: flex-start;
		flex-wrap: nowrap;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
		margin-inline: -18px;
		padding: 0 18px 8px;
	}

	.agym-amen__tabs::-webkit-scrollbar { display: none; }
	.agym-amen__tab { flex: none; scroll-snap-align: start; }
	.agym-amen__content { padding: 26px 22px; }

	.agym-form__row { grid-template-columns: minmax(0, 1fr); }

	.agym-footer__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
	.agym-footer__bar .agym-wrapin { flex-direction: column; text-align: center; }

	.agym-lb { grid-template-columns: 40px 1fr 40px; }
	.agym-lb button { font-size: 30px; }
}

@media (max-width: 620px) {
	.agym-wrapin { width: min(1220px, 100% - 28px); }

	/* The gutter shrank, so the full-bleed rail has to follow it. */
	.agym-amen__tabs { margin-inline: -14px; padding-inline: 14px; }

	.agym-plans__grid,
	.agym-plans__grid[style*="--n:5"],
	.agym-cards--4,
	.agym-cards--3,
	.agym-cards--2,
	.agym-coach__grid,
	.agym-revs__grid,
	.agym-posts { grid-template-columns: minmax(0, 1fr); }

	.agym-gal__grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 230px; }
	.agym-gal__item.is-wide { grid-column: span 1; }

	.agym-hero__cta { flex-direction: column; align-items: stretch; }
	.agym-hero__cta .agym-btn { width: 100%; }
	.agym-hero__badges li { font-size: 11px; padding: 7px 12px; }

	.agym-cta__btns { flex-direction: column; align-items: stretch; }
	.agym-branch__cta { flex-direction: column; align-items: stretch; }
	.agym-coach__ctabtns { width: 100%; flex-direction: column; align-items: stretch; }
	.agym-coach__ctabtns .agym-btn { width: 100%; }

	.agym-inc__head { text-align: center; }
	.agym-inc__head .agym-eyebrow { justify-content: center; }

	/* The inset photos overlap too tightly to read at this width. */
	.agym-about__inset,
	.agym-branch__inset { position: static; width: 100%; margin-top: 14px; border: 0; box-shadow: var(--shadow-sm); }
	.agym-about__stack,
	.agym-branch__media { padding-bottom: 0; }
	.agym-about__badge { left: 12px; top: 12px; padding: 12px 16px; }
	.agym-branch__stamp { position: static; margin-top: 14px; }

	.agym-sec { padding: 58px 0; }

	.agym-plan__desc { min-height: 0; }

	.agym-tour__formwrap { padding: 24px 18px; }

	.agym-mapcard { padding: 24px 22px; }

	/* 520px of map is most of a phone screen, and the address card underneath is
	   the part people actually came for. Cap it and let the card come up sooner. */
	.agym-mapbox { height: min(var(--map-h, 520px), 340px); }
	.agym-mapsec { padding-top: 58px; }
	.agym-mapsec--boxed { padding-bottom: 58px; }
	.agym-mapsec--full { padding-bottom: 58px; }

	.agym-footer__badges ul { grid-template-columns: minmax(0, 1fr); }

	.agym-topbar { font-size: 10.5px; letter-spacing: .13em; }
}

/* Very small phones: keep the wordmark from wrapping into two lines. */
@media (max-width: 380px) {
	.agym-logo__name { font-size: 17px; }
	.agym-logo__mark { width: 36px; height: 36px; }
}

/* Keep the mobile theme switch and menu aligned with the right edge. */
@media(max-width:900px){
 .agym-header__in{justify-content:space-between}
 .agym-header__brand{min-width:0;flex:0 1 auto}
 .agym-header__actions{margin-left:auto;flex:0 0 auto;justify-content:flex-end}
}
