/**
 * The canonical work page at /book/<url_key>.
 *
 * Deliberately quieter than a PDP. This page is where a reader finds out what a book is
 * and which publisher's copy to buy; the buying itself happens one click away, so nothing
 * here competes with an Add to Cart button it does not have.
 */

.work-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

.work-breadcrumbs {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.work-breadcrumbs a {
    color: #6b7280;
    text-decoration: none;
}

.work-breadcrumbs a:hover {
    color: #b45309;
}

.work-dot {
    margin: 0 0.4rem;
    color: #d1d5db;
}

.work-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 768px) {
    .work-layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ---- Covers ---- */

.work-covers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.work-cover {
    display: block;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* The first cover is the one the work leads with, so it gets the whole width. */
.work-cover.is-lead {
    grid-column: 1 / -1;
}

.work-cover img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.work-cover__caption {
    display: block;
    padding: 0.3rem 0.45rem;
    font-size: 0.68rem;
    line-height: 1.3;
    color: #6b7280;
    background: #fff;
}

.work-cover.is-lead .work-cover__caption {
    font-size: 0.75rem;
}

.work-cover--more {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 2 / 3;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
}

/* ---- Titles and credits ---- */

.work-title {
    font-size: 1.65rem;
    line-height: 1.3;
    margin: 0 0 0.25rem;
    color: #111827;
}

.work-title-en {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: #6b7280;
}

.work-credits {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: #c9933e;
}

.work-credits a {
    color: inherit;
    text-decoration: none;
}

.work-credits a:hover {
    text-decoration: underline;
}

.work-role {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 0.25rem;
}

.work-rating {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.work-stars {
    color: #f59e0b;
    letter-spacing: 1px;
}

.work-score {
    font-weight: 600;
    color: #111827;
}

.work-review-count {
    font-size: 0.85rem;
    color: #6b7280;
}

.work-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.work-fact {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 0.75rem;
    color: #4b5563;
}

.work-fact--pd {
    background: #ecfdf5;
    color: #065f46;
}

.work-fact--in {
    background: #ecfdf5;
    color: #065f46;
}

.work-fact--out {
    background: #fef2f2;
    color: #991b1b;
}

.work-original {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.work-synopsis {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    color: #374151;
}

/* ---- Sections ---- */

.work-section {
    margin-bottom: 1.75rem;
    padding: 1rem 1.15rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.work-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

.work-section-count {
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 0.75rem;
    color: #6b7280;
}

.work-edition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.65rem;
}

.work-edition {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.85rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.work-edition:hover {
    border-color: #c9933e;
    background: #fffdf8;
}

.work-edition.is-out {
    opacity: 0.62;
}

.work-edition__publisher {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1f2937;
}

.work-edition__format,
.work-edition__stock {
    font-size: 0.72rem;
    color: #6b7280;
}

.work-edition__price {
    font-weight: 600;
    color: #b45309;
}

.work-editions--none p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Translations are a browsing choice between translators, not a buying choice between
   publishers, so this band is quieter than the editions band above it and has no
   selected state. */
.work-translation-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.work-translation {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    text-decoration: none;
    color: #374151;
    font-size: 0.85rem;
}

.work-translation:hover {
    border-color: #c9933e;
    color: #b45309;
}

.work-translation__meta {
    font-size: 0.72rem;
    color: #9ca3af;
}

/* ---- Write a review of the work ---- */

.work-review-form {
    margin-top: 1.5rem;
    padding: 1rem 1.15rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
}

.work-review-form__title {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

.work-review-form__notice {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    color: #92400e;
}

.work-review-form__row {
    margin-bottom: 0.65rem;
}

.work-review-form__row label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
    color: #4b5563;
}

.work-review-form__row input,
.work-review-form__row select,
.work-review-form__row textarea {
    width: 100%;
    max-width: 460px;
    padding: 0.4rem 0.55rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
}
