/* Bestiary styles. Edit each selector here instead of adding overrides. */

/* ===== PAGE AND HEADING ===== */

.bestiary-page {
    min-height: 100vh;
    background-image: url("images/backgrounds/magic-hero.png");
    background-size: 100% auto;
    background-repeat: repeat-y;
    background-position: top center;
    padding: 70px 0 120px;
}

.bestiary-intro {
    text-align: center;
    margin-bottom: 45px;
}

.bestiary-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
}

.bestiary-heading span {
    width: 110px;
    height: 1px;
    background: rgba(216,178,110,.45);
}

.bestiary-heading h2 {
    margin: 0;
    color: #d8b26e;
    font-size: 46px;
    font-weight: 400;
    letter-spacing: 7px;
}

.bestiary-intro p {
    margin: 14px 0 0;
    color: #c7b995;
    font-size: 16px;
    letter-spacing: 1px;
}

.bestiary-grid {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 28px;
    padding: 0 30px;
}


/* ===== CARDS, PHOTOS AND GOLD FRAME ===== */

.creature-card {
    position: relative;
    height: 470px;
    background: transparent;
    overflow: visible;
    transition: .3s ease;
    cursor: pointer;
}

.creature-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    transition: filter 0.25s ease;
}

.creature-image {
    height: 312px;
    margin: 18px 10px 0;
    overflow: hidden;
    clip-path: polygon( 28px 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 0 100%, 0 28px );
}

.creature-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    box-sizing: border-box;
    padding: 8px;
}

.creature-info {
    position: absolute;
    text-align: center;
    z-index: 20;
    top: 71%;
    bottom: auto;
    left: 18px;
    right: 18px;
    padding: 0 6px;
}

.creature-info h3 {
    position: relative;
    z-index: 20;
    color: #e7c98b;
    font-weight: 400;
    letter-spacing: 3px;
    font-size: 20px;
    line-height: 1.1;
    min-height: 2.2em;
    margin: 0 0 4px;
}

.creature-info p {
    position: relative;
    z-index: 20;
}

.creature-type {
    margin: 0 0 12px;
    color: #c9a55f;
    font-size: 14px;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.creature-description {
    color: #c7bda8;
    font-size: 13px;
    max-width: 210px;
    width: 90%;
    margin: 0 auto;
    line-height: 1.25;
    display: none;
}

.creature-card:hover {
    box-shadow: none;
}

.creature-image img[alt="Sparkling Glintari"] {
    object-position: 80% center;
}

.creature-image img[alt="Translucent Slime"] {
    object-position: 80% center;
}

.creature-image img[alt="Kaskar"] {
    object-position: 70% center;
}

.creature-image img[alt="Ink Dodgers"] {
    object-position: 70% center;
}

.creature-card::after {
    display: none;
}

.creature-card:hover .creature-frame {
    filter: brightness(1.2) drop-shadow(0 0 4px rgba(255, 205, 90, 0.8)) drop-shadow(0 0 10px rgba(255, 185, 50, 0.45));
}


/* ===== PARCHMENT AND OPEN STATE ===== */

.creature-lore {
    position: fixed;
    left: 50vw;
    top: 50vh;
    width: 950px;
    transform-origin: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.creature-card.is-open .creature-lore {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    cursor: default;
    transform: translate(-50%, -50%);
}


/* ===== PARCHMENT TEXT AND CLOSE BUTTON ===== */

.lore-creature-sketch {
    position: absolute;
    left: 11%;
    top: 19%;
    right: 59%;
    width: 35%;
    height: 58%;
    object-fit: contain;
    object-position: center center;
    z-index: 3;
    display: none;
}

.lore-parchment {
    width: 100%;
    height: auto;
    display: block;
}

.lore-content {
    color: #2b1a0e;
    font-family: Georgia, serif;
    font-style: italic;
}

.lore-type {
    position: absolute;
    top: 13.7%;
    left: 12%;
    width: 34%;
    font-size: 22px;
    line-height: 1.2;
    text-align: center;
}

.lore-habitat {
    position: absolute;
    left: 60%;
    width: 29%;
    box-sizing: border-box;
    font-size: 12px;
    line-height: 1.15;
    height: auto;
    overflow: visible;
    overflow-wrap: break-word;
    top: 26%;
}

.lore-diet {
    position: absolute;
    left: 60%;
    width: 29%;
    box-sizing: border-box;
    font-size: 13px;
    line-height: 1.15;
    height: auto;
    overflow: visible;
    overflow-wrap: break-word;
    top: 39%;
}

.lore-traits {
    position: absolute;
    left: 60%;
    width: 29%;
    box-sizing: border-box;
    font-size: 12px;
    line-height: 1.15;
    height: auto;
    overflow: visible;
    overflow-wrap: break-word;
    top: 53%;
}

.lore-attacks {
    position: absolute;
    left: 60%;
    width: 29%;
    box-sizing: border-box;
    font-size: 13px;
    line-height: 1.15;
    height: auto;
    overflow: visible;
    overflow-wrap: break-word;
    top: 67%;
}

.lore-evolution {
    position: absolute;
    left: 60%;
    width: 29%;
    box-sizing: border-box;
    font-size: 12px;
    line-height: 1.15;
    height: auto;
    overflow: visible;
    overflow-wrap: break-word;
    top: 81%;
}

.lore-recorded {
    position: absolute;
    top: 80%;
    left: 22%;
    font-size: 12px;
}

.lore-date {
    position: absolute;
    top: 83%;
    left: 22%;
    font-size: 12px;
}

.lore-location {
    position: absolute;
    top: 86.6%;
    left: 22%;
    font-size: 12px;
}

.lore-close {
    position: absolute;
    top: 9%;
    right: 6%;
    width: 36px;
    height: 36px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid #76502b;
    border-radius: 50%;
    background: #e8c48b;
    color: #382313;
    font-family: Arial, sans-serif;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
}

.lore-close:hover {
    background: #f5dba9;
}

.lore-close:focus-visible {
    outline: 2px solid #382313;
    outline-offset: 3px;
}

.lore-class {
    position: absolute;
    top: 15.6%;
    font-size: 13px;
    line-height: 18px;
    left: 64%;
    width: 23%;
    text-align: left;
}

.lore-description {
    position: absolute;
    box-sizing: border-box;
    font-size: 13px;
    line-height: 1.3;
    overflow-y: auto;
    top: 31%;
    left: 12%;
    width: 34%;
    height: 29%;
}

.lore-notes {
    position: absolute;
    box-sizing: border-box;
    font-size: 12.4px;
    line-height: 1.3;
    overflow-y: auto;
    top: 70%;
    left: 22%;
    width: 23%;
    height: 16%;
}

.lore-evolution-stage {
    position: absolute;
    top: 21.2%;
    left: 29%;
    width: 9%;
    text-align: center;
    font-family: Georgia, serif;
    font-size: 15px;
    font-style: normal;
    line-height: 18px;
    color: #2b1a0e;
    z-index: 4;
}


/* ===== ACTIVE NAVIGATION ===== */

.nav-link {
    position: relative;
}

.nav-link.active {
    color: #d9b45b;
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -18px;
    width: 72px;
    height: 1px;
    background: #d9b45b;
    transform: translateX(-50%);
}

.nav-link.active::before {
    content: "◇";
    position: absolute;
    left: 50%;
    bottom: -25px;
    transform: translateX(-50%);
    color: #d9b45b;
    background: #07111f;
    padding: 0 6px;
    font-size: 13px;
    line-height: 14px;
    z-index: 2;
}

