/* =====================================================
   Author profiles / author blogs
   ===================================================== */

/* Authors directory header / toolbar */

.authors-dir-header {
    display: grid;
    gap: 1.15rem;
    margin-bottom: 1.35rem;
}

.authors-dir-intro {
    text-align: center;
    max-width: 760px;
    margin-inline: auto;
}

.authors-dir-intro h1 {
    margin: 0;
    font-size: clamp(1.85rem, 3vw, 2.45rem);
    line-height: 1.1;
}

.authors-dir-subtitle {
    margin: 0.55rem 0 0;
    font-size: 1rem;
    line-height: 1.45;
}

.authors-dir-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
}

.authors-filter {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(130px, 180px) auto;
    gap: 0.6rem;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.authors-filter input[type="search"],
.authors-filter select {
    width: 100%;
    min-width: 0;
    padding: 0.55rem 0.75rem;
    box-sizing: border-box;
    border: 1px solid rgba(30, 143, 190, 0.22);
    border-radius: 10px;
    color: #1f2933;
    background-color: rgba(255, 255, 255, 0.95);
}

.authors-filter input[type="search"]:focus,
.authors-filter select:focus {
    outline: none;
    border-color: rgba(30, 143, 190, 0.65);
    box-shadow: 0 0 0 3px rgba(30, 143, 190, 0.12);
}

.authors-filter button,
.authors-apply-btn {
    min-height: 42px;
    white-space: nowrap;
}

.authors-dir-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.authors-apply-btn {
    padding-inline: 1rem;
    text-align: center;
    justify-content: center;
}


@media (max-width: 1100px) {
    .authors-dir-toolbar {
        grid-template-columns: 1fr;
    }

    .authors-dir-actions {
        justify-content: stretch;
        width: 100%;
    }

    .authors-apply-btn {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .authors-filter {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .authors-filter input[type="search"] {
        grid-column: 1 / -1;
    }

    .authors-filter select {
        min-width: 0;
    }

    .authors-filter button {
        justify-content: center;
    }
}

@media (max-width: 520px) {
    .authors-filter {
        grid-template-columns: 1fr;
    }

    .authors-filter button,
    .authors-apply-btn {
        width: 100%;
        justify-content: center;
    }
}


.author-card .user-card-link {
    align-items: flex-start;
}

.author-avatar img,
.author-photo {
    object-fit: cover;
    object-position: center;
}

.author-short-bio {
    margin: 0.45rem 0 0;
    line-height: 1.45;
}

.author-stats {
    margin-bottom: 0.35rem;
}

.author-detail-page .bd-title-wrap {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.author-photo-card .bd-cover {
    aspect-ratio: 3 / 4;
    width: 100%;
    border-radius: 18px;
}

.author-actions-card {
    display: grid;
    gap: 0.75rem;
}

.author-rating-summary {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.author-fans-summary {
    font-size: 0.95rem;
}

.author-action-form {
    margin: 0;
}

.author-action-form .btn,
.author-actions-card > .btn,
.author-owner-actions .btn {
    width: 100%;
    justify-content: center;
}

.author-owner-actions {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.35rem;
}

.author-linked-books-card {
    display: grid;
    gap: 0.75rem;
}

.author-books-list {
    display: grid;
    gap: 0.65rem;
}

.author-book-link {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 0.65rem;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 0.45rem;
    border-radius: 12px;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.author-book-link:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-1px);
}

.author-book-link img {
    width: 44px;
    height: 62px;
    object-fit: cover;
    border-radius: 8px;
}

.author-mini-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.author-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.author-posts-list {
    display: grid;
    gap: 1rem;
}

.author-post-card {
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.09);
}

.author-post-card-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.author-post-card--with-image .author-post-card-inner {
    grid-template-columns: minmax(0, 1fr) 132px;
}

.author-post-content {
    min-width: 0;
}

.author-post-read-more {
    margin-top: 0.35rem;
}

.author-post-thumb-link {
    display: block;
    width: 132px;
    height: 96px;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.author-post-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.18s ease;
}

.author-post-thumb-link:hover .author-post-thumb {
    transform: scale(1.04);
}

.author-post-card h3 {
    margin: 0.35rem 0 0.45rem;
}

.author-post-card h3 a {
    color: inherit;
    text-decoration: none;
}

.author-post-card h3 a:hover {
    text-decoration: underline;
}

.author-post-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin: 0.2rem 0;
}

.author-post-kind {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    font-size: 0.82rem;
    background: rgba(255,255,255,0.10);
}

.author-ratings-section .review-body {
    margin-top: 0.55rem;
}

/* =====================================================
   Authors forms
   ===================================================== */

.authors-form-page,
.authors-post-page {
    padding-block: clamp(1.5rem, 4vw, 3.5rem);
}

.authors-form-card,
.authors-post-detail {
    max-width: 920px;
    margin-inline: auto;
    padding: clamp(1.15rem, 2.5vw, 2rem);
}

.authors-form-card {
    border: 1px solid var(--primary);
}

.authors-form-intro {
    text-align: center;
    max-width: 760px;
    margin-inline: auto;
    margin-bottom: 1.35rem;
}

.authors-form-intro h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1.08;
}

.authors-form-intro .text-dim {
    margin: 0.75rem 0 0;
    line-height: 1.55;
}

.authors-form {
    display: grid;
    gap: 1.15rem;
}

.authors-form-field {
    display: grid;
    gap: 0.42rem;
}

.authors-form-field label {
    font-weight: 700;
    color: #2b2b2b;
}

.authors-form input[type="text"],
.authors-form input[type="url"],
.authors-form input[type="datetime-local"],
.authors-form input[type="file"],
.authors-form textarea,
.authors-form select,
.authors-form .form-control {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid var(--primary);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.96);
    color: #1f2933;
    font: inherit;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.authors-form input[type="text"],
.authors-form input[type="datetime-local"],
.authors-form input[type="file"],
.authors-form select,
.authors-form .form-control {
    min-height: 44px;
    padding: 0.65rem 0.8rem;
}

.authors-form textarea {
    min-height: 170px;
    padding: 0.8rem;
    resize: vertical;
    line-height: 1.55;
}

.authors-form input[type="text"]:focus,
.authors-form input[type="url"]:focus,
.authors-form input[type="datetime-local"]:focus,
.authors-form input[type="file"]:focus,
.authors-form textarea:focus,
.authors-form select:focus,
.authors-form .form-control:focus {
    outline: none;
    border-color: rgba(30, 143, 190, 0.72);
    box-shadow: 0 0 0 3px rgba(30, 143, 190, 0.13);
    background-color: #ffffff;
}

.authors-form input::placeholder,
.authors-form textarea::placeholder {
    color: rgba(31, 41, 51, 0.56);
}

.authors-form-help {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.4;
}

.authors-form-errors {
    display: grid;
    gap: 0.25rem;
    color: #b42318;
    font-size: 0.92rem;
}

.authors-form-errors p {
    margin: 0;
}

.authors-form-errors-global {
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(180, 35, 24, 0.28);
    background-color: rgba(180, 35, 24, 0.08);
}

.authors-form-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.2rem;
}

.authors-submit-btn {
    min-width: min(100%, 260px);
    min-height: 44px;
    justify-content: center;
    font-weight: 700;
}

.author-application-status {
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--primary);
    background: rgba(30, 143, 190, 0.07);
    margin: 1rem 0;
}

.author-application-status p {
    margin: 0.6rem 0 0;
}

.authors-form-note {
    text-align: center;
    line-height: 1.55;
}

.author-rating-card {
    max-width: 760px;
}

.author-stars-field {
    justify-items: center;
    text-align: center;
}

.author-star-rating {
    display: inline-flex;
    gap: 0.18rem;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.15rem;
}

.author-star {
    position: relative;
    display: inline-block;
    width: 2.25rem;
    height: 2.25rem;
    line-height: 2.25rem;
    font-size: 2.15rem;
}

.author-star-empty,
.author-star-fill {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
}

.author-star-empty {
    color: rgba(43, 43, 43, 0.22);
}

.author-star-fill {
    width: 0;
    overflow: hidden;
    color: #f5b301;
    transition: width 0.14s ease;
}

.author-star-hit {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.author-star-hit-left {
    left: 0;
}

.author-star-hit-right {
    right: 0;
}

.author-star-hit:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 999px;
}

.author-rating-current {
    color: #6b7280;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.author-rating-actions {
    gap: 0.75rem;
    flex-wrap: wrap;
}

.author-rating-actions .btn {
    min-width: min(100%, 220px);
    justify-content: center;
}

.author-application-status {
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.07);
    margin: 1rem 0;
}

.authors-post-detail h1 {
    margin-top: 0.6rem;
}

.author-post-detail-image {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 18px;
    margin: 1rem 0;
}

.author-event-box {
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.07);
    margin: 1rem 0;
}

.author-post-body {
    line-height: 1.7;
}

.author-link-to-profile {
    text-decoration: none;
    font-weight: 700;
}

.author-link-to-profile:hover {
    text-decoration: underline;
}

@media (max-width: 980px) {
    .author-photo-card .bd-cover {
        max-width: 320px;
        margin-inline: auto;
    }

    .author-actions-card > .btn,
    .author-action-form .btn,
    .author-owner-actions .btn {
        width: auto;
    }
}

@media (max-width: 640px) {
    .author-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .authors-dir-actions {
        width: 100%;
    }

    .authors-dir-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .author-post-card--with-image .author-post-card-inner {
        grid-template-columns: 1fr;
    }

    .author-post-thumb-link {
        width: 100%;
        height: 180px;
        order: -1;
    }
}

.book-detail .bd-card + .bd-card {
    margin-top: 8px;
}

.author-profile-url {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    align-items: center;
    margin-top: 0.75rem;
    line-height: 1.45;
}

.author-profile-url-label {
    font-weight: 700;
    color: #2b2b2b;
}

.author-profile-url-link {
    overflow-wrap: anywhere;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.author-profile-url-link:hover {
    text-decoration: underline;
}

.author-bio-text {
    line-height: 1.7;
}

.author-bio-toggle {
    margin-top: 0.75rem;
    width: fit-content;
}

.author-bio-toggle:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.author-avatar-presence,
.author-photo-presence {
    display: block;
    position: relative;
    width: 100%;
}

.author-avatar-presence img,
.author-photo-presence img {
    display: block;
}
