/*
Theme Name: Nibiru
Theme URI: https://nibirucooling.co.uk
Description: Block theme for Nibiru Cooling Ltd. Every layout is editable in the Site Editor; contact details live in Settings → Business Info.
Version: 0.1.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: nibiru
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* Styling lives in theme.json first. This file only covers the block styles
   registered in functions.php and a few things theme.json can't express. */

html { scroll-behavior: smooth; }
:where(body) { -webkit-font-smoothing: antialiased; }

/* No gap between header, page content and footer (sections carry their own padding) */
.wp-site-blocks > * + * { margin-block-start: 0; }

/* Header */
.nibiru-header { position: sticky; top: 0; z-index: 50; }
.admin-bar .nibiru-header { top: var(--wp-admin--admin-bar--height, 0); }
@media (max-width: 781px) {
	.admin-bar .nibiru-header { top: 0; }
	.nibiru-header .nibiru-header__quote { display: none; }
}
.nibiru-header .wp-block-button__link { padding: 0.6rem 1rem; font-size: var(--wp--preset--font-size--small); }
.nibiru-header :is(.wp-block-site-title, .wp-block-button__link) { white-space: nowrap; }
@media (max-width: 480px) {
	.nibiru-header .wp-block-site-logo img { width: 170px; }
	.nibiru-header .wp-block-button__link { padding: 0.5rem 0.7rem; }
	.nibiru-header .wp-block-group { gap: 0.6rem; }
}

/* Client logo (Site Logo block). The PNG has the navy background built in. */
.wp-block-site-logo.nibiru-logo img { height: auto; display: block; }
.wp-block-site-logo.nibiru-logo a { display: block; line-height: 0; }

/* Site title with the planet-ring "N" mark (until the real logo file arrives) */
.wp-block-site-title.is-style-mark { display: flex; align-items: center; gap: 0.6rem; }
.wp-block-site-title.is-style-mark::before {
	content: "";
	flex: none;
	width: 2.25rem;
	height: 2.25rem;
	background: url(assets/images/mark.svg) center / contain no-repeat;
}

/* Eyebrow label above headings */
p.is-style-eyebrow {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--teal-text);
}
.has-navy-background-color p.is-style-eyebrow,
.has-navy-700-background-color p.is-style-eyebrow { color: var(--wp--preset--color--teal); }

/* Text colour on dark sections */
.has-navy-background-color :where(h1, h2, h3, h4),
.has-navy-700-background-color :where(h1, h2, h3, h4) { color: var(--wp--preset--color--white); }
.has-navy-background-color :where(a:not(.wp-block-button__link)),
.has-navy-700-background-color :where(a:not(.wp-block-button__link)) { color: var(--wp--preset--color--teal); }

/* Outline button */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1.5px solid currentColor;
	background: transparent;
	color: var(--wp--preset--color--navy);
}
.has-navy-background-color .wp-block-button.is-style-outline > .wp-block-button__link { color: var(--wp--preset--color--white); }
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--gold);
	border-color: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--navy);
}

/* Card */
.wp-block-group.is-style-card {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
	overflow: hidden;
	height: 100%;
}
.has-navy-background-color .wp-block-group.is-style-card {
	background: var(--wp--preset--color--navy-700);
	border-color: var(--wp--preset--color--navy-700);
}
.wp-block-group.is-style-card > .wp-block-image:first-child { margin: 0; }
.wp-block-group.is-style-card > .wp-block-image:first-child img { border-radius: 0; }
.wp-block-group.is-style-card > :not(.wp-block-image:first-child) { margin-inline: 1.5rem; }
.wp-block-group.is-style-card > :first-child:not(.wp-block-image) { margin-top: 1.5rem; }
.wp-block-group.is-style-card > :last-child { margin-bottom: 1.5rem; }
.wp-block-group.is-style-card h3 a { color: inherit; text-decoration: none; }
.wp-block-group.is-style-card h3 a:hover { color: var(--wp--preset--color--teal-text); }

/* Planet graphic behind a section */
.wp-block-group.is-style-planet { position: relative; overflow: hidden; isolation: isolate; }
.wp-block-group.is-style-planet::after {
	content: "";
	position: absolute;
	z-index: -1;
	right: max(-8rem, calc(50% - 46rem));
	top: 50%;
	width: min(34rem, 70vw);
	aspect-ratio: 1;
	transform: translateY(-50%);
	background: url(assets/images/planet.svg) center / contain no-repeat;
	pointer-events: none;
}
@media (max-width: 781px) {
	.wp-block-group.is-style-planet::after { opacity: 0.25; right: -30vw; }
}

/* Keep text clear of the planet graphic */
.wp-block-group.is-style-planet > .alignwide > :is(h1, h2, p) { max-width: 38rem; }
.nibiru-hero .nibiru-hero-intro { color: var(--wp--preset--color--line); }

/* Lists */
ul.is-style-checks { list-style: none; padding-left: 0; }
ul.is-style-checks li { position: relative; padding-left: 1.9rem; margin-bottom: 0.5rem; }
ul.is-style-checks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.3em;
	width: 1.15rem;
	height: 1.15rem;
	border-radius: 50%;
	background: var(--wp--preset--color--teal-deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
}
.has-navy-background-color ul.is-style-checks li::before { background-color: var(--wp--preset--color--teal-deep); }

ul.is-style-chips { list-style: none; padding-left: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
ul.is-style-chips li {
	margin: 0;
	padding: 0.45rem 1rem;
	border: 1px solid var(--wp--preset--color--navy);
	border-radius: 999px;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	color: var(--wp--preset--color--navy);
}

/* Big number (process steps, stats) */
p.is-style-step-number {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	line-height: 1.1;
	font-size: var(--wp--preset--font-size--xx-large);
	color: var(--wp--preset--color--gold);
	letter-spacing: 0;
	margin-bottom: 0.25rem;
}

p.is-style-step-number + :is(h3, p) { margin-top: 0.25rem; }
.nibiru-stats { border-top: 1px solid var(--wp--preset--color--navy-700); padding-top: var(--wp--preset--spacing--40); margin-top: var(--wp--preset--spacing--50); }
.nibiru-stats p.is-style-step-number { color: var(--wp--preset--color--white); }
.is-style-planet .nibiru-why { max-width: 46rem; margin-left: 0; grid-template-columns: repeat(auto-fill, minmax(min(12rem, 100%), 1fr)) !important; }
@media (max-width: 1100px) { .is-style-planet .nibiru-why { max-width: none; } }

/* FAQ */
.wp-block-details summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--navy);
}
.wp-block-details[open] summary { margin-bottom: 0.75rem; }

/* Portrait project videos */
.wp-block-video video { border-radius: 12px; max-height: 70vh; width: 100%; background: var(--wp--preset--color--navy); }

/* Button that looks like a plain link (footer and contact details) */
.wp-block-button.is-style-text-link > .wp-block-button__link {
	padding: 0;
	background: none;
	color: inherit;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.wp-block-button.is-style-text-link > .wp-block-button__link:hover { background: none; color: var(--wp--preset--color--teal); }
.nibiru-footer .wp-block-button.is-style-text-link > .wp-block-button__link { color: var(--wp--preset--color--white); font-size: var(--wp--preset--font-size--small); }

/* Footer */
.nibiru-plain-list { list-style: none; padding-left: 0; line-height: 2; }
.nibiru-legal { font-size: 0.8125rem; max-width: 46rem; }
.nibiru-footer a { text-decoration: none; }
.nibiru-footer a:hover { text-decoration: underline; }
.nibiru-footer .wp-block-navigation { --navigation-layout-direction: column; }

/* Forms (Contact Form 7) */
.wpcf7 label { display: block; font-weight: 600; color: var(--wp--preset--color--navy); font-size: var(--wp--preset--font-size--small); }
.wpcf7 input:not([type="submit"]):not([type="checkbox"]),
.wpcf7 select,
.wpcf7 textarea {
	width: 100%;
	margin-top: 0.35rem;
	padding: 0.7rem 0.85rem;
	border: 1px solid #94A3B8;
	border-radius: 8px;
	font: inherit;
	font-weight: 400;
	color: var(--wp--preset--color--navy);
	background: var(--wp--preset--color--white);
	box-sizing: border-box;
}
.wpcf7 :is(input, select, textarea):focus { outline: 2px solid var(--wp--preset--color--teal-deep); outline-offset: 1px; }
.wpcf7 .nibiru-form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.wpcf7 p { margin: 0 0 1rem; }
.wpcf7 .wpcf7-acceptance label { font-weight: 400; color: var(--wp--preset--color--slate); }
.wpcf7 input[type="submit"] {
	border: 0;
	border-radius: 8px;
	padding: 0.85rem 1.6rem;
	font: inherit;
	font-weight: 600;
	background: var(--wp--preset--color--teal);
	color: var(--wp--preset--color--navy);
	cursor: pointer;
}
.wpcf7 input[type="submit"]:hover { background: var(--wp--preset--color--gold); }
.wpcf7 .wpcf7-not-valid-tip { color: #B42318; font-size: var(--wp--preset--font-size--small); }

/* Skip link and focus */
:where(a, button, summary):focus-visible { outline: 2px solid var(--wp--preset--color--gold); outline-offset: 3px; }

/* Contact page: quick contact cards (icon from the card class; number and email from Business Info) */
.wp-block-group.is-style-card.nibiru-contact-card {
	position: relative;
	padding: 1.75rem 1.75rem 1.75rem 6.25rem;
	transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.wp-block-group.is-style-card.nibiru-contact-card > :not(.wp-block-image:first-child) { margin-inline: 0; }
.wp-block-group.is-style-card.nibiru-contact-card > :first-child { margin-top: 0; }
.wp-block-group.is-style-card.nibiru-contact-card > :last-child { margin-bottom: 0; }
.nibiru-contact-card::before,
.nibiru-contact-card::after {
	content: "";
	position: absolute;
	left: 1.75rem;
	top: 50%;
	width: 3.25rem;
	height: 3.25rem;
	transform: translateY(-50%);
}
.nibiru-contact-card::before { border-radius: 50%; background: var(--wp--preset--color--navy); }
.nibiru-contact-card::after {
	background: var(--wp--preset--color--teal);
	-webkit-mask: var(--nibiru-icon) center / 1.4rem no-repeat;
	mask: var(--nibiru-icon) center / 1.4rem no-repeat;
}
.nibiru-contact-card--phone { --nibiru-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E"); }
.nibiru-contact-card--email { --nibiru-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E"); }
.nibiru-contact-card .wp-block-button.is-style-text-link > .wp-block-button__link {
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.15rem, 0.8rem + 1vw, 1.6rem);
	font-weight: 600;
	color: var(--wp--preset--color--navy);
	text-align: left;
	text-decoration: none;
	overflow-wrap: anywhere;
}
/* The whole card is clickable */
.nibiru-contact-card .wp-block-button__link::after { content: ""; position: absolute; inset: 0; }
.nibiru-contact-card:hover {
	border-color: var(--wp--preset--color--teal-deep);
	box-shadow: 0 10px 30px rgb(11 18 32 / 0.08);
	transform: translateY(-2px);
}
.nibiru-contact-card:hover .wp-block-button__link { color: var(--wp--preset--color--teal-text); }
.nibiru-contact-card:focus-within { outline: 2px solid var(--wp--preset--color--teal-deep); outline-offset: 2px; }
@media (max-width: 480px) {
	/* Icon above the text on phones, so the email address has the full width */
	.wp-block-group.is-style-card.nibiru-contact-card { padding: 4.75rem 1.25rem 1.25rem; }
	.nibiru-contact-card::before, .nibiru-contact-card::after { left: 1.25rem; top: 1.25rem; width: 2.75rem; height: 2.75rem; transform: none; }
}

/* Contact page: map ([nibiru_map]) */
.nibiru-map iframe {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
}
.nibiru-map__directions { margin-top: 0.75rem; font-weight: 600; }
.nibiru-map__directions a { color: var(--wp--preset--color--teal-text); text-decoration: none; }
.nibiru-map__directions a:hover { text-decoration: underline; }

/* Contact page: form */
.wpcf7 .nibiru-form-note { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--slate); }
.wpcf7 input[type="submit"] { width: 100%; }
