/*
 * styling changes/queries for the designer:
 *
 * 2. In the design, the content overlaps the image, this is tricky and might not be necessary if we move the AR stuff to a second page
 * 3. I added a border-radius to the <model-viewer> and changed the background from white to the light-grey that is used elsewhere in the designs
 * 4. I took the line-height values from the Figma, but they look very tight to me, can these be increased?
 *
 * remove 'caveats'
 *
 */

/* some resets */
img {
    display: block;
    max-width: 100%;
}

/* custom styles */
:root {
    --color__theme-main: #78FAAE;
    --color__theme-main__fade: #B5FFD3;
    --color__theme-grey: #F1F2F2;
    --color__theme-dark: #0E3A2f;

    --bs-body-bg-rgb: 241, 242, 242;
    --bs-dark-rgb: 14, 58, 47;

    --font__theme-main: 'Skoda Next', Helvetica, Arial, sans-serif;
    --typography__h1-font-size: 4rem;
    --typography__h1-line-height: 1;
    --typography__h2-font-size: 2.125rem;
    --typography__h2-line-height: 1;
    --typography__h3-font-size: 2.875rem;
    --typography__p-font-size: 2rem;
    --typography__p-line-height: 1.2;
    --typography__p-small-font-size: 0.9375rem;
    --typography__p-small-line-height: 1.33;
    --typography__li-font-size: 2rem;
    --typography__li-line-height: 1.2;

    --layout__content-spacer: 27px;
    --layout__hero-height: 90vh;
    --layout__hero-margin-bottom: min(-4vh, -4rem);
    --layout__hero-image-position: center -10vh;
    --layout__hero-wordmark-top: 3rem;

    --component__glide-controls-max-width: 66vw;
}

body {
    background-color: var(--color__theme-dark);
}

footer {
    position: relative;
}

.stack > * + * {
    margin-block-start: var(--layout__content-spacer);
}

.hero {
    position: relative;
    margin-bottom: var(--layout__hero-margin-bottom);
    width: 100%;
    height: var(--layout__hero-height);
    max-height: 800px;
    max-width: 2000px;
    background: linear-gradient(to bottom, transparent, transparent 75%, var(--color__theme-dark) 95%, var(--color__theme-dark));
}

.hero img:not(.wordmark) {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--layout__hero-image-position);
    z-index: -1;
}

.hero img.wordmark {
    position: absolute;
    top: var(--layout__hero-wordmark-top);
    left: 50%;
    width: unset;
    height: unset;
    transform: translateX(-50%);
    z-index: 1;
}

.hero + section {
    position: relative;
    z-index: 1;
}

h1, h2, h3 {
    font-family: var(--font__theme-main);
    text-wrap: balance;
}

h1 {
    font-size: var(--typography__h1-font-size);
    font-weight: 900;
    line-height: var(--typography__h1-line-height);
}

h2 {
    font-size: var(--typography__h2-font-size);
    font-weight: 700;
    line-height: var(--typography__h2-line-height);
}

h3 {
    font-size: var(--typography__h3-font-size);
    font-weight: 900;
    line-height: 1;
}

.text-container h3 + *,
.text-container h2 + * {
    margin-top: 1.5rem;
}

.text-container a {
    color: var(--color__theme-main);
}

p {
    font-family: var(--font__theme-main);
    font-size: var(--typography__p-font-size);
    font-weight: 300;
    line-height: var(--typography__p-line-height);
    text-wrap: balance;
}

footer p {
    font-size: var(--typography__p-small-font-size);
    line-height: var(--typography__p-small-line-height);
}

.visuallyhidden {
    position: absolute !important;
    height: 1px !important;
    width: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    word-wrap: normal !important;
}

a.cta,
button.cta {
    display: inline-block;
    padding: 14px 40px;
    font-family: var(--font__theme-main);
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 1.6px;
    text-decoration: none;
    border-radius: 99vmax;
    border: none;
    color: var(--color__theme-dark);
    background-color: var(--color__theme-main);
    cursor: pointer;

    transition: background-color .2s linear;
}

a.cta:hover,
button.cta:hover {
    background-color: var(--color__theme-main__fade);
}

a.cta__text,
button.cta__text {
    color: #fff;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1.25;
    display: block;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

ul {
    padding: 0;
    list-style-type: none;
}

ul li {
    font-size: var(--typography__li-font-size);
    font-weight: 700;
    line-height: var(--typography__li-line-height);
    text-wrap: balance;
}

ul:not(.glide__slides) li + li {
    margin-top: 1rem;
}

.p-section {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.pt-section {
    padding-top: 5rem;
}

/* minor tweaks to the glide.js styles */
.glide {
    position: relative;
}

.glide__slide > img {
    width: 100%;
}

.glide__slide:not(.glide__slide--active) {
    cursor: pointer;
}

div[data-glide-el="controls"] {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: var(--component__glide-controls-max-width);
}

div[data-glide-el="controls"] > button {
    background: none;
    width: 2.25rem;
    height: 2.25rem;
    border: .375rem solid #fff;
    border-top-width: 0;
    border-right-width: 0;
}

div[data-glide-el="controls"] > button:first-of-type {
    transform: rotate(45deg);
}

div[data-glide-el="controls"] > button:last-of-type {
    transform: rotate(225deg);
}

/*
 * N.B. using CSS custom properties in media queries is not supported. The 768px value used below corresponds 
 * to the '--bs-breakpoint-md' value
 *
 */
 @media screen and (max-width: 1200px) {
     :root {
        --layout__hero-height: 80vh;
        --layout__hero-margin-bottom: min(-4vh, -2rem);
        --layout__hero-wordmark-top: 2rem;
        
        --typography__h1-font-size: 3.5rem;
        --typography__h2-font-size: 1.8rem;
        --typography__h2-line-height: 1.2;
        --typography__h3-font-size: 2.5rem;
        --typography__p-font-size: 1.8rem;
        --typography__p-line-height: 1.25;
        --typography__p-small-font-size: .625rem;
        --typography__p-small-line-height: 1.5;
        --typography__li-font-size: 1.8rem;
        --typography__li-line-height: 1.14;
        
        --component__glide-controls-max-width: 100vw;
    }
    
    img.wordmark {
        max-width: 50%;
    }
}

@media screen and (max-width: 992px) {
    :root {
        --layout__hero-height: 80vh;
        --layout__hero-margin-bottom: min(-4vh, -2rem);
        --layout__hero-image-position: top;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --layout__hero-height: 66vh;
    }
    
    *[class*="container"]:not(.g-0) {
        --bs-gutter-x: calc(1.5rem + 2ch) !important;
    }
}

@media screen and (max-width: 576px) {
    :root {
        --layout__hero-margin-bottom: min(-4vh, -5rem);
        --typography__h1-font-size: 3rem;
    }
}
