/* ========================================================================== */
/* PAGE LAYOUT */
/* ========================================================================== */

.page {
    display: flex;
    flex-direction: row;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 20px 50px 20px;
    gap: 30px;
    min-height: 80vh;
    box-sizing: border-box;
    opacity: 0;
    animation: contentFadeUp 0.8s ease-out 0.2s forwards;
}

a {
    text-decoration: underline;
    color: rgb(153, 153, 153);
    transition: 0.3s;
}

a:hover {
    color: rgb(196, 196, 196);
}

.wiki {
    background-color: #ffffffc2;
    border-radius: 15px;
    color: var(--color-text-dark);
    transform: scale(1.12);
}

.book-img {
    filter: invert(0.2);
}

/* ========================================================================== */
/* ANIMATIONS */
/* ========================================================================== */

@keyframes contentFadeUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes fadeUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes fadeRight {
    from { 
        opacity: 0; 
        transform: translateX(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes sidebarFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-50%) translateX(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(-50%) translateX(0); 
    }
}

@keyframes sidebarSecondaryFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-50%) translateX(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(-50%) translateX(0); 
    }
}

/* ========================================================================== */
/* SIDEBAR */
/* ========================================================================== */

.sidebar {
    position: fixed;
    top: 50%;
    right: 85px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    opacity: 0;
    animation: sidebarFadeIn 0.6s ease-out 0.5s forwards;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(27, 27, 27, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-link::before {
    content: attr(title);
    position: absolute;
    right: 54px;
    background: rgba(27, 26, 27, 0.95);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Nunito-normal', sans-serif;
    font-size: 0.85em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.sidebar-link:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.sidebar-link img {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    transition: transform 0.3s ease;
}

.sidebar-link:hover img {
    transform: scale(1.15);
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.sidebar-secondary {
    right: 30px;
    animation: sidebarSecondaryFadeIn 0.6s ease-out 0.7s forwards;
}

/* ========================================================================== */
/* CONTENT */
/* ========================================================================== */

.content {
    flex: 1;
    width: 100%;
    background: linear-gradient(169deg, #1b1a1b 0%, #1b1a1b 100%);
    border: 1px solid #cccccc;
    border-radius: 12px;
    padding: 40px;
    color: #ffffff;
}

/* ========================================================================== */
/* BREADCRUMB */
/* ========================================================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-family: 'Nunito-normal', sans-serif;
    font-size: 0.9em;
    color: #666;
}

.breadcrumb a {
    color: #888;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #ffffff;
}

/* ========================================================================== */
/* CONTENT HEADER */
/* ========================================================================== */

.content h1 {
    font-family: 'Minecraft', monospace;
    font-size: 2.5em;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px #000;
}

.content .intro {
    font-family: 'Nunito-normal', sans-serif;
    font-size: 1.1em;
    line-height: 1.7;
    color: #e0e0e0;
    margin-bottom: 15px;
}

.content hr {
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin: 30px 0;
}

/* ========================================================================== */
/* ITEM CARD - ВИПРАВЛЕНО */
/* ========================================================================== */

.item {
    display: grid;
    grid-template-columns: 80px 1fr; /* Виправлено: було 64px, іконка 128px */
    grid-template-rows: auto auto auto;
    gap: 0 15px;
    padding: 20px;
    margin-bottom: 25px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(0,0,0,0) 100%);
    border-left: 3px solid #444;
    border-radius: 6px;
    scroll-margin-top: 130px;
    transition: all 0.3s ease;
}

.item:hover {
    background: linear-gradient(90deg, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0) 100%);
    border-left-color: #fff;
    transform: translateX(5px);
}

/* ========================================================================== */
/* ITEM ICON - ВИПРАВЛЕНО */
/* ========================================================================== */

.item .icon {
    grid-row: 1 / 3;
    grid-column: 1;
    width: 64px;  /* Виправлено: було 128px */
    height: 64px; /* Виправлено: було 128px */
    padding: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    box-sizing: border-box;
    image-rendering: pixelated;
    transition: all 0.3s ease;
    align-self: start;
}

.item:hover .icon {
    transform: scale(1.05);
}

/* ========================================================================== */
/* ITEM INFO - ВИПРАВЛЕНО */
/* ========================================================================== */

.item .info {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item h2 {
    font-family: 'Minecraft', monospace;
    font-size: 1.2em;
    color: #e0e0e0;
    margin: 0;
    transition: color 0.3s ease;
}

.item:hover h2 {
    color: #ffffff;
}

.item .sub {
    font-family: 'Nunito-normal';
    font-size: 1.0em;
    color: #888;
    margin: 0;
}

/* ========================================================================== */
/* ITEM DESCRIPTION - ВИПРАВЛЕНО */
/* ========================================================================== */

.item .desc {
    grid-column: 1 / -1;
    grid-row: 2;
    color: #aaa;
    font-size: 0.95em;
    line-height: 1.7;
    margin: 15px 0;
    font-family: 'Nunito-normal', sans-serif;
}

.item .desc strong {
    color: #fff;
}

/* ========================================================================== */
/* CRAFT SECTION - ВИПРАВЛЕНО */
/* ========================================================================== */

.item .craft {
    grid-column: 1 / -1;
    grid-row: 3;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.9em;
}

.item .craft .image-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 10px;
    min-height: 200px; 
    align-items: center; /* Центруємо зображення вертикально */
}

.item .craft .image-row img {
    /* Старі властивості видаляємо або змінюємо */
    max-width: 300px;
    
    /* Нові властивості для однакового вигляду */
    height: 100%; /* Займає всю висоту контейнера */
    width: auto; /* Дозволяє ширині підлаштовуватися */
    max-height: 200px; /* Обмежуємо максимальну висоту */
    object-fit: contain;
    border-radius: 1px;
    margin: 0;
}

.item .title_craft {
    font-family: 'Minecraft', monospace;
    color: #bbbbbb;
    line-height: 1.6;
    margin-bottom: 10px;
    margin-top: 0;
}

.item .subtitle-craft {
    font-family: 'Minecraft', monospace;
    color: #868686;
    line-height: 1.8;
    margin: 10px 0;
}

.item .subtitle-craft strong {
    color: #aaa;
}

/* ========================================================================== */
/* IMAGE ROW - ДОДАНО */
/* ========================================================================== */

.image-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.image-row img {
    max-width: 280px;
    height: auto;
    transition: all 0.3s ease;
}

.image-row img:hover {
    transform: scale(1.02);
}

/* ========================================================================== */
/* TAGS */
/* ========================================================================== */

.tag {
    font-family: 'Nunito-normal', sans-serif;
    font-size: 0.75em;
    padding: 4px 12px;
    background: rgba(53, 53, 53, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: #888;
}

.tag.epic { 
    background: rgba(255, 85, 255, 0.1); 
    border-color: rgba(170, 85, 170, 0.5); 
    color: #f5f; 
}

.tag.legendary { 
    background: rgba(255, 170, 0, 0.1); 
    border-color: rgba(170, 136, 0, 0.5); 
    color: #fa0; 
}

.tag.rare { 
    background: rgba(85, 255, 255, 0.1); 
    border-color: rgba(85, 170, 170, 0.5); 
    color: #5ff; 
}

/* ========================================================================== */
/* FOOD (якщо потрібно) */
/* ========================================================================== */

.food {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background-color: rgba(26, 26, 26, 0.1);
    padding: 8px;
    border-radius: 6px;
    border: 2px solid #333;
    width: fit-content;
    margin-left: 10px;
}

.item .hunger,
.item .hunger_yellow {
    display: flex;
    flex-direction: row;
    gap: 2px;
}

.item .hunger img {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
}

.item .hunger_yellow img {
    width: 12px;
    height: 12px;
    image-rendering: pixelated;
}

/* ========================================================================== */
/* BACK LINK */
/* ========================================================================== */

.back {
    display: inline-block;
    font-family: 'Nunito-normal', sans-serif;
    font-size: 0.95em;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 30px;
}

.back:hover {
    color: #ffffff;
    transform: translateX(-5px);
}

/* ========================================================================== */
/* RESPONSIVE */
/* ========================================================================== */

@media (max-width: 1450px) {
    .sidebar {
        display: none;
    }
}

@media (max-width: 992px) {
    .page { 
        padding: 120px 20px 40px; 
    }
    .content { 
        padding: 30px; 
    }
    .content h1 { 
        font-size: 2em; 
    }
    .item { 
        padding: 15px 18px; 
    }
    .item .icon { 
        width: 56px; 
        height: 56px; 
    }
    .image-row img {
        max-width: 220px;
    }
}

@media (max-width: 768px) {
    .page { 
        padding: 120px 15px 40px; 
    }
    .content { 
        padding: 25px 20px; 
    }
    .content h1 { 
        font-size: 1.8em; 
    }
    .item { 
        grid-template-columns: 56px 1fr; 
        gap: 0 15px; 
        padding: 15px; 
    }
    .item .icon { 
        width: 56px; 
        height: 56px; 
        padding: 6px; 
    }
    .item h2 { 
        font-size: 1.1em; 
    }
    .item .desc { 
        font-size: 0.9em; 
    }
    .tag { 
        font-size: 0.7em; 
        padding: 3px 10px; 
    }
    .image-row {
        flex-direction: column;
    }
    .image-row img {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .page { 
        padding: 130px 15px 40px; 
    }
    .content { 
        padding: 20px 15px; 
    }
    .breadcrumb { 
        font-size: 0.85em; 
        margin-bottom: 15px; 
        flex-wrap: wrap; 
    }
    .content h1 { 
        font-size: 1.5em; 
        text-shadow: 1px 1px 0px #000; 
    }
    .content .intro { 
        font-size: 1em; 
    }
    .item { 
        grid-template-columns: 50px 1fr; 
        gap: 0 12px; 
        padding: 12px 15px; 
    }
    .item .icon { 
        width: 50px; 
        height: 50px; 
        padding: 5px; 
    }
    .item h2 { 
        font-size: 1em; 
    }
    .item .sub { 
        font-size: 0.8em; 
    }
    .item .desc { 
        font-size: 0.85em; 
        margin: 12px 0; 
    }
    .item .craft { 
        padding-top: 12px; 
        font-size: 0.85em; 
    }
    .tag { 
        font-size: 0.65em; 
        padding: 3px 8px; 
    }
    .back { 
        font-size: 0.9em; 
        margin-top: 15px; 
    }
}

@media (max-width: 400px) {
    .page { 
        padding: 120px 10px 30px; 
    }
    .content { 
        padding: 15px 12px; 
    }
    .content h1 { 
        font-size: 1.3em; 
    }
    .item { 
        grid-template-columns: 45px 1fr; 
        gap: 0 10px; 
        padding: 10px 12px; 
    }
    .item .icon { 
        width: 45px; 
        height: 45px; 
    }
    .item h2 { 
        font-size: 0.95em; 
    }
}