/* ==========================================================================
   innovalextax — Responsive overrides
   Mobile-first via media queries (max-width breakpoints).
   Breakpoints aligned with Bootstrap/Tailwind for predictability.
   ========================================================================== */

/* ---- Large desktop (max 1280px) — slightly tighter container ----------- */
@media (max-width: 1280px) {
	:root {
		--ix-container-w: 90%;
	}
}

/* ---- Tablet landscape (max 1024px) ------------------------------------ */
@media (max-width: 1024px) {
	:root {
		--ix-container-w: 92%;
		--ix-header-h: 76px;
		--ix-header-h-min: 60px;
	}

	/* Hide desktop nav, show burger */
	.ix-nav { display: none; }
	.ix-burger { display: inline-flex; }
	.ix-social--header { display: none; }

	/* Events grid → 2 columns */
	.ix-events-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Team grid → 3 columns */
	.ix-team__grid {
		grid-template-columns: repeat(3, 1fr);
	}

	/* Team single → stack */
	.ix-team-single__grid {
		grid-template-columns: 1fr;
	}
	.ix-team-single__media {
		max-width: 280px;
	}

	/* About / Contact → stack */
	.ix-about__grid,
	.ix-about__grid--noimg,
	.ix-contact__grid {
		grid-template-columns: 1fr;
		gap: var(--ix-space-md);
	}

	/* Footer → 2 columns */
	.ix-footer__grid {
		grid-template-columns: 1fr 1fr;
	}
	.ix-footer__col--brand {
		grid-column: 1 / -1;
	}
}

/* ---- Tablet portrait (max 768px) -------------------------------------- */
@media (max-width: 768px) {
	:root {
		--ix-container-w: 92%;
	}

	body { font-size: 15px; }

	/* Hero — tighter spacing */
	.ix-hero {
		min-height: 78svh;
		padding-block: calc(var(--ix-header-h) + var(--ix-space-sm)) var(--ix-space-md);
	}

	/* Events grid → 1 column */
	.ix-events-grid {
		grid-template-columns: 1fr;
	}

	/* Team grid → 2 columns */
	.ix-team__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Hide site title on small headers (keep logo icon only) */
	.ix-logo__sub { display: none; }

	/* Single post: hide vertical share rail, show inline */
	.ix-single-post {
		padding-top: calc(var(--ix-header-h) + var(--ix-space-lg));
	}
	.ix-single-post__layout {
		grid-template-columns: 1fr;
	}
	.ix-share-rail { display: none; }
	.ix-share-inline { display: flex; }

	/* Prev/next nav stacks on small screens */
	.ix-post-nav-grid {
		grid-template-columns: 1fr;
	}
	.ix-post-nav-slot--next {
		text-align: left;
	}
	.ix-post-nav-slot--next .ix-post-nav-label {
		margin-left: 0;
	}
	.ix-post-nav-slot--empty {
		display: none;
	}

	/* Form row → single column */
	.ix-form__row {
		grid-template-columns: 1fr;
	}

	/* Archive hero — smaller padding (but keep room above the back link) */
	.ix-archive-hero {
		padding-block: calc(var(--ix-header-h) + var(--ix-space-lg)) var(--ix-space-md);
	}

	/* Activities head: stack title and link */
	.ix-activities__head {
		flex-direction: column;
		align-items: flex-start;
	}

	/* Partners → two-up on phones, each card a bit wider. They still wrap
	   down automatically when the row is full. */
	.ix-partner-card {
		flex: 0 1 calc(50% - 12px);
	}

	/* Documents + Publications → stack columns, with breathing room */
	.ix-docpub__grid {
		grid-template-columns: 1fr;
		gap: clamp(36px, 7vw, 48px);
	}

	/* Publication cards → single column on phones */
	.ix-pubgrid {
		grid-template-columns: 1fr;
	}

	/* Row layout on tablet/phone: keep everything in one line —
	   icon left, text middle, button right (same as desktop). */
	.ix-row__body {
		/* Body takes remaining width between badge and CTA */
		flex: 1 1 0;
		min-width: 0;
	}
	.ix-row__cta {
		margin-left: auto;
	}
}

/* ---- Mobile (max 540px) ----------------------------------------------- */
@media (max-width: 540px) {
	:root {
		--ix-container-w: 92%;
	}

	/* Stats: stack vertically on very small screens */
	.ix-about__stats {
		gap: var(--ix-space-sm);
	}
	.ix-about__stat-num { font-size: 1.7rem; }

	/* Footer → 1 column */
	.ix-footer__grid {
		grid-template-columns: 1fr;
	}

	/* Team grid → 1 column */
	.ix-team__grid {
		grid-template-columns: 1fr;
	}

	/* Partners → single column on the narrowest phones. */
	.ix-partner-card {
		flex: 0 1 100%;
		aspect-ratio: 1 / 0.8;
	}

	/* Hero CTA → stack buttons */
	.ix-hero__cta { width: 100%; }
	.ix-hero__cta .ix-btn { width: 100%; justify-content: center; }

	/* Rows: keep single line — just tighten spacing so it fits. */
	.ix-row {
		padding: 14px;
		gap: 12px;
	}
	.ix-row__icon { width: 46px; height: 46px; }
	.ix-row__cta { margin-left: 8px; }
	.ix-arrow-btn { width: 42px; height: 42px; }

	/* Buttons: full width within form/cta */
	.ix-form .ix-btn { width: 100%; justify-content: center; }

	/* Back-to-top: smaller on mobile */
	.ix-back-to-top {
		width: 46px;
		height: 46px;
	}
	.ix-back-to-top__icon {
		width: 16px;
		height: 16px;
	}
}

/* ---- Very small (max 380px) ------------------------------------------- */
@media (max-width: 380px) {
	.ix-logo__text { font-size: 0.98rem; }
	.ix-logo__img { height: 38px; }

	/* Rows stay one line: trim badge + hide long publication blurb */
	.ix-row { padding: 12px; gap: 10px; }
	.ix-row__icon { width: 42px; height: 42px; }
	.ix-row__icon .ix-file-icon { width: 24px; height: 24px; }
	.ix-row__title {
		font-size: 0.95rem;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.ix-row__desc { display: none; }
	.ix-arrow-btn { width: 40px; height: 40px; }
}
