/*
Theme Name: Sloan Tree Nursery Blocks
Theme URI:
Author: Abstract Marketing
Author URI:
Description: Custom theme designed for Sloan Tree Nursery
Requires at least: 7.1
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sloan-tree-nursery-blocks
Tags: full-site-editing
*/

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

iframe {
    display: block;
}

input,
button,
textarea,
select {
	font: inherit;
}

input[type="button"],
input[type="email"],
input[type="search"],
input[type="submit"],
input[type="text"],
textarea {
	-webkit-appearance: none;
	appearance: none;
}

input:not([type="submit"]):not([type="radio"]),
select,
textarea {
	color: var(--wp--preset--color--contrast);
	border-radius: 16px;
	border: 0;
	padding: 15px 18px;
	font-size: .9375rem;
	background-color: var(--wp--preset--color--light-gray);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline-color: var(--wp--preset--color--primary-2);
	outline-offset: 1px;
}

input[type="checkbox"],
input[type="image"],
input[type="radio"] {
	width: 1.2em;
	height: 1.2em;
    accent-color: var(--wp--preset--color--primary);
}

select {
	-webkit-appearance: none;
	appearance: none;
	background: var(--wp--preset--color--light-gray) url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAxNSAxNSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Im0xNCA1LTYuNSA3TDEgNSIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIvPjwvc3ZnPg==) no-repeat;
    background-size: 15px;
    background-position: calc(100% - 12px) 50%;
	padding-right: 2.2em;
}

::placeholder {
	color: var(--wp--preset--color--contrast);
	opacity: 0.66;
}

img.alignright,
img.alignleft {
    float: none !important;
    margin: 1em auto;
    display: block;
    text-align: center;
}

@media (min-width: 782px) {
	.alignright {
		float: right;
		margin-inline-start: 1em;
	}

	.alignleft {
		float: left;
		margin-inline-end: 1em;
	}
}

@media (max-width: 781px) {
    .is-layout-constrained > figure.alignright,
    .is-layout-constrained > figure.alignleft {
        float: none;
        margin-inline: auto;
        margin-block-end: 1em;
        text-align: center;
    }
}

:root {
    --site-header-height: 164px;
}

/* The header sits over the hero, so it takes no row of its own. */
.wp-site-blocks {
    position: relative;
    display: grid;
    grid-template-rows: 1fr auto auto;
    grid-template-columns: 100%;
    min-height: 100%;
}

.wp-site-blocks > * {
    margin: 0;
}

.inline-icon {
    width: 1em;
    height: 1em;
}

.site-header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 10;
}

.has-modal-open :is(.site-header, .site-header__inner) {
    -webkit-backdrop-filter: unset !important;
    backdrop-filter: unset !important;
}

.site-header a,
.site-header a:hover {
    text-decoration: none;
}

/* First-paint value; scripts.js keeps this in step with the real header height. */
@media (max-width: 781px) {
    :root {
        --site-header-height: 192px;
    }
}

/* Hero slider */
.hero-slider {
    position: relative;
}

.is-style-group-slider::-webkit-scrollbar {
    display: none;
}

.hero-slider__dots {
    position: absolute;
    bottom: 48px;
    left: max(var(--wp--style--root--padding-left), calc((100% - var(--wp--style--global--content-size)) / 2));
    display: flex;
    gap: 8px;
    margin-inline-start: var(--wp--preset--spacing--70);
}

.hero-slider__dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: #ffffff73;
    cursor: pointer;
    transition: width .2s;
}

.hero-slider__dots button.is-active {
    width: 30px;
    background: var(--wp--preset--color--white);
}

.hero-slider__arrows {
    position: absolute;
    right: max(var(--wp--style--root--padding-right), calc((100% - var(--wp--style--global--content-size)) / 2));
    bottom: 40px;
    display: flex;
    gap: 10px;
}

.hero-slider__arrows button {
    width: 50px;
    height: 50px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ffffff2e;
    color: var(--wp--preset--color--white);
    font-size: 1.375rem;
    cursor: pointer;
}

.hero-slider__arrows button:hover {
    background: #ffffff4d;
}

.hero-slider__down {
    position: absolute;
    bottom: 36px;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--wp--preset--color--white);
    box-shadow: 0 6px 20px #0003;
    color: var(--wp--preset--color--primary);
    font-size: 1.625rem;
    font-weight: 700;
    text-decoration: none;
    transform: translateX(-50%);
}

@media (max-width: 781px) {
    .hero-slider__arrows,
    .hero-slider__down {
        display: none;
    }
}

/* Breadcrumbs in the hero */
.is-style-cover-hero .wp-block-breadcrumbs {
    color: #bfd9c9;
}

.is-style-cover-hero .wp-block-breadcrumbs a {
    color: inherit;
    text-decoration: none;
}

.is-style-cover-hero .wp-block-breadcrumbs [aria-current] {
    color: var(--wp--preset--color--white);
    font-weight: 500;
}

.is-style-cover-hero .wp-block-post-terms a {
    padding: 5px 12px;
    border-radius: 999px;
    background: #ffffff24;
    color: var(--wp--preset--color--white);
    font-size: .8125rem;
    font-weight: 700;
    text-decoration: none;
}

/* Long-form content */
.prose {
    line-height: 1.75;
}

.prose > * + * {
    margin-block-start: 20px;
}

.prose > * + :is(h2, h3) {
    margin-block-start: var(--wp--preset--spacing--60);
}

.prose h2 {
    font-size: clamp(1.625rem, 2.6vw, 2rem);
}

.prose ul {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-inline-start: 22px;
}

/* Links, tags and chips */
.wp-block-sloan-tree-nursery-blocks-page-toc {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .9375rem;
}

.wp-block-sloan-tree-nursery-blocks-page-toc p {
    margin: 0 0 6px;
    color: var(--wp--preset--color--primary-2);
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.wp-block-sloan-tree-nursery-blocks-page-toc a {
    padding: 8px 14px;
    border-radius: 12px;
    color: var(--wp--preset--color--muted);
    text-decoration: none;
}

.wp-block-sloan-tree-nursery-blocks-page-toc a.is-active {
    background: var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--primary);
    font-weight: 700;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chips--stacked {
    flex-direction: column;
    flex-wrap: nowrap;
}

.chips--stacked p {
    margin: 0 0 6px;
    color: var(--wp--preset--color--primary-2);
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 9px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--wp--preset--color--white);
    box-shadow: inset 0 0 0 1px var(--wp--preset--color--line);
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.chip.is-active {
    background: var(--wp--preset--color--primary);
    box-shadow: none;
    color: var(--wp--preset--color--white);
}

.chip small {
    font-size: .75rem;
    opacity: .6;
}

.tag {
    width: fit-content;
    margin: 0;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--primary);
    font-size: .8125rem;
    font-weight: 700;
}

/* Query pagination */
.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--wp--preset--color--white);
    box-shadow: inset 0 0 0 1px var(--wp--preset--color--line);
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 500;
    text-decoration: none;
}

.wp-block-query-pagination .page-numbers.current {
    background: var(--wp--preset--color--primary);
    box-shadow: none;
    color: var(--wp--preset--color--white);
}

/* Previous and next post links */
.post-nav a {
    display: block;
    color: var(--wp--preset--color--primary);
    font-family: var(--wp--preset--font-family--montserrat);
    font-size: 1.1875rem;
    font-weight: 700;
    text-decoration: none;
}

.post-nav--next {
    text-align: end;
}

/* Search results */
.search-result .wp-block-post-featured-image {
    flex-shrink: 0;
}

@media (max-width: 580px) {
    .search-result {
        flex-wrap: wrap !important;
    }
}

/* Map and directions */
.wp-block-sloan-tree-nursery-blocks-location-map {
    overflow: hidden;
}

.wp-block-sloan-tree-nursery-blocks-location-map iframe {
    width: 100%;
    border: 0;
}

.wp-block-sloan-tree-nursery-blocks-directions-form {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 7px 7px 7px 24px;
    background: var(--wp--preset--color--light-gray);
    border-radius: 999px;
}

.wp-block-sloan-tree-nursery-blocks-directions-form input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 0;
    background: transparent;
}

.wp-block-sloan-tree-nursery-blocks-directions-form button {
    padding: 14px 22px;
    border: 0;
    border-radius: 999px;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

/* Promo popup */
.wp-block-sloan-tree-nursery-blocks-promo-popup {
    position: fixed;
    overflow: visible;
    width: min(498px, calc(100vw - 48px));
    margin: auto !important;
    padding: 14px;
    border: 0;
    border-radius: 32px;
    background: var(--wp--preset--color--white);
    box-shadow: 0 30px 80px #0006;
}

.wp-block-sloan-tree-nursery-blocks-promo-popup::backdrop {
    background: #0b1911a8;
}

.wp-block-sloan-tree-nursery-blocks-promo-popup img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 75vh;
    object-fit: cover;
    border-radius: 22px;
}

.promo-popup__actions {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 6px 4px;
}

.promo-popup__actions .wp-block-button__link {
    flex: 1;
    text-align: center;
    text-decoration: none;
}

.promo-popup__dismiss {
    padding: 15px 28px;
    border: 0;
    border-radius: 999px;
    background: var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--primary);
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.promo-popup__close {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--wp--preset--color--white);
    box-shadow: 0 6px 18px #00000040;
    color: var(--wp--preset--color--primary);
    font-size: 1.375rem;
    font-weight: 700;
    cursor: pointer;
}

/* Gravity Forms */
.gform_wrapper .gfield_label {
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 700;
}

.gform_wrapper .gfield :is(input:not([type="checkbox"]), select, textarea) {
    width: 100%;
}

.gform_wrapper .gform_footer {
    justify-content: flex-end;
    margin: 0;
    padding: 0;
}

@media (max-width: 781px) {
    .is-style-gallery-masonry {
        columns: 2 !important;
    }

    .wp-block-sloan-tree-nursery-blocks-directions-form {
        flex-wrap: wrap;
        padding: 16px;
        border-radius: 24px;
    }
}

@media (max-width: 580px) {
    .is-style-gallery-masonry {
        columns: 1 !important;
    }
}

.wp-block-sloan-tree-nursery-blocks-shape-divider {
    transform: var(--transform);

	svg {
    	display: block;
		width: 100% !important;
		height: 100% !important;
	}
}

.wp-block-sloan-tree-nursery-blocks-shape-divider[data-flip-x] {
    --transform: scaleX(-1);
}

.wp-block-sloan-tree-nursery-blocks-shape-divider[data-flip-y] {
    --transform: scaleY(-1);
}

.wp-block-sloan-tree-nursery-blocks-shape-divider[data-flip-y][data-flip-y] {
    --transform: scale(-1);
}

/* Tree Reference Guide */

/* The whole card links to the tree through its image link. */
.tree-card {
    position: relative;
}

.tree-card .wp-block-post-featured-image a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.tree-card:hover h3 {
    text-decoration: underline;
}

.tree-card:has(a:focus-visible) {
    outline: 3px solid var(--wp--preset--color--primary-2);
    outline-offset: 3px;
}

.tree-card a:focus-visible {
    outline: 0;
}

/* Group tabs (All Trees, Shade Trees, Evergreens…) */
.tree-tabs :is(p, ul) {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tree-tabs a {
    display: block;
    padding: 12px 22px;
    border-radius: 999px;
    color: var(--wp--preset--color--primary);
    font-size: .9375rem;
    font-weight: 700;
    text-decoration: none;
}

.tree-tabs a:hover {
    background: var(--wp--preset--color--white);
}

.tree-tabs .is-current a {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
}

/* Family chips */
.tree-family-chips:not(:has(.wp-block-term)) {
    display: none;
}

.tree-family-chips ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tree-family-chips .wp-block-term-name {
    margin: 0;
}

.tree-family-chips .wp-block-term-name a {
    display: inline-flex;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--wp--preset--color--white);
    box-shadow: inset 0 0 0 1px var(--wp--preset--color--line);
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 500;
    text-decoration: none;
}

.tree-family-chips .wp-block-term-name a:hover {
    box-shadow: inset 0 0 0 1px var(--wp--preset--color--primary-2);
}

.tree-family-chips .is-current .wp-block-term-name a {
    background: var(--wp--preset--color--primary);
    box-shadow: none;
    color: var(--wp--preset--color--white);
}

/* Single tree: family tags, empty values and the related trees row. */
.tree-tags .wp-block-post-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tree-tags .wp-block-post-terms a {
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--primary);
    font-size: .8125rem;
    font-weight: 700;
    text-decoration: none;
}

.tree-tags .is-style-text-tag:empty,
.tree-spec:has(.tree-spec__value:empty),
.tree-related:not(:has(.wp-block-post)) {
    display: none;
}

.link-card,
.linked-group:not(.is-selected) {
    position: relative;
    overflow: hidden;
    transition: transform .2s;

    &:hover {
        transform: translateY(-5px);
    }

    a::after {
        content: '';
        position: absolute;
        inset: -500px 0;
        z-index: 1;
    }
}
