*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-image: linear-gradient(
    rgba(0, 35, 38, 0.55),
    rgba(0, 35, 38, 0.55)
), url("../images/night_storefront.jpg");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
    color: #F4E9D6;
    font-family: "Manrope", sans-serif;
    min-height: 100vh;
display: flex;
flex-direction: column;
}

a {color: #F4E9D6;
}
a:visited {
    color: #B8E6C1;
}
a:hover {
    color: #FFD1DC;
}

img {
    display: block;
    margin: 0 auto;
}

h1 {
    font-family: "Story Script", cursive;
    text-align: center;
}

h2 {
    font-family: "Averia Serif Libre", serif;
    text-align: center;
}

p {
    text-align: center;
    color: #FFD1DC
}

.book-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    justify-content: safe center;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.book-carousel a {
    flex-shrink: 0;
}

.book-carousel img {
    width: 180px;
    height: 270px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.book-carousel a:hover img,
.book-carousel a:focus-visible img {
    transform: scale(1.08);
}

.carousel-wrapper {
    position: relative;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    left: max(20px, calc((100% - 950px) / 2));
    right: max(20px, calc((100% - 950px) / 2));
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2;
}

.carousel-controls button {
    pointer-events: auto;
}

.carousel-controls button {
    pointer-events: auto;
    background-color: #F4E9D6;
    color: #016367;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.85;
    transition: all 0.3s ease;
}

.carousel-controls button:hover {
    background-color: #FFD1DC;
    opacity: 1;
    transform: scale(1.1);
}

.book-carousel {
    scrollbar-width: none;
}

.book-carousel::-webkit-scrollbar {
    display: none;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.nav-left,
.nav-right {
    display: flex;
    gap: 30px;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    font-family: "Manrope", sans-serif;
    font-weight: 600;
    font-size: 16px;
   transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}
.main-nav a:hover {
    color: #FFD1DC;
    transform: scale(1.08);
}

.about-story {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    text-align: center;
    line-height: 1.8;
}

.about-story p {
    margin-bottom: 20px;
}

.storefront-image {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

.storefront-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

.storefront-image figcaption {
    text-align: center;
    font-family: "Manrope", sans-serif;
    font-style: italic;
    font-size: 14px;
    color: #F4E9D6;
    margin-top: 12px;
}

.contact-info address {text-align: center;}

.store-hours {
    text-align: center;
    margin: 40px auto;
    padding: 20px;
}

.contact-email {
    text-align: center;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

.contact-social {
    text-align: center;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 20px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.social-links img {
    width: 24px;
    height: 24px;
    margin: 0;
    filter: brightness(0) saturate(100%)
            invert(79%) sepia(18%)
            saturate(501%) hue-rotate(349deg)
            brightness(91%) contrast(87%);
    transition: filter 0.3s ease;
}


.site-footer {
    margin-top: auto;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid #FFD1DC;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Decorative Floating Border */
body::before {
    content: "";
    position: fixed;
    top: 15px;
    bottom: 15px;
    left: 15px;
    right: 15px;
    border: 2px solid #F4E9D6;
    border-radius: 8px;
    pointer-events: none;
    z-index: 1000;
}

@media (max-width: 768px) {

    .main-nav {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .main-nav img {
        width: 220px;
        max-width: 100%;
        height: auto;
        order: -1;
    }

    .nav-left,
    .nav-right {
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px;
    }

    body::before {
    top: 8px;
    bottom: 8px;
    left: 8px;
    right: 8px;
    border-width: 1px;
}
}


/* BOOK MATCHMAKER */

.book-quiz {
    max-width: 800px;
    margin: 50px auto;
    padding: 30px;
    text-align: center;
}

.quiz-container {
    margin-top: 30px;
    padding: 30px;
    background-color: rgba(15, 45, 43, 0.9);
    border: 2px solid #F4E9D6;
    border-radius: 15px;
}


.quiz-question h2 {
    color: #FFD1DC;
    margin-bottom: 25px;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.quiz-options button {
    background-color: transparent;
    color: #F4E9D6;
    border: 2px solid #F4E9D6;
    border-radius: 10px;
    padding: 18px;
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-options button:hover {
    background-color: #F4E9D6;
    color: #183E3B;
    transform: translateY(-3px);
}


.quiz-options button.selected,
.quiz-options button.selected:hover {
    background-color: #FFD1DC;
    color: #183E3B;
    border-color: #FFD1DC;
}


.quiz-options button:focus-visible {
    outline: 3px solid #FFD1DC;
    outline-offset: 3px;
}


#next-question {
    margin-top: 25px;
    padding: 12px 30px;
    background-color: #FFD1DC;
    color: #183E3B;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#next-question:hover:not(:disabled) {
    background-color: #D2B48C;
    transform: translateY(-3px);
}

#next-question:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#answer-summary {
    white-space: pre-line;
}

#quiz-results {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 600px;
    margin: 30px auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: #2b1d2e;
}

#recommended-title {
    font-size: 2rem;
    font-weight: 700;
    color: #5c294a;
    margin: 20px 0 10px;
    line-height: 1.3;
}

#recommended-author {
    font-size: 1.1rem;
    font-style: italic;
    color: #7a526b;
    margin: 5px 0 20px;
}

#recommended-genre {
    display: inline-block;
    background-color: #f3e4ed;
    color: #5c294a;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 10px 0 20px;
}

#restart-quiz {
    background-color: #5c294a;
    color: #fff8ed;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 25px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#restart-quiz:hover {
    background-color: #7a526b;
    transform: translateY(-2px);
}

#restart-quiz:focus-visible {
    outline: 3px solid #7a526b;
    outline-offset: 3px;
}