
:root {
    font-family: 'Lato', sans-serif;
    font-size: 20px;
    line-height: 1.5;
    scroll-padding: 80px;

    --content-margins: min(2vw, 210px);
    --as-red: #AF1218;
}

h1, h2, h3, .subheader, dt {
    font-family: 'Montserrat', 'Lato', sans-serif;
    font-weight: normal;
    margin: 0;
}

h1 {
    font-weight: bold;
    font-size: clamp(60px, 10vw, 105px);
    margin-bottom: 79px;

    @media (width <= 992px) {
        text-align: center;
    }
}

h2 {
    font-size: clamp(40px, 5vw, 60px);
    color: black;
}

dl {
    text-align: left;
}

dt {
    font-size: 26px;
    margin-bottom: 25px;
}

dd {
    font-size: 16px;
    /* font-weight: 400; */
    margin-bottom: 15px;
    margin-left: 0;

    &.icon {
        align-items: center;
    }

    &.icon-location {
        align-items: start;
    }
}

button {
    cursor: pointer;
}

main {
    padding-top: 107px;
    margin-inline: var(--content-margins);
}

main h2 {
    margin-top: 88px;
}

nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: white;
    padding-block: 11px 10.88px;
    filter: drop-shadow(0 4px 10px rgb(0 0 0 / 0.15));

    @media (width <= 992px) {
        width: 100%;
        align-items: center;
        justify-content: center;
        display: flex;
    }
}

nav .mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 50px;
    aspect-ratio: 1 / 1;
    justify-content: space-evenly;
    flex-direction: column;
    margin-inline: auto 10px;
    z-index: 99999;

    & .hamburger, 
    &::before, 
    &::after {
        content: "";
        display: inline-block;
        border: solid black 1px;
        rotate: 0deg;
        transform-origin: center;
        transition:
            rotate 0.3s ease-out, 
            translate 0.3s ease-out 0.3s;
    }

    

    &[aria-expanded="true"] .hamburger, 
    &[aria-expanded="true"]::before, 
    &[aria-expanded="true"]::after {
        transition:
            rotate 0.3s ease-out 0.3s, 
            translate 0.3s ease-out;
    }

    &[aria-expanded="true"] .hamburger {
        rotate: 45deg;
    }

    &[aria-expanded="true"]::before {
        content: "";
        translate: 0 8px;
        rotate: -45deg;
    }

    &[aria-expanded="true"]::after {
        translate: 0 -8px;
        rotate: 45deg;
    }

    @media (width <= 992px) {
        display: flex;
    }
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 59px;

    padding: 0;
    margin: auto;
    list-style-type: none;

    @media (width <= 992px) {
        flex-direction: column;
        gap: 25px;
        align-items: center;
        justify-content: center;
        font-size: larger;
        background: white;
        position: absolute;
        top: 0;
        left: -200vw;
        height: 100vh;
        width: 100vw;
        transition: left 0.3s ease-out;

        &.open {
            left: 0;
        }
    }
}

nav a {
    display: grid;
    place-content: center;
    min-width: 44px;
    min-height: 44px;

    color: black;
    font-family: 'Montserrat', 'Lato', sans-serif;
    font-weight: 300;
    text-decoration: underline;
    text-decoration-skip-ink: none;
    text-decoration-color: transparent;
    text-underline-offset: 0px;
    transition: 
        text-decoration-color 0.3s ease, 
        text-underline-offset 0.3s ease;

    @media (width <= 992px) {
        font-size: larger;
    }
}

nav a:hover {
    text-underline-offset: 6px;
    text-decoration-color: black;
}

nav .logo {
    filter: brightness(0) saturate(100%) invert(0%) sepia(99%) saturate(0%) hue-rotate(78deg) brightness(94%) contrast(100%);
    width: 91.67px;
    height: 85.12px;
    margin: 0;

    @media (width <= 992px) {
        width: 29vw;
        height: auto;
    }
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: black;

    padding: 0;
    padding-top: 208px;

    background-image: linear-gradient(rgb(0 0 0 / 0.75), rgb(0 0 0 / 0.75)), url(https://as.sdsu.edu/bookclub/images/books_scatter.avif);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

header #intro {
    max-width: 576px;
    text-align: center;
    margin-bottom: 121px;
    padding-inline: 16px;

    & p {
        letter-spacing: 0.5px;
        line-height: 1.8;
        font-family: 'Roboto', 'Lato', sans-serif;
        font-weight: 400;
        font-size: clamp(16px, 2vw, 20px);
        line-height: 1.8 !important;
    }

    &.writers {
        max-width: 800px;
    }
}

section {
    width: 100%;
}

main > section:not(:first-of-type) {
    margin-top: 86px;
}

#meetings > div {
    max-width: 869px;
    margin: auto;
    padding-block: 66px;
    display: flex;
    flex-wrap: wrap;
    column-gap: 6px;
    font-family: 'Europa', 'Lato', sans-serif;
    font-weight: 300;
    padding-inline: 16px;

    @media (width <= 992px) {
        justify-content: center;
    }
}

#meetings dl {
    width: 352px;
}

#meetings dt {
    font-family: "Montserrat", var(--sans-serif);
    letter-spacing: 1.3px;
    text-box-edge: cap alphabetic;
    text-box-trim: trim-both;
    margin-bottom: 23px;
}

#meetings #joining-info {
    max-width: 471px;
}


footer {
    padding-inline: 16px;

    & > div {
        max-width: 1240px;
        margin: auto;
        justify-content: space-between;
    }

    & a {
        color: white;
        text-decoration: underline;
    }

    & dl {
        max-width: 296px;
    }

    & p {
        max-width: 404px;
    }

    & #meeting-footer {
        max-width: 676px;
        display: inline flex;
        column-gap: 97px;
        flex-wrap: wrap;
    }

    & .logo {
        width: min(19vw, 296px);
    }

    @media (width <= 992px) {
        & > div {
            flex-direction: column;
            align-items: center;
            text-align: center;
            gap: 40px;
        }

        & #meeting-footer {
            max-width: unset;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 25px;
        }

        & .logo {
            width: min(25vw, 296px);
        }
    }
}

.icon::before {
    content: "";
    font-family: "Font Awesome 7 Free", FontAwesome;
    font-weight: 100;
    min-width: 24.5px;
    margin-right: 11.5px;
    text-align: center;
}

.icon.icon-time::before {
    content: "\f017" / 'Time';
    font-size: 20.22px
}

.icon.icon-location::before {
    content: "\f3c5" / 'Location';
    font-size: 21.75px
}

.icon.icon-date::before {
    content: "\f133" / 'Date';
    font-size: 21.88px;
}

.icon.icon-goodreads::before {
    content: "\f3a9" / 'Goodreads Rating';
}

.icon.icon-amazon::before {
    content: "\f270" / 'Amazon Rating';
}

.icon.icon-page::before {
    content: "\f15b" / 'Page Count';
}

.icon.icon-audio::before {
    content: "\f025" / 'Audiobook Length';
}

.icon.btn-vote::before {
    font-family: FontAwesome;
    font-size: 29px;
}

.icon.icon-thumb-down::before {
    content: "\f165" / 'Thumb Down';
    color: var(--as-red);
}

.icon.icon-thumb-down { color: var(--as-red); }

.icon.icon-thumb-up::before {
    content: "\f164" / 'Thumb Up';
    color: green;
}

.icon.icon-thumb-up { color: green; }

.icon.solid::before {
    font-weight: 900;
    font-family: 'Font Awesome 7 Free';
}

.book-list {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    row-gap: 0;
    justify-content: space-around;
    padding-top: 23px;
    padding-bottom: 0;

    @media (width <= 992px) {
        display: block;
    }

    & li:nth-child(odd of .book-container-new) {
        border-right: solid black 1px;

        @media (width <= 992px) {
            border-right: none;
        }
    }

    & li:nth-last-child(-n + 2) {
        border-bottom: solid black 1px;
        padding: 45px 52px;
    }
}

.book-container-new {
    display: flex;
    flex-wrap: nowrap; 
    flex-basis: 50%;
    border-top: solid black 1px;
    padding: 52px 45px;
    height: stretch;
    height: -webkit-fill-available;

    @media (width <= 992px) {
        display: block;
        height: fit-content;
    }

    &:empty {
        width: stretch;
        width: -webkit-fill-available;
        max-width: 749.5px;
        border-bottom: 0;
    }

    & .date {
        text-align: left;
        color: var(--as-red);
        font-size: 26px;
        font-family: 'Montserrat', 'Lato', sans-serif;
        font-weight: 400;
        letter-spacing: 1.3px;
        text-box-edge: cap alphabetic;
        text-box-trim: trim-start;
        margin-block: 0;
    }

    & .cover {
        width: stretch;
        width: -webkit-fill-available;
        max-width: 255px;
        margin-bottom: 16px;
    }

    & .book-details {
        align-items: start;
        column-gap: 25px;
        width: stretch;
        width: -webkit-fill-available;
        align-content: start;
        flex-wrap: nowrap;

            @media (width < 1200px) {
            flex-wrap: wrap;
        }

    }

    & .author {
        font-size: 18px;
        font-family: 'Montserrat', sans-serif;
        font-weight: 400;
    }

    & .book-info {
        text-align: left;
        row-gap: 15px;
        max-width: 352px;
    }

    &:has(.rate) .book-info {
        max-width: 257px;

        @media (width < 1200px) {
            max-width: unset;
        }
    }

    & .book-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 15px;
        /* margin-block: 15px; */
        padding-block: 13px;
        border-block: 1px solid rgb(0 0 0 / 25%);
        font-family: 'Europa', 'Lato', sans-serif;
    }

    & .book-stats span {
        width: fit-content;
        text-align: left;
    }

    & .book-stats data, & output {
        width: unset;
        font-weight: 400;
        font-size: 14px;
    }

    & output {
        margin-left: 10px;
    }

    & .rating-label {
        margin-top: 15px;
    }

}


.book-title {
    font-size: 26px;
    font-family: 'Georgia Pro', 'Playfair Display', serif;
    font-weight: 700;
    font-style: normal;
    line-height: normal;
    margin-bottom: 5px;
    text-wrap: balance;

    @supports (text-wrap: pretty) {
        text-wrap: pretty;
    }
}

.book-details details summary .summary-action::after {
    content: '...';

}

#suggestions {
    font-family: 'Montserrat', 'Lato', sans-serif;

    & label {
        top: 2px;
    }

    & .form-field :is(input, textarea):where(:focus, :focus-within, :not(:placeholder-shown)) + label {
        top: -25px;
    }

    & .btn-submit {
        font-family: inherit;
    }
}

@supports (appearance: -apple-pay-button) { /* Safari-only styles */
    .cover {
        width: 100% !important;
    }
    .book-list {
        align-items: start;
    }

    #suggestions .book-container-new {
        min-height: fit-content;
    }
}

@supports (-moz-appearance: none) { /* Firefox-only styles */
    .book-list {
        align-items: start;
    }

    #suggestions .book-container-new {
        min-height: 597px;
    }
}

.book-container-new details {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;

    & summary, .readers-become-writers {
        color: black;
        list-style: none;
        font-family: 'Montserrat', 'Lato', sans-serif;
        font-weight: bold;
        font-weight: 700;
        font-size: 18px;
        cursor: pointer;
        width: fit-content;
        padding: 0;
        margin-top: 10px;
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    & .content {
        font-family: 'montserrat', var(--sans-serif);
        font-size: 16px;
        overflow: hidden;
    }

    &::details-content {
        content-visibility: visible;
        max-height: 120px;
        transition: max-height 600ms ease-out;
        overflow: clip;
    }

    &[open]::details-content {
        max-height: calc(var(--content-height) + 100px);
    }

    & .content {
        max-height: unset;
        transition: none;
    }

    &:not([open]) .content {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: unset;
        line-clamp: unset;
        animation: setClamp 100ms ease-out 650ms forwards;
    }
}

@keyframes setClamp {
    from { 
        -webkit-line-clamp: unset;
        line-clamp: unset;
    }
    to { 
        -webkit-line-clamp: 5;
        line-clamp: 5;
    }
}

.rate {
    width: stretch;
    width: -webkit-fill-available;
    max-width: 352px;

    @media (width < 1200px) {
        max-width: unset;
    }
}

.rater {
    --starsize: clamp(1rem, 2vw, 1.378rem);
}

    .readers-become-writers {
    color: black;
    font-family: 'Montserrat', 'Lato', sans-serif;
    font-weight: bold;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    width: fit-content;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.input-container {
    width: min(100%, 892px);
    overflow: hidden;
}

button.btn-submit.btn-vote {
    display: inline-block;
    width: fit-content;
    border: none;
    cursor: pointer;
    border-radius: 2px;

    &:is(:hover, :active, :focus, :focus-visible, :focus-within) {
        background-color: transparent;
        outline: solid black;
        outline-offset: -5px;
    }
}

.p-0 {
    padding: 0;
}

.m-0, .synopsis {
    margin: 0;
}

.bg-red {
    background-color: var(--as-red);
    color: white;
}

.text-white {
    color: white;
}

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

.text-red {
    color: var(--as-red);
}

#skipnav {
    transform: unset;
    max-height: 1px;
    overflow: hidden;

    &:focus-within {
        max-height: unset;
        z-index: 9999;
    }
}

div:has(.btn-toggle) {
    position: relative;
    max-width: 1500px;
    margin-inline: auto;
    text-align: center;
}

.btn {
    outline: solid black 2px;
    border: none;
    font-family: 'Montserrat', 'Lato', sans-serif;
    min-width: 210px;
    min-height: 44px;
    margin-top: 23px;
    display: grid;
    place-content: center;
    font-weight: normal;
    color: black;

    &:is(:hover, :focus, :active, :focus-visible, :focus-within) {
        background-color: black;
        color: white;
    }

    &:disabled {
        opacity: 50%;
        pointer-events: none;
        user-select: none;
        cursor: default;
    }
}

.btn.btn-suggestion:not(:disabled) {
    background-color: #AF1218;
    color: white;
}

ul.response:empty {
    display: none;
}

#completed li:has(.book-list):not(:first-child) {
    opacity: 0;
    translate: 0 250px;
    max-height: 0;
    overflow: hidden;
    transition:
        opacity 0.5s ease-out, 
        translate 0.5s ease-out, 
        max-height 0.5s ease-out;

    &.reveal {
        opacity: 1;
        max-height: 4500px;
        translate: 0 0;
    }
}

#completed li:has(.book-list):not(:first-child) .book-list {
    padding-top: 0;

    & .book-container-new:is(:first-child, :nth-child(2)) {
        border-top: none;
    }
}

#completed .book-list:not(:has(.book-container-new:nth-child(3))) .book-container-new {
    width: 100cqw;
}

.story-list {
    max-width: 800px;

    & .entry {
        width: 100%;
    }

    & .book-title {
        line-height: 1.5;
        text-box-edge: cap alphabetic;
        text-box-trim: trim-start;
    }

    & .writer-summary {
        --icon-size: 120px;
        padding-left: calc(var(--icon-size) + 25px);
        display: flex;
        align-items: center;
        justify-content: space-between;

        @media (width <= 768px) {
            --icon-size: 0px;
        }
    }

    & hgroup {
        margin-block: 1rem 0.5rem;

    }
}

.writer-summary::before {
    content: '';
    position: absolute;
    translate: 0 -50%;
    inset: 0;
    transform: none;
    height: auto;
    top: 50%;
    inline-size: var(--icon-size);
    background-image: url(https://as.sdsu.edu/bookclub/images/SVG/book-marker-closed.svg);
    background-repeat: no-repeat;
    background-size: 50%;
    background-position: center right;
}

.writer-summary:is(:hover, :focus-within) .writer-summary::before,
.story-list details[open] .writer-summary::before
{
    background-image: url(https://as.sdsu.edu/bookclub/images/SVG/book-marker-open.svg);
    background-size: auto;
}

.writer-summary::after {
    content: '';
    aspect-ratio: 1 / 1;
    width: 25px;
    background-color: transparent;
    border-width: 0 0 4px 4px;
    border-color: transparent transparent black black;
    border-style: solid;
    display: inline-block;
    rotate: -45deg;
    flex: 0 0 auto;
    transition: rotate 0.3s ease-out;
}

@media (width <= 768px) {
    .writer-summary::before {
        display: none;
    }
}


.writer-summary:is(:hover, :focus-within)::after,
details[open] .writer-summary::after {
    border-color: #AF1218;
}

details[open] .writer-summary::after {
    rotate: 135deg;
}

.smooth-open[open] + article {
    padding-top: unset
}

.smooth-open:is([open], :hover) .writer-summary {
    background: white;
    color: black;
}

.form-field {
    max-width: 75%;
    margin-inline: auto;
    position: relative;
}

@media (width <= 992px) {
    .book-list li:not(:first-child) {
        border: none;
        border-bottom: solid black 1px;
    }


    .book-list li:is(:first-child) {
        border-block: solid black 1px;
    }
}



#TEST_PAGE {
    /* TEST CODE WILL GO HERE WHEN UPDATES OCCURRING */
}