@font-face {
    font-family: 'Zodiak-Light';
    src: url('./Fonts/WEB/fonts/Zodiak-Light.ttf') format('truetype');
    font-weight: 300;
    font-display: swap;
    font-style: normal;
}

:root {
    --header-height: 10rem;
    font-family: "Zodiak-Light";
    font-size: .9rem;
}

* {
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}


body {
    display: grid;
    justify-self: center;
    min-height: 100vh;
    max-width: min(800px, 100%);
    grid-template-rows: auto 1fr auto;
    margin: 0;
    padding: 0;
    background-color: hsl(0, 0%, 99%);
}

a {
    text-decoration: none;
    padding: .5rem .25rem;
    color: grey;
}

p {
    margin-top: 0;
}

header {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    padding: 0 0 .5rem 0;
    margin: 0;
}

.header-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 12vh;
    padding: 0 1rem;
    border-left: 1px solid khaki;
    border-right: 1px solid khaki;
    border-image: linear-gradient(0deg, khaki, transparent) .9;
}
.header-text img {
    align-self: flex-end;
    height: clamp(2rem, 100%, 10vh);
}
.header-text div {
    display: flex;
    flex-flow: column;
    justify-content: center;
    align-items: flex-end;
}
.header-text h1 {
    font-size: calc(100vh / 30 );
    margin:  0;
    padding: .5rem 0;
    text-align: right;
    word-break: break-word;
    overflow-wrap: break-word;
}

nav {
    width: 100%;
    background-color: khaki;
    height: max-content;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}
nav ul {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    padding: 0;
    width: max-content;
}
nav ul li {
    position: relative;
    text-align: center;
    list-style-type: none;
    padding: 1rem .5rem;
    width: 7rem;
    cursor: pointer;
}
nav ul li:hover  {
    font-weight: bold;
}
nav ul .slider {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 7rem;
    height: 1px;
    background: black;
    z-index: -1;
    transition: transform 0.3s ease;
}

li:nth-child(1).active ~ .slider { transform: translateX(0); }
li:nth-child(2).active ~ .slider { transform: translateX(7rem); }
li:nth-child(3).active ~ .slider { transform: translateX(14rem); }

li:nth-child(1):hover ~ .slider { transform: translateX(0); }
li:nth-child(2):hover ~ .slider { transform: translateX(7rem); }
li:nth-child(3):hover ~ .slider { transform: translateX(14rem); }

#main-page {
    margin: 1rem 2rem;
}
#main-page article {
    display: grid;
    gap: 0 1rem;
    grid-template-columns: 5fr 1fr;
    grid-template-areas: 
        "text1 book"
        "text2 text2";
}
article h2 {
    margin: 0;
    padding: 1rem 0;
}
.book-wrapper {
    grid-area: book;
    height: auto;
    text-align: center;
}
.book-wrapper img {
    height: auto;
    max-height: 20rem;
    box-shadow: 4px 4px 10px 1px rgba(0,0,0,.5);
    border-radius: 4px;
}
.book-wrapper p  {
    margin-top: .5rem;
    font-size: smaller;
    font-style: italic;
    font-weight: bolder;
}
#main-page article div:last-of-type {
    grid-area: text2;
}

#list-of-trees {
    margin: 1rem 2rem;
}

table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    border: 1px solid gray;
    padding-bottom: 2rem;
}
.table-header {
    font-weight: bolder;
    text-align: center;
    background-color: lightgray;
    padding: 1.25rem 0;
    border: 1px solid gray;
    cursor: pointer;
}
table td {
    padding: .5rem .75rem;
    border: 1px solid gray;
}
table td:nth-of-type(3), td:nth-of-type(4) {
    text-align: center;
}

input:focus-visible {
    outline: none;
}

button {
    font: inherit;
    margin-block: .25rem 1rem;
    padding: .5rem 1rem;
    background-color: khaki;
    border: 1px solid gray;
    border-radius: .5rem;
    outline: none;
    cursor: pointer;
    transition: all .1s ease;
}

button:hover {
    filter: drop-shadow(4px 4px 4px rgba(0,0,0,.2));
}

#search-page {
    margin: 1rem 2rem;
}

#search-form {
    display: grid;
    justify-content: center;
}

#search-form div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#search-form label {
    width: 20%;
}

#search-form span {
    text-align: right;
}

#search-form input {
    margin: .5rem 0 .5rem 0rem;
    width: 80%;
    font: inherit;
}

#search-form button {
    justify-self: right;
    width: 80%;
}

footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1 0 100%;
    min-height: 4rem;
    max-height: 10vh;
    background-color: khaki;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

#btn-to-top {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    background-color: khaki;
    border: 1px solid gray;
    border-radius: .5rem;
    background-image: url(./img/up-arrow.svg);
    background-size: 1.25rem;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform .3s ease;
}

#btn-to-top:hover {
    filter: drop-shadow(4px 4px 4px rgba(0,0,0,.2));
    transform: translateY(-2px);
}

@media (max-width: 600px) {
    .header-text h1 {
        font-size: 1.5rem;
    }
    .book-wrapper {
        display: block;
        width: 100%;
    }
    #main-page article {
        grid-template-columns: 1fr;
        grid-template-areas:
            "text1"
            "book"
            "text2";
    }
    table td:nth-of-type(4), th:nth-child(4) {
        display: none;
    }
}