/*
Theme Name: TalTech
Description: Block theme for TalTech research group and project sites, following the TalTech CVI (colours, uppercase Black headings, magenta accents). Made for page-based sites in one language (Estonian or English).
Version: 1.0.0
Requires at least: 7.0
Requires PHP: 8.1
Text Domain: taltech
Domain Path: /languages
Update URI: false
License: GNU General Public License v2 or later
*/

/* Brand lettering: tight tracking on the uppercase Black headlines, balanced line breaks. */
:where(h1, h2, h3, .wp-block-site-title, .wp-block-pullquote p) {
	letter-spacing: -0.01em;
	text-wrap: balance;
}

::selection {
	background: var(--wp--preset--color--magenta);
	color: var(--wp--preset--color--white);
}

/* Heading style "Light with bold accent": Light words with Black, magenta accents in bold. */
.wp-block-heading.is-style-light {
	font-weight: 300;
}

.wp-block-heading.is-style-light strong {
	font-weight: 900;
	color: var(--wp--preset--color--magenta);
}

/* Inside coloured sections the accent stays white; dark blue on magenta is unreadable. */
:is(.is-style-section-magenta, .is-style-section-burgundy, .is-style-section-dark-blue, .wp-block-cover:not(.is-light), .has-background:not(.has-white-background-color, .has-surface-background-color, .has-grey-2-background-color)) .wp-block-heading.is-style-light strong {
	color: inherit;
}

/* Paragraph style "Lead": introductory text. */
p.is-style-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
}

/* Header lock-up: TalTech logo | site title. */
.taltech-logo img {
	display: block;
	height: auto;
}

.taltech-lockup {
	min-width: 0;
}

/* Navigation: magenta underline on the current page, as on taltech.ee. */
.wp-block-navigation .wp-block-navigation-item > a {
	padding-block: 0.25rem;
	border-bottom: 2px solid transparent;
}

.wp-block-navigation .current-menu-item > a,
.wp-block-navigation .current-menu-ancestor > a,
.wp-block-navigation .wp-block-navigation-item > a[aria-current="page"] {
	color: var(--wp--preset--color--magenta);
	border-bottom-color: currentColor;
}

.wp-block-navigation .wp-block-navigation__submenu-container {
	box-shadow: var(--wp--preset--shadow--card);
	border: 0 !important;
	padding: 0.75rem 0;
}

/* Mobile overlay (dark blue): bigger, left-aligned items; magenta on dark blue is unreadable. */
.wp-block-navigation__responsive-container.is-menu-open,
.wp-block-navigation__responsive-container.is-menu-open .items-justified-right {
	--navigation-layout-justification-setting: flex-start;
	--navigation-layout-justify: flex-start;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	font-size: var(--wp--preset--font-size--large);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	box-shadow: none;
}

.wp-block-navigation__responsive-container.is-menu-open :is(.current-menu-item, .current-menu-ancestor) > a {
	color: inherit;
}

/* Decorative cropped "T" from the TalTech custom graphics, for coloured sections. */
.taltech-t-graphic {
	background-image: url(assets/images/t-graphic.svg);
	background-repeat: no-repeat;
	background-position: right -6vw top -2rem;
	background-size: auto calc(100% + 6rem);
}

/* Key facts: big numbers. */
.taltech-fact {
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 900;
	line-height: 1;
	color: var(--wp--preset--color--magenta);
}

/* Square-ish media look: TalTech uses no rounded corners. */
.wp-block-image img,
.wp-block-search__input,
.wp-block-search__button {
	border-radius: 0;
}

.wp-block-search__input {
	border-color: var(--wp--preset--color--grey-1);
}

.wp-block-table thead {
	border-bottom: 2px solid var(--wp--preset--color--magenta);
}

.wp-block-table td,
.wp-block-table th {
	border-color: var(--wp--preset--color--grey-2);
}

/* Sections run edge to edge, so the footer sits flush against the last one, and stays at the
   bottom of the window on short pages. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
}

.wp-site-blocks > main {
	flex-grow: 1;
}

.wp-site-blocks > footer {
	margin-block-start: 0;
}

@media (max-width: 600px) {
	.taltech-logo img {
		width: 64px !important;
	}
}

/* Consecutive white sections share one gap instead of stacking two paddings; on pages with
   a title the first white section also starts right below it. */
.wp-block-post-content > .alignfull:not(.has-background, .wp-block-cover, [class*="is-style-section-"]) + .alignfull:not(.has-background, .wp-block-cover, [class*="is-style-section-"]),
body:not(.page-template-page-no-title) .wp-block-post-content > .alignfull:first-child:not(.has-background, .wp-block-cover, [class*="is-style-section-"]) {
	padding-top: 0 !important;
}
