/*
 * Homilia — open-source book promotion website template
 * Original: https://github.com/DigitalMalayaliStudio/homilia
 * Copyright (c) 2024 Digital Malayali Studio
 * MIT License. TatePad-specific changes are in tatepad.css.
 */
*,
*:before,
*:after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    font: inherit;
}

html {
    font-size: 62.5%;
}

img {
    max-width: 100%;
    display: block;
}

h1,
h2,
h3,
h4 {
    text-wrap: balance;
    font-weight: 600;
}

:root {
    --primary-color: #180a09;
    --secondary-color: #fefbff;
    --tertiary-color: #db3332;
    --review-color: #ffdd81;
    --font-size: 1.6rem;
}

.color-primary {
    color: var(--primary-color);
}

.color-secondary {
    color: var(--secondary-color);
}

body {
    background-color: var(--secondary-color);
    font-family: Georgia, serif;
    font-size: var(--font-size);
    color: var(--primary-color);
    line-height: 1.5;
    position: relative;
}

a {
    text-decoration: none;
}

.container {
    max-width: 1140px;
    margin: 5rem auto;
}

.scroll-container {
    position: absolute;
    right: 3vw;
    top: 0;
    height: 100%;
}

.scroll-container:before {
    content: '';
    display: block;
    height: 100vh;
}

#scroll-to-top {
    display: block;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    position: sticky;
    top: 92vh;
    background-color: var(--tertiary-color);
    color: var(--secondary-color);
    font-size: x-large;
}

strong,
.bold {
    font-weight: 600;
}

.small {
    font-size: 1.3rem;
}

.tiny {
    font-size: 1rem;
}

.italic {
    font-style: italic;
}

h1 {
    font-size: 2.8rem;
}

h2 {
    font-size: 2rem;
}

h3,
.large {
    font-size: 1.8rem;
}

h4 {
    font-size: 1.7rem;
}

.text-center {
    text-align: center;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    margin: 0 5rem;
}

.logo {
    line-height: 1.2;
    padding-right: 1.5rem;
}

.menu a, .social-media a {
    color: var(--tertiary-color);
}

.social-media a:hover {
    color: var(--secondary-color);
}

.menu, .social-media {
    display: flex;
    list-style-type: none;
    gap: 1rem 4rem;
}

.social-media {
    margin-top: 1.2rem;
    column-gap: 1.3rem;
}

.link {
    color: var(--tertiary-color);
}

.menu a:hover,
.link:hover {
    color: var(--primary-color);
    text-decoration: underline wavy var(--tertiary-color);
    text-decoration-thickness: 0.15rem;
}

.overview {
    display: flex;
    align-items: center;
    margin: 5rem 13rem 0;
    gap: 7rem;
}

@keyframes bounce {
    from {
        transform: translateY(1%);
    }

    to {
        transform: translateY(-1%);
    }
}

.overview figure {
    width: 70rem;
    animation: bounce 1.8s infinite alternate;
}

.amazon-sample {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}

.amazon {
    display: block;
    position: relative;
    padding: 0.5rem 2.5rem;
    color: var(--secondary-color);
    background-color: var(--primary-color);
    border-radius: 1.5rem;
    width: fit-content;
    overflow: hidden;
}

@keyframes shine {
    0% {
        left: -2.5rem;
    }

    20%,
    100% {
        left: 17rem;
    }
}

.amazon::before {
    content: "";
    position: absolute;
    cursor: default;
    width: .8rem;
    height: 7rem;
    top: -.5rem;
    background-color: var(--secondary-color);
    transform: rotate(20deg);
    animation: shine 3s infinite ease-in-out;
}

.amazon:active {
    color: var(--primary-color);
}

#chapter {
    margin: 8vh 2rem;
}

#chapter hr {
    width: 5%;
    max-width: 25%;
}

.sample-container {
    max-width: 800px;
    margin: auto;
}

.sample-container h3,
.sample-container p {
    margin-bottom: 5rem;
}

.sample-container h4 {
    margin-bottom: 1rem;
}

.sample-container>p {
    max-width: 500px;
    margin-inline: auto;
    text-wrap: balance;
    position: relative;
}

.sample-container>p::before {
    content: '★';
    position: absolute;
    font-size: 3rem;
    left: calc(50% - 1.5rem);
    bottom: 100%;
}

.sample-container>p::after {
    content: '★';
    position: absolute;
    font-size: 3rem;
    left: calc(50% - 1.5rem);
    top: 100%;
}

.sample {
    text-align: justify;
}

.sample>p:not(:first-child) {
    text-indent: 2rem;
}

.sample>p:not(:last-child) {
    margin-bottom: 3rem;
}

.sample p:first-child::first-letter {
    font-size: 7rem;
    font-weight: bold;
    float: left;
    padding-right: 1rem;
    line-height: 1;
}

section {
    scroll-margin-top: 1rem;
    padding-inline: 2rem;
}

.section-title {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-block: 2rem;
}

hr {
    border-width: .2rem 0 0 0;
    border-style: solid;
    border-color: var(--primary-color);
    width: 35%;
}

.section-title h2 {
    border: .2rem solid var(--primary-color);
    padding: .3rem 2rem;
    border-radius: 5rem;
    margin: 0 2rem;
}

.book-details,
.contact-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 520px;
    margin: 0 auto;
}

.subtitle {
    margin-bottom: 1rem;
}

.author-details {
    margin: 1rem 0;
}

.author {
    display: flex;
    max-width: 520px;
    margin: 1rem auto 0 auto;
    gap: 5rem;
}

.bio {
    text-align: left;
}

.author-profile {
    float: left;
    width: 35%;
    margin-right: 2rem;
    shape-outside: circle(50%);
}

.author-profile img {
    border-radius: 50%;
}

.add-review {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reviews-block {
    --quantity: 6;
    --width: 30rem;
    --height: 58rem;
    --time: 40s;
    margin-inline: auto;
    mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 1) 80%, rgba(0, 0, 0, 0) 100%);
    overflow: hidden;
}

@keyframes slide {
    from {
        left: 100%;
    }

    to {
        left: -30rem;
    }
}

.review-row {
    position: relative;
    width: calc(var(--width) * var(--quantity));
    height: var(--height);
}

.review {
    cursor: pointer;
    width: var(--width);
    position: absolute;
    top: 8%;
    animation: slide var(--time) infinite linear;
    animation-delay: calc(var(--time) / var(--quantity) * var(--position) * -1);
}

.review-row:hover .review {
    animation-play-state: paused;
    filter: grayscale(1);
}

.review-row .review:hover {
    filter: grayscale(0);
}

.review-text {
    background-color: var(--review-color);
    padding: 2rem;
    border-radius: 2rem 2rem 0 0;
}

.quote {
    position: absolute;
    font-size: 10rem;
    line-height: 0;
    top: 3rem;
    left: 0;
}

.reviewer {
    border-radius: 50%;
    width: clamp(10rem, 40%, 100%);
    margin: -1rem auto;
}

.review figcaption {
    color: white;
    background-color: var(--tertiary-color);
    border-radius: 0 0 2rem 2rem;
    padding: 2rem;
}

.book-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 1rem;
    justify-content: center;
    max-width: calc(80% - 2rem);
    margin: auto;
}

.book-gallery img {
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center;
}

.book-gallery figure {
    cursor: pointer;
}

.book-gallery figure:nth-child(1) {
    grid-column: span 3;
}

.book-gallery figure:nth-child(1) img {
    aspect-ratio: auto;
}

.lightbox-item {
    display: none;
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    margin: auto;
    background-color: rgb(0, 0, 0);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.lightbox-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.lightbox-item figcaption {
    position: absolute;
    color: var(--secondary-color);
    background-color: rgb(0, 0, 0, .5);
    width: 100%;
    padding: 1rem;
    bottom: 0;
    text-align: center;
}

.lightbox-item:target {
    display: flex;
}

.close {
    display: flex;
    position: absolute;
    font-size: xx-large;
    background-color: var(--tertiary-color);
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    color: var(--secondary-color);
    text-align: center;
    text-decoration: none;
    top: 2vh;
    right: 2vw;
    justify-content: center;
    align-items: center;
}

.next {
    display: flex;
    position: absolute;
    font-size: xx-large;
    background-color: var(--tertiary-color);
    width: 4rem;
    height: 4rem;
    color: var(--secondary-color);
    text-align: center;
    text-decoration: none;
    top: 50vh;
    right: 2vw;
    justify-content: center;
    align-items: center;
}

.prev {
    display: flex;
    position: absolute;
    font-size: xx-large;
    background-color: var(--tertiary-color);
    width: 4rem;
    height: 4rem;
    color: var(--secondary-color);
    text-align: center;
    text-decoration: none;
    top: 50vh;
    left: 2vw;
    justify-content: center;
    align-items: center;
}

.contact-details h3 {
    margin: 1rem 0;
}

footer::before {
    content: "";
    display: block;
    background-image: url('assets/images/bg-wave.png');
    aspect-ratio: 960/68;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    margin-bottom: -.5rem;
}

.footer-container {
    background-color: var(--primary-color);
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding-bottom: 3rem;
}

.footer-container h4,
.copyright p:nth-child(1) {
    margin-bottom: 1rem;
}

.footer-logo {
    margin-top: 2rem;
    max-width: 15%;
}

.footer:not(.link) {
    --tertiary-color: #fadcd8;
}

.footer.menu a:hover {
    color: var(--secondary-color);
}

.footer.link {
    color: var(--secondary-color);
    text-decoration: underline wavy var(--tertiary-color);
    text-decoration-thickness: 0.10rem;
}

.footer.link:hover {
    text-decoration: none;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

@media only screen and (max-width: 1024px) {
    nav {
        flex-direction: column;
    }

    .menu {
        flex-wrap: wrap;
        justify-content: center;
        margin: 3rem 1.5rem;
    }

    #chapter {
        margin: 0 2rem;
    }

    .overview {
        flex-direction: column;
        gap: 5rem;
        margin: 2.5rem 0;
    }

    .overview figure {
        max-width: 35%;
        min-width: 25rem;
    }

    .brief p.large {
        text-align: center;
        max-width: 500px;
    }

    .amazon-sample {
        justify-content: center;
    }
}

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

    .overview {
        gap: 2rem;
        margin-top: 2rem;
    }

    .amazon-sample {
        flex-direction: column;
    }

    .book-details p {
        hyphens: auto;
    }

    .authors {
        flex-direction: column;
        max-width: 520px;
        gap: 2rem;
    }

    .bio h4 {
        text-align: center;
        margin: 1rem 0;
    }

    .bio p {
        text-align: justify;
        text-align-last: left;
        hyphens: auto;
    }

    .footer-container {
        flex-direction: column;
    }

    .footer-logo {
        text-align: center;
        max-width: 70%;
    }

    .social-media {
        justify-content: center;
    }

    .footer.menu {
        margin: 2rem;
    }

    .copyright {
        text-align: center;
    }
}
