/**
 * INGE Elementor bridge — full-bleed header/footer + layout fixes.
 */

/* ------------------------------------------------------------------
   CRITICAL: Elementor e-con-full.e-flex uses --content-width (kit 1140px)
   which boxes the header/footer. Force true full-bleed shells.
------------------------------------------------------------------ */
body.inge-theme > .elementor,
body.inge-theme > .elementor > .e-con.e-parent,
body.inge-theme > .elementor > .e-con.e-parent > .e-con-inner,
.elementor-7,
.elementor-8,
.elementor-7 > .e-con,
.elementor-8 > .e-con,
.elementor-7 .e-con.e-parent,
.elementor-8 .e-con.e-parent {
	width: 100% !important;
	max-width: none !important;
	--width: 100% !important;
	--content-width: 100% !important;
	--container-max-width: 100% !important;
	margin-inline: 0 !important;
	padding-inline: 0 !important;
}

.elementor-7 .elementor-widget-container,
.elementor-8 .elementor-widget-container,
.elementor-widget-igne-header > .elementor-widget-container,
.elementor-widget-igne-footer > .elementor-widget-container {
	width: 100% !important;
	max-width: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Page parent containers also full-bleed (hero / newsletter / ivory sections) */
body.elementor-page .elementor > .e-con.e-parent {
	width: 100% !important;
	max-width: none !important;
	--width: 100% !important;
	--content-width: 100% !important;
	--container-max-width: 100% !important;
	margin-inline: 0 !important;
}

body.elementor-page .elementor > .e-con.e-parent > .e-con-inner,
body.elementor-page .elementor-widget-container {
	max-width: none !important;
	padding-inline: 0 !important;
}

/* Header / footer shells: edge-to-edge background */
.site-header,
.site-footer,
.newsletter-section,
.internal-hero,
.hero-section {
	width: 100% !important;
	max-width: none !important;
	box-sizing: border-box;
}

/* Kill Hello Elementor conflicting .site-header flex/padding only — keep INGE footer padding */
body.inge-theme .site-header {
	display: block;
	padding-block: 0;
	flex-wrap: unset;
	justify-content: unset;
}

/* Restore footer padding (Hello Elementor + earlier override had zeroed it) */
body.inge-theme .site-footer {
	padding-block: 64px 26px !important;
	/* Breathing room above footer on all pages */
	margin-block-start: clamp(48px, 6vw, 88px);
}

/* Newsletter is already a green band — don't insert a light gap between it and footer */
body.inge-theme .elementor:has(.newsletter-section) + .elementor .site-footer,
body.inge-theme .elementor:has(.newsletter-section) + .elementor-8 .site-footer {
	margin-block-start: 0;
}

/*
 * Hello Elementor boxes non-Elementor pages:
 *   body:not([class*=elementor-page-]) .site-main { max-width: 1140px }
 * That squeezes CPT singles / archives (~150px side margins at 1440vw).
 * Let .section > .container own width via --container (1320).
 */
body.inge-theme:not([class*="elementor-page-"]) .site-main,
body.inge-theme.single .site-main,
body.inge-theme.archive .site-main,
body.inge-theme.search .site-main,
body.inge-theme.error404 .site-main {
	width: 100% !important;
	max-width: none !important;
	margin-inline: 0 !important;
	padding-inline: 0 !important;
}

/* Singles / PHP templates: ensure main content clears the footer */
body.inge-theme .site-main {
	padding-block-end: clamp(24px, 3vw, 40px);
}

/* Last content band before footer — a bit more bottom padding */
body.inge-theme .site-main > .section:last-child,
body.inge-theme .site-main > article.section:last-child,
body.inge-theme .elementor-widget-igne-cpt-grid .section,
body.inge-theme .elementor-widget-igne-posts-grid .section,
body.inge-theme .elementor-widget-igne-contact-form .section {
	padding-block-end: clamp(72px, 9vw, 120px);
}

/* Inner content width matches reference --container */
.site-header__inner,
.site-footer .container,
.site-footer__grid,
.site-footer__bottom,
.newsletter-section > .container,
.internal-hero > .container,
.section > .container,
.hero-section .container {
	width: min(var(--container), calc(100% - (var(--page-gutter) * 2)));
	max-width: min(var(--container), calc(100% - (var(--page-gutter) * 2)));
	margin-inline: auto;
	box-sizing: border-box;
}

.site-footer {
	padding-inline: 0;
}

/* Menus / forms */
.footer-menu a,
.mobile-nav-inner a {
	display: block;
	color: var(--color-muted-light);
	margin: 0 0 9px;
}

.mobile-nav .mobile-nav-inner {
	display: contents;
}

.inge-newsletter-form-slot,
.inge-form-hint {
	min-width: 0;
}

.inge-newsletter-form-slot .elementor-form,
.inge-newsletter-form-slot form {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 12px;
	align-items: start;
}

.contact-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 28px;
	align-items: stretch;
}

/* News list default is one column. Grid / card / slider opt out. */
.news-list--list,
.container.news-list--list {
	display: grid !important;
	grid-template-columns: 1fr !important;
	gap: 18px !important;
	width: min(var(--container), calc(100% - (var(--page-gutter) * 2)));
	max-width: min(var(--container), calc(100% - (var(--page-gutter) * 2)));
	margin-inline: auto;
}

.news-list--grid,
.news-list--card {
	display: grid !important;
	gap: 18px !important;
	width: min(var(--container), calc(100% - (var(--page-gutter) * 2)));
	max-width: min(var(--container), calc(100% - (var(--page-gutter) * 2)));
	margin-inline: auto;
}

.news-list--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.news-list--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.news-list--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }

.news-card__media {
	display: block;
	margin: -26px -26px 14px;
	overflow: hidden;
	border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.news-card__media img {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: cover;
}

.posts-slider .news-list--slider {
	display: flex !important;
	grid-template-columns: none !important;
	width: auto;
	max-width: none;
}

.posts-slider .news-card {
	flex: 0 0 min(320px, 80vw);
}

.post-taxonomies {
	display: grid;
	gap: 8px;
	margin-block-end: 18px;
}

.post-taxonomies--hero {
	margin-block-start: 18px;
	margin-block-end: 0;
}

.post-taxonomies--hero .post-taxonomies__row,
.post-taxonomies--hero .post-taxonomies__row a {
	color: inherit;
}

.post-taxonomies__row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin: 0;
	align-items: center;
	font-size: 0.92em;
}

.post-taxonomies__row a {
	color: var(--color-green-800);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.news-card--media .news-card__body,
.news-card__body {
	display: grid;
	gap: 6px;
}

.news-list--list .news-card--list {
	display: block;
}

/*
 * Theme tokens follow Elementor Site Settings (Global Colors / Fonts)
 * via kit-bridge.php. Fallbacks in site.css keep the INGE look if unset.
 */

/* Body/UI font from Global Fonts (text), with self-hosted Vazirmatn fallback */
body.inge-theme,
body.inge-theme button,
body.inge-theme input,
body.inge-theme select,
body.inge-theme textarea,
body.inge-theme .elementor-widget,
body.inge-theme .elementor-heading-title,
body.inge-theme p,
body.inge-theme a,
body.inge-theme li,
body.inge-theme span,
body.inge-theme .site-header,
body.inge-theme .site-footer {
	font-family: var(--e-global-typography-text-font-family, "Vazirmatn"), Tahoma, Arial, sans-serif !important;
}

body.inge-theme h1,
body.inge-theme h2,
body.inge-theme h3,
body.inge-theme h4,
body.inge-theme h5,
body.inge-theme h6,
body.inge-theme .hero-copy h1,
body.inge-theme .internal-hero h1,
body.inge-theme .section-heading h2 {
	font-family: var(--e-global-typography-primary-font-family, var(--e-global-typography-text-font-family, "Vazirmatn")), Tahoma, Arial, sans-serif !important;
}

/* Title colors use design tokens (mapped from Global Colors in kit-bridge). */
body.inge-theme .section-heading h2,
body.inge-theme .research-card h3,
body.inge-theme .axis-card h2,
body.inge-theme .axis-card h3,
body.inge-theme .news-card h3,
body.inge-theme .publication-card h3,
body.inge-theme .home-stats h2,
body.inge-theme .collaboration-panel h2,
body.inge-theme .event-card h3,
body.inge-theme .home-bottom-section .event-card h3,
body.inge-theme .content-stack h2,
body.inge-theme .about-goals-layout h2,
body.inge-theme .about-principles-layout h2 {
	color: var(--color-green-950);
}

body.inge-theme .internal-hero,
body.inge-theme .hero-copy {
	color: var(--color-text-light);
}

body.inge-theme .internal-hero h1,
body.inge-theme .hero-copy h1 {
	color: var(--color-text-light);
}

body.inge-theme .internal-hero p {
	color: var(--color-gold-400);
}

body.inge-theme .mission-section h2,
body.inge-theme .publication-section .section-heading h2 {
	color: var(--color-text-light);
}

body.inge-theme .newsletter-frame h2 {
	color: var(--color-gold-400);
}

@media (max-width: 900px) {
	.news-list--cols-3,
	.news-list--cols-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 640px) {
	.news-list--cols-2,
	.news-list--cols-3,
	.news-list--cols-4 {
		grid-template-columns: 1fr !important;
	}
}

.news-list .news-card {
	width: 100%;
}

/* Contact section needs ivory band + container margins like reference */
.section--ivory .contact-grid,
.contact-section .contact-grid {
	width: min(var(--container), calc(100% - (var(--page-gutter) * 2)));
	max-width: min(var(--container), calc(100% - (var(--page-gutter) * 2)));
	margin-inline: auto;
}

.publication-rail__track {
	gap: 18px !important;
}

.publication-section .publication-card {
	margin: 0;
}

.research-card__icon svg {
	width: 52px;
	height: 52px;
	display: block;
}

@media (max-width: 768px) {
	.contact-grid,
	.inge-newsletter-form-slot .elementor-form,
	.inge-newsletter-form-slot form {
		grid-template-columns: 1fr;
	}
}
