/*
 * institute-content: the output of the client plugin's shortcode [institute_content section="…"]
 * (square-star-modular, shortcodes/InstituteContent.php and partials/institute-content/: about-caw, benefits,
 * connect, events, registration), each printed as div.institute-content.<section> (plan 02b-T20, master ruling 33).
 * Views: single institute pages, and any view whose content holds the shortcode (inc/plugin-styles.php).
 *
 * Every selector starts with .institute-content. Colours only through the preset and custom variables of contract
 * 1.1 and 1.7. The registration section's form is Gravity Forms' own (gravity-forms.css): only its width is set here.
 */

/* Width (master ruling 52): in a section root (a block with a caw-pattern- class and a constrained layout) the block
   takes the wide width in place of the text width the constrained layout gives its children; the layout's own margins
   place it. Its rows and the events grid span it. Its own text, and the registration section's form, keep the text
   width and start at the block's left edge (rule L20), there and in a wide group. The separator is the block's
   section heading, so its rule spans the block, like every section-heading rule (contract 2.4, master ruling 87).
   In a WPBakery column the block keeps filling its column. ------------------------------------------------------------------------------------------ */

.institute-content:is([class*="caw-pattern-"].is-layout-constrained > *) {
	max-width: var(--wp--style--global--wide-size);
}

.institute-content:is([class*="caw-pattern-"].is-layout-constrained > *, .alignwide > *) > :is(h2, h3, p, ul, .gform_wrapper) {
	max-width: var(--wp--style--global--content-size);
	margin-right: 0;
	margin-left: 0;
}

/* Flow: the theme's own looks for h2, h3, p and ul, with the theme's block gap between the parts. The registration
   section's form (.gform_wrapper) keeps the spacing gravity-forms.css gives it. ------------------------------------ */

.institute-content > :not(.gform_wrapper),
.institute-content .column > *,
.institute-content .event > * {
	margin-top: 0;
	margin-bottom: 0;
}

.institute-content > * + :not(.gform_wrapper),
.institute-content .column > * + * {
	margin-top: var(--wp--style--block-gap);
}

.institute-content img {
	max-width: 100%;
	height: auto;
}

/* The separator: its lines go, its label takes the look of the section-heading style (contract 2.4). ------------- */

.institute-content .separator .holder {
	display: none;
}

.institute-content .separator .label {
	display: block;
	padding-bottom: var(--wp--preset--spacing--40);
	border-bottom: 3px solid var(--wp--preset--color--teal);
	color: var(--wp--preset--color--slate);
	font-family: var(--wp--preset--font-family--montserrat);
	font-size: var(--wp--preset--font-size--section-heading);
	font-weight: 900;
	line-height: 1.15;
	letter-spacing: 0.0625rem;
	margin: 0 0 var(--wp--preset--spacing--60);
}

/* The label's spacing below takes the place of the block gap after the separator. */
.institute-content > .separator + :not(.gform_wrapper) {
	margin-top: 0;
}

/* Rows: one column below 600px; from 600px, col-6 is a half, col-3 a quarter and col-9 three quarters. ----------- */

.institute-content .row {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--style--block-gap) var(--wp--preset--spacing--60);
}

.institute-content .row > * {
	min-width: 0;
	margin: 0;
}

@media (min-width: 600px) {
	.institute-content .row {
		grid-template-columns: repeat(12, minmax(0, 1fr));
	}

	.institute-content .row > .col-6 {
		grid-column: span 6;
	}

	.institute-content .row > .col-3 {
		grid-column: span 3;
	}

	.institute-content .row > .col-9 {
		grid-column: span 9;
	}
}

/* Events: the card grid of rule L4 for three cards, and the look of a card (contract 5.6). ------------------------ */

.institute-content .events.row {
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--60);
}

@media (min-width: 600px) {
	.institute-content .events.row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 768px) {
	.institute-content .events.row {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.institute-content .event > * + * {
	margin-top: var(--wp--preset--spacing--40);
}

.institute-content .event .post-thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.institute-content .event .post-thumb + * {
	margin-top: 0.75rem;
}

.institute-content .event .meta {
	color: var(--wp--preset--color--meta-grey);
	font-size: var(--wp--preset--font-size--small);
}

.institute-content .event h3 {
	color: var(--wp--preset--color--deep-teal);
	font-family: var(--wp--preset--font-family--montserrat);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 900;
	line-height: 1.19;
	letter-spacing: 0.03125rem;
}

.institute-content .event .readmore {
	color: var(--wp--preset--color--deep-teal);
}

/* The button: the primary button of contract 2.5. ------------------------------------------------------------------ */

.institute-content a.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 2.625rem;
	padding: 0.625rem 1.875rem;
	border: 2px solid var(--wp--preset--color--teal-strong);
	border-radius: 999px;
	background-color: var(--wp--preset--color--teal-strong);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--montserrat);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.1875rem;
	text-decoration: none;
	text-transform: uppercase;
}

.institute-content a.button:is(:hover, :focus-visible) {
	border-color: var(--wp--preset--color--teal-strong);
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--teal-strong);
}

/* The ring of contract 1.7. */
.institute-content :is(a.button, .readmore):focus-visible {
	outline: var(--wp--custom--focus--ring-width) solid var(--wp--custom--focus--ring-outer);
	outline-offset: var(--wp--custom--focus--ring-width);
	box-shadow: 0 0 0 var(--wp--custom--focus--ring-width) var(--wp--custom--focus--ring-inner);
}

/* Colours by context (contract 2.6). On mist the rule is teal-strong. In a dark section the label is white with no
   rule, the card's text and link are white, and the button takes the on-dark look. --------------------------------- */

.institute-content:where(.is-style-section-mist *) .separator .label {
	border-bottom-color: var(--wp--preset--color--teal-strong);
}

.institute-content:where(.is-style-section-slate *, .is-style-section-deep-teal *, .is-style-section-teal-band *) .separator .label {
	border-bottom-width: 0;
	color: var(--wp--preset--color--white);
}

.institute-content:where(.is-style-section-slate *, .is-style-section-deep-teal *, .is-style-section-teal-band *) .event :is(.meta, h3, .readmore) {
	color: var(--wp--preset--color--white);
}

.institute-content:where(.is-style-section-slate *, .is-style-section-deep-teal *, .is-style-section-teal-band *) a.button {
	border-color: var(--wp--preset--color--white);
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--deep-teal);
}

.institute-content:where(.is-style-section-slate *, .is-style-section-deep-teal *, .is-style-section-teal-band *) a.button:is(:hover, :focus-visible) {
	border-color: var(--wp--preset--color--white);
	background-color: transparent;
	color: var(--wp--preset--color--white);
}
