/* CPIVH Style Sheet */

@font-face {
    font-family: "baskerville";
    font-weight: 100 500 1000;
    src:
        url("../assets/fonts/librebaskerville-variablefont_wght-webfont.woff2")
            format("woff2"),
        url("../assets/fonts/librebaskerville-variablefont_wght-webfont.woff")
            format("woff2");
    font-display: swap;
}

@font-face {
    font-family: "d-din-bold";
    font-weight: 800;
    src:
        url("../assets/fonts/d-dincondensed-bold-webfont.woff2") format("woff2"),
        url("../assets/fonts/d-dincondensed-bold-webfont.woff") format("woff2");
    font-display: swap;
}

@font-face {
    font-family: "d-din";
    font-weight: 400;
    src:
        url("../assets/fonts/d-dincondensed-webfont.woff2") format("woff2"),
        url("../assets/fonts/d-dincondensed-webfont.woff") format("woff2");
    font-display: swap;
}
/*
# Font info:
- Original font TTF font files converted to WOFF(2) via fontsquirrel.com/tools/webfont-generator
- Fonts used have free commercial use licenses
- DIN alternative: DIN 1451 from https://fontsarena.com/blog/free-din-font-and-alternatives/
- Baskerville alternative: Libre Baskerville (variable) from Google Fonts
*/

:root {
    /* Brand base palette (fallback) */
    --blue: #00205c;
    --red: #c40d3c;
    --tan: #d6d2c4;
    --teal: #758892;
    --tapa:rgb(243, 242, 237);
    /* Brand base palette in Oklch for better color manipulation */
    --blue: oklch(0.2682 0.1139 260.72); /* #00205c */
    --red: oklch(0.5239 0.2046 17.29); /*#c40d3c*/
    --tan: oklch(0.894 0.0067 96.71); /*#d6d2c4*/
    --teal: oklch(0.615 0.0267 230.73); /*#758892*/

    /* Brand color scales (2 steps light 2 steps dark) */
    --blue-l1: oklch(from var(--blue) calc(l * 1.5) c h);
    --blue-l2: oklch(from var(--blue) calc(l * 2) c h);
    --blue-d1: oklch(from var(--blue) calc(l * 0.625) c h);
    --blue-d2: oklch(from var(--blue) calc(l * 0.25) c h);
    --red-l1: oklch(from var(--red) calc(l * 1.55) c h);
    --red-l2: oklch(from var(--red) calc(l * 1.75) c h);
    --red-d1: oklch(from var(--red) calc(l * 0.625) c h);
    --red-d2: oklch(from var(--red) calc(l * 0.3875) c h);
    --tan-l1: oklch(from var(--tan) calc(l * 1.0375) c h);
    --tan-l2: oklch(from var(--tan) calc(l * 1.08) c h);
    --tan-d1: oklch(from var(--tan) calc(l * 0.875) c h);
    --tan-d2: oklch(from var(--tan) calc(l * 0.75) c h);
    --teal-l1: oklch(from var(--teal) calc(l * 1.125) c h);
    --teal-l2: oklch(from var(--teal) calc(l * 1.25) c h);
    --teal-d1: oklch(from var(--teal) calc(l * 0.675) c h);
    --teal-d2: oklch(from var(--teal) calc(l * 0.5) c h);

    /* Ensure WCAG AA contrast */
    --text-on-light: oklch(0.3 0 0); /* L=0.3 for dark text */
    --text-on-dark: oklch(0.9 0 0); /* L=0.9 for light text */

    /* Consistent perceived brightness */
    --success: oklch(0.7 0.15 140); /* Green */
    --warning: oklch(74.841% 0.15241 89.106); /* Yellow */
    --error: oklch(0.7 0.15 30); /* Red */

    /* Layout units: Full */
    --u1: 8px;
    --u2: calc(var(--u1) * 2);
    --u3: calc(var(--u1) * 3);
    --u4: calc(var(--u1) * 4);
    --u5: calc(var(--u1) * 5);
    --u6: calc(var(--u1) * 6);
    --u7: calc(var(--u1) * 7);
    --u8: calc(var(--u1) * 8);
    --u9: calc(var(--u1) * 9);
    --u10: calc(var(--u1) * 10);
    /* Layout units: Fractional */
    --uf2: calc(var(--u1) / 2);
    --uf4: calc(var(--u1) / 4);

    /* Standard font sizing based on defined units */
    font-size: 14px;
    line-height: var(--u3);
}

@media (prefers-color-scheme: dark) {
    :root {
        background-color: var(--blue-d2);
        color: var(--text-on-dark);
    }
}
@media (prefers-color-scheme: light) {
    :root {
        background-color: var(--tan-l2);
        /* background-color: #d5d2c4;
        background-color: var(--tan-d2); */
        color: var(--text-on-light);
    }
}

* {
    margin: 0;
    padding: 0;
    border: 0;
    box-sizing: border-box;
    vertical-align: baseline;
    font-size: 100%;
    font: inherit;
    font-family: "baskerville", "Georgia", "Times New Roman", serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--u9);
    background-color: var(--tan-l2);
    /* background-color: #d5d2c4;
    background-color: var(--tan-d2); */
}

/* Base layout (small screens at 320-480px) */
body {
    position: relative;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

body {
    background:
        linear-gradient(
            to right,
            rgba(243, 242, 237, 0.1) 0px,
            rgba(243, 242, 237, 1) 32px,
            rgba(243, 242, 237, 1) calc(100% - 32px),
            rgba(243, 242, 237, 0.1) calc(100% - 0px)
        ),
        url("../img/bg-tapa-light-vertical-l.png"),
        url("../img/bg-tapa-light-vertical-r.png"),
        linear-gradient( to bottom, var(--tan-d2), var(--tan-d2));
    background-position:
        0 0,
        0 0,
        right 0,
        0 0;
    background-repeat: no-repeat, repeat-y, repeat-y, no-repeat;
    background-size:
        100% 100%,
        48px auto,
        48px auto, 
        100% 100%;
}

header,
main {
    width: 100%;
    /* min-width: 300px;
    max-width: 800px; */
    margin: 0 auto;
}

header, .home header {
    position: relative;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: var(--u2);
    padding: 0 0 var(--u3) 0;
    width: 100%;
    margin: 0 0;
    padding-bottom: var(--u6);
    background-image: 
        radial-gradient(
            ellipse at bottom,
            rgba(40, 39, 35, 0) 60%,
            rgba(40, 39, 35, 0.2) 85%,
            rgba(40, 39, 35, 0.4) 100%
        ),
        radial-gradient(
            ellipse at bottom,
            rgba(255, 255, 255, 0.5) 0%,
            rgba(255, 248, 215, 0.1) 55%,
            rgba(255, 248, 215, 0) 60%
        ),
        url("../img/bg-tapa-masthead-700-light.jpg");
    background-position: 
        0 0,
        0 0,
        center bottom;
    background-repeat: 
        no-repeat,
        no-repeat,
        repeat;
    background-size: 
        100% 100%,
        100% 100%,   
        auto 100%;
}

footer {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: var(--u2);
    width: 100%;
    min-width: 300px;
    margin: 0 auto;
    margin: 0 auto;
    padding: var(--u3);
    text-align: center;
    font-size: 0.75rem;
    line-height: 1rem;
}


main {
    position: relative;
    flex-grow: 1;
    max-width: 100%;
    margin: 0;
    padding: var(--u2) 0;
    /* padding-bottom: var(--u2); */
    background:
        linear-gradient(
            to bottom,
            rgba(40, 39, 35, 0.3) 0px,
            rgba(40, 39, 35, 0) 8px
        );
    background-repeat: repeat-x;
    background-size: 100% 32px;
    background-position: 0 0;
}

section {
    position: relative;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: var(--u2);
    min-width: 300px;
    max-width: 600px;
    margin: 0 auto;
    padding: var(--u3);
    text-align: center;
}

.content section, .content section * { text-align: left; }

h1,
h2,
h3,
h4,
h5,
h6,
[class^="btn-"] {
    font-family: "d-din-bold", "Arial Narrow", sans-serif;
    font-weight: 800;
    font-style: normal;
    letter-spacing: 0.0326em;
    line-height: 1em;
}

h1 {
    padding: 0 var(--u1);
    font-size: 3.5rem;
    /* line-height: var(--u5); */
    text-align: center;
    color: var(--blue);
    letter-spacing: 0;
}

.content h1 {
    color: #fff;
}

h2 {
    font-size: 1.75rem;
    line-height: var(--u4);
    color: var(--blue-d2);
}

h3 {
    font-size: 1.25rem;
    line-height: var(--u3);
    color: var(--blue-d1);
}

h4 {
    font-size: 1rem;
    line-height: var(--u2);
    color: var(--teal-d1);
}

p {
    font-size: 1rem;
    /* color: var(--blue-d2); */
    padding: 0 0 var(--u4) 0;
}

a:link {
    color: var(--blue);
    text-decoration: none;
}
a:hover {
    color: var(--blue-l1);
    text-decoration: underline;
}

a:has(img) {
    line-height: 1em;
}

a strong { font-weight: 1000; }

a[class^="btn-"] {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: var(--u1) var(--u2);
    border-radius: var(--u1);
    background-color: var(--blue);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1.25rem;
    font-weight: 400;
    text-align: center;
    text-decoration: none;
    transition-property: background-color;
    transition-duration: 0.25s;
}

a[class^="btn-"]:hover {
    background-color: var(--blue-l1);
    text-decoration: none;
    color: #fff;
}

.logo {
    width: 400px;
    height: auto;
}

.intro-text {
    font-size: 1.2rem;
}

p.links {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: space-around;
    gap: var(--u3);
    width: 100%;
}

/* p.links a {
    flex-basis: 50%;
    flex-grow: 0;
    flex-shrink: 2;
} */

p.links a img {
    max-width: 50%;
    min-width: 100px;
    height: auto;
}


ul.links {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

ul.links li {
    margin: 0;
    padding: 0;
    list-style: none;
    list-style-image: none;
    list-style-position: outside;
    list-style-type: none;
}

section.vcl {
    padding-top: var(--u8);
}

section.links.vcl {
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.social {
    justify-content: space-evenly;
}

section.va a {
    flex-basis: auto;
    flex-grow: 0;
    flex-shrink: 1;
}
.social a[class^="btn-"] {
    max-width: var(--u5);
    max-height: var(--u5);
    padding: 0px;
    flex-basis: var(--u5);
    flex-grow: 0;
    flex-shrink: 3;
    background-color: unset;
}

.social a img {
    width: 100%;
    height: auto;
    max-width: var(--u5);
    min-width: var(--u4);
    max-height: var(--u5);
    min-height: var(--u4);
    object-fit: cover;
}

.links a#vcl {
    border-radius: var(--u1);
    background-color: #fff;
    text-decoration: none;
}

section.links.vcl a img {
    max-width: 200px;
    min-width: 100px;
}

.btn-icon svg {
    flex-basis: 100%;
    flex-grow: 0;
    flex-shrink: 0;
    fill: var(--teal);
    transition: fill 0.25s;
}
.btn-icon:hover svg {
    fill: var(--teal-d1);
}

.btn-icon span {
    display: inline-block;
    visibility: hidden;
    width: 0;
    height: 0;
    overflow: hidden;
}


.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

section.promo {
    position: relative;
    margin: 0 24px;
    max-width: 100%;
    min-width: unset;
}

.promo > div {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    max-width: 100%;
    margin: 0 auto;
    gap: var(--u2);
    max-width: 640px;
    min-width: 300px;
}

.promo > div h2, .promo > div .actions {
    width: 100%;
    text-align: left;
    line-height: 1em;
}

.promo * { padding: 0;}

.promo .teaser {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-self: space-between;
    width: 75%;
    margin: 0;
    padding: 0;
}

.promo .teaser img svg {
    fill: var(--blue)
;}

.promo > div .actions a.btn-primary {
    margin: 0 auto;
}

.promo.heavy {
    background: 
        radial-gradient(
        ellipse at center,
        rgb(from var(--tapa) r g b / 0.95) 0%,
        rgb(from var(--tapa) r g b / 0.75) 25%,
        rgb(from var(--tapa) r g b / 0.45) 50%,
        rgb(from var(--tapa) r g b / 1) 90%
        ),
        linear-gradient(to bottom, 
        rgb(from var(--tapa) r g b / 1.0) 0%,
        rgb(from var(--tapa) r g b / 0.5) 10%,
        rgb(from var(--tapa) r g b / 0.5) 60%,
        rgb(from var(--tapa) r g b / 1.0) 100%
        ),
        url('../img/cpivh-bg-pattern-wave-tan.png'),
        linear-gradient(to bottom, var(--tapa) 0%,var(--tapa) 100%)
    ;
    background-repeat: no-repeat, no-repeat, repeat, no-repeat;
    background-position: top center, top center, bottom center, top center;
    background-size: 
        100% 100%,
        100% 100%,
        16px 16px,
        100% 100%;
}


.promo.heavy > div:after {
    position: absolute;
    top: 10%;
    left: 80%;
    z-index: 0;
    content: "";
    display: block;
    width: 240px;
    height: 240px;
    margin: 0;
    padding: 0;
    background:
        linear-gradient(45deg,  
        rgb(from var(--teal-l2) r g b / 0.5) 40%,
        rgb(from var(--blue-l1) r g b / 0.5) 100%); 
    ;
    -webkit-mask-image: url('/img/cpivh-pilot.svg');
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-image: url('/img/cpivh-icon-pilot.svg');
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}


/* End content page specific styles */

@media screen and (max-width: 480px) {

    body {
        background:
            linear-gradient(
                to right,
                rgba(243, 242, 237, 0.1) 0px,
                rgba(243, 242, 237, 1) 24px,
                rgba(243, 242, 237, 1) calc(100% - 24px),
                rgba(243, 242, 237, 0.1) calc(100% - 0px)
            ),
            url("../img/bg-tapa-light-vertical-l.png"),
            url("../img/bg-tapa-light-vertical-r.png"),
            linear-gradient( to bottom, var(--tan-d2), var(--tan-d2));
        background-position:
            0 0,
            0 0,
            right 0,
            0 0;
        background-repeat: no-repeat, repeat-y, repeat-y, no-repeat;
        background-size:
            100% 100%,
            32px auto,
            32px auto, 
            100% 100%;
    }

    .logo {
        width: 300px;
    }

    h1 {
        font-size: 3rem;
        /* line-height: 3rem; */
        padding: 0 var(--u2);
    }

    /* .links.cta {
        flex-direction: column;
    } */

    /* section.links.social {
        flex-wrap: wrap;
        justify-content: space-evenly;
        gap: var(--u4);
    } */

    .promo .teaser {
        width: 100%;
    }

    .promo .title { width: calc(100% - 72px); }

    section.promo.heavy {
        padding: var(--u4) 0;
    }

    .promo.heavy > div:after {
        top: 10px;
        left: 75%;
        width: 64px;
        height: 64px;
    }
}

@media screen and (min-width: 481px) and (max-width: 768px) {
    
    .logo {
        width: 400px;
    }

    .links.cta {
        flex-direction: row;
    }

    /* section.links.social {
        flex-wrap: wrap;
        justify-content: space-evenly;
        gap: var(--u4);
    } */

    section.promo.heavy {
        padding: var(--u4) 0;
    }

    .promo .title { width: calc(100% - 120px); }

    .promo .teaser {
        width: 100%;
    }

    .promo.heavy {
        background: 
            radial-gradient(
            ellipse at center,
            rgb(from var(--tapa) r g b / 0.85) 0%,
            rgb(from var(--tapa) r g b / 0.5) 25%,
            rgb(from var(--tapa) r g b / 0.45) 50%,
            rgb(from var(--tapa) r g b / 1) 90%
            ),
            linear-gradient(to right, 
            rgb(from var(--tapa) r g b / 1.0) 0px,
            rgb(from var(--tapa) r g b / 0.5) 5%,
            rgb(from var(--tapa) r g b / 0.85) 40%,
            rgb(from var(--tapa) r g b / 0.85) 50%,
            rgb(from var(--tapa) r g b / 0.5) 95%,
            rgb(from var(--tapa) r g b / 1.0) 100%
            ),
            url('../img/cpivh-bg-pattern-wave-tan.png'),
            linear-gradient(to bottom, var(--tapa) 0%,var(--tapa) 100%)
        ;
        background-repeat: no-repeat, no-repeat, repeat, no-repeat;
        background-position: top center, top center, bottom center, top center;
        background-size: 
            100% 100%,
            100% 100%,
            16px 16px,
            100% 100%;
    }

    .promo.heavy > div:after {
        top: -20px;
        left: 80%;
        width: 80px;
        height: 80px;
    }

    
}

@media screen and (min-width: 769px) {

    /* body {
        background:
            linear-gradient(
                to right,
                rgba(243, 242, 237, 0.1) 0px,
                rgba(243, 242, 237, 1) 32px,
                rgba(243, 242, 237, 1) calc(100% - 32px),
                rgba(243, 242, 237, 0.1) calc(100% - 0px)
            ),
            url("../img/bg-tapa-light-vertical-l.png"),
            url("../img/bg-tapa-light-vertical-r.png"),
            linear-gradient( to bottom, var(--tan-d2), var(--tan-d2));
        background-position:
            0 0,
            0 0,
            right 0,
            0 0;
        background-repeat: no-repeat, repeat-y, repeat-y, no-repeat;
        background-size:
            100% 100%,
            60px auto,
            60px auto,
            100% 100%; 
    } */

    

}

/* @media screen and (min-width: 1025px) {

} */

@media (prefers-reduced-data: reduce) {
    /* Styles for users who prefer reduced data usage (e.g., hide high-res images, disable video autoplay) */

    body {
        background: unset;
        background-color: var(--tan-l2);
    }

    header {
        background-image: unset;
        background-color: var(--tan-l1);
    }

}


