/**
 * Academica block patterns (patterns/ folder): hero, quick links, key figures,
 * call-to-action panel, latest news and section titles.
 * Loaded on the front end and in the block editor. The Academica Companion
 * plugin uses the same classes and skips its own copy of these styles when
 * this theme is active.
 */

:root {
	--ask-accent: #1b4f8f;
	--ask-accent-dark: #133a6b;
	--ask-accent-soft: #e8eef6;
	--ask-accent-rgb: 27, 79, 143;
	--ask-header: #1b4f8f;
	--ask-ink: var(--ask-text, #0b0c0c);
	--ask-muted: #505a5f;
	--ask-line: #b1b4b6;
	--ask-line-light: #d8dadb;
	--ask-surface: #f3f2f1;
	--ask-focus: var(--ask-accent);
}

/* Dark areas: buttons and fields get a white focus outline (see style.css). */
.ask-hero,
.wp-block-cover:not(.is-light),
.has-primary-blue-background-color,
.has-header-background-color,
.has-dark-gray-background-color,
.has-black-background-color {
	--ask-focus-ring: #fff;
}

/* ---------- Focus (keyboard) ---------- */

.ask-school-content a:focus-visible,
.entry-content [class*="ask-"] a:focus-visible,
.ask-staff-directory a:focus-visible,
.ask-event-list a:focus-visible {
	outline: 2px dotted currentColor;
	outline-offset: 2px;
}

/* Button-style links: use the ring colour (white on dark areas), not the button's text colour. */
.entry-content [class*="ask-"] a.wp-block-button__link:focus-visible,
.ask-school-content a.wp-block-button__link:focus-visible {
	outline-color: var(--ask-focus-ring, #0b0c0c);
}

/* ---------- Links (always underlined, thicker on hover) ---------- */

.ask-school-content a,
.entry-content [class*="ask-"] a,
.ask-event-list a,
.ask-staff-directory a {
	color: var(--ask-accent);
	text-decoration: underline;
	text-decoration-thickness: max(1px, .0625rem);
	text-underline-offset: .15em;
}

.ask-school-content a:hover,
.entry-content [class*="ask-"] a:hover,
.ask-event-list a:hover,
.ask-staff-directory a:hover {
	color: var(--ask-accent-dark);
	text-decoration-thickness: max(3px, .1875rem);
}

/* Core buttons inside School Kit patterns */
.ask-hero .wp-block-button__link,
.ask-cta-band .wp-block-button__link {
	display: inline-block;
	padding: 10px 18px;
	border-width: 2px;
	border-style: solid;
	border-radius: 0;
	font-size: var(--ask-button-size, clamp(17px, 15.7px + 0.33vw, 19px));
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}

.ask-hero .wp-block-buttons,
.ask-cta-band .wp-block-buttons {
	gap: 15px 20px;
	align-items: center;
}

/* Light backgrounds (e.g. the call-to-action panel): accent buttons. Pattern
   link styles would otherwise recolour the button text. */
.entry-content [class*="ask-"] .wp-block-button__link:not(.has-background),
[class*="ask-"] .wp-block-button__link:not(.has-background) {
	border-color: var(--ask-accent);
	background: var(--ask-accent);
	color: #fff;
}

.entry-content [class*="ask-"] .wp-block-button__link:not(.has-background):hover,
[class*="ask-"] .wp-block-button__link:not(.has-background):hover {
	border-color: var(--ask-accent-dark);
	background: var(--ask-accent-dark);
	color: #fff;
}

.entry-content [class*="ask-"] .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
[class*="ask-"] .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background) {
	border-color: var(--ask-accent);
	background: #fff;
	color: var(--ask-accent);
}

.entry-content [class*="ask-"] .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
[class*="ask-"] .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover {
	border-color: var(--ask-accent);
	background: var(--ask-accent);
	color: #fff;
}

/* Buttons adapt to their background: no extra classes needed.
   On light backgrounds they use the accent colour (style.css). On dark
   backgrounds (hero, cover, dark colour backgrounds) the default button
   turns white and the Outline style turns into a white outline. */
.entry-content .ask-hero .wp-block-button__link:not(.has-background),
.entry-content .wp-block-cover:not(.is-light) .wp-block-button__link:not(.has-background),
.entry-content .has-primary-blue-background-color .wp-block-button__link:not(.has-background),
.entry-content .has-header-background-color .wp-block-button__link:not(.has-background),
.entry-content .has-dark-gray-background-color .wp-block-button__link:not(.has-background),
.entry-content .has-black-background-color .wp-block-button__link:not(.has-background),
.ask-hero .wp-block-button__link:not(.has-background),
.wp-block-cover:not(.is-light) .wp-block-button__link:not(.has-background),
.has-primary-blue-background-color .wp-block-button__link:not(.has-background),
.has-header-background-color .wp-block-button__link:not(.has-background),
.has-dark-gray-background-color .wp-block-button__link:not(.has-background),
.has-black-background-color .wp-block-button__link:not(.has-background) {
	border-color: #fff;
	background: #fff;
	color: var(--ask-accent-dark);
}

.entry-content .ask-hero .wp-block-button__link:not(.has-background):hover,
.entry-content .wp-block-cover:not(.is-light) .wp-block-button__link:not(.has-background):hover,
.entry-content .has-primary-blue-background-color .wp-block-button__link:not(.has-background):hover,
.entry-content .has-header-background-color .wp-block-button__link:not(.has-background):hover,
.entry-content .has-dark-gray-background-color .wp-block-button__link:not(.has-background):hover,
.entry-content .has-black-background-color .wp-block-button__link:not(.has-background):hover,
.ask-hero .wp-block-button__link:not(.has-background):hover,
.wp-block-cover:not(.is-light) .wp-block-button__link:not(.has-background):hover,
.has-primary-blue-background-color .wp-block-button__link:not(.has-background):hover,
.has-header-background-color .wp-block-button__link:not(.has-background):hover,
.has-dark-gray-background-color .wp-block-button__link:not(.has-background):hover,
.has-black-background-color .wp-block-button__link:not(.has-background):hover {
	border-color: var(--ask-surface, #f3f2f1);
	background: var(--ask-surface, #f3f2f1);
	color: var(--ask-accent-dark);
}

.entry-content .ask-hero .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
.entry-content .wp-block-cover:not(.is-light) .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
.entry-content .has-primary-blue-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
.entry-content .has-header-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
.entry-content .has-dark-gray-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
.entry-content .has-black-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
.ask-hero .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
.wp-block-cover:not(.is-light) .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
.has-primary-blue-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
.has-header-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
.has-dark-gray-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
.has-black-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background) {
	border-color: #fff;
	background: transparent;
	color: #fff;
}

.entry-content .ask-hero .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.entry-content .wp-block-cover:not(.is-light) .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.entry-content .has-primary-blue-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.entry-content .has-header-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.entry-content .has-dark-gray-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.entry-content .has-black-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.ask-hero .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.wp-block-cover:not(.is-light) .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.has-primary-blue-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.has-header-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.has-dark-gray-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.has-black-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover {
	border-color: #fff;
	background: #fff;
	color: var(--ask-accent-dark);
}

/* ---------- Hero ---------- */

.ask-hero {
	padding: 50px 40px 55px;
	border-radius: 0;
	background: var(--ask-header);
	color: #fff;
}

.ask-hero > * {
	max-width: 760px;
}

.ask-hero .ask-eyebrow,
.entry-content .ask-hero .ask-eyebrow {
	margin: 0 0 10px;
	padding: 0;
	background: none;
	color: #fff;
	font-size: 19px;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}

.entry-content .ask-hero .ask-hero__title,
.ask-hero .ask-hero__title {
	margin: 0 0 20px;
	color: #fff;
	font-size: clamp(32px, 2rem + 2vw, 56px);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: 0;
}

.ask-hero .ask-hero__lead,
.entry-content .ask-hero .ask-hero__lead {
	margin: 0 0 30px;
	color: #fff;
	font-size: 24px;
	line-height: 1.25;
}

/* Split hero: text panel + photo */
.ask-hero.ask-hero--split,
.entry-content .ask-hero.ask-hero--split {
	gap: 0;
	align-items: stretch;
	padding: 0;
	margin-bottom: 0;
}

.ask-hero.ask-hero--split > * {
	max-width: none;
}

.ask-hero--split .ask-hero__content {
	padding: 50px 40px 55px;
}

.ask-hero--split .ask-hero__media {
	position: relative;
	min-height: 360px;
	margin: 0;
}

.ask-hero--split .ask-hero__media .wp-block-image,
.entry-content .ask-hero--split .ask-hero__media .wp-block-image {
	position: absolute;
	inset: 0;
	margin: 0;
}

.ask-hero--split .ask-hero__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border-radius: 0;
}

/* ---------- Quick links (plain navigation list) ---------- */

.ask-quicklinks.wp-block-columns {
	gap: 30px;
	margin-bottom: 0;
}

.ask-quicklink,
.entry-content .ask-quicklink {
	padding: 15px 0 0;
	border: 0;
	border-top: 5px solid var(--ask-accent);
	border-radius: 0;
	background: none;
}

.entry-content .ask-quicklink h3,
.ask-quicklink h3 {
	margin: 0 0 10px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
}

.entry-content .ask-quicklink h3 a,
.ask-quicklink h3 a {
	color: var(--ask-accent);
}

.entry-content .ask-quicklink h3 a:hover,
.ask-quicklink h3 a:hover {
	color: var(--ask-accent-dark);
}

.entry-content .ask-quicklink p,
.ask-quicklink p {
	margin: 0;
	color: var(--ask-ink);
	font-size: 19px;
	line-height: 1.4;
}

/* ---------- Section rhythm ----------
   Patterns stacked on a page (e.g. a homepage built from them) get the
   same space between them, whatever their order. */
.entry-content > [class*="ask-"]:not(:first-child),
.is-root-container > [class*="ask-"]:not(:first-child) {
	margin-top: 60px;
}

@media screen and (max-width: 640px) {
	.entry-content > [class*="ask-"]:not(:first-child),
	.is-root-container > [class*="ask-"]:not(:first-child) {
		margin-top: 40px;
	}
}

/* ---------- Stats ---------- */

/* Four figures in a row, two per row when the content column is narrow
   (small screens, or pages with both sidebars). */
.entry-content:has(> .ask-stats),
.is-root-container:has(> .ask-stats) {
	container-type: inline-size;
}

.ask-stats.wp-block-columns {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 30px;
	padding: 0;
	border-radius: 0;
	background: none;
	text-align: left;
}

.ask-stat {
	padding: 15px 0 0;
	border-top: 1px solid var(--ask-line);
}

.ask-stat p,
.entry-content .ask-stat p {
	margin: 0;
}

.entry-content .ask-stats .ask-stat__number,
.ask-stats .ask-stat__number {
	color: var(--ask-ink);
	font-size: 48px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0;
}

@container (max-width: 640px) {
	.ask-stats.wp-block-columns {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.entry-content .ask-stats .ask-stat__label,
.ask-stats .ask-stat__label {
	margin-top: 5px;
	color: var(--ask-ink);
	font-size: 19px;
	line-height: 1.3;
}

/* ---------- Call-to-action panel ---------- */

.ask-cta-band {
	margin-top: 60px;
	padding: 30px 35px 35px;
	border: 0;
	border-left: 10px solid var(--ask-accent);
	border-radius: 0;
	background: var(--ask-surface);
	color: var(--ask-ink);
	text-align: left;
}

.entry-content .ask-cta-band .ask-cta-band__title,
.ask-cta-band .ask-cta-band__title {
	margin: 0 0 15px;
	color: var(--ask-ink);
	font-size: 32px;
	font-weight: 700;
	line-height: 1.15;
}

.entry-content .ask-cta-band .ask-cta-band__text,
.ask-cta-band .ask-cta-band__text {
	max-width: 40em;
	margin: 0 0 25px;
	color: var(--ask-ink);
	font-size: 19px;
	line-height: 1.5;
	opacity: 1;
}

.ask-cta-band .wp-block-buttons {
	justify-content: flex-start;
}

/* ---------- News + events ---------- */

.ask-news-events.wp-block-columns {
	gap: 60px;
}

.entry-content .ask-section-title,
.ask-section-title {
	margin: 0 0 20px;
	padding: 0;
	border: 0;
	color: var(--ask-ink);
	font-size: clamp(26px, 1.4rem + 1vw, 34px);
	font-weight: 700;
	line-height: 1.15;
}

.entry-content .ask-latest-news.wp-block-latest-posts,
.ask-latest-news.wp-block-latest-posts {
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--ask-line);
	list-style: none;
}

.entry-content .ask-latest-news.wp-block-latest-posts li,
.ask-latest-news.wp-block-latest-posts li {
	margin: 0;
	padding: 15px 0 20px;
	border-bottom: 1px solid var(--ask-line);
	list-style: none;
}

.entry-content .ask-latest-news .wp-block-latest-posts__post-title,
.ask-latest-news .wp-block-latest-posts__post-title {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
}

.ask-latest-news .wp-block-latest-posts__post-date {
	display: block;
	margin: 5px 0 10px;
	color: var(--ask-muted);
	font-size: 16px;
	letter-spacing: 0;
	text-transform: none;
}

.ask-latest-news .wp-block-latest-posts__post-excerpt {
	margin: 0;
	color: var(--ask-ink);
	font-size: 19px;
	line-height: 1.45;
}

.entry-content .ask-latest-news .wp-block-latest-posts__post-excerpt a {
	display: none;
}

.ask-view-all,
.entry-content .ask-view-all {
	margin: 20px 0 0;
	font-size: 19px;
	font-weight: 700;
}

/* ---------- Responsive ---------- */

@media screen and (max-width: 781px) {
	.ask-hero.ask-hero--split {
		flex-direction: column;
	}

	.ask-hero--split .ask-hero__media {
		min-height: 240px;
	}

	.ask-quicklinks.wp-block-columns {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 30px;
	}

	.ask-news-events.wp-block-columns {
		gap: 40px;
	}
}

@media screen and (max-width: 640px) {
	.ask-hero,
	.ask-hero--split .ask-hero__content {
		padding: 30px 20px 35px;
	}

	.ask-hero.ask-hero--split {
		padding: 0;
	}

	.entry-content .ask-hero .ask-hero__title,
	.ask-hero .ask-hero__title {
		font-size: 32px;
	}

	.ask-hero .ask-hero__lead,
	.entry-content .ask-hero .ask-hero__lead {
		font-size: 19px;
	}

	.ask-cta-band {
		padding: 20px 20px 25px;
		border-left-width: 5px;
	}

	.entry-content .ask-cta-band .ask-cta-band__title,
	.ask-cta-band .ask-cta-band__title,
	.entry-content .ask-section-title,
	.ask-section-title {
		font-size: 26px;
	}

	.ask-quicklinks.wp-block-columns {
		grid-template-columns: minmax(0, 1fr);
	}

	.entry-content .ask-stats .ask-stat__number,
	.ask-stats .ask-stat__number {
		font-size: 36px;
	}

	.ask-hero .wp-block-buttons,
	.ask-cta-band .wp-block-buttons {
		flex-direction: column;
		align-items: stretch;
	}

	.ask-hero .wp-block-button,
	.ask-cta-band .wp-block-button {
		width: 100%;
	}

	.ask-hero .wp-block-button__link,
	.ask-cta-band .wp-block-button__link {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}

}

/* Block editor only: the editor sets an inline height:auto on images, so the
   hero photo needs !important to fill its panel. Scoped to the editor canvas. */
.editor-styles-wrapper .ask-hero--split .ask-hero__media img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
}
