/* BookClub visual identity: violet, citrus and a little bookish energy. */
:root {
    --ink: #29213f;
    --green: #6540d8;
    --paper: #f7f5ff;
    --line: #e6dff3;
    --muted: #70667f;
    --orange: #8c42ab;
}

body {
    background: radial-gradient(ellipse at 95% 0%, #e5dcff 0, transparent 40%),
        radial-gradient(ellipse at 0% 35%, #f1f7d9 0, transparent 35%), var(--paper);
    font-family: 'DM Sans', system-ui, sans-serif;
}

header {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 20px 26px;
    background: #ffffffed;
    border: 1px solid #e9e2f3;
    border-radius: 24px;
    box-shadow: 0 5px 25px #59438406;
}

.brand {
    color: #4d2baa;
    font-size: 29px;
    letter-spacing: -1.4px;
}

.brand-mark {
    display: inline-block;
    width: 29px;
    height: 29px;
    vertical-align: -5px;
    margin-right: 6px;
}

.brand span {
    color: #736582;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .3px;
    margin-top: 2px;
}

header nav {
    gap: 12px;
    font-weight: 600;
}

header nav>a:not(.button) {
    border-radius: 12px;
    padding: 9px 12px;
}

header nav>a:not(.button):hover {
    background: #f0eafa;
    color: #5730b8;
}

h1,
h2,
h3 {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -.7px;
}

h1 {
    letter-spacing: -1.7px;
}

h2 {
    font-size: 30px;
}

.section-title {
    margin-top: 42px;
    align-items: center;
    gap: 20px;
}

.section-title h2 {
    font-size: clamp(30px, 3.4vw, 44px);
    line-height: 1.12;
    max-width: 780px;
    margin: 8px 0 18px;
    letter-spacing: -1.5px;
}

.section-title>span {
    background: #e9e1fa;
    color: #5f3ca0;
    border-radius: 100px;
    padding: 7px 14px;
    white-space: nowrap;
    font-weight: 700;
}

.eyebrow {
    color: #8b49b3;
    letter-spacing: 1.7px;
    font-size: 11px;
    font-weight: 700;
}

button,
.button {
    border-radius: 13px;
    font-weight: 700;
    background: #6540d8;
    border-color: #6540d8;
    padding: 12px 20px;
    box-shadow: 0 3px 0 #45278b18;
    transition: background .15s, transform .15s;
}

button:hover,
.button:hover {
    filter: none;
    background: #5230bd;
    border-color: #5230bd;
    color: white;
    transform: translateY(-1px);
}

button:disabled {
    transform: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline-color: #a265f5;
}

.secondary {
    background: #f0eaff;
    border-color: #e2d5fa;
    color: #5734a7;
    box-shadow: none;
}

.plain {
    background: none;
    border: none;
    color: #6540d8;
    box-shadow: none;
}

.plain:hover {
    background: #f1ebfb;
    color: #5734a7;
}

.grid {
    gap: 25px;
}

.reading-card {
    border-radius: 24px;
    border: 1px solid #e9e2f3;
    box-shadow: 0 8px 24px #47285b08;
    transition: transform .18s, box-shadow .18s;
}

.reading-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 13px 30px #47285b13;
}

.reading-card-banner {
    height: 235px;
    background: #ddd1f5;
}

.reading-card-banner:after {
    background: linear-gradient(transparent 35%, #241234cc);
}

.banner-caption {
    left: 22px;
    bottom: 18px;
}

.banner-caption strong {
    display: inline-block;
    background: #e0f49a;
    color: #354224;
    padding: 4px 10px;
    border-radius: 8px;
    margin-bottom: 5px;
    font-size: 11px;
}

.banner-caption>span {
    font-size: 12px;
    font-weight: 500;
}

.banner-placeholder {
    color: #7355a3;
    background: linear-gradient(140deg, #e8d9fc, #d8edca);
}

.reading-card-body {
    padding: 23px;
}

.reading-card h3,
.book-grid .reading-card h3 {
    font-size: 23px;
    letter-spacing: -.6px;
    line-height: 1.25;
}

.card-host {
    color: #85758d;
    line-height: 1.55;
}

.card-host strong {
    color: #614681;
    font-weight: 600;
}

.card-description {
    color: #766b80;
}

.topic-pill {
    color: #7042a7;
    background: #f0e6fc;
    padding: 4px 12px;
    font-size: 11px;
}

.reading-card:nth-child(3n+2) .topic-pill {
    background: #ffe9dd;
    color: #994d32;
}

.reading-card:nth-child(3n+3) .topic-pill {
    background: #e9f0d7;
    color: #56692c;
}

.card-facts {
    color: #786d80;
}

.availability {
    background: #edf7d2;
    color: #4d6625;
    box-shadow: none;
    border-radius: 7px;
}

.availability.full {
    background: #f3e7ee;
    color: #7e576c;
}

.reading-card-actions {
    gap: 10px;
}

.reading-card-actions .button,
.reading-card-actions button {
    border-radius: 12px;
    min-height: 44px;
    font-weight: 700;
}

.reading-card-actions form button,
.reading-card-actions>a:not(.card-details) {
    background: #d7ef86;
    border-color: #d7ef86;
    color: #35421e;
    box-shadow: none;
}

.reading-card-actions form button:hover,
.reading-card-actions>a:not(.card-details):hover {
    background: #c8e76c;
    border-color: #c8e76c;
}

.card-details {
    color: #6540b1;
    border-color: #e1d7f0;
    box-shadow: none;
}

.reading-card-actions .request-state {
    background: #efeaf7;
    color: #7b6b94;
    border-color: #efeaf7;
}

.panel,
.search-panel {
    border: 1px solid #e7dff2;
    border-radius: 23px;
    box-shadow: 0 5px 24px #49306105;
}

#club-search {
    padding: 30px;
    background: #fff;
}

#club-search h2 {
    color: #523295;
    font-size: 29px;
    letter-spacing: -1px;
}

input,
select,
textarea {
    border-radius: 11px;
    border-color: #ded5e9;
    background: #fcfbff;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #9c79e8;
}

.genre-options {
    gap: 6px 16px;
}

.genre-options label {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 7px 9px;
    transition: background .15s;
}

.genre-options label:hover {
    background: #f7f2ff;
}

.genre-options label:has(input:checked) {
    background: #f0e8ff;
    border-color: #e4d4fc;
    color: #5c319c;
}

.genre-selector p {
    color: #8d8197;
}

.notice {
    border-radius: 12px;
    border-left-color: #9270d6;
    background: #efe9fa;
    color: #573c83;
}

.reading-timeline li {
    border-color: #d8c4f4;
}

.message {
    padding: 20px;
    margin-top: 14px;
    border: none;
    background: #f7f3fd;
    border-radius: 16px;
}

.message strong {
    color: #6540a7;
}

.message small {
    font-size: 11px;
}

#map {
    border-radius: 23px;
    border-color: #e1d6ee;
}

footer {
    margin-top: 24px;
    color: #91849b;
    border-color: #e5dbee;
}

@media(max-width:760px) {
    header {
        margin: 10px 12px 0;
        padding: 17px 18px;
        border-radius: 20px;
        gap: 12px;
    }

    header nav {
        gap: 4px;
        font-size: 12px;
    }

    header nav>a:not(.button) {
        padding: 7px 9px;
    }

    .brand {
        font-size: 27px;
    }

    .section-title {
        margin-top: 30px;
        gap: 12px;
    }

    .section-title h2 {
        font-size: 32px;
    }

    .section-title>span {
        font-size: 11px;
        padding: 6px 10px;
    }

    #club-search {
        padding: 22px 17px;
    }

    .reading-card-banner {
        height: 235px;
    }

    .reading-card-body {
        padding: 22px;
    }
}

@media(prefers-reduced-motion:reduce) {

    *,
    *:before,
    *:after {
        transition: none !important;
    }

    .reading-card:hover,
    button:hover,
    .button:hover {
        transform: none;
    }
}

.profile-avatar {
    width: 112px;
    height: 112px;
    object-fit: cover;
    border-radius: 50%;
    margin: 8px 0 20px
}

.club-portrait {
    width: 100%;
    max-width: 720px;
    max-height: 300px;
    object-fit: cover;
    border-radius: 22px;
    margin: 12px 0
}

.reading-card-body>.club-avatar {
    display: block;
    width: 42px;
    height: 42px;
    min-width: 42px;
    max-width: 42px;
    min-height: 42px;
    max-height: 42px;
    object-fit: cover;
    border-radius: 13px;
    margin: 0 0 12px;
    flex: none
}

.book-summary {
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 24px 0 30px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 26px
}

.book-summary>img {
    width: 120px;
    max-height: 190px;
    object-fit: contain;
    border-radius: 5px
}

.book-summary h2 {
    margin: 8px 0
}

.book-page {
    margin-top: 36px
}

#id_gender {
    display: flex;
    flex-wrap: wrap;
    gap: 12px
}

#id_gender label {
    display: flex;
    align-items: center;
    gap: 8px
}

#id_gender input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0
}

@media(max-width:540px) {
    .book-summary {
        gap: 16px;
        align-items: flex-start
    }

    .book-summary>img {
        width: 85px
    }

    .book-summary h2 {
        font-size: 22px
    }
}

.section-discussion {
    border: 1px solid #e1d7f0;
    border-radius: 14px;
    background: #fff;
    margin: 8px 0 16px;
    overflow: hidden
}

.section-discussion>summary {
    cursor: pointer;
    padding: 18px;
    font-weight: 700;
    color: #523295
}

.section-discussion>summary .muted {
    display: block;
    font-size: 13px;
    font-weight: 400;
    margin: 8px 0 0 19px
}

.section-discussion[open]>summary {
    border-bottom: 1px solid #e1d7f0;
    background: #f7f3fd
}

.section-chat {
    padding: 18px
}

.section-chat h2 {
    font-size: 21px
}

.discussion-messages {
    max-height: min(50lh, 65vh);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    overflow-wrap: anywhere;
    padding: 0 8px 0 0;
    scrollbar-gutter: stable
}

.discussion-messages:focus-visible,
.section-discussion>summary:focus-visible {
    outline: 3px solid #9270d6;
    outline-offset: 2px
}

.member-identity {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow-wrap: anywhere
}

.member-thumbnail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    min-height: 40px;
    max-height: 40px;
    object-fit: cover;
    border-radius: 12px;
    flex: none
}

.member-initial {
    background: #ede5fc;
    color: #6540d8;
    font-size: 18px;
    font-weight: 700
}

.member-profile-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 24px
}

.member-profile-heading h1 {
    margin: 0
}

.member-profile-heading .member-thumbnail {
    width: 80px;
    height: 80px;
    min-width: 80px;
    max-width: 80px;
    min-height: 80px;
    max-height: 80px;
    font-size: 32px
}

#club-members {
    scroll-margin-top: 24px
}

.member {
    gap: 12px;
    flex-wrap: wrap
}
