/*
Theme Name: Vertikote
Theme URI: https://www.vertikote.com.au
Description: Custom block theme for Vertikote, rebuilt from the 2018 Beaver Builder site. Uses core WordPress blocks only.
Version: 1.1.0
Requires at least: 6.6
Requires PHP: 8.1
Author: Support Desk
Text Domain: vertikote
*/

/* Header: sticky white bar with logo left, uppercase menu right.
   The sticky rule goes on the template part wrapper, which is a child of the page. */
header.wp-block-template-part:has(.vk-header) {
	position: sticky;
	top: 0;
	z-index: 100;
}

.vk-header {
	box-shadow: 0 1px 0 rgba(1, 0, 55, 0.08);
	padding-block: 38px !important;
	transition: padding 0.2s ease;
}

/* Shrinks once the page is scrolled (class set by the theme's small script), and is always compact on phones. */
.vk-scrolled .vk-header {
	padding-block: 10px !important;
}

@media (max-width: 781px) {
	.vk-header {
		padding-block: 10px !important;
	}

	.vk-header .wp-block-site-logo img {
		width: 180px;
	}
}

.admin-bar header.wp-block-template-part:has(.vk-header) {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar header.wp-block-template-part:has(.vk-header) {
		top: 46px;
	}
}

.vk-header .wp-block-navigation {
	font-size: 0.875rem;
	font-weight: 700;
	text-transform: uppercase;
}

.vk-header .wp-block-navigation-item.current-menu-item > a,
.vk-header .wp-block-navigation-item a[aria-current="page"] {
	color: var(--wp--preset--color--blue);
}

/* Headings sit 20px above the text that follows, as on the old site. */
:where(.is-layout-flow, .is-layout-constrained) > :is(h1, h2, h3, h4) + * {
	margin-block-start: 20px;
}

/* Full-width sections sit flush against each other, as on the old site. */
main > .alignfull,
main > .alignfull + * {
	margin-block-start: 0;
}

/* No gap between the page content and the header or footer. */
.wp-site-blocks > main,
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* Text sections: 40px above, as on the old site; extra room before the footer. */
main > .wp-block-group {
	padding-top: 40px !important;
	padding-bottom: 0 !important;
}

main > .wp-block-group:last-child {
	padding-bottom: 60px !important;
}

/* Hero: full-height photo with a translucent white band carrying the headline. */
main > .wp-block-cover.alignfull:first-child {
	min-height: calc(100vh - 64px) !important;
}

.vk-hero-band {
	background: rgba(255, 255, 255, 0.72);
	text-align: center;
}

/* Image and text split sections are a fixed 500px high on desktop, with the text
   indented 100px from the page edge and 40px from the photo, as on the old site. */
@media (min-width: 782px) {
	main > .wp-block-media-text.alignfull {
		min-height: 500px;
	}

	main > .wp-block-media-text.has-media-on-the-right > .wp-block-media-text__content {
		padding: 0 40px 0 140px !important;
	}

	main > .wp-block-media-text:not(.has-media-on-the-right) > .wp-block-media-text__content {
		padding: 0 90px 0 40px !important;
	}

	main > .wp-block-media-text > .wp-block-media-text__content > .wp-block-group > * {
		margin-left: 0 !important;
		max-width: none !important;
	}
}

/* Image captions: small, centred grey text. */
.wp-block-image figcaption {
	font-size: 0.875rem;
	margin-top: 10px;
	text-align: center;
}

/* Coloured call-to-action panels (On-site page): content centred both ways. */
.vk-panels > .wp-block-column {
	display: flex;
	flex-direction: column;
	justify-content: center;
	text-align: center;
}

.vk-panels > .wp-block-column > p {
	margin-inline: auto;
	max-width: 230px;
}

.vk-panels .wp-block-image {
	margin-inline: auto;
}

/* Contact page: maps run edge to edge beside the office details. */
main > .wp-block-group.vk-contact-row.vk-contact-row {
	padding: 0 !important;
}

.vk-contact-row .vk-map {
	display: block;
}

.vk-contact-row .wp-block-column > * {
	margin-block-start: 0;
}

.vk-contact-details strong {
	color: var(--wp--preset--color--navy);
}

/* Contact form (Fluent Forms): plain fields with a thin navy border, as on the old site. */
.fluentform .ff-el-form-control {
	border: 1px solid var(--wp--preset--color--navy);
	border-radius: 2px;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 300;
	padding: 6px 8px;
}

/* Dividers: thin light grey rule. */
.wp-block-separator,
.wp-block-separator.has-alpha-channel-opacity {
	border: 0;
	border-top: 1px solid #eeeeee;
	margin-block: 20px;
	opacity: 1;
}

/* Accordions (core Details block) styled like the old Beaver Builder ones. */
.wp-block-details.is-style-vk-accordion {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--navy);
	margin-block-end: 10px;
}

.wp-block-details.is-style-vk-accordion > summary {
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
	cursor: pointer;
	font-size: 1.125rem;
	list-style: none;
	padding: 15px 48px 15px 20px;
	position: relative;
}

.wp-block-details.is-style-vk-accordion > summary::-webkit-details-marker {
	display: none;
}

.wp-block-details.is-style-vk-accordion > summary::after {
	content: "+";
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
	position: absolute;
	right: 1.25rem;
	top: 50%;
	transform: translateY(-50%);
}

.wp-block-details.is-style-vk-accordion[open] > summary::after {
	content: "\2212";
}

.wp-block-details.is-style-vk-accordion > :not(summary) {
	padding-inline: 20px 40px;
}

/* Warranty table: coloured cells, no grid lines, as on the old site.
   Its section runs the full page width with 40px edges; the note sits 20px further in. */
main > .wp-block-group:has(.vk-warranty-table) {
	margin-left: 0 !important;
	margin-right: 0 !important;
	max-width: none !important;
	padding-left: 20px !important;
	padding-right: 20px !important;
}

main > .wp-block-group:has(.vk-warranty-table) > * {
	max-width: none !important;
}

main > .wp-block-group:has(.vk-warranty-table) > p {
	padding-inline: 20px;
}

.vk-warranty-table {
	background: #fafafa;
	border-collapse: collapse;
	table-layout: fixed;
	width: 100%;
}

main > .wp-block-group:has(.vk-warranty-table) > p {
	margin-block-start: 50px;
}

.vk-warranty-table th,
.vk-warranty-table td {
	border: 2px solid var(--wp--preset--color--white);
	padding: 20px 15px;
	text-align: center;
}

.vk-warranty-table th,
.vk-warranty-table .type-td {
	font-weight: 700;
}

/* The header row is one continuous navy bar, without white dividers. */
.vk-warranty-table th {
	border-color: var(--wp--preset--color--navy);
	padding-block: 30px;
	text-align: left;
}

/* Thin white lines between coloured cells; none around the empty grey ones. */
.vk-warranty-table td {
	border-width: 1px;
}

.vk-warranty-table td:not([class]) {
	border-color: #fafafa;
}

.vk-warranty-table th,
.vk-warranty-table .option-td {
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}

.vk-warranty-table .type-td {
	background: var(--wp--preset--color--blue);
	color: var(--wp--preset--color--white);
}

.vk-warranty-table .included-option {
	background: rgba(0, 114, 188, 0.314);
}

.vk-warranty-table .included-option-alt {
	background: rgba(0, 114, 188, 0.125);
}

.vk-warranty-table .included-option,
.vk-warranty-table .included-option-alt {
	color: var(--wp--preset--color--navy);
	font-weight: 700;
}

/* On phones the table keeps a readable width and scrolls sideways. */
@media (max-width: 781px) {
	.wp-block-table:has(.vk-warranty-table) {
		overflow-x: auto;
	}

	.vk-warranty-table {
		font-size: 0.8125rem;
		min-width: 720px;
	}
}
