/**
 * Hojaiyga — responsive corrections.
 *
 * Elementor gives a section no horizontal padding of its own, so on a phone
 * the content sits against the screen edge. Rather than setting a gutter on
 * every section individually (and having to remember it on every new one),
 * the gutter is defined once here, on the container inside each top-level
 * section. It therefore applies to the pages, the header and the footer
 * alike, and to anything added later.
 *
 * No !important anywhere: these selectors are simply specific enough to win.
 */

/* ------------------------------------------------------------------ gutters */

/*
 * A 1200px container on a 1280px laptop leaves 40px of margin in total, so the
 * content runs into the edges of the screen. The gutter therefore starts well
 * before the tablet breakpoint. Rules are ordered widest to narrowest so the
 * narrower ones win.
 */

@media (max-width: 1300px) {
	.elementor-section.elementor-top-section > .elementor-container {
		padding-left: 30px;
		padding-right: 30px;
	}
}

@media (max-width: 1024px) {
	.elementor-section.elementor-top-section > .elementor-container {
		padding-left: 26px;
		padding-right: 26px;
	}
}

@media (max-width: 767px) {
	.elementor-section.elementor-top-section > .elementor-container {
		padding-left: 18px;
		padding-right: 18px;
	}
}

@media (max-width: 380px) {
	.elementor-section.elementor-top-section > .elementor-container {
		padding-left: 14px;
		padding-right: 14px;
	}
}

/* Nothing may push the page sideways. */
html,
body {
	overflow-x: hidden;
	max-width: 100%;
}

.elementor-section,
.elementor-column,
.elementor-widget {
	min-width: 0;
}

/* --------------------------------------------------------- header on mobile */

/*
 * Scope note, learned the hard way: "ehf-header" and "ehf-footer" are classes
 * the Ultimate Addons plugin puts on <body>, NOT on the header and footer
 * elements. Using them as ancestor selectors here matched every section on
 * every page and broke the whole site layout. The header and footer are
 * <header id="masthead"> and <footer id="colophon">, and only those ids may
 * be used to scope these rules.
 *
 * Below 900px the header becomes one row: logo left, hamburger right. The
 * collapsed menu list is wider than a phone screen, so it is taken out of the
 * row entirely and positioned beneath the header instead — otherwise it
 * refuses to shrink and squeezes the logo down to nothing.
 */

@media (max-width: 900px) {

	#masthead .elementor-section.elementor-top-section > .elementor-container {
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		gap: 10px;
		padding-top: 10px;
		padding-bottom: 10px;
		position: relative;
	}

	#masthead .elementor-container > .elementor-column > .elementor-element-populated {
		padding-top: 0;
		padding-bottom: 0;
	}

	/* Column 1 — logo, takes the remaining space. */
	#masthead .elementor-container > .elementor-column:nth-child(1) {
		flex: 1 1 auto;
		width: auto;
		min-width: 0;
	}

	body #masthead .elementor-widget-image {
		text-align: left;
	}

	body #masthead .elementor-widget-image img {
		margin-left: 0;
		margin-right: 0;
		max-width: 190px;
	}

	/* Column 2 — just wide enough for the hamburger. */
	#masthead .elementor-container > .elementor-column:nth-child(2) {
		flex: 0 0 54px;
		width: 54px;
		min-width: 0;
		position: static;
	}

	#masthead .elementor-widget-navigation-menu,
	#masthead .elementor-widget-navigation-menu > .elementor-widget-container {
		position: static;
	}

	#masthead .hfe-nav-menu__toggle,
	#masthead .hfe-nav-menu-icon {
		margin-left: auto;
		margin-right: 0;
	}

	/* The menu panel drops below the header, full width. */
	#masthead ul.hfe-nav-menu {
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		width: auto;
		max-width: none;
		z-index: 99;
	}

	/* Column 3 — the button. The hero repeats this call to action. */
	#masthead .elementor-container > .elementor-column:nth-child(3) {
		display: none;
	}
}

@media (max-width: 400px) {

	body #masthead .elementor-widget-image img {
		max-width: 165px;
	}
}

/* --------------------------------------------------------- footer on mobile */

@media (max-width: 767px) {

	#colophon .elementor-column + .elementor-column {
		margin-top: 24px;
	}

	#colophon .elementor-widget-image img {
		max-width: 200px;
	}
}

/* ------------------------------------------------------------------- cards */

/* Belt and braces: the templates set these as margins too, but the class keeps
   the gaps if a card is ever duplicated in the editor. */
.elementor-column.hj-card {
	margin-left: 12px;
	margin-right: 12px;
	margin-bottom: 24px;
}

@media (max-width: 767px) {
	.elementor-column.hj-card {
		margin-left: 0;
		margin-right: 0;
		margin-bottom: 18px;
	}
}

/* ---------------------------------------------------------- content details */

@media (max-width: 767px) {

	/* Headings were sized for a wide screen; stop long words breaking out. */
	.elementor-widget-heading .elementor-heading-title {
		overflow-wrap: break-word;
		word-break: normal;
		hyphens: none;
	}

	/* Buttons set to "inline" on desktop go full width once stacked. */
	.hj-elementor-page .elementor-widget-button .elementor-button {
		white-space: normal;
	}

	/* Accordion titles need room for the +/- icon. */
	.elementor-accordion .elementor-tab-title {
		padding-right: 46px;
		position: relative;
	}

	.elementor-accordion .elementor-tab-title .elementor-accordion-icon-right {
		position: absolute;
		right: 18px;
		top: 50%;
		transform: translateY(-50%);
		margin: 0;
	}

	/* Icon lists: keep the tick aligned with the first line of long items. */
	.elementor-icon-list-item {
		align-items: flex-start;
	}

	.elementor-icon-list-icon {
		padding-top: 3px;
	}
}

/* Tablet: three- and four-across card rows get cramped before they stack. */
@media (min-width: 768px) and (max-width: 1024px) {

	.hj-elementor-page .elementor-widget-icon-box .elementor-icon-box-title {
		font-size: 18px;
	}

	.hj-elementor-page .elementor-widget-icon-box .elementor-icon-box-description {
		font-size: 15px;
	}
}
