/* =========================================================
   SHARED COMPONENTS
   Reusable visual rules used by multiple Targin features.
   ========================================================= */

/* Shared grid foundations */

.bookGrid,
.landGrid {
    display: grid;
    grid-template-columns: repeat(3, 260px);
    justify-content: center;
    margin: 0 auto;
}

.characterGrid,
.codexGrid {
    display: grid;
    grid-template-columns: repeat(4, 220px);
    justify-content: center;
    max-width: 1100px;
    margin: 0 auto;
}


/* Shared card shells */

.bookCard,
.landCard,
.characterCard,
.codexCard {
    display: flex;
    flex-direction: column;
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 6px;

    background:
        linear-gradient(
            145deg,
            rgba(31, 42, 32, 0.96),
            rgba(13, 18, 14, 0.98)
        );
}

.bookCard,
.landCard {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.38);
}

.bookCard,
.landCard,
.characterCard {
    transition:
        transform 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.bookCard:hover,
.landCard:hover,
.characterCard:hover {
    transform: translateY(-6px);
    border-color: rgba(228, 201, 130, 0.65);
}

.bookCard:hover,
.landCard:hover {
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
}

.bookCardContent,
.landCardContent,
.characterCardContent,
.codexCardContent {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.bookCard h3,
.landCard h3,
.characterCard h3,
.codexCard h3 {
    color: var(--cream);
}

.landDescription,
.characterSummary {
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.bookCardContent .secondaryButton,
.landCard .secondaryButton,
.characterCard .secondaryButton,
.codexCard .secondaryButton {
    margin-top: auto;
    align-self: flex-start;
}

.landCard .secondaryButton,
.characterCard .secondaryButton {
    padding: 8px 14px;
    font-size: 0.78rem;
}


/* Shared section treatment */

.timelineSection,
.codexSection {
    background:
        radial-gradient(
            circle at center,
            rgba(73, 88, 68, 0.09),
            transparent 65%
        );
}


/* Shared modal sizing */

.landModalContent,
.timelineModalContent,
.codexModalContent {
    max-width: 760px;
}


/* Shared relationship/link rows */

#mapBookLinks,
#landCapitalLink,
#landCharacterLinks,
#landLocationLinks,
#landBookLinks,
.timelineConnections,
#characterBookLinks,
#characterLocationLinks,
#characterRelatedLinks,
#codexLandLinks,
#codexCharacterLinks,
#codexLocationLinks,
#codexBookLinks,
#bookCharacterLinks,
#bookLandLinks,
#bookLocationLinks,
#bookCodexLinks,
#bookTimelineLinks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.landConnections,
.timelineConnections,
.codexConnections {
    margin-top: 24px;
}


/* Shared relationship buttons */

.bookProfileLink,
.landConnectionButton,
.mapBookLink,
.characterConnectionButton,
.characterRelationButton {
    border: 1px solid rgba(201, 166, 91, 0.4);
    border-radius: 4px;
    cursor: pointer;
}

.bookProfileLink,
.landConnectionButton,
.mapBookLink,
.characterRelationButton {
    padding: 7px 11px;
    background: rgba(201, 166, 91, 0.07);
}

.bookProfileLink,
.landConnectionButton,
.mapBookLink {
    color: var(--gold-light);
    font-size: 0.8rem;
}

.bookProfileLink:hover,
.landConnectionButton:hover,
.mapBookLink:hover,
.characterConnectionButton:hover,
.characterRelationButton:hover {
    background: rgba(201, 166, 91, 0.16);
}

.bookProfileLink:hover,
.landConnectionButton:hover,
.mapBookLink:hover,
.characterRelationButton:hover {
    border-color: var(--gold-light);
}


/* Shared placeholder treatment */

.characterPortraitPlaceholder,
.codexImagePlaceholder,
.authorPhotoPlaceholder {
    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            145deg,
            #253328,
            #111912
        );
}


/* Shared modal image treatment */

.bookModalCover,
.codexModalImage,
.artModalImage {
    object-fit: contain;
    background: #080b09;
}

.bookModalCover,
.characterModalImage,
.codexModalImage {
    border: 1px solid var(--border);
}
